BitConnect

Zazzle Shop

Screen printing

Wednesday, September 17, 2008

Red band Role Models



God bless the internet. That's all I can think of as I watch the red band trailer for ROLE MODELS, the latest in a long line of red band trailers that seriously kick ass. Like ZACK AND MIRI MAKE A PORNO before it, this ROLE MODELS trailer really shows what the film is all about instead of watering it down for a G-rated audience (though the original theatrical version was still pretty funny).

The film stars Paul Rudd and Seann William Scott as two energy drink salesman who are forced to participate in a Big Brother program (not the reality TV show) where they would mentor troubled kids. Scott gets a foul-mouthed troublemaker while Rudd gets a nerdy loner (Christopher Mintz-Plasse). Check the trailer out below courtesy Trailer Addict!

'LL DO WHATEVER THE NAKED GIRLS TELL ME TO DO


these topless girls seem to think I can be swayed by writing a presidential candidates name on their chest. These topless girls are 100 percent correct.

Click here for the Candidates

Star Wars Snowboarding



Star Wars themed snowboarding at Mountain High. Directed by Mike Benson. Starring Casey Wrightsman, Geoff Isringhausen, Cory Whetstone, Nick Sibayan, and Eric Miranda.

Fun Pics of the Day


Click here for more pics..there are a ton

GOD THIS TOOK FOREVER

http://www.wwtdd.com/ul/12211-0.jpg
Megan Fox in this months GQ showed up yesterday, but only now are they up in high quality scans. So these are the same pictures, but larger.

HEY IT'S THE JAMES BOND SONG



The song written by Jack White as the theme for the next James Bond movie has made its debut as the instrumental theme of a new Coke Zero ad. White isn't happy about people hearing his work for the first time in a commercial (even though hes done a Coke ad before) but the song is good so who cares. And at least crackhead Amy Winehouse got dumped in time for him to do something. I think three minutes of her mumbling, then dropping the microphone, then cursing at the producers, then falling down and snoring would have set the wrong tone for the movie.

15 Most Artistically Awesome Advertisements [Videos]

Some really cool advertisements in here. If you know others, please link them in the comments.

read more | digg story

Mr. & Mrs. Darth Vador

The Bike that Rides on Water

by Jorge Chapa

dicycle, the bike that rides on water, the water bike, pedal powered vehicles, pedal powered boats, rides on land and water, water bicycle

We love it when people take a familiar idea and turn it into something completely new. Take the good old pedal boat — a simple vehicle powered by human motion, not unlike the trusty bicycle. What if one could create an amphibious human-powered vehicle that could move from land to water with the ease of a salamander? That was the inspiration behind the radically innovative Di-Cycle Concept by GBO design, a half bicycle / half pedal boat hybrid that looks as fun as it sounds.

The Di-Cycle Concept is particularly well suited for the Netherlands, where there is an ardent biking culture and plenty of water. Therefore it comes as no surprise that this is where the Di-Cycle was developed. GBO design wanted to create a fun and active vehicle that could explore the city using both roads and the multiple canals in the city of Helmond. The Di-Cycle looks like an enjoyable way to get around any aquatic city, and for this creative design, GBO won the Brabantse Spelen design competition in 2005. Truly a spectacular and eye popping concept.

+ Dicycle @ GBO

Via Automoto

dicycle, the bike that rides on water, the water bike, pedal powered vehicles, pedal powered boats, rides on land and water, water bicycle

dicycle, the bike that rides on water, the water bike, pedal powered vehicles, pedal powered boats, rides on land and water, water bicycleOlder versions of the DiCycle - apparently not that new of a concept?

dicycle, the bike that rides on water, the water bike, pedal powered vehicles, pedal powered boats, rides on land and water, water bicycle


Sonic Lighter: The First iPhone App That Lights Other iPhones On Fire



We always knew that the whole Apple thing was a cult. The signs were always there: Steve Jobs, dressed in a strict uniform of unpretentious clothes, revealing our next idol to worship on a seasonal basis. Now the Sonic Lighter iPhone app brings the sacredness of group flame to iPhone users everywhere. Not only can you create fire of your own, but Sonic Lighter allows you to simultaneously light iPhones around you. It's a $1 app, but boy will it piss off everyone around you who worships a BlackBerry. [smule]

Pictures of Many Idiots Trying to Park Their Cars


How did these people get a drivers license?

click here for pics | digg story

Japan's Landfills Abound with Gold, Silver and Platinum

Japan's enormous high-tech rubbish dumps have become a natural resource for precious metals including gold, silver and indium

Japan's high-tech rubbish dumps - the vast “urban mines” of landfill outside every big city - have grown so huge that the country now ranks among the biggest natural resource nations in the world.

Tens of millions of defunct mobile phones, discarded televisions, PCs and MP3 players conceal a “virtual lode” of hundreds of tonnes of precious metals. An even greater seam may be lurking forgotten - but not yet discarded - in Japan's attics and garages.

According to new calculations by the National Institute for Materials Science (NIMS) in Tsukuba, Japan has unwittingly accumulated three times as much gold, silver and indium than the entire world uses or buys in a year. In the case of platinum, Japan's urban mines may contain six times annual global consumption.

The institute's leading urban mine expert said that if these electronics-rich treasure troves were properly tapped, supposedly resource-poor Japan would suddenly join the likes of Australia, Canada and Brazil in the top five producers of some elements.

The mines have been accumulated because of the extraordinarily high speed at which Japanese consumers replace gadgets. Of these, the 20million mobile phones replaced by the Japanese each year are especially attractive “ores” for urban miners. Only 13 per cent, about 550 tonnes a year, are recycled, with the remainder thrown away or stored in drawers and cupboards.

The circuit boards of each phone contain a smorgasboard of precious metals: in minute quantities there are silver, lead, zinc, copper, tin, gold, palladium and titanium.

Although other developed countries - particularly the United States and Britain - are thought to have very substantial untapped urban mines of their own, Japan leads the world as an assessor of what its dumps and attics contain in the way of metal resources. Koumei Harada, the director of the institute's strategic use of elements division, has pioneered the calculation of Japan's potential urban mine resources.

By comparing the quantities of metals imported over the past 60 years with what has left Japan inside its electronics, cars and other exported goods, Professor Harada arrived at basic reserves. From this were subtracted theoretical quantities of metal that remain in use.

According to the professor, decades at the forefront of the global consumer electronics industry had left Japan with a tantalising legacy: it has invisibly accumulated stocks of some metals to rival proven worldwide reserves in the ground, but it knows where only about half of it is. Worse, that half is difficult to process.

Now the Ministry of Economy, Trade and Industry is pushing for nationwide collections of old electronics from homes and for ideas about how best to excavate the landfill. Companies such as Asahi Pretec already run urban mines at various plants in Japan. One of its plants retrieved about 15 tonnes of gold last year from a variety of industrial waste.

