Realworldnumbers

Permutations of seemingly innocuos musings, and strange guesstimations.

Still, nothing happening. June 22, 2009

Filed under: Around the House — realworldnumbers @ 5:37 pm

I hope my blog doesn’t just sit there.  Please, let me find inspiration!

 

Nothing is happening. April 24, 2009

Filed under: Around the House — realworldnumbers @ 6:13 pm

I feel lazy, and I don’t feel like updating my page for a bit.

 

Using AWK – print only phone numbers out of unstructured, unreliably columnised lines December 15, 2008

Filed under: Programming, data — realworldnumbers @ 3:20 pm
Tags: , ,

Sorry about the g33ky post, but i was looking for an example of how to use awk for this circumstance.  There’s probably another text-manipulation cli app to do the job, but i just wanted to use awk for this one.

Note: Solaris awk is known to be buggy. us the xpg4 version on all solaris boxes, or the “match” function wont work.

 

1 line of data set example:

20081210 133924638-0500 mmsrb owmmsrelay 193 46 46 Info;MMSRelayTxnLog(220/101)193:46:lc=Op ct=owmmsrelay op=MMBox_view.REQ ms=4.63 uid=114944517818131292 size=0 SrvcID=MMS AppID=”Openwave MMS Relay” AppHost=10.33.233.131 AppPort=8088 MsgID=AElADNwAEADBAC4KIe6D OrigIF=WEB RcptIF=WEB OrigAddr=”+19046219845/TYPE=PLMN” RcptAddr=”+19056219845/TYPE=PLMN” NumRcpts=1 EvTime=20081210133924 EvStatus=Success Folder=INBOX TrackID=AElADNwAEADBAC4KIe6D PeerHost=10.33.238.131 PeerPort=55476

 

bash-3.00$ more program.awk

/usr/xpg4/bin/awk ‘

RS = “\n”

{

where=match($0,”\+”)

if (where)

print substr ($0,where+1,11)

}’ test.txt

Alternatively

/usr/xpg4/bin/awk ‘

RS = “\n”

{

where=match($0,”\+”)

if (where)

print substr ($0,where+1,11)

}’

and

# cat test.txt | program.awk

 

Explanation:

/usr/xpg4/bin/awk ‘ <— calls the correct awk

RS = “\n” <—- record seperator becomes the end of line

{

where=match($0,“\+”) <—– match the first record with REGULAR EXPRESSION , in this case a plus sign.

if (where)

print substr ($0,where+1,11) <—– print out the 11 characters after the found location

}’ test.txt <—- the file name

 

 

 

Output:

bash-3.00$ ./awk.pl

19046219845

 

A Great Horsepower to Torque Conversion Chart November 5, 2008

I was just working on a project tonight – and ran across this great chart.    It’s an old-fashioned draw-a-line 2D calculator. 

So it’s possible to have 100HP at with 10000lbs of Foot-Pounds torque at 60 RPM.  Then you break your engine.  Enjoy!

Thanks to the electric toolbox http://www.elec-toolbox.com/ for the graphic.

horsepower-to-torque-conversion-chart

 

Careful. These Outlet Wiring Instructions are Wrong. October 19, 2008

Today I went to the hardware store (LOWES) and bought a 10-pack of decorative electric outlets.  I picked the “Pass & Seymour” brand.  I pretty much know what I’m doing with electrical, but I always like to read instructions.  That’s when I got stymied.  I sat there for 10 minutes comprehending what it said.  I put down the tools and hit the net.  30 minutes later and I could only come to 1 conclusion – the instructions shipped with it were wrong!

Normally, I’d suspect bad instructions to be from China, but these electrical outlets are stamped “Made in U.S.A.”.  

Take a look … do you see anything wrong with the illustration?  

First off, you can see that the plug appears “upside down”.  Actually, this is normal – and it makes sense.  Sometimes a power cord has sufficient weight to “ply” it away from the wall socket, exposing a small portion of the prongs.  I suppose it’s better to have the ground exposed, than the two contact points that carry the electric current. 

The real culprit here is not the orientation of the outlet, but rather the positioning of the prongs in relation to the ground pin.  Normally, the larger Neutral slot should be on the lower right, and the smaller HOT slot should be on the lower left (in the upside-down mounting).

 

 

Now take a look at the actual outlets themselves, and you will see how it should be. 

Ordinarily, bad instructions results in having to take things apart.  In this case, it could result in a DIY’er burning down the house.  I think Pass & Seymour better consider a recall… 

 

 

The days are getting shorter – Perl Script to Calculate Sunrise and Sunset October 11, 2008

Hi Everyone;

I made a great perl script to calculate sunrise and sunset times in Toronto for the whole year with a graphical output. I wrote this in my dead-time during a work order tonight… so I hope you enjoy it as much as I enjoyed making it.

Notes:

  • my brother’s birthday, which is right around the corner is day 286.  That’s a g33ky number.
  • Here’s a day-of-the-year number calendar .
  • does not account for Daylight Savings Time changes
  • the output is in decimal form (.1 hours is about 6 minutes)

