Monday, March 4, 2013

RPN as desk calculator

In case you ever need a calculator on a computer, there are so many to choose from. In Windows go to the trusty calc, and in Mac go to the dashboard). Your phone has one also... although the default android one kinda sucks.

If you have a Unix prompt you can go to the "basic calculator" with bc.

I live under a rock... I have heard of "bc" in Unix but not "dc"... the desk calculator. See here for details. Ooh this thing uses Reverse-Polish-Notation! I thought only old HP calculator uses that. I love it.... that's because you solve expression by evaluating as you would by hand... without all that parantheses... The rule is simply arguments first then operation. This "dc" even predates the C programming language. Oh you can do more than just plain old calculations. It gets a bit ugly.

Oh no...

This is some terrible news. Parents rushing to the hospital to deliver baby but both died in traffic accident... and now even the baby didn't survive. That guy with BMW hit and run... on foot. This guy better be caught.

You would think something terrible like this would not happen as there is some higher beings watching over you as you read them in children books. Unfortunately all I can say is... life is so unpredictable.

Careful driving please. Too many lives are lost everyday... and most don't make the news.

Tuesday, February 26, 2013

Windows Annoyance (part 6)

In Windows 8, if you open up an PDF attachment in browser email. You will get the PDF file AT YOUR FACE by the Reader app. It fills up the entire screen. Not even obvious how to close it. Ok I figure out how to close it, but how to do you print it? Oh there is no print option? Come on!

To print, you will need to bring the charm bar out (Windows-C) or slide on that finger mouse pad, then click on "Devices" as your printer is one of your devices. Then you can print. (I had to look this up on the web)

I'm like come on, if the Reader app MUST occupy the full screen, at least give print as an option when you right-click on it. File->Print is totally intuitive, it's been like that for decades, where is the menu? Needing the charm bar here is totally unintuitive. Jumping out of the desktop into the full screen Reader app is already not so user friendly.

Friday, February 22, 2013

Forbes's Top 10 Most Miserable Cities

See here for entire list.
  1. Detroit
  2. Flint
  3. Rockford
  4. Chicago
  5. ...

The article says:

Chicago residents must endure long commutes (31 minutes on average), plummeting home prices (37% the past five years), brutal winters and high foreclosure rates
Ok, brutal winter is not Chicago's fault. But it isn't really that bad. 31 minutes commute isn't that bad, come on. Yes, plummeting home price is. What about violent crimes?

Wednesday, February 20, 2013

Rounded box

Once upon a time (a long while ago), an "architect" level guy wanted to restyle a certain webpage. In that wacky company, an "architect" is a tell-er, who actually has NO CLUE how to do ANYTHING. They just wanted a rounded boxes because rectangles are not in style (among other things). Gee, I was uninformed... especially in area of CSS. So I did a <table> with <td> entries of background image of rounded arcs, created by carving a circle into 4 pieces, and lines, and the center being the meat. Yes laugh at me all you want. It does the trick but it is fairly clumsy.

The style to use is "border-radius", and there are "moz" and "webkit" versions to make Firefox and mobile browsers play nice:

Here, I am inside a round box
<style type="text/css">
div.myroundbox {
 border: 1px solid #CCCCCC;
    background-color: #EEEEEE;

   -webkit-border-radius: 15px;
 -moz-border-radius: 15px;
 border-radius: 15px;
 padding: 10px;
} 
</style>

<div class="myroundbox">
Here, I am inside a round box
</div>
This is an excellent guide:
http://www.css3.info/preview/rounded-border/