Wednesday, 26 December 2012

programming for everyone

Published with Blogger-droid v1.4.9

Friday, 21 December 2012

home media photos and music. collecting bits and apps.

We would like a photo frame slideshow. And a music player (with decent sound and easy selection of music). And I was also looking at things to play internet radio.

We have a cute QNAP NAS (serves mounts, iTunes) and wireless network.

A tablet with a nice place to dock it and speakers would do the job. If we can get a couple of apps.

First up streaming music player. Skifta looks good. Already tried it on phone and easy setup. Simple interface to play music. Doesn't do photo slideshow, just allows photo browsing. Qualcomm. Cute slogan. "Skifta - May your stuff be with you."
Good philosophy. Also makes  easy to stream music to a different device.

I tried MediaHouse before on phone. It does the job also, plays music. Browses photos. Interface a bit clunkier but more options.

On the server side, some of my music files need to be cleaned up and metadata added :-7

Next. Digital Photo Frame.
Hmmm. Would like to play over wireless.
Need to search more for playing wireless and liking/selecting photos, making playlists etc.

We will also be  able to play music from internet.
Pandora is a spotify clone? Or more? Or less?

Internet Radio. xiialive looks shiny AOR A Online Radio

And of course it being a tablet it can do a bit more fondleslabby wondrousness.  Games, music/sound, youtube, internet, family calendar, Skype, ... oh dear.

Being an Android tablet we need to build a photo frame / music playing docking station. Humm. Wood? Sugru? :)

Why is the sky blue? xkcd

I really quite like it when simple questions have complicated but explainable answers. But then the _real_ answer is a bit more complicated than first.

Terry Pratchett. Education = "Telling lies to children". :) The term appeared in the book The Science of Discworld. "the simplification of technical or difficult-to-understand material".

Why is the sky blue? (and also, why is the sun yellow?)

So, then. Why _isn’t_ the sky violet?

I think a more complete explaination is Rayleigh scattering of wavelengths with short (blue and violet) wavelengths being scattered more AND we have better perception of blue than violet with our eyes. See the natural daylight/sunlight spectrums below. Blue is slightly higher but our measurements and perceptions of light (and sound) is logarithmic so a small increase in intensity scale dominates more in our perception. I think. ☺

Pretty! I think I can see a little violet :)

Can we find a spectral power distribution for skylight ?
A spectrum taken of blue sky clearly showing solar Fraunhofer lines and atmospheric water absorption band.
Comparison of the scattering efficiency of blue light in the atmosphere compared to red light.

“Our eyes don't work as well on violet as they do on blue.” 
“The answer to this deeper question lies not only in the sky but also in our eyes and in the way in which we perceive color.” 

Hey kids. What colour would the sky be if there was no atmosphere?
Draw a diagram of the paths different colours of  light takes from sun, into atmosphere and down to you.

What colour is the Sun?
The Sun closely approximates a black body radiator.
Our sun is a yellow dwarf, because its visible radiation is most intense in the yellow-green portion of the spectrum and although its color is white, from the surface of the Earth it may appear yellow because of atmospheric scattering of blue light.

“CIE D55” – represents mid-morning or mid-afternoon daylight and has a correlated color temperature of approximately 5500 degrees Kelvin.

Typical spectral power distribution graph for daylight. Notice the strong presence (high relative power) of ALL wavelengths (or the "full color spectrum"). Daylight provides the highest level of color rendering across the spectrum.

Now. :) Why do rainbows always appear ... over there. At a certain angle to the sun each time. ?

Of course we can't go away without looking at some spectral graphs for light from electric light bulbs.
Characteristic spectral power distributions (SPDs) for an incandescent lamp (left) and a fluorescent lamp (right). The horizontal axes are in nanometers and the vertical axes show relative intensity in arbitrary units. Light sources and illuminants may be characterized by their spectral power distribution (SPD). The relative SPD curves provided by many manufacturers may have been produced using 10-nanometer (nm) increments or more on their spectroradiometer.[33] The result is what would seem to be a smoother ("fuller spectrum") power distribution than the lamp actually has. Owing to their spiky distribution, much finer increments are advisable for taking measurements of fluorescent lights, and this requires more expensive equipment. [edit]Color temperature in astronomy

And a bit more astronomy, from a far away star this time.
 [Description:] [Description:] Characteristic spectral power distribition of an A0V star (Teff = 9500 K, cf. Vega) compared to blackbody spectra. The 15000 K blackbody spectrum (dashed line) matches the visible part of the stellar SPD much better than the blackbody of 9500 K. All spectra are normalised to intersect at 555 nanometres.

Wednesday, 12 December 2012 simple monitor script for remote mount

Also, James discovers via Wurgh, spot the difference, has my scripting evolved to avoid use of < and & ? :)

# usage: ./ > monitor_remote_access.log 2>&1 &

[[ "$1" == "" ]] && REMOTEDIR=/projects

while true; do
 DTS_BEFORE=$(date +%Y_%m_%d_%H_%M_%S)
 S_BEFORE=$(date +%s)

 OUT=$(time ls $REMOTEDIR 2>mon_${2}.log)
 #real    0m0.015s
 #user    0m0.001s
 #sys     0m0.004s
 SUCCESSCHECK=$(echo "$OUT" |grep "$3")
 ERRORCHECK=$(cat mon_belprojects.log)
 TIMECHECK==$(echo "$OUT" |grep "real")
 DTS=$(date +%Y_%m_%d_%H_%M_%S)
 S=$(date +%s)

 # 3 checks 1. success, 2. error returned, 3. time command took

 sleep 10