Market Rally, Typescript, Asking for a Raise
3.04 | "Just one positive thought in the morning can change your whole day." - Dalai Lama
News and Numbers
Markets this Week:
S&P 500 is up 3%
NASDAQ 100 is up 4%
Bitcoin-USD is down 3%
Ethereum-USD is trading flat
Headlines from this Week:
U.S. President Biden signed legislation that lifted the nation’s debt ceiling averting a default on the federal government’s debt.
Nvidia debuted new AI supercomputers and services.
Finance
By Vlad Estoup, B.Comm. (Finance); working in Ethereum cybersecurity
Navigating the Market's Rally: Contrarian Strategies and Potential Risks Ahead
In a year marked by remarkable market performance, with the Nasdaq 100 up 35% year-to-date and the S&P 500 rising by 13%, investors need to exercise caution. Before the next major bull run, it is essential to acknowledge the possibility of downside corrections. Additionally, underlying concerns such as stagflation, high inflation, geopolitical tensions, and political stability continue to persist, even if the media focuses primarily on the market rally. In this article, we delve into the significance of contrarian thinking, and the risks associated with media narratives, and offer guidance for prudent financial strategies.
Contrarian investors have historically reaped significant rewards by questioning prevailing sentiments and avoiding herd behaviour. To fully capitalize on market opportunities, it is crucial to adopt a contrarian mindset. While media narratives may downplay potential risks, astute investors remain mindful of broader economic and geopolitical factors.
One narrative deserving of attention is the prospect of stagflation. Stagflation refers to an economic environment characterized by stagnant growth, high inflation, and high unemployment. Despite arguments suggesting current inflationary pressures are transitory, contrarian investors recognize the potential for long-term consequences. Supply chain disruptions, rising commodity prices, and expansive monetary policies may contribute to a sustained period of inflation. Diversifying investment portfolios with assets that act as hedges against inflation is advisable.
Geopolitical tensions are often overlooked during market rallies. The ongoing conflict in Ukraine serves as a stark reminder that global political tensions can quickly escalate and impact financial markets. Uncertainty surrounding international relations, trade policies, and regional conflicts can lead to market volatility. Contrarian investors stay attuned to geopolitical developments and adjust their portfolios accordingly.
The media plays a significant role in shaping investor sentiment. However, it is crucial to recognize their bias, which fluctuates with market trends. During market downturns, media outlets tend to amplify negative narratives, inducing panic among investors. Conversely, during market growth periods, they may understate risks, creating a false sense of security. Relying solely on media narratives can result in suboptimal returns, as investors may sell at market bottoms and buy at market tops.
Guidance for Prudent Financial Strategies:
Maintain Cash Reserves: Holding substantial cash reserves provides a buffer during market downturns and enables seizing investment opportunities when markets offer attractive entry points. Cash reserves offer flexibility and agility.
Diversify Your Portfolio: Diversification is key to mitigating risk. Spread investments across different asset classes and geographical regions. Including non-correlated assets such as gold, real estate, and alternative investments can protect against market volatility and inflationary pressures.
Stay Informed: Thorough research and evaluation of various viewpoints are crucial. Seek credible sources and understand the broader economic, geopolitical, and market factors that may impact your investments. Don't rely solely on media narratives.
While the Nasdaq 100 and S&P 500 continue to rally, investors must exercise caution and adopt a contrarian approach. The media's focus on the market rally may overshadow underlying risks such as stagflation, high inflation, geopolitical tensions, and political stability concerns. By questioning prevailing sentiments, staying informed, and maintaining cash reserves, investors position themselves to navigate potential downside corrections and capitalize on future market opportunities. Remember, contrarians often reap the greatest rewards.
This is not financial advice and you should always do your own research before investing in any securities or cryptocurrencies.
Sci-Tech
By Keyann; Software Engineer in Web3
Typescript compilation
I was tinkering with some code this week, trying to use this package ‘TSOA’ to automatically generate OpenAPI docs for my routes, but I encountered a few snags trying to do so, because I was fiddling with the typescript configurations, compiling typescript, using Docker, and importing generated files like swagger.json
. These files were essential for TSOA and my project, but didn't exist initially. To tackle this, I had to roll up my sleeves and dive deep into typescript compiler, how it’s configured, and Docker.
Let’s dive in.
When starting any typescript/node project, you run a command like `npm init` which generates a generic package.json file. After which, you’ll use npm to install typescript, and create a tsconfig.json file. These files are sort of like a car’s engine, you know it’s there, but don’t really understand it that well.
Here's the twist: if you’re tsconfig.json is not configured, the TypeScript compiler, tsc
, by default, will compile the code to a "dist"
directory. This means that if the package.json
file had a script to execute a file inside a ‘/build’ folder, but while tsc
was compiling your code to a ‘/dist’ folder, I could end up with different server outputs or even runtime errors from my code. To make matters more complicated, if you’re using docker, and your package.json is setup with scripts to run your code for both development and production, but docker is executing the production start, you’ll get really confused because you won’t see the compiled files unless you look inside the docker container to see how the output was generated.
To ensure consistency and avoid these issues, I had to carefully manage the TypeScript compilation process. Understanding how to configure the tsconfig.json and package.json
file became crucial to establish a consistent output directory for the compiled code, ensuring that both local development and the Docker environment shared the same output structure. This consistency eliminated the disparity between development and deployment environments, providing a reliable and predictable runtime experience.
Let's take a look at the code examples to illustrate these configurations and file structures:
tsconfig.json:
{
"compilerOptions": {
"target": "es2021",
"module": "commonjs",
"outDir": "dist", //tells typescript where to place the build files
// other compiler options...
},
"include": [
"src"
],
"exclude": [
"node_modules"
]
}
package.json:
{
"name": "my-app",
"version": "1.0.0",
"scripts": {
"build": "tsc", //'npm build' executes 'tsc' command
"dev": "node /src/server.ts", //'npm dev' executes server.ts
"start": "node dist/src/server.js", //npm start executes server.js
},
"dependencies": { // dependencies... }, "devDependencies": { // dev dependencies... } }
Dockerfile:
# base image and other configurations...
# Build the TypeScript code
RUN npm run build #tell docker to build and compile
# Start the server
CMD ["npm", "run", "start"] #start will execute server.js
File Structure:
- project
- src
- routes.js
- swagger.json
- server.ts
- dist
- routes.js
- swagger.json
- server.js
- package.json
- tsconfig.json
- Dockerfile
- other files...
In the above example, the package.json
file includes scripts for starting the server in both local and Docker environments. The build
script invokes tsc
to compile the TypeScript code and outputs the compiled files to the "dist"
directory. The Dockerfile copies the project files, builds the TypeScript code using npm run build
, and starts the server using npm run start
. This ensures that the compiled code in the "dist"
directory is used consistently in both local and Docker environments, maintaining a predictable runtime experience.
Additionally, if they were in configured to be in a build folder that can affect where you expect files to be. For example, if you change ‘outDir’ in tsconfig to ‘build’, and keep while your package scripts point to 'dist’ you’ll experience issues.
Another issue I ecountered was with ECMA and typescript. If you configure your project with "type": "module"
in the package.json
file and "module": "commonjs"
in the tsconfig.json
file, it may lead to compatibility issues and unexpected behavior. Mixing the ECMAScript Modules (ESM) behavior specified in "type": "module"
with the CommonJS module system specified in "module": "commonjs"
can result in conflicts.
package.json:
{
"name": "my-app",
"type": "module" //added this line here
"version": "1.0.0",
"scripts": {
"build": "tsc",
"dev": "node /src/server.ts",
"start": "node dist/src/server.js",
},
"dependencies": { // dependencies... }, "devDependencies": { // dev dependencies... } }
In Node.js, ESM and CommonJS module systems are not fully interchangeable. When "type": "module"
is declared in package.json
, it enables ESM behavior, allowing the use of import
and export
statements in JavaScript files. On the other hand, "module": "commonjs"
in tsconfig.json
specifies the use of the CommonJS module system during TypeScript compilation, which relies on require()
and module.exports
.
To address this issue, it's important to understand the distinction between the two module systems. CommonJS, traditionally used by Node.js, is the module system that relies on require()
and module.exports
syntax. ECMAScript Modules (ESM), introduced in ES2015 (ES6), uses import
and export
syntax and is the standard for JavaScript modules.
When using ESM in Node.js, additional considerations come into play. To enable ES modules in Node.js, include "type": "module"
in your package.json
file. This tells Node.js to interpret all .js
files as ES modules. However, note that Node.js is strict about how you use import
with ESM. Unlike TypeScript and many bundlers, Node.js requires you to include the file extension in your import statements.
Furthermore, Node.js v18 introduced stricter rules regarding ESM and CommonJS interoperability. It disallows using require()
to load ES modules and using import
to load CommonJS modules. If your project uses ESM (indicated by "type": "module"
in package.json
), make sure to use import
instead of require()
in your code. Additionally, ensure that all your dependencies are compatible with ESM. If you dynamically import files, double-check that the import paths are correctly specified.
If you add you are dynamically importing modules or files which rely on a build folder, but are ignoring the build folder in a .gitingore file, ensure that your package.json has all the necessary dependencies and is documented in your read me so that no issues arise when someone clones your repo.
By understanding these nuances, you can navigate the challenges of ESM and CommonJS interoperability, ensuring compatibility and proper module resolution in your Node.js project. Keep these considerations in mind as you work with TypeScript, ECMAScript Modules, and Node.js, and adjust your configurations accordingly.
To ensure consistency and avoid these issues, you have to carefully manage the TypeScript compilation process, which includes the tsconfig and package.json. If you’re using docker, you’ll also need to be mindful of which scripts your dockerfile is executing. If you’re using tsoa, be mindful of which output directories you define as well.
By aligning the configurations and file structures across different environments, we can ensure consistent behaviour and avoid surprises during development and deployment.
Keep on coding and may your development journey be filled with triumphs and fewer elusive files!
Paradigm Shift
By Roman Kuittinen-Dhaoui, BBA, CPHR Candidate; working in Human Resources
Asking for a Raise
“If you don’t ask, the answer is always no.” - Nora Roberts
When asking for a raise, it is important to approach the conversation with a well-prepared and professional mindset. Begin by gathering evidence of your contributions and achievements within the company. Highlight specific projects or initiatives where you have made a significant impact, quantifying your results whenever possible. This will provide a strong foundation for your case and demonstrate the value you bring to the organization. Additionally, research market data (i.e., Glassdoor, PayScale, etc.) to determine a reasonable and justifiable salary increase based on your role and experience.
Timing is also crucial when asking for a raise. Choose a suitable moment when your manager is available and not overwhelmed with other pressing matters. It can be helpful to schedule a meeting specifically to discuss your compensation. During the conversation, clearly articulate your request and back it up with the evidence you have gathered. Be confident and assertive, but also open to a constructive dialogue. Listen to your manager’s perspective and be prepared to address any concerns or questions they may have.
It is essential to be flexible and consider alternative options if a salary increase is not immediately possible. Instead of focusing solely on a higher base salary, explore opportunities for professional development, additional benefits, or performance-based incentives. It is important to maintain a positive and collaborative approach throughout the negotiation process, as this will foster a constructive relationship with your employer and increase the chances of reaching a mutually beneficial agreement. For example, rather than frame the ask as “can I get X salary?” which is a yes or no question, re-frame your request to be open ended such as “can you help me find a path to salary X?”
At the end of the day, if you are unhappy with your compensation at one company, you can go work somewhere else where you’ll feel valued.
TLDR: Know your worth, and ask for it with tact.
(Head)Space
By Vlad
Travel: The Unconventional Yet Exceptional Investment in Business Acumen
Travel, often perceived as a luxury or leisure activity, carries underestimated potential as an investment to refine the business mindset. Its transformative power transcends conventional borders, extending its reach to realms of personal growth, innovation, and business acumen.
Travelling for business prompts one to step outside their comfort zone. By navigating unfamiliar territories, individuals cultivate adaptability and resilience, traits invaluable in today's ever-changing business environment. This exposure to new cultures and environments inherently fosters innovation and creativity - indispensable qualities for successful entrepreneurs and business leaders.
Moreover, travel offers an exceptional opportunity to gain insight into diverse markets, consumer behaviours, and business models around the globe. This unique perspective is invaluable in a world increasingly interconnected through globalization and digital transformation.
The networking potential that travel presents is unrivalled. Connecting with a diverse range of individuals can open new avenues for collaboration, enriching one's professional sphere and potentially sparking lucrative partnerships.
In summary, travel stands as a unique investment that fosters invaluable soft skills and broadens business perspectives. By embracing the unconventional yet enriching approach of travel, entrepreneurs and business leaders can reap tangible benefits that shape their business mindset for the better.
Company of the Week
Observe.AI
Observe.AI provides natural language tools to track voice and text conversations. Its Intelligent Workforce Platform transforms contact centres by embedding AI into customer conversations, optimising agent performance, and automating repeatable processes that drive revenue and retention.
To date, Observe.AI has raised $213M USD in funding.
Written by: Vlad Estoup, Keyann Al-Kheder, and Roman Kuittinen-Dhaoui