Professor Harada is part of a team working on establishing “artificial ore” factories at Japan's waste dumps and landfill sites. By his estimates, a tonne of ore from a real goldmine might produce only five grams of actual gold, while a tonne of artificial ore made from reduced mobile phones would yield about 150 grams.

Green Lantern Story Details And Casting Update

By El Mayimbe on September 16, 2008



I don’t do due requests, but due to overwhelming demand from fans, I decided to take a look at the first draft of THE GREEN LANTERN by Berlanti, Green and Guggenheim dated 6/9/08, 104 pages. IESB took a look at a different draft, most likely the 2nd draft or first rewrite which was 5 pages longer.

To be perfectly honest, I’m not a die-hard Green Lantern fan. My only comic book experience with Green Lantern was during The Reign of the Supermen storyline in the early 1990s when Cyborg Superman destroyed Coast City and Hal Jordan lost his mind and became the villain Parallax. Catching up on my Lantern lore, courtesy of Wikipedia, I found out yesterday before checking out the script that Hal Jordan is now again the Green Lantern after 2004’s Rebirth mini-series. Gonna check that one out.

On the casting front, DAVID BOREANAZ is not up for the role of Green Lantern. Earlier today, news went around the net that the guy from BONES was up for the role. Don’t believe the hype. Here is the deal, which is what I expected when I inquired about the Boreanaz rumor - the script is out to a few name actors and David ISN’T NOT ONE OF THEM. For starters, Hal Jordan is 27 in the script and David is pushing 40.

Just because a concept artist used David’s likeness for storyboards doesn’t mean he got the gig. It is typical studio policy to go out to all the name actors available so that a studio has a “name” to market on what looks to be another $150 million tentpole huge special effects driven bonanza slated for 2010 to compete with Marvel’s slate.

So, that being said, my POV on the script is that of a story analyst, and a general fan of comic book movies. In other words, I rep the other quadrant or audience that is the non-Green Lantern fanboy contingent that this script has to attract.

The script is good. REALLY REALLY GOOD. Hence the B+ rating. I had a ball reading it and got very into it. The script for me is short of excellent and an A rating because of one particular stupid ignorant scene which offended and pissed me the hell off and took me out of the story which I will mention at the end of my review.

Fanboys are gonna love the shit out of it though. Reading this script and the exceptional work done on SUPERMAX aka GREEN ARROW, it is perfectly clear that Warner Bros. Pictures has upped their comic book movie game and want to go after MARVEL really hard.

There is some very excellent craft in THE GREEN LANTERN. The 3 writers clearly have writing chops, which is expected from writers who work under tight deadlines in television. The structure adheres closely to what I call – the “superhero origin movie paradigm.” Our hero, in this case Hal Jordan has a fear, limitation, block, or wound at the beginning of the story which he has to overcome (his character arc) or have some control by the midpoint of the script which is usually the time he becomes the superhero for the first time ie: BATMAN BEGINS. In GREEN LANTERN’s case, Hal Jordan has to overcome his selfishness and self pity over the death of his father Martin Jordan which takes place early in the script. Hal Jordan for the first 20 pages or so is a prick. The story follows the GREEN LANTERN origin closely and cinematically speaking – IT WORKS.

In a nutshell, ABIN SUR’s ship crash lands in the desert on Gaia aka Earth after his fight with LEGION in space. LEGION got a serious beef with the Green Lantern Corps and hunts them. Abin incurs some injuries with Legion which prove to be fatal. Legion is the biggest menace to the Green Lantern Corps and has already killed three of them. With his dying breath, Abin asks the ring to pick someone honest, someone brave. The ring passes Clark Kent and Guy Gardner and selects Hal Jordan.

abin-hal

Hal Jordan makes it back to Abin’s ship. Abin dies in Hal’s arms and Hal buries him in the desert. Hal also takes the famous Green Lantern oath by the end of act 1 – the crossing of the first threshold scene.

Also, while Hal is taking the oath, HECTOR HAMMOND at the request of the government, performs an autopsy on Abin Sur. Abin’s body was recovered at the crash site. During the autopsy, Hector removes a piece of shrapnel which is a piece of LEGION. It infects Hammond who will become the second villain of the script. LEGION is the the biggest threat to Oa, the Guardians of the universe, and the Green Lantern Corps, and Hector Hammond is the biggest threat to Earth, Hal Jordan and his loved ones. Legion is a bad motherfucker and a Green Lantern terminator, reminds of one of my favorite DC super villians – DOOMSDAY.

Hectorham-gl

Also what was not previously mentioned is that ALAN SCOTT aka the first Green Lantern is also in this script and a major character, but I won’t say how.

The first part of the 2nd act, the test, allies, and enemies stage is where Hal Jordan gets accustomed to his new powers and the 2nd half of act 2 is Hal doing his first deeds on Earth as it’s newest hero. There is also a romantic subplot that Hal has with CAROL FERRIS. The 2nd half of act 2 has Hal losing his first fight with Hector Hammond. Green Lantern travels to Oa to ask the Guardians for help because he believes he cannot defeat Hector Hammond alone.

gl-oa

guardians

The 3rd act is wall to wall action where Hal Jordan joins all the other Lanterns on Oa in fighting Legion and then the other Lanterns like KILOWOG joining Hal on Earth to take on Hammond. Very cool and if executed as written, the script has the potential to be a HUGE blockbuster with serious franchise potential for further sequels and prequels as the script alludes to.

kilowog-gl

A special effects company will have a field day with THE GREEN LANTERN with all the green shapes and objects that Hal Jordan and his fellow Lanterns conjure up with the ring.

Overall, one of the most solid first draft superhero screenplays EVER. It turned me into a Green Lantern fan and I already ordered Emerald Dawn and Rebirth to read.

greenlanternpicture

Now my beef. To most folks, it would seem minor, but to a Latin like me, it’s huge deal.

A note to the Berlanti, Green and Guggenheim and the creative execs on the project.

Guys, you know the character of HUGE MOTHERFUCKING BOYFRIEND?

Well, if you don’t want to incur the wrath of this HUGE MOTHERFUCKING AUTHOR AND STORY ANAYLYST then get rid of the dead Latino Meth Drug Dealer body at the bottom of page 27.

Do we need a stereotype and an inaccurate one at that in a superhero movie?!

First of all, you ignorant fools the OVERWHELMING MAJORITY of crystal meth dealers are WHITE!

A statistical fact.

Does the dead Latin body that Hammond performs an autopsy on advance story or reveal character?

No. It only serves to perpetuate a stereotype and again an inaccurate one. It also serves to alienate the biggest movie going audience which according to a report issued on 8/14/08 by Hispanic Media Marketing, went to the movies this summer at unprecedented levels.

You see, a huge percentage of the half a billion bucks of The Dark Knight’s money came from the Latino movie going audience. Don’t believe me? Get the report and the tracking. So if you guys and the WB want us to embrace your movie then get rid of the stereotype. The body could remain, it doesn’t have to be a Latino and the scene would still work.

There is no need for stereotypes in Superhero movies.

I’m not asking you, I’m telling you…

… GET THE FUCK RID OF IT.

