Moon + business; Sort floats; Screen Studio
How Moon Cycles Affect Business Practices. How I fixed my sorting algorithm. A great find to record screencasts.
Business
Quick thought about moon cycles
The moon's cycles influenced the creation of months in the calendar. Businesses and people often base their work on these time slots. But what would happen to people on Mars? How would the business landscape be affected if we didn't have the month paradigm?
Science, Programming & Design
Sorting floats with conditionals
I was sorting a float array in descending order using the b - a
comparison function, but it was giving me weird results. It seemed to sort the array partially correctly, but not entirely. I discovered that I needed to use the if
statement and return -1, 0, 1
in order to fix the issue.
Previously, I had been using the comparison function (a, b) => a - b
to sort numbers, but I just realized that it can cause problems when sorting floats. It's best to write a bit more code and do things safely by using the if
statement.
if a > b { 1 } else if a < b { -1 } else { 0 }
Screen Studio
I recently added this screen recorder to my toolkit and it's been a great addition. It shows the mouse pointer in a smooth animation and provides close-up shots of clicks on the UI. It's very useful for creating walkthroughs and tutorials. The export to MP4 process can take a while. I recommend setting it to 24 frames per second and web quality for optimal performance.
If you have any comments or feedback, just respond to this email!
Thanks for reading,
Gorka