Home
Amigos
 
[Most Recent Entries] [Calendar View] [Friends View]

Below are the most recent 25 friends' journal entries.

    [ << Previous 25 ]
    Friday, July 10th, 2009
    shortindiangirl
    1:19p
    SAHM
    I'm a stay at home mom today and it feels great. It's quiet & peaceful and already I miss my mom who's travelling this weekend. It seems that baby has taken up all the time while she's normally here and I'm wishing that I could have this quiet time with her.

    This may not be the first time I've been home alone with baby, but it sure is the first time I have actively wished I had MORE of this time before I needed return to work. By accident or otherwise, baby's doing exactly as she is supposed to and on schedule so far. *Hope I don't jinx it*.

    So as my first order of SAHM business, I need to rant about strollers.

    Many Americans hardly walk anywhere, except for that occasional stroll in the park, and inside department stores or the mall. While shopping, you can place your baby in a shopping cart (in or out of the infant seat). So I really don't understand the HUGE market and hubbub about strollers. Why is the stroller market so big and so complex ?

    From the house to the car hardly requires a stroller. From the car to the store hardly requires a stroller. Maybe for the odd fair, or 4th of July celebration with a picnic in the park - sure a stroller is useful, but consider the nature and frequency of such use, isn't lifting your own kid (in a sling, carrier or just in your arms) adequate ? After all, pushing a stroller requires one, if not both hands anyway.

    Maybe I am the naive mom of a 12lbs 9oz baby, and I don't yet realize that once they get heavier, supporting their weight on one's body is too cumbersome. But even so the stroller would be used so occasionally that I don't get the depth of features and choices.

    Now for people who want to tote their kid when they go running or bicycling, & a cart isn't built into the experience, a stroller makes sense. So I wonder what %-age of the American 1st & 2nd year parents actually do enough activities that don't involve a cart anyway. Obviously enough to justify the market...
    kalyan
    9:43a
    Leopard next door
    Mandanna came running and said he just saw a leopard next to him, relaxing on a wall with its legs on either side of it. He had gone to pick up something from my Scorpio which was right next to this wall. We all rushed out and went back to see the leopard get up and jump into the tea bushes next to it. We got excited but got back to our work and Mandanna went to drop off our friends at a home stay. When he got back again after an hour, he came in and said that he saw the leopard again, this time sitting in the tea bushes.

    Click here for rest of the post
    myrch
    12:26p

    Naturopathic "medicine" is an approach to healing that eschews drugs in favor of herbs and roots and promoting the body's own defenses to illness.

    My view of naturopathy is pretty simple: you could dig a tunnel under the Korean Demilitarized Zone with a spoon, but really, this thing works a lot better and may even finish the job in your lifetime.

    With so many reasons to loathe naturopathy, why are people attracted to the idea in the first place?

    The most obvious reason, of course, is that people who are suspicious of authority in general and Western Medicine in particular will view alternatives as somehow more credible or well-meaning. Implicit in this state of mind is deep, intense cynicism about medical scientists, drug developers, doctors, nurses, and lab technicians -- and the administrators who keep all of those people employed.

    There is another, equally interesting (and equally irrational) aspect to naturopathy: the idealization of nature.

    People who champion naturopathy argue that even if the body needs help repairing damaged tissue, fending off invaders, or calming autoimmunity, aid is somewhere out there, and in the form of something vaguely inanimate, such as a rock, a plant, or fungus. Naturopathic cures never appear in the form of something natural but aesthetically disturbing, such as animal tallow or spoor. Isn't that a little suspicious?

    Now, as anyone who seriously studies biology or medicine can tell you, nothing in nature -- and I do mean nothing -- is ideal.

    That isn't to say nature doesn't produce impressive things. Sharks' Pits of Lorenzini, the human brain, photosynthesis, etc., are all damn impressive. But to see even these three things as ideal or in some state of perfection is patently ridiculous. One of the themes of biology and medicine is this: "shit is messy, and if it was just slightly messier, it wouldn't work at all."

    Last, naturapathy's supporters refuse to look at the body mechanistically, that is, as a machine with parts that can be understood at a biochemical or molecular level. Naturopaths rely on meta-level explanations for how things work, perhaps invoking the name of an organ or organ system, but never getting at the heart of why things actually happen (e.g. this gene is always on, or this receptor is not functioning properly). The easiest way to frustrate or invalidate the claims of a naturopath is to question them on mechanism with lots of "How does..." and "What is causing..." questions.

    I don't mean to cast total doubt on the possibility that there are plants or fungi out there that contain substances helpful to human medicine.
    That is clearly false. But there is a right way and a wrong way to determine the effects of such things. The wrong way is word of mouth. The right way is scientific experimentation.

    Thursday, July 9th, 2009
    yathin
    9:44p
    East Glacier
    Like I said in my last post, West Glacier was all about grand scenery and little wildlife. So, hoping that the law of averages does its thing I was looking forward to East Glacier. Bears, Moose and Mountain Goats were the top of my wish list for the day.


    My vacation days usually start well before the hint of sunlight. That means I need to haul myself out of my cramped tent, pack up and leave the campsite in nearly frigid conditions. It was such a beginning to the day at Fishing Bridge in West Glacier. After a quick pit stop at a gas station, I was on my way towards East Glacier. First destination was the strangely named 'Goat Lick' point along the main highway that connects West Glacier to East Glacier. Knowing about the grand naming schemes in and around the park, I wasn't hoping to see the mysterious mountain goats.


    And as expected, the parking lot at the Goat Lick pullout was empty. The tropical ape that I am, I didn't want to get away from the heated car into ice age temperatures outside. I was very, very positive that this was just another tourist trap and there would be no goats, gorillas or goblins around. My more adventurous fellow-traveler from the cold north wanted to go scan the area and did just that while I sat in the car. Seconds later there was a frenetic waving of hands and I forgot the meaning of cold as I rushed out with my (ever-ready) camera and tripod. Mountain Goats! With little ones too. There were a whole lot of them sitting, standing and sleeping in precarious places on dangerous looking cliffs. I had seen the famous mountain goats of Glacier National Park at last! Photographing them would be a letdown though because the sun was still not up. I would have waited for the sun to drop by, but then the goats were too far for my telephoto lens to make any decent photographs, so I made a few documentation photographs and headed onwards to a place called Two Medicine.


    Moose are giants. You don't realize how huge they are until you see one of those things for real. They are as tall as camels and with antlers that can span seven feet across they look more intimidating than camels. American bison look dwarf-like next to a bull moose. Since I couldn't imagine that they could really be so big, I just had to see one. Now, my fellow traveler knew a thing or two about Moose. Besides being their national animal, there was a great experiment done in their country to build a mighty moose cavalry. A cavalry so strong that enemies on mere horses would be trampled and crushed. Victories in wars would have been a moose-walk for the Swedish army. But it wasn't to be for moose are creatures not built for war. The Swedes would be wiser in their know-hows when it came to moose talk since that day. So, according to Swedish knowledge moose are to be found in places where there are trees, old and young, with water close by - old trees to hide, young trees to eat and water to play around in. I was also told that Moose are usually seen running by the roadside looking for the best place to escape into the forest by the roadside. And the Swede was right. By Thor, the Swede was right! On a deserted road through a conifer forest, I saw a giant animal running along the road. Moose! I couldn't believe the I could be so excited with my first moose sighting, but it was that exciting. It was a young male moose running along the road looking for a gap in the forest to run away into. Just as the Swede had predicted. Moose really are giants!


    So, in the first hour of sunlight I had two lifers - Mountain Goats and Moose. It couldn't get any better than that right? Well, what else could happen to make an already fantastic day better? It just did get better. Driving on the edge of the park, I noticed a animal in the shadows by the roadside. I first thought it was cattle from one of the surrounding ranches until I realized I was looking at a bear! Grizzly? My heart wanted it to be a grizzly, but I just knew it had to be a Black bear. And it was. It was another young black bear, but unlike the black bears I had seen on previous occasion, this one was really black. He was walking straight towards my car, on my side of the road, when I stopped at a distance and put on the emergency lights so that passing cars would slow down. Unfortunately, a bunch of cars came by from the other side and scared away the bear into the forest. I had gotten a couple of photographs, but I wished I had seen more of him. Slightly disappointed, I went ahead and pulled into a turnout to review my photographs. Now bears are inquisitive little buggers and I should have known that. While I sat there wondering when I would see my next bear, I casually looked at my rear view mirror and imagine what I see!? That young bugger had come out of the forest and was looking very curiously at my car! I got out of the car with excitement and that spooked him and he ran away into the jungle once again. I turned the car around and waited on the turnout on the other side and I just knew the bear would come out. And come out he did. This time I didn't get out of the car since I had parked it in a way that I could shoot from the window. He first stood behind a bush and looked at me for a few seconds. He then took a few baby steps out of the bush towards the car and then decided that he wanted to cross. He moved towards the other side of the road rather slowly and I was hoping no car would come by because that would surely kill him. He went to the middle of the road and then stopped. He raised one paw and looked at the me plotting his next move. At that point I wanted to get out to force him to cross the road quicker, but thankfully he decided to continue moving. He then got into the bush and disappeared into the forest. What a beautiful animal and what a magical moment!

    Later on during a day a beaver was seen in one of the lakes at a place called Many Glacier. A moose was seen running (as usual) along the forest's edge. And after the sun had gone down we came across a stopped car. The driver said he had seen two grizzlies in the meadow next to the road. The wait was exciting but we didn't see any grizzlies that night. And so ended the stay at Glacier national park. It was a beautiful stay and I was impressed by the Rockies. However, Yellowstone and Grand Tetons were coming up next.








    More photographs... )




    shortindiangirl
    8:44p
    Frustration
    Most of the time I love my baby. She's wonderful and quite a joy.

    But some of the time she's EXTRAORDINARILY FRUSTRATING. And a super pain in the ass from hell.

    No wonder it takes a strong marriage. It's easy to turn baby related & transition related frustration onto the spouse. Sigh, I have to go away for a while & remind myself that she did not ask to be born.

    Current Mood: aggravated
    shortindiangirl
    4:13p
    Continue to be un-impressed with the Mac
    Still unimpressed with the Mac:

    1) File management: Can't copy files from my computer to a USB memory stick. It gives me strange errors and when it does appear to copy them, the files are not accessible from any other computer.

    2) Preview: Importing a scanned file from a scanner is a pain. Even though multiple pages are scanned Preview only shows me the first page. Even if I change the setting to scan it in pdf format, it will scan it in tiff format ONLY. Preview's import setting is essentially useless.

    3) Every time my computer has to be woken up from power saving, the Mac asks me whether I should connect my INTERNAL keyboard and INTERNAL trackpad to the Mac or my Virtual Machine. WTF ? It thinks that the internal keyboard & trackpad are external devices. Fool.

    4) Peripherals when connected via USB ports keep asking whether to connect to the Mac or my Virtual machine. Even if I check the box that says "remember this association", it constantly has to ask.

    5) The Mac can't keep track of my bluetooth mouse (supposedly designed for use by the Mac). Bluetooth constantly has problems staying on. I have to turn it off and turn it back on again.

    The whole "it just works" thing is a hoax. It works better than Windows, but that's about it.
    myrch
    9:59a

    People I love, in ascending order of intensity

    Cantankerous essayists
    Canadians
    Constitutional lawyers
    Asian toddlers
    Italians
    Harrison Ford, ca. 1980
    The organic food farmers profiled in The Omnivore's Dilemma
    Scientists
    Classically trained musicians
    My father
    Mom and Bob
    Dea
    Myself

    Wednesday, July 8th, 2009
    myrch
    1:40p

    Think Spam is unhealthy?

    In the realm of canned meat products, there exists something worse. Sure, it's only 140 calories per serving, but...

    world_tourist
    [ pink ]
    1:19a
    california and oregon
    Jet lagged and playing with photos! Here are some =D
    Went on a 12 day california/oregon trip. here are some images on my flickr



    Oregon Photos Here


    California Photos Here

    Current Music: It's Unsustainable - Chris Walla
    Tuesday, July 7th, 2009
    gubaby
    4:04p
    twitter
    trying to write more but not having the time, follow me on twitter for the meantime! see you all soon!

    http://www.twitter.com/jacquelinegu

    or

    http://www.twitter.com/positivedose

    yep, i got two of 'em! :)
    Monday, July 6th, 2009
    yathin
    9:06p
    West Glacier
    I didn't know much about Glacier National park except for the fact that it is the only other national park in the lower 48 states that has Grizzly bears. Yahooing (but of course!) for more information revealed that it was the world's first international park and is contiguous with Waterton Lakes national park in Canada. And since I was planning on visiting the world's first national park - Yellowstone - during the trip, the prospect of going to the world's first international park seemed exciting. However, it was the park mascot that sold me Glacier - the Mountain Goat!

    Now what does American Football, the Loch Ness monster and Glacier National Park have in common? They were all created for the consumer - spectators, audience or tourists. According to a well known source here's a history lesson: "In 1891, the Great Northern Railway crossed the Continental Divide at Marias Pass (5,213 ft/1,589 m), which is along the southern boundary of the park. In an effort to stimulate use of the railroad, the Great Northern soon advertised the splendors of the region to the public. The company lobbied the United States Congress, and in 1897, the park was designated as a forest preserve"

    And so, Glacier National Park came into existence with catchy names for glaciers, roads, lakes and all. Thankfully the birds and animals were left untouched by the naming frenzy. The most famous of all roads in Glacier National Park is the Going-to-the-sun Road. It doesn't really go up to the sun (I didn't have to confirm that right?) and it is not all that high up in the mountains at around 6600 feet (2200 meters) on its highest point, but it is a civil engineering landmark nonetheless. You'll have to see and drive on the road to believe what an achievement it is. Really. Winter can dump eighty to hundred feet of snow on the road and it takes forever to clear out the snow when spring arrives. It wasn't even open in late June when I made the trip there!

    With the Going-to-the-sun road closed on the west side at its highest point, Logan Pass, traveling to the east side would have to wait for another day. Glacier National park on the west side starts off pretty flat. With beautiful conifer forests, the magnificent Lake McDonald and Grand views of the high Rockies. Every turnout overflows with scenic beauty (and with cars of course!). There are countless trails leading to a lake shore or into the forest. Trailheads and turnouts have notes posted everywhere in bright yellow, orange or red warning tourists that they are now in Grizzly country. The poor animal even carries a scientific name as horrible as Ursus arctos horribilis (meaning Bear bear horrible. Ursus means bear in Latin. Arctos means bear in Greek. horribilis means... OK, you figure this one out). Anyway, the bear bear bear is known to be notorious in these parts and every conversation for hikers and campers revolves around how to stay safe from them... if you can that is. Hikers are seen carrying bells, whistles and pepper-spray when in Grizzly country. The park also has the smaller and more common Black Bears (which are quite large by the way). So, how does one know if the bear is a Grizzly or a black bear? Well, it is really simple. Just look for their scat. Black bear scat will have leaves, berries and such. Grizzly bear scat will have bells, whistles and pepper-spray cans.

    It looked like I had taken the Crater lake weather with me as Glacier National park looked all cloudy and dull. The drive up to Logan pass was an uneventful one except for brief stops at a lake placid and a river wild. The Logan pass parking lot was an excited one. On one of the mountains near the pass, a gang of young male Big-horned sheep were honing their ramming skills on a patch of snow. A steady stream of tourists walked up a very, very, very slippery and steep trail to see the sheep from up-close. Blessed with a giant telephoto lens (compared to those pocket cameras anyway) that the tourists did not possess, I first took a shot of the sheep from down below. And then the greed for better shots took over my mind and I began going up the steep slope ignoring my awful mountaineering skills. I was doing OK uphill until I turned around and saw the near vertical trail (at least for my eyes and ability anyway). And the first slip happened and I had to stop almost immediately. I heard from tourists coming down that the sheep had gone away and now there was no motivation to do the last ten percent of the trail. Getting down was the priority now but not in the rolling down manner. After some circus and some nervous moments on slippery snow, I was finally down on the road with mud and ice on my back side. Did I mention that grass and small shrubs have strong root systems? :-)

    The day ended with a long and bumpy drive through deep wilderness to Lake Kintla on the Canadian border. The road was rough with spectacular scenery and wide open meadows. It took several hours to cover the fifteen or so miles because of frequent stops and slow driving in the hope of catching a grizzly on the meadows or a moose among the willows, but it wasn't to be. At one point I wondered if I had crossed off into Canada by mistake. Now that would be illegal and a lot of trouble for me. Anyway, I was more slow than I thought I was and Lake Kintla itself wasn't a letdown. Besides being amazingly beautiful (and I'm running out of words to describe the parks other features) it had one of the most remote camping grounds I've been to. Unfortunately, I had already pitched my tent at another place called Fishing Bridge and I had to turn around for the night.

    West Glacier was all about grand scenery and little wildlife. East Glacier was different and that story shall be told in the coming days. For now, here are the images from West Glacier.




    Glacier National Park




    More images and a funny squirrel... )





    kanishka_sinha
    8:54p
    Reflective clarity


    I can discern the underlying patterns from the swirling blue mists that surround us
    And coalesce the Platonic ideas into droplets with the strength of inevitability
    All I need to do stand my ground and wait for the Universe to burst forth from the bubble
    Together we'll take care of everything
    myrch
    11:45a
    The saddest part of a broken heart isn't the ending so much as the start

    It may seem surprising that Sarah Palin perseveres as a political entity despite her (a) bizarre comments, (b) stupid comments, and (c) quitting politics.

    And to be sure, many folks eagerly await her political death. But Sarah Palin is not going away. At least not yet.

    Yes, she is a good-looking woman. In fact, it seems to me she's more attractive now than she was when she was younger. More importantly, if Todd Purdum's Vanity Fair article, "It Came From Wasilla is to be believed, Palin understands how to use her looks to great photographic effect.

    But it is not her attractiveness that explains why she resonates with millions of Americans.

    My country has long been ambivalent toward smart people. Sure, smart people invent stuff, say smart things, and make sick people feel better. But they also use fancy language just to confuse us, keep their riches to themselves, and perhaps most importantly, talk 'bout things that piss Jesus off.

    Dumb people, on the other hand, thems we likes.

    Palin is not stupid, exactly, but she's intensely un-curious about the world, as evidenced by her wide-ranging lack of knowledge of subjects beyond Aleeyaska, snow "machine" racing, and hunting. She doesn't portray herself as a smart person or as an authority. Instead, she says she's "normal" or "real America" and uses folksy language (droppin' the letter g, invokin' sports analogies, and insertin' cliches) to emphasize the point.

    The 2008 election demonstrated that America had mostly tired of a president with whom we'd feel comfortable drinking beers. But there will always be a segment of American society that craves leaders who look like them, talk like them, and most importantly, are neither more sophisticated than them nor uppity.

    Which is why Palin is such a danger to herself. To date, she's done a pretty good job of manifesting a political outsider of unexceptional intelligence. But one thing we also know about Palin is that she's deeply ambitious. If she sets her sights too high -- and she will -- she risks leaving in the dust her ground-bound rabble of anti-authoritarian idiots, effectively damning her political prospects forever.

    world_tourist
    [ mystressprynne ]
    8:34a
    Sunday, July 5th, 2009
    yathin
    1:10p
    Crater Lake
    I love blue and Crater lake is all about that color. It had been on my list of places to see for a long time and I finally got a chance to travel to the place this summer - on the longest day of the year in the Northern hemisphere. I headed out from San Jose several hours before dawn to beat the weekend traffic as I don't particularly enjoy driving in bumper-kissing traffic. I'm sure there are people out there who enjoy traffic and crowds and noise and such, but that's not me. Anyway, I had put in some good miles - bless cruise control - by the time I reached Redding in California when the first rays of the sun hit this part of the world. After a quick stop for fuel and coffee, the central valley of California had ended and the mountains had begun. Mountain roads are beautiful to drive on but they do need a lot of concentration as they are filled with distractions in the form of scenic places and wildlife. As the cloud cover cleared up a bit, a giant white peak was seen among the shorter pine-covered hills. It was the great white mountain of the Cascades - Mount Shasta. Traveling further north revealed that that mountain just rises out of flat ground and forms an incredible backdrop for the highways that run around it. I thought about going to the forests around the peak, but I had to decide between that and losing out on a camping site at Crater lake, so I decided to head on towards the lake.

    I had imagined Oregon to be all rugged mountains but it started off pretty flat - with Mount Shasta looking over the land. By that time, distractions had taken control and I was on an Oregon birding trail near Klamath Falls. Nesting Sandhill cranes, courting Wrens and blackbirds and mud-collecting swallows were seen and though I could have spent hours and hours there, I had to move on. When I arrived at Crater lake, the first thing I needed to do was to get a campsite. Most campgrounds get filled up by noon on summer days. However, most campgrounds at Crater lake weren't even open and the few that were open still had some snow in them! And there I was for my summer vacation in shorts and sandals. After registering at the campsite, I pitched my tent and headed seven miles north to the rim of the crater lake. It was all foggy when I reached the rim and through holes in the cloud I could see the deep, dark blue waters of the mighty crater lake. It is one of the deepest lakes in the world and was formed when a volcanic peak collapsed and trapped all the water from the snowfall on the surrounding peaks, so it has a bit of interesting history.

    The overcast conditions made me feel that I wouldn't be able to see the blue that the lake is so famous for, so I headed out to the trails nearby to catch some wildlife. I had to turn around soon though because it was obviously not a 'shorts n sandals' type weather and I had to head back to the campsite to change into something more appropriate - a layer of thermals and sweaters. :-)

    The fog cleared up for a few minutes during the day and the breathtaking blue was seen at last, but I think the lake deserves to be seen on a clear day when three-fourths of the rim drive isn't closed.

    The morning came early for me. I could hear rainfall on my tent and I dreaded the thought of having to get outside and pull apart the wet tent and dump it into the car. The sleeping bag had saved me from the bitter cold of the night and I only realized how cold it was outside after getting out of it. I quickly pulled apart the tent and started driving towards the lake from the campsite. It was still very dark outside and it was still raining. The car said that that outside air temperature was about 27F (or -3 Celsius) but since it was windy it felt a lot colder. When I got to the rim, there was absolutely no one there. And then I saw a shadow moving in the snow - a red fox in his gray winter coat was patrolling the village one last time before the sun makes an appearance. I put on my woolens and headed out to the rim to see what was happening on the lake. The lake was calm with clouds all around the rim and fog was moving in. I spent a couple of hours walking around the place till the sun broke through the clouds to show Crater lake one last time before I continued traveling north towards Seattle.





    Crater Lake Blue




    More images from around Crater Lake and the road... )





    arnabsworld 6:29a
    BaconSnake: Inlined Python UDFs for Pig

    I was at SIGMOD last week, and had a great time learning about new research, discussing various research problems, meeting up with old friends and making new ones. I don't recall exactly, but at one point I got into a discussion with someone about how I'm probably one of the few people who've actually had the privilege of using three of the major distributed scripting languages in production: Google's Sawzall, Microsoft's SCOPE and Yahoo's Pig. The obvious question then came up -- Which one do I like best? I thought for a bit, and my answer surprised me -- it was SCOPE, for the sole reason that it allowed inline UDFs, i.e. User Defined Functions defined in the same code file as the script.

    I'm not aware if Sawzall allows UDFs, and Pig allows you to link any .jar files and call them from the language. But the Microsoft SCOPE implementation is extremely usable: the SQL forms the framework of your MapReduce chains, while the Mapper, Reducer and Combiner definitions can be written out in C# right under the SQL -- no pre-compiling / including necessary.

    Here's how simple SCOPE is. Note the #CS / #ENDCS codeblock that contains the C#:

    R1 = SELECT A+C AS ac, B.Trim() AS B1 FROM R WHERE StringOccurs(C, “xyz”) > 2 
    
    #CS 
    public static int StringOccurs(string str, string ptrn) {
       int cnt=0; 
       int pos=-1; 
       while (pos+1 < str.Length) {
            pos = str.IndexOf(ptrn, pos+1) ;
            if (pos < 0) break; cnt++; 
       } return cnt;
    }
    #ENDCS
    

    Since I'm working at Yahoo! Research this summer, and I missed this feature so much, I thought -- why not scratch this itch and fix the problem for Pig? Also, while we're at it, maybe we can use a cleaner language than Java to write the UDFs?

    Enter BaconSnake (available here), which lets you write your Pig UDFs in Python! Here's an example:

    -- Script calculates average length of queries at each hour of the day
    
    raw = LOAD 'data/excite-small.log' USING PigStorage('\t')
               AS (user:chararray, time:chararray, query:chararray);
    
    houred = FOREACH raw GENERATE user, baconsnake.ExtractHour(time) as hour, query;
    
    hour_group = GROUP houred BY hour;
    
    hour_frequency = FOREACH hour_group 
                               GENERATE group as hour,
                                        baconsnake.AvgLength($1.query) as count;
    
    DUMP hour_frequency;
    
    -- The excite query log timestamp format is YYMMDDHHMMSS
    -- This function extracts the hour, HH
    def ExtractHour(timestamp):
    	return timestamp[6:8]
    
    -- Returns average length of query in a bag
    def AvgLength(grp):
    	sum = 0
    	for item in grp:
    		if len(item) > 0:
    			sum = sum + len(item[0])	
    	return str(sum / len(grp))
    

    Everything in this file in normal Pig, except the highlighted parts -- they're Python definitions and calls.

    It's pretty simple under the hood actually. BaconSnake creates a wrapper function using the Pig UDFs, that takes python source as input along with the parameter. Jython 2.5 is used to embed the Python runtime into Pig and call the functions.

    Using this is easy, you basically convert the nice-looking "baconsnake" file above ( the .bs file :P ) and run it like so:

    cat scripts/histogram.bs | python scripts/bs2pig.py > scripts/histogram.pig
    java -jar lib/pig-0.3.0-core.jar -x local scripts/histogram.pig
    

    Behind the scenes, the BaconSnake python preprocessor script includes the jython runtime and baconsnake's wrappers and emits valid Pig Latin which can then be run on Hadoop or locally.

    Important Notes: Note that this is PURELY a proof-of-concept written only for entertainment purposes. It is meant only to demonstrate the ease of use of inline functions in a simple scripting language. Only simple String-to-String (Mappers) and DataBag-to-String (Reducers) functions are supported -- you're welcome to extend this to support other datatypes, or even write Algebraic UDFs that will work as Reducers / Combiners. Just drop me a line if you're interested and would like to extend it!

    Go checkout BaconSnake at Google Code!

    Update: My roommate Eytan convinced me to waste another hour of my time and include support for Databags, which are exposed as Python lists. I've updated the relevant text and code.

    Saturday, July 4th, 2009
    world_tourist
    [ yathin ]
    2:44p
    Monument Valley, USA
    Here are a few images from a recent trip to Monument Valley on the border of the US states of Arizona and Utah.




    US route 163

    More images... )





    yathin
    1:53p
    Monument Valley
    The drive from Denver to back home in California was going to be a long one. I wanted to get back home before the holiday crowd takes over the national parks across the country. It is amazing how popular remote places and outdoor activities are in this country and for someone like me who prefers to be in places where there are no crowds, weekends and holiday weekends are time to stay away from national parks and such.

    I left Denver early on the morning of the 2nd of July. Interstate 70 through the Rocky Mountains is an amazing road. Besides being very scenic there is a lot of wildlife next to the roads all through the mountains. I saw lots of deer and big-horned sheep. They could be traffic hazards, but it is always nice to see that they are around even if they are next to a winding freeway at 11,000 feet where vehicles speed in excess of 75 mph. I picked Monument Valley on the Utah-Arizona border as the place to stop by for the night. It wasn't exactly midway between Denver and San Jose, but I couldn't have picked a better approximate midway point.

    When I got to the Navajo reservation, it was all cloudy and dark. The day was still young but I didn't have much hope to see the sun that evening. I went into the park and went for a drive on the valley floor. The overcast and low light conditions was interesting to make some photographs but when I saw horses for trail rides, I decided to go for it. Riding a mustang in the iconic western landscape can be wonderful experience but with the Navajo tour guide telling me things about Navajo culture, beliefs and tradition, it was just awesome. The weather played its part with an occasional drizzle as the Navajo horseman sung his rain song. Almost as soon as I had finished with the horse ride, the clouds opened up a bit to show the magnificent landscape of the Colorado plateau.

    Here are some photographs from the Monument Valley.




    Route 163




    Read more... )




    world_tourist
    [ en_viktor ]
    1:05p
    Petropavlovsky Cathedral in Kazan, Tatarstan
    Petropavlovsky Cathedral (Saints Peter and Paul Cathedral) in Kazan is an masterpiece of Moscow (Naryshkin) Baroque. The temple is consecrated in honour of heavenly Tsar Peter I patron.

    Petropavlovsky Cathedral is builded in 1722. Constracting were operated by merchant Mikhlyaev, the head of imperial factories in Kazan. Most likely, orientally beautiful cathedral and its bell-tower were constructed by in common Moscow and Kazan masters.

    Photos )

    Friday, July 3rd, 2009
    yathin
    10:25p
    Back!
    The two weeks in the American west went very well. Some of you reading my (infrequent) updates on twitter may know what animals were seen, but here's a list anyway: 7 wolves, 4 grizzlies, 4 (wild) black bears (and 4 black bears in captivity), moose, coyotes, fox, badgers, beaver, muskrat, and countless elk, chipmunks, squirrels, pronghorn and bison. While Glacier National Park and Grand Tetons are very wild and perhaps untamed, Yellowstone is incredible. From geothermal features to meadows and mountains teeming with wildlife, Yellowstone has to be seen to be believed. Really. It is going to take a long time to put together the images and words from the trip, I guess. :-)

    Meanwhile, Happy Independence day to all the Americans! This photograph is for you folks.



    American Mustang. Monument Valley, Utah.




    Thursday, July 2nd, 2009
    myrch
    10:46a



    An Eaud to Water

    Of all the molecules that circle Earth,
    You are most ubiquitous and unique.
    You are 80 percent of Colin Firth
    But more like 70 percent of Mo'nique.

    Nitrogen and oxygen gases bore;
    Their symmetry yields no dipole moment.
    But you, lascivious water, with your
    sp3 orbitals, doth sighs foment.

    And noble gases? What's so noble, then?
    The curves of your frame do more to please
    Lords and ladies, who recognize the Zen
    Arete of 104.5 degrees.

    Your arched shape explains so many things:
    Your meniscuses, your thirst for salts,
    Your heat capacity and snowflake rings,
    And, of course, your nucleophile assaults.

    Life on Earth happens only with your grace.
    When you are removed, most chemistry stops.
    Lest we let our true feelings be effaced,
    Here they are, water: We think you're the tops.

    Wednesday, July 1st, 2009
    myrch
    1:37p


    Gay rights advocates have become skittish and impatient of late. They grow skeptical that Obama will fulfill campaign pledges to eliminate Don't Ask, Don't Tell and the Defense of Marriage Act.

    On Monday, President Obama affirmed his commitment to end the "Don't Ask, Don't Tell" policy that prohibits gays and lesbians from openly serving in the military. Obama said to a gathering of gay rights advocates: "It's not for me to tell you to be patient, any more than it was for others to counsel patience to African Americans who were petitioning for equal rights a half century ago."

    But it is for Obama to tell the audience to be patient. He's only been in office five months, and is facing down a half dozen cataclysmic issues all of which affect more people (and affect them more deeply) than gay marriage or gays in the military.

    Forgetting history, Don't Ask, Don't Tell seems an unprovoked offense to equal rights and justice. But until this policy was enacted, gays and lesbians had no recourse to serve in the military at all. Gays and lesbians have served in various branches of the U.S. military since before there was a U.S. military, of course. But it's hard to know just how many of them there've been, since the military has largely ignored the subject.

    As recently as the 1960s and 1970s, if a soldier was found to be gay, he would be "dishonorably discharged" -- the reason was not made public record. As a result, military branches can't answer a simple question like, "how many soldiers have you discharged for homosexuality?" Some data exists. From 1950 to 1965, the Navy "separated" more than 17,000 sailors from the others for homosexuality, according to the 1971 book Homosexuality in the Military. That's just non-officers in the Navy, hardly the most populous branch of the military. Though it may be the gayest.

    Since Don't Ask, Don't Tell was enacted in 1991 under Clinton, more than 13,000 troops have been discharged for homosexuality. In other words, the number of discharges is almost certainly way down prior to 1991.

    In effect, Don't Ask, Don't Tell is a transition policy that has given jarheads and grunts plenty of time to adjust to the idea of serving alongside openly homosexual troops.

    I am sad for those who've been shafted by the policy, but I prefer to look at Don't Ask, Don't Tell as a necessary transition step.

    shortindiangirl
    10:58a
    Ageing baby
    The terms are somewhat loose, but in general:

    Birth - 2 months: Newborn
    2 months - 1 year: Infant
    1 year - 2 years: Baby (although airlines still say Infant until age 2)
    2 years - 3 years: Toddler
    3 years - 11 years: Child
    11 years - 15 years: Adolescent
    15 years - 19 years: Young adult
    19 years - 22 years: Young / New adult
    22 years - 42 years: Adult
    42 years - 67 years: Middle aged
    67 years - 84 years: Retired / Senior
    84 years & up : Aged / Mature

    My newborn has grown up to being an infant. Already I can see her size and shape maturing. No more does she have this teeny little head with ALL mouth that opens to eclipse her face. Now her mouth is a rosebud and proportionate to her head. Her head, though, will change in proportion to her body by and by.

    Current Mood: Temporal
    kalyan
    12:39a
    Following the Rains of Life
    If you are from India, you know that the monsoons are the lifeline of the country. It brings joy and celebration to the land, the people and most of all the wildlife. Over ten meters of rain falls in the Western Ghats in this season transforming the land completely [...]

    Click here for more
    Tuesday, June 30th, 2009
    myrch
    11:10a

    America has always been like a hungry toddler in a supermarket, immobilized in a shopping cart seat but vociferous in its demands. The current sugar cereal of Americans' desire is universal health care coverage, and our current president seems intent on giving it to us.

    I've written about the subject before, and said my problem with universal health care coverage is that it will further punish those of us who make intelligent lifestyle choices by increasing the amount of money we pay in taxes and insurance, for the purpose of subsidizing smoking, binge drinking, and slovenliness.

    I still feel that way, but I'm resigned to the adoption of a universal health care program. It just feels inevitable.

    I am most concerned now with the way in which my country adopts such a program, given two things: the economics of American health care -- and the health of Americans.

    We are a notoriously fat, lazy, and unhealthy people. We are greedy. We are self-obsessed. This national identity has resulted in massively inflated costs. But what are these costs?
      Chronic, avoidable illnesses - Laziness and a propensity for smoking and drinking too much result in an incredible diversity of painful, chronic illnesses later in life, from heart disease to emphysema and diabetes. These avoidable (or at least, postpone-able) illnesses suck up most of the taxpayers' money in Medicare and Medicaid funding, ca. $300-400 billion combined, or $2,000 per person, per year. That's not the actual cost of these illnesses, though. Private insurers pick up the rest, which is trillions of dollars, paid for by you or your employer.

      Medical malpractice - Today I learned that while Canada sees approximately the same percentage of medical malpractice claims as the United States, somehow, the costs of those claims are 90 percent less in Canada than in the U.S. Yeah, 90 percent. Part of the problem there is that the United States does not put a cap on "pain and suffering" damages, and in many instances there is no statute of limitations on when you can sue. Another weakness in the system, some believe, is that the rules for paying for litigation encourage miffed former patients to undertake frivolous or unfair lawsuits levied against good doctors who are merely guilty of being human.

      Drug costs - Drug discovery and development is a cost- and time-consuming process, and industry pressures are such that companies may only expect that their new drug is "the best available" for a short period of time -- perhaps a year. That means drug companies must charge incredibly high amounts of money for the drugs to break even. There is nothing that can or should be done about this. Putting a (legal) cap on what drug companies can charge will discourage them from pursuing anything but "sure things," which in turn will slow the rate at which we, as a species, develop new technologies. Not a great idea, given humanity's ever-increasing population means infectious disease events will also increase -- exponentially. What we can do is invest more public money in drug discovery, though I doubt the federal government wants to own new brands, as that would expose them to litigation. No, I think we want drug companies and medical research centers to continue to bear that burden.

      Specialty services - Some doctors specialize in costly procedures or techniques, and charge a fee each time their services are utilized. As a result, some doctors push their pet skills on patients (directly or through referrals from their doctor friends), even when those skills do not improve a patient's prospects. The Cleveland Clinic's solution is to pay their doctors an annual salary and forbid charges for specialty services. So a doctor who is really good at hemispherectomy will get paid the same amount no matter how many times she performs the surgery that year.

      Fear of death - Even if a person lives a healthy life, the body will eventually start to break down. We were only built to make it past parenting age, after all. When the body begins to fail, some people are willing to spend all the money they have (or don't have) to stay alive. It is incumbent on all of us not only to live a healthy lifestyle, but also to accept the inevitability of death, and not to drag out the dying process when prospects for recovery are slim to none.
    There are other reasons why medical care in America is expensive, but these are major causes.

    Because of the peculiarities of American culture and economies, I believe that we simply cannot afford universal health care coverage at this time. President Obama wants more than $1 trillion now, and that's just a first payment. Recall that our national debt is already $11 trillion: every American adult owes about $50,000.

    America needs to show it can act responsibly enough to deserve universal health care. Perhaps that means implementing the program in two phases: in the first phase, we work as a people to bring costs down, by exercising more, drinking and smoking less, changing our perspective of self-worth and entitlement, and working with health care workers and industries to eliminate waste. Once we have accomplished this -- quantified perhaps as (inflation adjusted) medical expenditures per capita -- only then do we enact a program that ensures medical coverage for all Americans.

    [ << Previous 25 ]
About LiveJournal.com

Advertisement