That simple ignorance is the reason I can’t give this expertly crafted script the A it clearly and obviously deserves. The dead body changes ethnicity and I change the grade. Till then, I will be monitoring the rewrites so that dead body better not be Latino because the last thing my community needs in a tentpole movie is to inaccurately perpetuate the we deal crystal meth.

As the New Yorker in me would say, “Get the fuck out of here with that bullshit!”

In the meantime, you can follow my updates on TWITTER.

Mayimbe out.

19 Really Cool Gadgets for Your Office or Cubicle



The office can be a cold, hard, life-sucking place to spend your working days. For all the stigma surrounding “the office,” you’re getting unique opportunities to interact with people and your environment in between filing TPS reports. Here are 19 gadgets that will help to turn that day job prison into a techy heaven!

read more | digg story

Why Schools Make You Tuck In Your Shirt!



Explaining the reason for a school dress code.

Police return pot to patient almost 3 years later



'That's a chunk of hash,' Huntington Beach man says.

The Orange County Register

HUNTINGTON BEACH It was like Christmas Day for Jim Spray. He giggled with glee as he tore into brown paper bags as if they were presents.

These bags, however, were filled with jars of his medical marijuana and other paraphernalia that had been stored for nearly three years at the city's police department.

A court order today forced officials to give it back, marking the second time in a year that Huntington Beach police have had to return seized marijuana to a patient after court rulings stated that the marijuana should not have been seized in the first place.

"That's a chunk of hash," said Spray, a 52-year-old trade show decorator from Huntington Beach. A tall, stocky police official watched as the medical marijuana patient inspected a tiny, eye shadow-sized container full of hashish.

"It's still good. I almost forgot about all this," said Spray, who uses medical marijuana because of pain from a herniated disc.

It has been almost three years since Huntington Beach officers confiscated Spray's estimated 4 ounces of marijuana and a $1,000 growing system, which included special lighting and a water-timing system.

While police had destroyed most of the growing equipment, officials returned Spray's marijuana today after an order from Orange County Superior Court Judge Thomas Borris.

The order came nearly nine months after the 4th District Court of Appeal ruled that the city must return Spray's marijuana and equipment taken from his home in November 2005. Spray was represented by attorneys with medical marijuana advocacy group Americans for Safe Access.

The Huntington Beach Police Department doesn't have a policy regarding medical marijuana, officials have said in the past. Officers interpret the Compassionate Use Act as protecting medical marijuana recipients from prosecution, not arrest.

The 1996 law allows people to use medical marijuana in California. Federal law, however, outlaws all marijuana use.

On Aug. 25, state Attorney General Jerry Brown developed guidelines for the first time since the passing of the act. The most notable guideline upholds the legality of medical marijuana dispensaries that operate as nonprofit cooperatives or collectives.

In addition, the new directive essentially tells law enforcement officials that they cannot take marijuana from medical marijuana patients in the first place and are not allowed to charge them if they are carrying less than 8 ounces.

Agencies, such as Huntington Beach, however, are still trying to figure out what to make of Brown's directive, since it is opinion and not law, officials said.

About six months ago, Dave Lucas of Huntington Beach also retrieved his purple urkel – a higher-end marijuana – and a couple of smoking pipes officers confiscated from him more than a year ago.

Lucas retrieved his medical marijuana in April, after waiting for the California Supreme Court to decline to review an appellate court ruling, which ordered Garden Grove police to return seized medical marijuana to Felix Kha.

In November, Kha won the right to get his medical marijuana returned to him. A month later, the same court also ruled in Spray's favor.

"Hopefully, they'll stop taking people's medicine away," Spray said today out loud in the police lobby.

Spray said he plans to file a claim against Huntington Beach because of his destroyed marijuana growing equipment. Medical marijuana advocates Bill Britt and Marvin Chavez Sr., who were there for support, helped Spray with the about half a dozen bags of once-seized pot.

"Do you know how much of a pleasure it is to take medicine from the department?'' said Chavez, a medical marijuana patient and advocate. "It's such a victory."

Contact the writer: 714-445-6688 or ccarcamo@ocregister.com

7 Plays Dumber than DeSean Jackson

Jocks. Who doesn’t love them? Ok don’t really answer that; but who doesn’t love the down-to-earth mistakes that show their occasional hubris and overall boneheadedness? Last night, Eagles WR DeSean Jackson treated us to one of the stupidest moments in NFL history for celebrating his touchdown reception about 18 inches too early. A word of advice to Jackson: you are not Usain Bolt–save the celebrating for after you cross the line.

Of course, Jackson’s play was not of huge consequence (although some of the staunchest Cowboys haters were hoping for a goal line stand, just for karma). There have been plenty of bonehead plays before his. We at IGN reviewed some of the best in recent sports history:

7 - Leon Lett’s Fumble Recovery
It is widely accepted that with his bonehead play, DeSean Jackson has officially entered the Leon Lett Club. For some reason the king of bonehead plays is not on youtube as of this writing, but in Superbowl XXVII (Jan 1993), Lett was fortunate enough to recover a fumble against the Buffalo Bills and take it to the house…except he put his hands out to celebrate in the last 10 yards before approaching the end zone and one of the Bills players caught up to him and knocked the ball out of his hand. Although it was in the Superbowl, the play was of no consequence as the Cowboys won handily.

6 - Leon Lett. Again. The very next season.
This time was not in the Superbowl, but it did cost his team the game. On Thanksgiving Day 1993 during a snowstorm in Dallas, the Cowboys were leading the Dolphins 14-13 and simply needed to run out the clock if the Dolphins miss their field goal. Well, the FG was blocked and the Cowboys started celebrating–except Lett tried to pick up the ball and proceeded to fumble it, which allowed the Dolphins to regain possession and kick another FG as the clock ran out.

5 - Jose Canseco uses his head
During his 1993 stint with the Texas Rangers, Canseco allowed what would’ve been an easy out against the Cleveland Indians to be an easy score. He lost a fly ball in the lights as he approached the warning track, and the ball missed his glove and bounced off his head. In a sport that is so heavily based on statistics, it’s safe to say that Canseco led the league that year in assists.

4 - Fred Brown, Georgetown
Not to be confused with Downtown Fred Brown about 10 years earlier, this Fred Brown played alongside Patrick Ewing in the early 80s and came to a 1 point game in the 1982 national championship game against a UNC squad that included Michael Jordan and James Worthy. UNC went up 63-62 with 15 seconds left. Brown took it up the floor for the final posession and for no explicable reason gave the ball to James Worthy. Dean Smith gets his first NCAA title.
Start watching at about 2:50

3 - Chris Webber, Michigan
Yes, not one but 2 of UNC’s championships have come at the expense of some other idiot’s bonehead plays. At the pinnacle of Fab 5 fame, Chris Webber sealed his fate of never winning a NCAA title by calling timeout in the last seconds of the 1993 championship against UNC. Only problem: they didn’t have any timeouts left, which gave UNC the winning free throws. Instead of even trying to live this down Webber took the bull by the horns and named his charity foundation Timeout, which probably sounds better than Tyra’s Assets

