FloatCalc

There’s a simple Java program FloatCalc.java:

public class FloatCalc {

    public static void main(String[] args) {
        System.out.println(1 - 0.56);
    }

}

What will be the output of this program?

Bonus question: Does the computation occur in run-time or compile-time?

2014 in review

The WordPress.com stats helper monkeys prepared a 2014 annual report for this blog.

Here’s an excerpt:

A San Francisco cable car holds 60 people. This blog was viewed about 2,900 times in 2014. If it were a cable car, it would take about 48 trips to carry that many people.

Click here to see the complete report.

Good Answer: Does Windows carriage return \r\n consist of two characters or one character?

Recently I’ve earned silver badge:  Good Answer

This badge is awarded answers which have score of 25 or more. And my answer to question Does Windows carriage return \r\n consist of two characters or one character? has reached 25 upvotes.

Here’s my answer:

These are two characters:

  • \r is carriage return;
  • \n is line feed.

Two characters combined represent a new line on Windows. Whereas on Linux, \n represents new line. It moves cursor to the start of new line on Linux. On Windows, the cursor will stay at the same column in the console but on the next line.

\r on Linux has the same effect as on Windows: moves cursor to the start of the line. It is possible to print different information on the same line where \r is used instead of \n.

Russia goes to winter time

After living for three years in “eternal” DST, on October 26, 2014, Russia will turn the clock 1 hour back to the standard, or winter, time.

Operating systems installed the corresponding updates. The time zone changed to UTC+3, and its title has RTZ 2 specification in parenthesis.

Windows 7 notifies: Daylight Saving Time ends on October 26, 2014 at 2:00. The clock is set to go back 1 hour at that time.

Windows 7: Daylight Saving Time ends on October 26, 2014 at 2:00. The clock is set to go back 1 hour at that time.

Read the rest of this entry »

Copyright check

A simple script to check whether the year in Copyright header is updated:

hg st -q -n | xargs grep Copyright | grep -v 2014

Nothing fancy! Just to save it.

It would be awesome if such a script updated the year automatically.

Windows Themes

How often do you change themes in Windows? Especially how often do you switch from visual stylesenabled theme (Aero or Basic, XP style) to classic one.

Please leave your answers in comments.

Heartbleed Explanation

Heartbleed Explanation

Follow

Get every new post delivered to your Inbox.

Join 244 other followers