2016-08-25

Got an interesting situation where I had to distinguish if the piece of string is float or date in Python 2.7. No problems to do that when there is dateutil.parse library in Python. But in my case the tricky situation was that piece of string which actually is float, can be interpreted as... date.
So, I came to solution - let there be two separate functions.
Checking if the string is float is straightforward.

2014-12-06

But why would anybody do that? Does it make any sense? Why it is not enough with only one main Dropbox folder?

There are some cases related with programming, when it is easier to have all scripts in some specific place, e.g. C:/scripts, instead of some complicated Dropbox folder path like C:/Documents and Settings/whatever/user/space in folder/name creates problems/Dropbox/specific folder for scripts/any programming language/scripts...

But how about duplicating the contents in the main Dropbox folder? You can still work in your C:/scripts, and all updates will be synced in your specific folder inside Dropbox main folder.

2014-09-07

Mathematics which explains the distance
at time for harmonic oscillations.

Harmonic oscillations and the representation of distance, speed and acceleration over time. So, if we derive the distance over time, we get the speed. If we derive that, we get acceleration.

This distance at time is composite function which has inner and outer parts and constant. Which parts in the formula are constants? Amplitude, angular frequency and phase shift. Firstly we see that its a multiplication of constant (amplitude) and composite function (frequency, time and phase within the sine). So we leave amplitude intact and will multiply it with derivative of outer function which keeps the inner function. So, cosine becomes negative sine, and then multiply it with derivative of inner function. Inner function is the first order polynome, so phase dissapears and frequency loses time. So, the derivative of inner function is pure angular frequency. So, recall, how far we are - we multiply amplitude with negative sine of intact inner function and multiply it with derivative of inner function - angular frequency. To get rid of negative sign, we can change sine to cosine by adding pi/2 inside of this trigonometric function. Remember that sine of angle is equal to cosine of angle plus pi/2.