2 - Delfi Geli, Alaves
If you don’t follow euro soccer allow me to explain the stakes. Liverpool FC was playing Deportivo Alaves for the 2001 UEFA Cup, which is kind of like saying Florida State was playing Oklahoma in the Bowl game for all the Americas. Anyway, after playing a relatively high-scoring 4-4 game, Alaves’ star Delfi Geli managed to score an own-golden-goal (golden meaning it was sudden death OT) defending a free kick. Top put this in American terms, it would be as if Leon Lett had fumbled in his own end zone to give the Bills the game-winning touchdown in Superbowl overtime.
Start watching @ 3:40

1 - DeSean Jackson in high school
Yes, the only thing truly dumber than DeSean Jackson now, is DeSean Jackson in high school. In this all-star game he did a flip at the 1 yard line to celebrate his td, not only proving that he has nothing in common with Usain Bolt, but he is no Shawn Johnson either.


'Upside down rainbow' caused by freak weather


By Jessica Salter
Last Updated: 11:01am BST 16/09/2008

Freak atmospheric conditions rarely seen outside the polar regions have been credited with causing the formation of an "upside down rainbow".

Normal rainbows are made when light penetrates raindrops and re-emerges out the other side in the same direction but the inverted types, known as circumzenithal arcs, are caused when sunlight bounces off ice crystals high in the atmosphere, sending the light rays back up.

The 'upside down' rainbow was caused by freka weather conditions

The "smiley faces in the sky" need extremely specific conditions not usually found above Britain.

This picture was reportedly captured on camera by astronomer Dr Jacqueline Mitton near her home in Cambridge last Sunday.

She said: "I've never seen anything like it before - and I'm 60.

"The conditions have to be just right: you need the right sort of ice crystals and the sky has to be clear.

advertisement

"We're not sure how big an area it was visible over, but it was certainly very impressive."

A spokesman for the Met Office confirmed the inverted rainbows are occasionally spotted in British skies.

He said: "It is convex to the sun and is formed by refraction in suitably-oriented ice crystals and may show vivid rainbow colouring, as in this case."

The 'Porno' actress playing Laura Bush

Banks

The versatile Elizabeth Banks plays a porn star and the first lady in two October movies.


TORONTO, Ontario (AP) -- Elizabeth Banks has what it takes to be a porn star or first lady. And she'll be strutting her stuff as both on the big-screen within a two-week span.

On October 17, Banks' take on Laura Bush arrives with "W.," Oliver Stone's film biography of President Bush, played by Josh Brolin. On October 31, Banks co-stars with Seth Rogen in "Zack and Miri Make a Porno," Kevin Smith's comedy about two best pals and platonic roommates who shoot their own skin flick to cover their mounting debts.

"I'm pleased that Hollywood hasn't figured out how to pigeonhole me yet, and I think having these two movies come out at basically the same time is indicative of that," Banks, 34, said in an interview at the Toronto International Film Festival, where "Zack and Miri" premiered.

"I've always felt like a character actor in a leading lady's body, and Laura Bush is a very natural fit for me. I found a lot to admire about her as a woman and as a character to play. And I got really lucky in that I adore Josh Brolin, and we both approached the Bushes with the same point of view, which is that they're extremely in love and a very supportive couple, and that essentially, Laura wears the pants in the relationship, because all women wear the pants in the relationship, and he is smart enough to know that, too." VideoWatch Laura meet George in "W." »

Banks also wears the pants in "Zack and Miri," or rather, the "granny pants," a pair of humongous underpants her character is caught wearing in a cell-phone video that becomes a Web hit. From there, Banks' Miri and Rogen's Zack move on to hardcore porn, certain they can sell enough copies of their amateur adult movie to pay their bills.

Tame by true porn standards, "Zack and Miri" does have some explicit nudity involving co-stars Jason Mewes and Katie Morgan. Banks was ready to show some skin herself.

"One of our first discussions was about nudity. I was like, 'OK, well, what's the porn going to be?' Because even in the script, it's just like, 'and they have sex,' or something. It was the bad porno dialogue, and then they do it," Banks said.

"Kevin sort of assured me that he didn't think that we would have to show a lot of my bits and parts. We'd probably cover things up and use some camera angles. But you know, I was fully prepared to go there for the movie, and Seth was, too. We were going to get naked, and it was going to be crazy and uncomfortable. Then Kevin sort of had this epiphany part way through that it would serve the movie a lot better if we just really had a romantic, beautiful sort of lovemaking session. It totally works in the movie. It's the sweetest, the most heartbreaking thing."

Banks' credits include newspaper secretary Miss Brant in the "Spider-Man" flicks, the horror comedy "Slither," the horse-race drama "Seabiscuit" and this year's romance "Definitely, Maybe." She also had a recurring TV role in "Scrubs" and co-starred with Eddie Murphy in the summer flop "Meet Dave."

Two weeks after "Zack and Miri" comes the comedy "Role Models," in which Banks co-stars with Paul Rudd and Seann William Scott. Banks previously appeared in "The 40-Year-Old Virgin," which also featured Rogen and Rudd.

After Smith's first choice for Miri, Rosario Dawson, turned down the part, Rogen encouraged Smith to sign up Banks.

"It was weird that she wasn't the star of more big, huge comedy movies, because to me, she was one of the funniest people out there," Rogen said.

Shortly after production wrapped on "Zack and Miri," writer-director Smith learned that Stone had cast Banks in "W.," which went into production last May on a breakneck schedule so the film could debut before the November election.

"I thought, how ironic. A porn princess and the first lady in one year," Smith said. "It's also just fun to mark the irony in the fact that two weeks prior to getting down and dirty in our movie, she's probably not being down and dirty in the other movie."

"W." follows Bush from his Yale days through his father's term as president and on to the September 11 attacks and the Iraq War.

Stone pulls no punches in depicting Bush's boozy younger years, but the film also captures the charisma that allowed the younger Bush to outdo his father and win re-election, Banks said.

"I personally think the audience will remember or understand again why Bush was elected twice. He is a great guy. I've met George W. Bush, and I thought he was a great guy," said Banks, who visited the White House when "Seabiscuit" screened for the president.

"He's like your friend's cool dad who's actually really interested in you and your life. He was very self-deprecating and cool and the whole nine yards when I talked with him. I totally got why if you met him, you'd be like, yeah ... I'd let that guy run the country. Cool. I think he has a good heart, and that is also in the movie."

A lifelong Democrat, Banks does not care for the job Bush has done as president. But she said most of "W." deals with the filmmakers' "best guess at what these people are like behind the scenes," not with the Bushes' public life.

"At the heart of 'W.' is a great love story. It's a father-son story, and then there's this great love story, too. George and Laura, they come off like a great couple in this movie," Banks said. "They really do, and we believe that they are. I mean, you never hear a whiff of George Bush cheated on Laura Bush. Never. You hear that about every other president, but it's never even whispered.

