Wednesday 26 December 2012

programming for everyone

http://m.bbc.co.uk/news/technology-20764273

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.
http://www.skifta.com/ Qualcomm. Cute slogan. "Skifta - May your stuff be with you."
Good philosophy. Also makes  easy to stream music to a different device. https://play.google.com/store/apps/details?id=com.skifta.android.app&hl=en

I tried MediaHouse before on phone. It does the job also, plays music. Browses photos. Interface a bit clunkier but more options. https://play.google.com/store/apps/details?id=com.dbapp.android.mediahouse&hl=en


On the server side, some of my music files need to be cleaned up and metadata added :-7
http://www.google.ie/search?sourceid=chrome&ie=UTF-8&q=ogg+mp3+metadata+editor
http://lifehacker.com/233336/alpha-geek-whip-your-mp3-library-into-shape-part-iii-metadata



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.
Spotify
https://play.google.com/store/apps/details?id=com.spotify.mobile.android.ui&hl=en
Pandora is a spotify clone? Or more? Or less?
https://play.google.com/store/apps/details?id=com.pandora.android&hl=en


Internet Radio.
https://play.google.com/store/apps/details?id=com.android.DroidLiveLite xiialive looks shiny
https://play.google.com/store/apps/details?id=com.leadapps.android.radio&hl=en 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. http://en.wikipedia.org/wiki/Lie-to-children "the simplification of technical or difficult-to-understand material". http://wiki.lspace.org/mediawiki/index.php/Lies-To-Children

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

  http://imgs.xkcd.com/comics/sky_color.png

Oh.
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?
http://en.wikipedia.org/wiki/Color_temperature
The Sun closely approximates a black body radiator. 
http://en.wikipedia.org/wiki/Sun
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.
http://en.wikipedia.org/wiki/Solar_spectrum


“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.
http://upload.wikimedia.org/wikipedia/commons/b/b0/Spectral_Power_Distributions.png
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: http://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/A0V-blackbody_SPD_comparison.png/300px-A0V-blackbody_SPD_comparison.png] [Description: http://bits.wikimedia.org/static-1.21wmf6/skins/common/images/magnify-clip.png] 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

monitor_remote_access.sh simple monitor script for remote mount

Also, James discovers http://gist.github.com via http://kasun86.blogspot.ie/2011/07/posting-code-snippets-to-blogger.html Wurgh, spot the difference, has my scripting evolved to avoid use of < and & ? :)




# usage: ./monitor_remote_access.sh > 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)
 S_DELTA=$((S-S_BEFORE))

 echo "DTS_BEFORE=$DTS_BEFORE DTS=$DTS TIME=$TIME ERRORCHECK=$ERRORCHECK SECONDS=$S_DELTA TIMECHECK=$TIMECHECK SUCCESSCHECK=$SUCCESSCHECK"
 # 3 checks 1. success, 2. error returned, 3. time command took
 [[ "$SUCCESSCHECK" == "" ]] && echo "ERROR: SUCCESSCHECK=$SUCCESSCHECK";
 [[ "$ERRORCHECK" != "" ]] && echo "ERROR: ERRORCHECK=$ERRORCHECK";
 (( S_DELTA > 20 )) && echo "ERROR: TIMECHECK FAIL SECONDS=$S_DELTA";

 sleep 10

done