Showing posts with label fun. Show all posts
Showing posts with label fun. Show all posts

Monday, April 23, 2012

The pleasure of flying

Today I had a pleasure of my first flight to US. And I must say I really enjoyed all the procedures. For example, the questions at Zurich Airport -- I met a very senile lady. She asked me several questions twice, without apparently registering the fact. Maybe I should have tried to answer two different things -- just to cross check if she was at least listening to the answers.

But the jewel of jewels is the Philadelphia Airport. It took me more than two hours to get from the first plane to the gate for the connecting flight. And I do not understand why. I mean, clearly there is some concept of the parallelism. But why the hell they are not using the full power of it? At least half of the stands in both immigration and security checkpoints were closed. Not to mention that I was directed to really slow and really long lane. At the securoty checkpoint, I was directed to get off my shoes. I really hated it. Not the process taking the shoes off but the missed opportunity -- I would enjoy so much taking off my hiking shoes after full one day trip. But because I put off my shoes on the plane, my feet weren't smelly so there was nothing to enjoy too much.

Anyway, let us continue with the story. The connecting flight was scheduled on 4pm. But it would not be fun if the flight was not delayed. For example one hour due to the weather at San Francisco. Oh, did I tell you one hour. Noo, that was really naive from them. The current "departure forecast" is 7:30. And I already dropped of my luggage with what -- with the us power adaptor. So I even cannot use the computer all that time :-(

Friday, April 13, 2012

Monday, April 2, 2012

Is biking green?

Nowadays, you hear a lot about "being green". And certainly biking is one of the most energy-efficient transportation [1]. But being energy efficient does not mean to be environmental-friendly, does it?

Well, there is this big problem with greenhouse gasses, like CO2. Hmm, CO2? The thing we produce during respiration? So let us estimate how greenhouse-friendly is actually biking to the work.

We need to estimate COproduction during the biking, i.e. we need the difference between CO2 production during the biking and the usual activity. Unfortunately, CO2 production of humans is not very advertised topic. But what comes out must come in. In fact, the CO2 exhalation is preceded by O2 inhalation with the same (molar) amount. Thus we just need to figure out molar amount of O2.

Now, O2 is more studied. There is a lot of sport/fitness research for maximum oxygen consumption (VO2 max). So let us do the estimate.
According to [2] the maximal VO2 for an average person is roughly  35 ml*kg-1*min-1. From [3] we get that the actual difference between rest and biking at 70% of max heart rate corresponds roughly to 25% of VO2 max.

Putting this together for my weight 70kg and time 60 minutes, it is 35 * 70 * 60 * 0.25 = cca 37 litres of oxygen. Moving back to molar amounts - 1 mol of ideal gas under room temperature corresponds to roughly 24 litres [4]. Note that oxygen is not so far from ideal gas in this scenario. This gives us roughly 1.5mol of oxygen.

According to [5] the molar mass of CO2 is 44g/mol. This yelds 66 grams of per COthe one-hour long trip. Now, what is the comparison to other means of transportation? SBB claims [6] that for the same trip, the car would produce 4.2kg of CO2 which is quite a lot. But the train under average utilization will produce only 0.18kg -- only three times as much as bike! (I guess this also includes CO2 production during electricity generation).

So what is the bottomline? Yes, the biking is green. But japanese trains are greener :-)

P.S. As a good scientist, one should always cross-check his results. Especially if the sources are just a random collection from the internet. So let us do the task. According to [1], on the flat ground a normal person expends 1.62 kJ*kg-1* km-1. For my trip of roughly 25 kilometers this is 1.62 * 70 * 25 = 2 835 kJ.
Putting 2800kJ energy inbalance into [7] gives roughly 0.63 kg per week, or roughly 90 grams per day. So, the workout should reduce weight 90 grams, we have 66 grams from CO2, where is the rest? The answer can be found in [8] -- according to the respiration equation with each mol of CO2 we also produce a mol of H2O and some energy. And using [5] again, we obtain that this corresponds to the missing 20 grams. So our results are (quite surprisingly) reliable.

[1] http://en.wikipedia.org/wiki/Bicycle_performance#Energy_efficiency].

Monday, March 26, 2012

Restarting desktop computer? What a weird idea!

Dear Microsoft updates and application installers.
I hardly believe my eyes each time I see the famous "restart required" prompt. Especially the annoying ones after automatic updates that can be postponed by max of 4 hours. They pop-up periodically on our lab laptop and try to provoke most awkward situations (laptop restarting in the middle of the presentation). Why would I want to restart my computer? Why would I want to break my work?

The idea of restarting a computer is outdated now. Consider Linux operating system. You can install, update or remove programs without rebooting. You can even update your kernel [http://www.ksplice.com/] without rebooting!
As the proof of my statement about obsolete reboots, consider my desktop computer at school.
It is running over half a year now, it survived moving inside the office, survived changing of external hardware (monitors, keyboard, mouse), it even survived update from gnome2 to gnome3 (although that time I lost my session -- it turned out that running gnome2 months after its removal was not the best idea).

Anyway, to the point -- Today I am celebrating whole 200days of uptime :-)

[ppershing@nslpc19: /usr/research/home/peter ]>uptime
 09:27:12 up 200 days, 19:38, 27 users,  load average: 8.18, 8.36, 8.21

Overconsumption as a away to kill our planet