"They are together, and I think it helps that they met late in life and married later and had trouble having kids. They were sort of like, in it together for a long time, and they've really been through some stuff. So the fact that they're still together amazes me. A lot of people say to me, 'Oh, I think she's just biding her time. She's going to divorce him,' and I don't see it. I think it's going to be really interesting to see them go back to the ranch and live the life I think Laura wants to live."

Copyright 2008 The Associated Press. All rights reserved.This material may not be published, broadcast, rewritten, or redistributed.

The Trickiest Trap in Nature

I thought it was the Registry of Motor Vehicles, Credit Reporting Agencies, or Strippers, but I was wrong.

Trickiest Trap: Photo by Thomas Northcut/Getty Images

Most spider webs work through chance: The spider erects an invisible trap and waits until some unlucky insect hits it. But a common Australian spider called the St. Andrew’s Cross—known for its striking, cross-barred web—is sneakier.

According to Dieter Hochuli, a professor at the University of Sydney, the spider lures its prey with the highly visible white stripes of its web. The decorations, which significantly increase the rate at which it captures bees, wasps and houseflies, mimic the ultraviolet light reflected by flowers, tricking the pollinating insects into approaching the deadly trap.

Birds Sixth Sense

Sharp Eye: This bird might see magnetic-field lines.: Photo by Alan and Dianne Page

Scientists have known for years that map sense stems from the magnetite in birds’ beaks, which measures the strength of the Earth’s magnetic field so they recognize home when they get there. But how do they know which direction home is?

Researchers at the University of Oxford have pinpointed a mechanism—in the lab, at least—that may act as a bird’s compass. The compound, called a CPF triad, was used for the experiment because it’s similar to proteins found in migratory birds’ retinas. When illuminated with a blue light typical of dusk, which is when birds orient themselves, CPF formed two unpaired electrons that spin in opposite directions. A magnetic field forced the electrons to align, providing a fixed location for the birds to call north. Avian specialist Henrik Mouritsen of the University of Oldenburg in Germany thinks it’s like having a fighter pilot’s eyes—like a head-up display, birds can activate a layer of vision to see Earth’s magnetic-field lines.

U.S. Embassy in Yemen attacked, 16 Dead


U.S. embassy in Yemen has killed at least 16 people, including civilians and Yemeni security guards," the AP reports.

"Yemen has long been viewed as a haven for jihadists," the Times notes. "It became a special concern for the United States in 2000, after Al Qaeda operatives rammed the U.S.S. Cole in Aden harbor, on Yemen’s southern coast, killing 17 American sailors."

The paper adds, "The U.S. compound has also been the scene of occasional political violence in previous years, including a large demonstration against the American-led invasion of Iraq in March 2003, in which two Yemenis were fatally shot and dozens injured."

In April, the State Department "ordered all non-essential diplomatic staff to leave the country after an attack on the embassy claimed by al-Qaeda," Al-Jazeera observers. "A residential compound used by U.S. oil workers in [the capital city of] Sanaa had also come under attack from rockets at that time.

MSI Wind - is it any good?

medion-2.jpg

Netbooks. The Dream: a tiny, full featured computer in your bag, a device so small and light you never notice it's there. A machine with a battery life so long you treat it like a cellphone. The reality? Actually closer than you might think.

I picked up a netbook this weekend, a clone of the MSI Wind. Rebadged for the German market as the "Medion Akoya Mini" (and sold in Spain), the clone is exactly the same as the Wind. Well, almost. The model I have loses Bluetooth but gains a 160GB HDD, a quite ridiculous amount of storage in such a small computer. It cost €400 ($570), which is around €50 less than the actual MSI Wind.

medion-8.jpg

I chose the Wind (Akoya, whatever) over the Eee PC or the Acer Aspire 1 for several reasons, but the main one was the keyboard. Compared to my MacBook Pro, the Wind's keyboard is absolutely terrible. But compared the the Asus, it's a dream. The keys have a fair amount of travel and bounce, and they are big enough (just) to touch type. If you can touch type, which I can't.

The second reason is that the Wind seems to be the easiest of netbooks on which to install Mac OS X (more on that later). While XP is actually pretty good on the Wind (there is no off-the-shelf Linux option), I just prefer OS X.

And third? It's so much fun! Having a tiny computer in your bag is, for someone who grew up in the 80s, science fiction. I feel like I'm living in the future, and that alone is worth the €400. Details:

Hardware

medion-6.jpg

The Wind (as we shall refer to it here) has a set of specs that actually put the MacBook Air to shame. A 10.2" LED backlit display, which is very bright and clear, runs at 1024 x 600 (widescreen). On the sides you'll find three USB ports, headphone and microphone jacks, a VGA-out for connecting another monitor, a Kensington lock socket (why bother when you can almost put the whole thing in your pocket?), an ethernet (10/100) port (take that MacBook Air) and a card reader (SD, MMC and MS formats).

medion-7.jpg

This last is actually a great little addition. I can carry the Wind and a camera and easily off-load photos. The slot is spring loaded so you just push to eject.

The processor is a 1.6 GHz Intel Atom with Intels GMA950 on-chip graphics card. These are surprisingly fast. In fact, Winds running OS X benchmark slightly faster than the old PowerBook G4s. Not bad.

You also get a decent webcam and built in mic, making this a good little Skype machine, and the trackpad, while not multitouch like the Asus Eee 900 (which has two-finger scrolling), does allow vertical scrolling if you run your finger down the right-hand side. Note. Newer Winds ship with a touchpad made by Sentelec, which allows you to configure hot corners to scroll. Accounts on the web say this doesn't work very well. Mine has the older Synaptics pad with the one-finger scrolling, and it works great. Sadly, you can't tell which one your Wind might have until you actually start using it.

The mouse button isn't so good. It looks like a single bar but rocks to allow left and right clicking. You need to give it a good push to register the click. But then, with three USB ports, you could always sacrifice one to the Logitech Nano mouse.

medion-12.jpg

The keyboard has some annoyances -- some caused by Windows and some by the hardware. The keys are still small and you'll hit the wrong ones occasionally. The top contains the usual function keys, and hitting them in conjunction with "Fn" gives access to volume, brightness, Wi-Fi on/off, sleep (or, in Windows-speak, suspend) and a switch to choose whether external displays are mirrored or spanned. It would be nice if these could be accessed without the function key, but XP won't let you change it.

medion-11.jpg

Here you see one of the rubber feet (great. Five of them make the Wind quite stable) and the speakers, which are truly, truly horrible. That said, iTunes works fine with Airtunes to send music wirelessly to bigger speakers. And here comes another big surprise: The Wi-Fi card actually has draft 802.11n.

medion-9.jpg

medion-10.jpg

What's this? Amazingly, this little diagram perfectly describes the sound from the speakers -- tinny, jarring, thin, and just like having an electric nail put in your ear. So refreshingly honest!

Performance

Surprisingly good. In fact, just to be nasty, I installed the trial version of Adobe Lightroom:

medion-13.jpg

Not only does it run, but it's actually usable. Importing RAW images was neither slow nor fast (and I upped the torture-quotient by making the Wind convert the RAW files to DNG). Browsing images is as fast as any average laptop. In fact, it only slows down when moving to the Develop Module, something which causes even my MacBook Pro to hiccup. Combine it with the SD card reader and the big HD, and you have a neat little photo shoot companion.

Next up, iTunes (I know. I loaded it up with Apple software). ITunes works just fine. It shows up as a share on the local network, and I can control it using the Remote App on my iPod Touch. While testing, I had this quite ridiculous setup: Library on MacBook Pro, streaming to iTunes on the Wind, controlled with the iPod Touch, streaming to speakers connected to AirTunes. Sure, one cable would have taken care of all that, but I'm a nerd.

The Wind also does okay with the iTunes visualizers. Here you can see a video. First, Magnetosphere, the new iTunes 8 visualizer. YouTube has mashed the quality, but you can that see it works, albeit in a cut down manner.

Movies are fine, as long as you use headphones. Which brings us to battery life. Running at full whack (without any energy saving options), you'll get a good two hours or even more. I have the smaller 3 cell battery (there is a bigger 6 cell model). Movies will obviously take more juice, but the Wind never gets hot. Those grills in the side actually put out a fair breeze. Anecdotal evidence from the net says that the processor doesn't get much above 50ºC.

Hacking

medion-4.jpg

The next stage is to install OS X. I'm waiting on a new Wi-Fi card, as the supplied one doesn't have any Mac drivers, and a netbook without Wi-Fi is rather pointless. It actually seems pretty easy, and reports say that Leopard runs very well, with a few caveats. From the Modaco forums comes this list from hacker Paul:

WORKING GREAT!
- Graphics card running accelerated at 1024x600 native resolution

- Ethernet- Webcam

- Internal speakers

- USB- SD card slot

- Sleep

- Bluetooth

- Hotkeys for display, volume etc.

- Touchpad



WORKING OK (i.e. with caveats!)
- VGA out (working as a secondary display, but not in mirrored mode!)

- Keyboard layout (for some reason the backslash on the UK keyboard between shift and Z is not detected, remapped to key to left of '1')


NOT WORKING
- WiFi (see below!)

- Headphone port

- Mic port

- Internal mic

- Hibernate - native macs hibernate using EFI signals, which doesn't work on 'hackintoshes.' Still pursuing a fix for this!

With this huge 160GB drive, I'm going for a dual-boot -- whoever installed XP saw fit to make the recovery partition around 30GB, which is perfect for a test OS X install. I'll be writing this up when it's done.

Overall, I love it. It will never be a main machine, but for a carry everywhere computer the size-performance ratio is hard to beat. With the addition of a 3G network card (to be bought this afternoon), its mobility outweighs the shortcomings. If only those speakers were a little better.

How to Run MAC OSX on an Eee PC

From Wired How-To Wiki

Jump to: navigation, search
EeeMac by Gregory Cohen, via TUAW.
EeeMac by Gregory Cohen, via TUAW.

Feel like stepping beyond the limits of Apple hardware? Want a Mac netbook for under $650? How about an EeePC running Mac OS X?

At least part of the appeal of the dimunitive EeePC netbook is its hackability -- from Linux to Vista, intrepid hackers have figured out how to run just about everything on the EeePC.

In fact, this tutorial was written on a Mac OS X-powered EeePC.

While many would question why you'd want to go to the trouble of installing OS X when there are many Windows and Linux distributions available out of the box? Maybe you're looking for a challenge. Installing OS X on non-Apple hardware provides plenty of chances to flex those (very metaphorical) geek muscles.

Feeling adventurous? Let's start hacking.

This article is a wiki. If you know of a way to get Hackintosh to work on the Eee PC, log in and help get this article in shape.

Contents

[hide]

Legal Caveats

But, before we get started there are a few things you should know. First and foremost, you're about to violate Mac OS X's licensing agreement, which specifically states that use must be limited to Apple hardware.

Therefore, there may be potential legal implications to running Mac OS X on non-Apple hardware. Although, as with most EULAs, Apple's binding agreement has never been upheld by a court of law. We're not lawyers and this guide is not intended to provide legal advice, so proceed at your own risk.

If violating the Apple license bothers you, we have a simple solution: Don't do it.

Known Issues

Before you remove your operating system in lieu of creating your own "Hackintosh," you should be aware of the lingering technical issues and missing features inherent in the hacked version of Mac OS. Eventually some developer will probably solve most of these problems, but so far no one has.

The shortlist of known issues at the time of writing is:

  • No Sound and No Flash -- Your EeePC Hackintosh will not have sound. This seems to carry over from and cause problems with Adobe's Flash plug-in. In my experience, using both Flash 9 and 10 beta, Flash movies will load, play for two seconds and then freeze up. There may be a solution for both problems. Try installing some sort of stereo audio driver and point OS X to it using the System Preferences Audio tab. Many users report success with cheap USB audio dongles.
  • Ethernet doesn't work -- Other experimenters have reported USB-to-ethernet dongles do indeed work to fix this problem. We haven' tried it. If you know something about this, log in and confirm or deny the reports.
  • No F-key support -- Software F-key functions work just fine -- e.g. F-9 activates Expose and so on, but the hardware functions like volume and brightness will not work.
  • Wifi requires a third-party app -- Yes you can get wifi and it does work, but it requires a third-party driver and utility that might be the stupidest Mac app you're ever going to use. It can't remember passwords and you'll have to turn it on and off every time you restart or wake your EeePC from sleep.


The good news is everything else works. Except for Flash, no apps have caused any problems. Although, be aware that Adobe Illustrator, Adobe Contribute and possibly some other graphics apps require larger screens and won't install on your EeePC.

The other good news is, even with the stock 1 GB RAM in the EeePC, Mac OS X is surprisingly snappy. Based on my own experience, the EeePC feels about as snappy as my Macbook. On the other hand, benchmarks actually put the performance on par with late model G5 Macs.

Battery life isn't quite such a happy story. On average, my EeePC Hackintosh gets about 3.5 hours. Firing up Photoshop or Lightroom can reduce the working time to something around 2 hours -- a far cry from the 6-7 hours some people can eek out of XP.

Installing

In order to install OS X you're going to need to download one of several Hackintosh OS X distributions. These distros contain modified version of OS X that allow it to run on non-Apple hardware. There are two known to work with the EeePC. Due to legal issues, I can't link straight to them, but here's a link to a torrent search for iDeneb 10.5.4 and Kalyway 10.5.2 which both work with the EeePC 901 and 1000H.

I used the iDeneb disk for my installation and followed the instructions found on Maceee.com.

In addition to the hacked version of OS X, here's a list of other things you'll need:


Here's a quick rundown of the installation process, along with some notes on where my experience differed from the Maceee instructions.

  1. Transfer the Ralink installer and patched ktext installer to a USB stick or similar.
  2. Download this modified BIOS file and use the ASUS Update tool pre-installed with Windows XP to update the BIOS. You can find the update tool through Start Menu >> Applications >> Asus >> Asus Update.
  3. With the modified BIOS installed you're ready to go, make sure you've burned iDeneb to a DVD and have a USB DVD drive attached to the EeePC. Pop in the iDeneb DVD and get started.
  4. Restart your EeePC and quickly press the F2 key to enter the BIOS menu. Navigate to Advanced >> CPU Configuration and disable everything but USB support. Also, go to Onboard Devices in the BIOS and disable everything. This step strikes me as unnecessary, but I haven't tried installing without it. Your mileage may vary.
  5. Now head to the BIOS Boot Devices menu, select your DVD drive as the main boot device and restart.
  6. When your EeePC reboots you should be in the iDeneb installer. If you need to format your disk, head to Utilities > Disk Utility, just as you would with a normal OS X install CD. Format your drive as "HFS+ journaled" and save. Two caveats: if you've got an EeePC with a solid state drive, don't use the journaled option when formatting. Second, you should realize this step does what it says and will erase your disk. Also of note, my trackpad did not work during the iDeneb install process. Luckily an attached USB mouse did.
  7. When you reach the drive selection screen, choose the drive you just formatted. Then, on the next screen choose Customize to select the correct packages. Expand the patch options and select the following:
    • Expand the triangle for Chipsets and check ICHx Fixed.
    • Expand the triangle for Kernel and check Kernel 9.4.0 Vanilla.
    • Expand the triangle for Wireless and check Broadcom.
    • Expand the triangle for Fix and check both FireWire Remove and ApplePS2Controller
    • Expand the triangle for Video, then the triangle for Intel. Finally, check the box for GMA950.


Click the install button and cross your fingers. From here it's a pretty normal install of OS X though it does take a bit longer than it would on a Mac. If all goes well, OS X will walk you through the account setup screens and you're up and running.

Unfortunately things did not go well for me. It seems to be a pretty common problem that OS X hangs at "Do you want to transfer information from another Mac" screen. Luckily there's a workaround. Just shut the EeePC and then start it up again holding down the F8 key. When the prompt appears type -s to enter single user command line mode. From there type the following commands, one at a time:

sbin/fsck -fy
/sbin/mount -uw /
touch /var/db/.AppleSetupDone
passwd root


Set the root password and restart. Now OS X should boot at normal. Head to System Preferences, create your user and set the startup options you want. Reboot and login as the user you just created.

Restart the computer and access your BIOS settings. Turn everything we disabled earlier back on (i.e. onboard devices and CPU options) and restart.

Now you have OS X installed, but there's a number of things that are a bit screwy -- screen resolution, no wifi and more. To fix those issues we need the driver files we downloaded earlier. Using the USB stick or similar, transfer the Ralink installer and patched ktext installer to your desktop.

Double click and follow the install process for each. Once you're done, restart and the screen resolution will be fixed and you'll be able to connect to Wifi.

Here's how you connect: Head to the applications folder and double click WirelessUtilityCardbusPCI. Once the app opens, click the advanced tab and toggle the "radio" button off and then back on.


Now head to the site survey tab, select your desired Wifi network and click the connect button.


If you are attempting to use a protected network, it may ask you for a password.

Misc Issues

There are some other issues. While not necessarily deal breakers, they are things you should be aware of. First and foremost installing Apple updates is very bad idea -- they can break your installation entirely. App updates that don't require a restart are generally okay. iTunes 8, for instance, worked for me. But in general you're stuck with OS X 10.5.4 until the iDeneb hackers release an update.

Obviously the EeePC keyboard is different than Mac keyboards. The alt key is the command key, the Windows key is the option key and control is the Mac alt key.

The screen calibration is bit bluish by default, though you can fix it with the screen calibration tools in System Preferences.

Overall, despite some annoyances, I've been quite happy with my EeePC Hackintosh and wouldn't hesitate to recommend giving it a try, provided you're willing to spend some time fiddling with the installation to get everything working.

How to Build a Simple SMS notification app

Everybody's talking about how mobile devices are key to the web's future. It's easy to see we're headed in that direction, as iPhones and other devices are squishing real web browsers onto our tiny, pocket-sized screens.

What about everybody on slightly less cutting edge devices? Or, even iPhone owners with slow connections that want access to specific data quickly? The answer is the SMS app, which is now accessible to the average web developer.

When we wrote about three SMS services on the Webmonkey blog, we wondered what it would take to put something together ourselves. In a shockingly short time, we wrote the Sunrise SMS App, which accepts a city as input and gives the sunrise (and sunset) times.

In this tutorial, I'll show you how I built this SMS app and how you can build your own.

This article is a wiki. Got extra advice that could help improve it? Log in and contribute.


Contents

[hide]

What is an SMS App?

An SMS app takes input from a user's text message and replies with a new text message as a response. Let's take a look at some example applications.

First, our Sunrise app, which returns sunrise and sunset times for a user's city. To test out a working version, grab your phone and text "sunrise " to 41411. Here's an example response from my iPhone:


Google SMS has a vast array of features to their SMS app. You can use it to get sports scores, movie times -- all sorts of data. This shows the real power behind SMS apps.

Are you ready to create one of your own?

What You Need

  • A TextMarks account (which requires giving it your mobile number)
  • Google API key to geocode city names
  • Some basic server-side programming experience. My examples will use PHP5 with SimpleXML and cUrl.


Create Keyword With TextMarks

To create an SMS application, we need to first make a keyword for that application using the TextMarks service. You'll need an account and a mobile number, but you can get started without one by creating a keyword. It will walk you through creating an account at the same time.


  1. Choose a keyword. This may take a few tries to find one you want. Everything three letters or less is reserved by TextMarks, as are some common words. There are still many good keywords to choose from. Tip: if you choose a real word, see whether it's known by predictive text on phones without QWERTY keyboards.
  2. Tell TextMarks your URL. Click the "respond to a keyword with text from a web page" option. An app that returns plain text isn't really an app. We want to change our response based on input. To that end, be sure to include \0 somewhere in your URL, so that you can pass everything the user types to your application. Don't worry about getting that URL right the first time. You can edit it later.

That's it! Two steps and you're ready to start providing feedback to text messages. In the upcoming sections, I'll show you how to write a basic "Hello World" SMS app, then dig a little deeper with an example app that tells users when the sun will rise and set when given their current location.


Write a basic SMS App

Before dedicating a lot of effort to a project, I'd like to make sure to first prove the concept will work. For this "Hello World" app, we'll write a short message and then repeat what the user sent to us.

In a PHP file (I called mine /sun.php/), include the following few lines:

$city = $_GET["city"];
print "It worked! You wrote: $city";
?>


Here, we're expecting something to be passed in the city parameter. You can test this in your browser before texting by bringing up the PHP page and passing a city value. For example, your URL might be:

www.example.com/sms/sun.php?city=San+Francisco+CA


The results would be:

It worked! Your wrote: San Francisco CA


