How to become a software engineer in 2023

Now is a great time to consider a career as a software engineer. Despite the recent layoffs and hiring freezes at some tech companies, the future remains bright overall for software engineering professionals.

Continue reading...

Programming

JS keyword counter

Feb 02

In this article, we will learn how to count words in real-time using jQuery. We have an input field, and when we type, we get the number of words in the input in real-time.

Continue reading
Programming

C Programming Language

Feb 02

C is a procedural programming language. It was initially developed by Dennis Ritchie as a system programming language to write an operating system. The main features of C language include low-level access to memory, simple set of keywords

Continue reading
Security

The Security Risks of Using Instant Messaging Apps

March 01

the potential security risks associated with instant messaging clients and provides recommendations for users to protect their privacy and security.

Continue reading

Other Posts

How to set switch case instead of if...else if.. in future double method in flutter?

In Flutter, you can use a switch statement to replace multiple if...else if... statements in a double method. Here's an example:

See the Pen How to set switch case instead of if...else if.. in future double method in flutter? by Manukakalmitha (@manukakalmitha) on CodePen.

In the example above, we have a method that takes three arguments: the operation to perform (as a String), and two double values to operate on. Instead of using if...else if... statements to check the operation, we can use a switch statement. The switch statement checks the operation variable and executes the corresponding case statement. If none of the case statements match the value of operation, it will execute the default case. Note that if the default case is reached, we throw an ArgumentError to indicate that an invalid operation was provided. You can call the method as follows:

See the Pen Untitled by Manukakalmitha (@manukakalmitha) on CodePen.




How do I make a range/ sub array based on a condition, in order to compute returns before a threshold / stop loss? (in numpy or pandas)

To create a range/sub-array based on a condition in order to compute returns before a threshold/stop loss in NumPy or Pandas, you can use boolean indexing. Here is an example code snippet to illustrate this:

See the Pen Untitled by Manukakalmitha (@manukakalmitha) on CodePen.

In this example, we first create an array of stock prices. We then define a stop loss threshold of 30 and create a boolean array stop_loss_mask based on the condition stock_prices < stop_loss. We use this boolean array to create a sub-array of stock prices before the stop loss, stop_loss_prices. Finally, we compute the returns before the stop loss by taking the difference between consecutive elements in stop_loss_prices and dividing by the previous element, and store the result in stop_loss_returns. Note that in this example we assume that the stop loss threshold is inclusive, meaning that the stock price at the threshold is included in the sub-array. If you want to exclude the threshold price from the sub-array, you can modify the boolean condition to stock_prices <= stop_loss instead.