How to understand the output

————-***********************————–      Day: 286 , sunrise: 7.46371983255512 , sunset: 18.6748421708946 

  •  
    • The —– is darkness (night)
    • The ******* is sunlight (day)
    • sunrise 7.46371….  is the time local to toronto at GMT -4 (7.46 = 7 oclock + (.46 * 60 minutes) = 7:27am

 

Sample output.  If you scroll through enough lines, an “hourglass” shape starts to appear:

# ./sun.pl
----------------******************----------------      Day: 1 , sunrise: 8.8499964506844 , sunset: 17.8363243941365 
----------------******************----------------      Day: 2 , sunrise: 8.85157917721863 , sunset: 17.8505635052382 
---------------*******************----------------      Day: 3 , sunrise: 8.85247026342554 , sunset: 17.8653183755327 
---------------*******************----------------      Day: 4 , sunrise: 8.85266811641787 , sunset: 17.8805734993673 
---------------*******************----------------      Day: 5 , sunrise: 8.85217187255689 , sunset: 17.8963130190473 
---------------*******************----------------      Day: 6 , sunrise: 8.8509813847397 , sunset: 17.9125207658933 
---------------*******************----------------      Day: 7 , sunrise: 8.84909720761213 , sunset: 17.9291803019326 

Here’s the perl code to support it.  A lot of it was based on http://www.adventist.org/sun/sun.pm .  Obviously, i did a lot of reworking of the ideas into my own script.  Click MORE for a special suprise (and the code)

(more…)

 

Does anyone know what kind of butterfly this is? September 18, 2008

Hi Everyone;

Just wondering if anyone knows what kind of butterfly this is? I’m really quite sure it’s not a monarch.

Location: Markham (Toronto), Ontario, Canada
Date : September 17, 2008 @ 3pm EDT

Click the image for better resolution.

What butterfly is this?

What butterfly is this?

Update:

I sent an email last night to a butterfly professional.  Here’s the response:

It is a Compton Tortoiseshell butterfly. I photographed a few of these a week
or two ago.
They are very similar to Coma and Question Mark butterflies.
Gord

Thanks Gord!  Look at his great site about butterfly watching in Ontario site at : http://www.web-nat.com/Butterfly/

 

So Long, Jupiter August 19, 2008

Filed under: Space and Nature — realworldnumbers @ 12:25 am
Tags: ,

As Saturn had passed beyond our visible slice of the heavens earlier this summer, so too will Jupiter. It’s schedule to rise earlier and earlier, eventually escaping the night to ironically be in the horizontal domain of North America’s daylight.

They’ve been hanging around, low in the sky, every night as the summer marches towards shorter days and longer nights.

It’s been a treat to look through a real telescope and actually see the eternal storm as brilliant horizontal rings with my real eyes. It’s much smaller to focus in on through the telescope than Saturn was, but it’s still remarkable. Also, as you relax your eye, some planets begin to appear, Callisto, Ganymede, and Europa. All visible to my human eyeball.

Most of what we know about Jupiter comes from the Voyager Spacecraft.

Here are some photos I’ve taken in the South, early to late evening. Shooting conditions were less than optimal, and this is the first time I’ve used the digital zoom. The first few pictures are taken with optical zoom (using the lens), and the fuzzed out bottom ones are taken with the digital zoom.

Here’s an interesting image. After examining this picture for an image, I discovered that by using a high-contrast, I was able to extract an image from the noise captured.

A real image of Jupiter, taken from the noble traveler, Voyager 2.

And this is the best that I could do through a telescope with my canon.

 

Voyager 2 – Still Out There, Still Doing It’s Job June 24, 2008

NASA Voyager 2 Schematic

Probably the most awesome peice of hardware out there is still out there, and still doing it’s job. The Voyager 2 space probe is powered, and happily sailing along deeper and deeper into outer space.

To this day, NASA employs staff to send command instructions and to receive scientific and telemetry data that Voyager is still sending.

Voyager II was launched on August 20, 1977 to explore Jupiter, Saturn, Uranus, Neptune, and Pluto, then to continue in interstellar space. After having visited Pluto in 1989, every planet in the Solar system has been visited at least once.

Voyager Weekly reports of the activities are available from NASA. Items include details such as how much electricity and propellant are still available, and also telemetry information, like how far away from earth, how fast it’s travelling and how long a signal takes to reach it. Here’s an example from this week:

  • Distance from the Sun (Km) 12,788,000,000
  • Distance from the Earth (Km) 12,814,000,000
  • Velocity Relative to Earth (Km/sec) 23.150
  • Generator Output (Watts) 284.2
  • Voyager 2 command operations consisted of the uplink of seven bracketed Command Loss Timer Resets sent on five-minute centers using 0.5 Hz steps on 03/26 [DOY 086/2007z]. The spacecraft received three of the seven commands sent.
  • There were 53.6 hours of DSN scheduled support for Voyager 2 of which 1.2 hours were large aperture coverage. There were no real-time or schedule support changes made or significant outages during the period.
  • Science instrument performance was nominal for all activities during this period. The EDR backlog is 2 day.

Isn’t it incredible how far away Voyager 2 is ? Even at the speed of light, round trip time for radio communications is almost 24 hours. Can you imagine sending a simple instruction to Voyager 2 and not expecting a response until tommorow at this time? Insane! Nowadays, the signal is travelling so far and is so distorted that only half of the commands are ever understand and responded to.

A fantastic document about Voyager 2 with a fun flip-page animation!

Print out all 178 pages (duplex if you can) and you will have an awesome document for reading! The flip-page animation is in the lower left corner and looks like this:

I found this document hunting around the NASA web page. It was written in 1985 about the January 1986 fly-by of Uranus. True history was made with Voyager, because very little was known about Neptune at the time. For example, the guide mentions “one of the five presently known moons of Uranus”, however, after Voyager flew by we now know of 27.

To summarise, simply from telemetry ( reducing Voyager to a simple talking projectile ), we are learning so much about our galaxy and the reach of our Sun. For more information check out this article on the Heliopause, the boundry that seperates our solar system from interstellar space. Thanks Voyager. I know you’ll be out there for a millennial’s worth of human generations.

This document makes a great nighttime reader. Print out a copy. Here’s the index so you know what to expect. Forgive the spaces, but OCR can only do so much.:

1. Introduction
Voyager’s Past
Anticipating Uranus

2 . Uranus
Overview of t h e Planet
The Atmosphere of Uranus
The Magnetosphere of Uranus
The Satellites of Uranus
The Rings of Uranus

3 . Getting The Job Done
Planning
Sequencing
Flight Operations
Commanding
Receiving Data
The Results

4 . Scientific Objectives
Imaging Science Subsystem (ISS)
Infrared Interferometer Spectrometer and Radiometer (IRIS)
Ultraviolet Spectrometer (UVS)
Photopolarimeter Subsystem (PPS)
Radio Science Subsystem (RSS)
Fields and Particles Experiments
Planetary Radio Astronomy (PRA)
Magnetometer (MAG)
Particle Detectors
Plasma Subsystem (PLS)
Low-Energy Charged Particle (LECP)
Cosmic Ray Subsystem (CRS)
Plasma Wave Subsystem (PWS)
Sensor Engineering Characteristics
The Physics of the Optical Target Instruments
Science Links

5 . Voyager Spacecraft
The High Gain Antenna
Spacecraft Attitude Control
Spacecraft Maneuvers
Scan Platform
Spacecraft Power Subsystem
Digital Tape Recorder
The Spacecraft Receiver
The Computer Command Subsystem
The Flight Data Subsystem
The Science Instruments

6. Mission Highlights
Pre-Encounter Test and Calibration Activities
Observatory Phase (OB)
Far Encounter Phase (FE)
Critical Late Activities
Near Encounter Phase (NE)
Post Encounter Phase (PE)
Contingency Sequences
Cruise to Neptune

7 . What’s New
Maintaining a Strong Signal
Discarding Unnecessary P i c t u r e Data
More Accuracy for Fewer B i t s
Taking Good Pictures in Feeble Light Levels
Big Changes in t h e Deep Space Network
The Bottom Line

8. Gee-whiz Facts
Overall Mission
Voyager Spacecraft
Navigation
Science
The Future

9 . How Far and How Fast
The Great Escape
Voyager 2 a t Uranus
Key Events. Distances. and Speeds

10 . Jupiter and Saturn Highlights
Jupiter
Jupiter’ s Rings
Jupiter ‘ s Moons
Jupiter ‘ s Magnetosphere
Saturn
Saturn ‘ s Rings
Saturn’ s Moons
Saturn’ s Magnetosphere

 

Kindergarten Google – A to Z and 1 to 10 April 23, 2008

Have you ever taken the time to see exactly what the A to Z search on Google comes back with? We start by simply typing in a single letter on Google and seeing what the first return is. For the most part, we find a notable pattern, but with a few bizarre oddities:

  • Sometimes, an article on Wikipedia is referenced “ie, an article on the letter ‘b’ “
  • There are a few stock symbols
  • Many mathematical constants

Funny items

  • The letter “S” brought up Queen’s University… huh?
  • The letter R brought up a project that’s commonly referred to as the “S” project ;)
  • There’s a little bit of toilet humour under “P”

I thought of this article a while back, but seems like a good waste of time to me! Let’s begin!

Section 1 : A to Z

ALinks in HTML documents The destination anchor of a link may be an element within an HTML document. When the A element’s href attribute is set, the element defines a source

BB – Wikipedia, the free encyclopedia B is the second letter in the Latin alphabet. Its name in English is spelled bee or occasionally be (pronounced /biː/), plural bees.

Cthe speed of light = 299 792 458 m / s

DDOMINION RES NEW (NYSE)

43.38 -0.04 (-0.09%) 23 Apr 9:43am ET
Open: 43.42
High: 43.42
Low: 43.15
 
Volume: 121,193
Avg Vol: 2,889,000
Mkt Cap: 25.04B

E -

e = 2.71828183

(more…)