Note that the plusses disappear from the city name. Those are URL encoded spaces and PHP decodes them automatically.

The corresponding TextMarks URL for this example would be:

www.example.com/sms/sun.php?city=\0


Go ahead and text your keyword, plus a city name to 41411. You should get a similar result on your phone. It will include an advertisement on the bottom. That's just the way it goes when you're using a service for free.

I like to do this basic SMS test to make sure everything is working. I use the same URL that I will eventually use for my full-fledged application. We'll be doing the same thing in the next section. Let's take sun.php and turn it into an SMS app to return the sunrise and sunset times for a given location.


Sunrise/Sunset Example SMS App

Now that you have an idea of how information flows through an SMS app, let's create something with a little more substance.

We know Webmonkeys often work until dawn, so we wrote an SMS app that makes it easy to find out when the sun will be rising. I'll show you how we did it by tying into a couple of APIs as we create the sunrise/sunset example app.

To test out a working version, grab your phone and text "sunrise " to 41411. Again, here's an example from my iPhone:


Are you as eager as I am?

You can grab the entire PHP file from Webmonkey's Code Library, or follow along piece by piece below. Let's get to coding this app before the sun sets.


Geocoding the City Name

Before we can get sunrise and sunset information, we need to know the latitude and longitude points of the city the user sent us in the text message. I won't go into a lot of detail into geocoding, because Webmonkey already has a whole tutorial on using Google's HTTP geocoder.

The quick version is that we send Google a city name (Tip: ZIP codes and entire addresses work, too) and its geocoder replies with comma separated values. It has XML, too, but we don't need to get detailed results. All we want are the coordinates.

Here is the code for geocoding, using the "city" argument in the URL:

/*** REMEMBER to use your own API key ***/
$apikey = "yourkeyhere";

// Get lat/long from Google HTTP Geocoder
$city = $_GET["city"];
$city = urlencode($city);
$geourl = "http://maps.google.com/maps/geo?q=$city&output=csv&key=$apikey";
$csvContent = get_url($geourl);
list($status, $accuracy, $lat, $long) = split(",", $csvContent);

if ($status != 200)
{
display_output("Eek! Couldn't determine where you are based on: $city");
}
else
{
display_output("Worked!\nLat: $lat\nLong: $long"); // For debugging--REMOVE at next step
}

/*** Functions used by the rest of the app go here ***/
function display_output($content)
{
print header("Content-type: text/plain");
print $content;
exit;
}
?>


The CSV result from Google looks something like this:

200,4,37.775196,-122.419204


There are four values returned:

  1. status - should be 200, or there was an error
  2. accuracy - city-level, zip-level, etc. More about accuracy here.
  3. Latitude
  4. Longitude

I used PHP to split the values into four variables. Then, if the status is 200, there's a message displaying latitude and longitude. We'll remove this message in the next step, but it's always a good idea to make sure everything is working as expected at each stage.


Determining the Time Zone

Now that we have the latitude and longitude, we can use it to determine sunrise and sunset times... except that we also need to know the time zone. Lucky for us, there are two different calls from the EarthTools API that help us with each of these pieces of data.

First, we'll retrieve the time zone and daylight savings information from EarthTools. Replace the debugging line that displayed the lat/long data with the following code:

  // Get time zone from Earthtools
// http://www.earthtools.org/webservices.htm
$timeurl = "http://www.earthtools.org/timezone/$lat/$long";
$xmlContent = get_url($timeurl);
$xmlObject = simplexml_load_string($xmlContent);
$zone = $xmlObject->offset;
$localtime = reformat_time($xmlObject->localtime);
$dst = dst_to_number($xmlObject->dst);

display_output("Time zone: $zone\nLocaltime: $localtime\nDST: $dst"); // For debugging--REMOVE at next step


You'll also need these few helper functions. You can put them below the display_output function, but make sure they're above the ?> PHP tag:

function reformat_time($time, $fmt="g:i A")
{
return date($fmt, strtotime($time));
}
function dst_to_number($dst)
{
if ($dst == "True")
{
return 1;
}
else
{
return 0;
}
}
function get_url($url)
{
// Create cUrl object to grab XML content using passed variable $url
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
$content = trim(curl_exec($c));
curl_close($c);

return $content;
}


As with the previous step, I included a debugging line to show that everything is working properly. The time zone is reported with as the number of hours different than Greenwich Mean Time (GMT). For example, in the US, the number will be negative, because we are behind England.

To get an idea for what results come from the EarthTools API, try passing the $xmlContent variable to the display_output function. XML tags (such as the "offset" tag) are accessible as elements of the SimpleXML object. The Google geocoder tutorial, we go indepth about accessing SimpleXML results.


Retrieving the Sunrise and Sunset Times

Now that we have the longitude, latitude, and time zone, we can call the EarthTools API to get the sunrise and sunset data. Replace that debugging line from the previous step with the following code:

  // Get sunrise/sunset data from Earthtools
// http://www.earthtools.org/webservices.htm
$daymonth = date("j/n");
$sunurl = "http://www.earthtools.org/sun/$lat/$long/$daymonth/$zone/$dst";
$xmlContent = get_url($sunurl);
$xmlObject = simplexml_load_string($xmlContent);
$sunrise = reformat_time($xmlObject->morning->sunrise);
$sunset = reformat_time($xmlObject->evening->sunset);

// Print out sunrise/sunset msg
display_output("Sunrise: $sunrise\nSunset: $sunset\n\nbtw, we think it's $localtime where you are. Adjust accordingly.");


Here we grab the appropriate items from the EarthTools XML. In this case, we need to go down two levels and get the sunrise item from the morning item. The sunset item is part of the evening item. Again, check out the raw $xmlContent variable to see the full XML available.

The reason my output includes the user's local time is that EarthTools has some daylight savings time issues in some places, especially the US. If you know about a better way to determine whether DST is observed, or a different data source for our application, edit this Wiki-fied tutorial. An app can only be as good as its data.

As we've gone along, you've probably been checking progress in a web browser. That's the best and easiest way to test an SMS app. (Did you grab the full code from Webmonkey's code library?)

Now for the fun part: try it on your phone. Text to your keyword and include your city. Do you get sunrise and sunset information quickly back to your phone? Is that not the coolest?


Where to go from here

OK, so now you've copied our app, but how about making your own? You'll need to find a data source. ProgrammableWeb is an excellent resource for APIs.

Someone created an SMS domain name checker. Is there similar data you'd like to have at your fingertips anywhere you are?

Also, the best data source may be your own. Maybe the latest headlines from your blog? I created a WiFi finder for Portland using my own database of WiFi hotspots.

You'll also see that this tutorial is only a taste of the many possibilities for SMS applications. Check out the advanced Textmarks usage, such as using a user's unique code or creating multiple choice menus. There's a lot more that can be done and you could do it.

So, when you create a killer SMS app, be sure to let us know by adding it here or to your user profile page.

  • This page was last modified 23:37, 16 September 2008.

FeedM8 - Go Mobile