Tuesday, June 23, 2015

Comments on "Freud and the Bolsheviks"

I have noticed that some of the readers of this blog are from Russia. Coincidently, I have also been reading some books related to Russia or russian psychoanalysts, such as Spielrein, Wulff, Rosenthal and others. One of the most interesting books I have found in quite some time is "Freud and the Bolsheviks", by Martin Miller.

This great book starts with a historical account of the psychological research in the imperial Russia and gradually takes you to the moment when psychoanalysis entered the country. Then the author proceeds showing how this new theory was received and actually supported by the government during the first years after the revolution, only to be prohibited after the death of Lenin.

The final chapters focus on the renewal of the interest of the Russians for Psychoanalysis after the years of prohibition.

This is a great book for a quick overview of the development of Psychoanalysis in Russia and the extensive bibliography at the end give some nice hints on what to read if you intend to study this subject in more detail.

For the book: "Freud and the Bolsheviks" by Martin A. Miller

Very cool site

This week, I found out about Himalayan Salt: a very nice site, dedicated to Himalayan salt lamps, for our health. You can search for lamps, check out the Top100 or browse the different categories.

Rounding a floating point value to a certain precision

For my work, I needed to round a floating point value (double in C#) to a precision of 0.05. Unfortunately, Math.Round only lets you round a value to the nearest decimal. That means you can only round to 0.1, 0.01, 0.001, ... To round your values to 0.05, or 0.25, or whatever, I created the following function:

In C#:

public static double Round(double x, int numerator, int denominator)
{ // returns the number nearest x, with a precision of numerator/denominator
// example: Round(12.1436, 5, 100) will round x to 12.15 (precision = 5/100 = 0.05)
int y = (int)Math.Round(x * denominator + (double)numerator / 2.0);
return (double)(y - y % numerator)/(double)denominator;
}

In Euphoria:

global function Round(atom x, integer numerator, integer denominator)
-- returns the number nearest x, with a precision of numerator/denominator
-- example: Round(12.1436, 5, 100) will round x to 12.15 (precision = 5/100 = 0.05)
integer y
y = floor(x * denominator + numerator / 2.0 + 0.5)
return (y - remainder(y, numerator)) / denominator
end function