Dear overconsumers,
let me start with a quote from http://www.ibtimes.com/articles/319115/20120325/iphone-5-rumors-roundup-release-date-features.htm "Last year, Apple managed to sell roughly 30 million iPhones in the last quarter alone. Since it launched theiPhone 4S, it has sold about 20 million units of the handset, making it one of the best sellers in the history of smartphones. The next iPhone, dubbed iPhone 5, is expected to be even more popular. Analysts forecast that Apple will sell about 50 million iPhone 5 units in 2012 and 2013."

It is evident that people are just crazy about iPhone. But why they want this piece of junk? Well, because it is cool! It is a modern style of life and the desire to show others you social status. But unfortunately it is also killing our planet. How many of you are waiting for then new version of iPhone just to replace now outdated iPhone 4S? How many of you are buying a new car each few years? How many of you are buying new clothes for each season just because the new style is different?

It was not more than a few centuries ago when people used their belongings over 100%. There was no waste. People bought shoes and clothes and they used them even after the possibility of repairs. People recycled most of the junk from kitchen to feed animals. Personally I stick with this idiom and try to use my belongings to a maximum degree.

But what about you? You overconsumers buy new shoes, new clothes, new kitchen appliances, new laptops, new smartphones and even new cars each year. This is hardy sustainable, especially because old things need to be somehow removed and they travel to the waste. Recycling is a powerfull word here but who really cares? And even recycling is not 100% effective. So, will you please stop killing our planet?

Sunday, March 25, 2012

Coder classification part II (right coder)




leftcoder
  • sticks to the left of his editor window
  • word-wraps on 40 characters
  • believes that the true power is in simplicity
  • uses variables and functions that are short:
    • int i,j,x,y,a,b;
    • void fn_a2(int n);
  • the optimal program have average of zero characters per line
rightcoder
  • loves to make veeery loooong statements
  • does not have an editor with word wrapping
  • uses variables and functions according to the following scheme
    • for (int myVariableToIterateSimpleCycle=0; myVariableToIterateSimpleCycle < myNumberOfCycleIterations; MyVariableToIterateSimpleCycle++)
    • int calculateAverageOfSuppliedListOfNumbers(vector<int> suppliedListOfNumbers)
  • the example of an optimal program is one-line database server in C++
  • hates Python for not being able to put conditionals,cycles and loops on a single line
  • others fear if he says "that is one-liner"

Friday, March 23, 2012

Coder classification part I (topcoder)





topcoder
  • is lazy to scroll
  • writes his own functions near the beginning of the file
  • hopes that this way he may show everyone how cool his code is
  • makes his functions long so other developers need to scroll a lot
bottomcoder
  • writes his own functions near the end of the file
  • hopes that nobody (especially his boss) will ever look so far into the code
  • have a macro to jump to the end of the file
  • the usual edit to his code by other developers starts with //WTF? or //FIXME



Tuesday, March 20, 2012

Helvetica coding contest II


Thanks Mino for this great idea ;-)

#include <stdio.h>
int main() {
  print(“Helvetica coding contest\n”);
  return 0;
}

#include <stdio.h>
int main() {
  print(“Courier coding contest\n”);
  return 0;
}

#include <stdio.h>
int main() {
  print(“Times coding contest\n”);
  return 0;
}

Thursday, March 15, 2012

Open letter to Visa Waiver Program site

Dear ESTA (Electronic system for travel authorization) website.

 I really thank you for making my life miserable. But before that, I would like to congratulate you on dropping the support for Internet Explorer. It is a brave step and the implementation quite impressive -- waiting more than 20 seconds before you show me the site is more than IE's timeout on the connection.

But let us go back to the application itself. It was my pleasure to realize that although I need to fill in my country of birth, there is no such country (Czechoslovakia apparently did not exist 25 years ago). Well, I guess that concentrating on the history is too big effort. On the other hand, concentrating on the future where Slovakia does not exists (and virtually any other country including US) does not solve my current problem of travel authorization as well.


Moreover, I would expect that you make you mind -- is the phone number needed or not? And by the way, should I include leading zero for my number? Obviously the number itself cannot be used without that zero.

However, the most worrying fact is that I am not able even to fill in even the simplest questions like "the family name as it appears on your passport". Obviously, I cannot lie and use the name without accent marks as that is not what is on my passport!


As a final thought, one thing which is really baffling me is how do you manage redirecting 3 times in a row, most of the sites are not being able to do it properly a single time.


> wget "https://esta.cbp.dhs.gov/esta/application.html?execution=e1s1"
--2012-03-15 18:07:49--  https://esta.cbp.dhs.gov/esta/application.html?execution=e1s1
Resolving esta.cbp.dhs.gov (esta.cbp.dhs.gov)... 63.167.255.44
Connecting to esta.cbp.dhs.gov (esta.cbp.dhs.gov)|63.167.255.44|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://esta.cbp.dhs.gov/esta/application [following]
--2012-03-15 18:07:50--  https://esta.cbp.dhs.gov/esta/application
Reusing existing connection to esta.cbp.dhs.gov:443.
HTTP request sent, awaiting response... 302 Found
Location: https://esta.cbp.dhs.gov/esta/application.html [following]
--2012-03-15 18:07:50--  https://esta.cbp.dhs.gov/esta/application.html
Reusing existing connection to esta.cbp.dhs.gov:443.
HTTP request sent, awaiting response... 302 Found
Location: https://esta.cbp.dhs.gov/esta/application.html?execution=e1s1 [following]
--2012-03-15 18:07:51--  https://esta.cbp.dhs.gov/esta/application.html?execution=e1s1
Reusing existing connection to esta.cbp.dhs.gov:443.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]


Yours sincirely,
  Visa Waiver Program applicant