Scientists Save World from Flatulent Cows
Posted by admin - 31/10/08 at 01:10:04 amThe Times Online reports that Japanese scientists have found a way to stop cow farts, which account for 5% of the world’s greenhouse gas emissions.
Ruby on Rails email scheduling using runner and cron
Posted by admin - 30/10/08 at 11:10:00 amProblem
You want to send emails from a Ruby on Rails application, when there is a specific condition on a database table. If the database table gets modified by another application outside Rails you cannot use an observer model.
Solution
We already assume that:
- You are using a database
- You have a model named voicemail (id, number_id, audio, created_at, updated_at)
- You have a model named number (id, voicemail_email_set, voicemail_email, ….)
- A mail server to use (smtp in our case)
- Another application (voice application) populates the voicemail table but with empty updated_at values
So the steps we have to follow are:
- Change the settings in your config/environment.rb file to use the settings for your mail server, and make sure you restart your application after the changes:
ActionMailer::Base.smtp_settings = { :address => "yourmailserver.com", :port => 25, :domain => "your.domain.com", :authentication => :login, :user_name => "your_smtp_username", :password => "your_smtp_password", :raise_delivery_errors => true} - Create your mailer model (ie voicemail_mailer.rb), in app/models:
class VoicemailMailer "application/wav", :disposition => "attachment; filename=#{file_name}", :transfer_encoding => "base64") do |attachment| attachment.body = tmp_file end end end - Create your email scheduler in file lib/email_scheduler.rb:
#!/usr/bin/env /path_to_your_app/script/runner # get all the voicemails that have not been sent yet voicemails_to_email = VoiceMail.find(:all, :conditions => 'updated_at is null') # For all the voicemails we have, send them and update the field date_sent for vm2email in voicemails_to_email do # Get the number for the voicemail number = Number.find(vm2email.number_id) # check to see if the send to email is set for the number if number.voicemail_email_set # Get number details (email_to,email_from etc) email_to = number.voicemail_email voicemail_to_send = vm2email.audio # Set other details email_from = 'Service@yourdomain.com' email_subject = 'Please find attached your voicemail message' email_body = "Received on: #{Time.now} \n for number: #{number.phone_no}" # Now send the email VoicemailMailer.deliver_sent(email_to,email_from,email_subject,email_body,voicemail_to_send) # And update the record's date_sent field vm2email.updated_at = Time.now vm2email.save end end - Create a task in your crontab that runs the scheduler (every five minutes):
0,5,10,15,20,25,30,35,40,45,50,55 * * * * path_to_your_ror_app/lib/email_scheduler.rb
Kenya / Coming up: pockets of rioting youth
Posted by admin - 28/10/08 at 04:10:46 amThe morning was quiet in Nairobi. This afternoon i visited the informal settlements Mathare and Kibera. Police was around and Mathare seemed realtively quiet. Downtown Nairobi though there were…
Read about the whereabouts of independent Africa Correspondent Arjen Westra. travelling the continent and reporting on things he sees and hears and…. smells.
Observing Report 30 June/1 July 08 (The bonus-ball)
Posted by admin - 26/10/08 at 02:10:58 amWell, after many weeks of varied weather and cloudy nights, on Sunday evening the skies cleared and I went out for a quick spotting session to help plan what to view on Monday night, which was also forecast to be clear. I’m still not ready to start imaging DSOs yet, so I figured that some widefield observing and some Jupiter imaging would be reasonable objectives. Jupiter’s the brightest object in the southern sky at the moment, but it only reaches 12° elevation when it passes through my “window of opportunity”, so in order to view it from my garden I would have to finish decimating the overgrown privet hedge that blocks the prospect southwards. That was the job for Monday.
Monday evening arrived and things didn’t look promising - plenty of high cloud was obscuring the sky, and I figured that if I couldn’t get a consistent view of Polaris, I would have to abandon the session, as the scope’s alignment routine depends on getting the mount aligned with the pole.
I was just about to give up when the clouds parted and the stars shone forth. I had about an hour before Jupiter was due to swing into view, so I took my time with the mount-alignment, ensuring that everything was set up as near to perfect as possible, then it was time to see the sights.
First up was a view of M8 (Messier 8, the Lagoon Nebula) in Sagittarius, before it went out of sight. Pretty impressive, I reckon. I could have tried to image it, but it escaped behind the house next door.
Next I decided that it was time to get the scope pointing at Jupiter, which was due to hit my field of view within the next 30 minutes. That set, I went in for a cuppa.
When I came back out, Jupiter was dead-centre in the eyepiece with some of the moons lined up like a string of pearls either side of the planet. Io was just grazing the edge of the disc, and later there was the shadow of Io on the face of the parent planet. Nice.
Soon the webcam was in place and it was taking 100-second .avi movies of the planet. I had zoomed right in with the 8mm setting on the eyepiece, this gave a magnification of x125, and I was projecting the image onto the webcam chip about 70mm away. This gave a large image but because the planet was so low, it appeared just above the rooftops, and the heat from them was causing a lot of shimmering. Short exposures would be needed, so I settled for 15 fps. The .avis were processed later, and the best image produced from them so far is this:

Jupiter, with a hint of Great Red Spot (lower-left) and the shadow of Io (upper-left)
After that, I put away the webcam and attached the Nikon D50 instead, still using the eyepiece-projection method, and rattled off a selection of wider-field shots of the planet with some of its moons. I had to use longer exposures to get the moons, and shorter ones to get Jupiter, so the images produced are composites. The best one of these is:

Left to right: Europa, Ganymede, Jupiter, Callisto.
Io is in transit across the face of Jupiter, but it’s lost in the background.
The object in the top-right corner is a star.
After a couple of hours of this, Jupiter passed out of sight so it was time to look at something else before the skies became too light. I had a look at Winstars and figured that Neptune, a planet reluctant to appear before us, might be in shot after a short wait. I slewed the scope to point at it but it was behind some trees. No matter, it was time for another brew anyway.
Neptune’s not visible to the naked eye, so I had a look for it through my trusty binoculars. I found the row of three stars that currently acts as a marker for locating the planet, and, by using averted vision, could just make out a very faint dot of light where Neptune should be. Encouraged by this, I waited until the area was in sight, and took a short series of zoomed-in long exposures of the seemingly-empty area of blackness, hoping that the results would be in focus (none of the marker stars were bright enough to show up in the viewfinder, it was hit-and-hope stuff). I had to stop soon, though, as the sky was just too light, and the morning dew was beginning to form on the optics. The session was over, and I was convinced that I had failed to capitalise on this unplanned opportunity.
I packed away and headed inside to warm up. While swilling down a hot cuppa, I had a quick look at the pics that might have included Neptune, and there it was, a small blue fuzzy ball! It needed a lot of processing to get rid of the noise and other defects caused by the optics and the atmospheric conditions, but I ended up with this, and I’m right chuffed about it:

Neptune (the tiny blue thingy to the right of centre), and 2 of the 3 marker-stars.
Next time out, I’ll try for a better picture. It’ll be easier now that I know where to look and what camera settings to use.
Bipolar Disorder in Children
Posted by admin - 25/10/08 at 04:10:29 amBipolar Disorder in Children
Bipolar disorder is a mood disorder, commonly known as manic-depression. It has only been recently that this illness has been an acceptable diagnosis in children. For the most part children were labeled as problem children and more often than not the parents were just accused of bad parenting. There are a lot of childhood psychiatric illnesses that have freely been recognized for years, such as ADHD, Oppositional Defiant Disorder, Obsessive Compulsive Disorder and Tourette’s syndrome, and it is often that Bipolar Disorder is overlooked because of the mixed signals of these other childhood illnesses.
Children don’t exhibit the same bipolar symptoms as those that we commonly think of in relation to adults. In children it seems that they all have several traits in common. They are all oppositional, you say yes, they say no, and them the rage starts. They can go on for hours with screaming and wailing. Nothing stopped it. I learned on my own that it was just best to let them get it out and watch that they were not hurting themselves. This was all before I had ever hear of Bipolar Disorder or any other disorder for that matter. I just thought we had behavioral problems and that I was a bad parent. It is easy to look back now and see what was going on. Most children with BP just can’t switch gears easily, meaning that you can’t just expect them to drop whatever they are doing to go to the mall, the store, school or even the bath. They need time to prepare for it. We still give our granddaughter a count down of sorts. A half hour, fifteen minutes, ten minutes, whatever is necessary and then by the time the countdown ends, she is as ready as she can be. Another one of the symptoms of bipolar disorder in children is the night terrors. My granddaughter would just sit up in bed screaming and crying and you couldn’t touch her. She would look at you with such fear in her eyes, that is was frightening. She would shrink away from you and even try to run, as if you were the monster. It would go on for as long as ten minutes before she would start to calm down. We were never sure if she was really awake during these times, but as the nightmare waned she would slowly allow you to hold her. This was when she was as young as two years old. She would draw pictures during the day of animals with blood coming out of their eyes and ears. Everything was so vivid for such a young child. We can only imagine what her dreams must have consisted of.
Sleeping does not come easily to bipolar children. It is as if they can only sleep for a short period and that is all they need. None of my children ever slept through the night from the day we came home from the hospital. I was so envious of all my friends that had babies that slept all night. I would work hard to keep them awake during the day so maybe they would sleep at night. It never worked. Bipolar children do not seem to require the sleep that others do.
Bipolar kids also seem exceptionally bright from the beginning. They seem to walk early, talk sooner and speak more like an adult than a child. Even as they get older they seem to do things more rapidly than other children. Parents seem in awe of the child, and in so many ways they are like little adults instead of children.
There are many other symptoms of Bipolar Disorder in children. They all seem to have trouble getting along with others as they tend to bully and be bossy. Many of the children seem to have an extreme sensitivity to collars, tags, shoe laces that aren’t tied just the right pressure, in fact change is just not acceptable, and anything that is different just won’t work. Bedwetting is a huge problem and goes on even for years in childhood. Some BP kids suffer from hallucinations and these are not just that the child sees and hears things, they often smell and feel things that no one else does. There are also many children even as young and four and five that have suicidal feeling and will try and harm themselves.
I am not a doctor of any kind. I am just a mother who has witnessed much strange behavior. I am not presuming to diagnose or treat anyone. I just want to tell you what I have learned and give you some of the insight I have found. I am not giving out any guarantees, only the hope that if something isn’t quite right, keep on looking for answers and then look farther. I only wish that I had had someone, anyone, give me a push in the right direction. The answer is out there!
Book Mark it-> del.icio.us | Reddit | Slashdot | Digg |
libsecondlife - Past, Present, and Future
Posted by admin - 23/10/08 at 08:10:00 amThe libsecondlife SL4B event schedualed yesturday was pushed back to Sunday, June 24th because the sim was at capacity and almost nobody could get in to attend.
libsecondlife - Past, Present, and Future - June 24th, 1:30pm PST
This event is an open discussion about libsecondlife. It will start with a short introduction and background information and then everyone will be free to discuss any aspect of libsecondlife.
absent healing
Posted by admin - 22/10/08 at 01:10:16 am
absent healing
the power of healing by distance
Geographical Webservices in Costa Rica
Posted by admin - 20/10/08 at 05:10:59 amhttp://www.geonames.org/export/ws-overview.html
http://ws.geonames.org/countryInfo?lang=en&country=CR&style=full
The Geonames Webservices collection provides live XML information that can be integrated into a web application.
TCT Daily Podcast - Episode #227 Kung Fu Cows!
Posted by admin - 19/10/08 at 03:10:58 am
Today’s Totally Cool Tech: Chinese Cancer Fighting Cows

Chinese scientists announced that they have bred a genetically altered cow capable of producing cancer fighting proteins for humans.
Try GotoMyPC free for 30 days! For this special offer, visit www.gotomypc.com/podcast
Email: tctpodcast@gmail.com
Voice Mail: (206) 888-6672
ShareThis
could this be any easier?
Posted by admin - 16/10/08 at 03:10:40 amTalking Points Memo | How The Obama Camp Should Respond:
Just as John McCain bought his ad time for right after Obama’s speech last night, they should get their own for right after Palin.
And here’s the ad: A one-minute spot featuring Hillary Clinton herself, talking to the camera and laying into Palin on the issues, her complete lack of qualifications, and the temerity of the McCain campaign to think they could get away with this. Then she urges anyone watching who might have supported her to get out there and support Barack Obama.
Then it closes simply with Obama walking on to the set to shake Hillary’s hand: “I’m Barack Obama, and I approved this message.”
That could be what we call a “crusher.”





