Shared posts

20 Jun 06:03

Comic for June 20, 2013

Dilbert readers - Please visit Dilbert.com to read this feature. Due to changes with our feeds, we are now making this RSS feed a link to Dilbert.com.
10 Jun 10:13

Bharat Nirman: Nation advancing ahead at full speed

by Nirav
07 Jun 03:55

Surfrider Foundation : Barrel

by Bibhuti

Surfrider Foundation : Barrel

“For every pound of algae in the Ocean there are six pounds of plastic.”

Agency: Arnold Furnace, USA
Executive Creative Director: Tom Spicer
Creatives: Cameron Brown, Luke Duggan, James Galli Barrow
Designer: Darren Cole
Production: Chris Hulsman, Warwick Nicholson
Image manipulation: Cream Studios
Photographers: Zac Noyle, Daniel Fryer

30 May 05:05

Liquid mammoth blood found

by Jason Kottke

A mammoth recently found in Siberia was so well preserved that when researchers were chipping it out of the ice, liquid blood flowed out.

Semyon Grigoriev, chairman of the university's Museum of Mammoths and head of the expedition, said: "The fragments of muscle tissues, which we've found out of the body, have a natural red colour of fresh meat. The reason for such preservation is that the lower part of the body was underlying (sic) in pure ice, and the upper part was found in the middle of tundra. We found a trunk separately from the body, which is the worst-preserved part."

The temperature was ten degrees celsius below zero when the mammoth was found, so the discovery of liquid blood was a shock. "It can be assumed that the blood of mammoths had some cryo-protective properties," Grigoriev said. "The blood is very dark, it was found in ice cavities below the belly and when we broke these cavities with a pick, the blood came running out."

More photos and information here. Bring on the mammoth clones, John Hammond. (via @carlzimmer)

Tags: biology   science
27 May 05:23

Geek&Poke's Java 101 - Today: File handling

by Oliver Widder
27 May 05:21

Donald’s Market : Sweater

by Bibhuti

Donald’s Market : Sweater

“Vegetables Keep Your Clothes From Shrinking.”

Agency: Immersion Creative, Vancouver, Canada
Creative Director: Mike Catherall
Art Directors: Oran Rahmani, Seann Einerssen
Copywriter: Mike Catherall
Photographer: Peter Holst / holstphotographic.com
Stylist: Claudia Da Ponte
Makeup Artist: Sara Rose

21 May 07:08

Comic for May 21, 2013

29 Apr 04:39

Detail

2031: Google defends the swiveling roof-mounted scanning electron microscopes on its Street View cars, saying they 'don't reveal anything that couldn't be seen by any pedestrian scanning your house with an electron microscope.'
29 Apr 04:37

Comic for April 27, 2013

29 Apr 04:37

Star Models : Sketch

by Bibhuti

Star Models : Sketch

“You are not a sketch. Say NO to anorexia.”

Agency: Revolution, Brazil
Creative Directors: Emerson Braga, Edson Rosa
Art Director: Edson Rosa
Copywriter: Emerson Braga
Photographer: Diego Freire
Illustrators: Edson Rosa, Samuel Marinho
Additional Credits: Carlos Pereira, Renata Matos, Vitor Barros, Flavio Fernandez, Melina Romariz, Mylene Alves, Clarissa Mattos, Jaime Neder Rezak

29 Apr 04:36

Comic for April 28, 2013

29 Apr 04:35

Geek&Poke Weekly About Technical Debts (Part 2)

by Oliver Widder
04 Apr 05:52

Gradient Text

by Mark Allison

Recently there was a comment on the article on Text Shadows asking how to fill text with a gradient. In this article we’ll look at a simple technique for doing precisely that.

Creating text filled with a gradient is actually really easy, although it’s not immediately obvious how to do it in the same was as simply changing the text colour. The trick is to use a Shader, or more specifically a LinearGradient (which extends Shader), to do all of the work for us.

The constructor for LinearGradient that we’ll use takes seven arguments, although there is also a more complex form which allows for multiple colour steps to be defined. The first four of these represent the start x & y and end x & y coordinates of the line along which the gradient will be drawn (this effectively controls the direction of the gradient). The next two arguments represent the start and end colours of the gradient, and the final argument dictates how areas outside of the rectangle defined in the first four arguments will be drawn.

So how do we go about applying this? In its simplest form, we can get a reference to a standard TextView object, and set the Shader on it’s Paint object:

Shader myShader = new LinearGradient( 
    0, 0, 0, 100, 
    Color.WHITE, Color.BLACK, 
    Shader.TileMode.CLAMP );
textview.getPaint().setShader( myShader );

The TileMode that we’re using means that the colour of areas outside of the rectangle (0, 0) – (0, 100) will match the colour of the closest edge of that rectangle – i.e. extending the colour of the edges of the rectangle.

While this will certainly work, it does suffer from the small drawback that the gradient will need to be static dimensions which are completely detached from the size of the text within the TextView. So what if we want the dimensions of the gradient to actually match our text? We simply need to extend TextView.

Now the obvious thought is to extend TextView and simply override onDraw() to create a new LinearGradient which matches the dimensions of the textView control each time the control is drawn. However this is rather inefficient because it means instantiating a Shader object each time onDraw is called. Object instantiation is a rather expensive business and should be avoided at all costs in your onDraw method. If you perform object instantiation in your onDraw you’ll find that your frame rates suffer badly as a result.

So if we don’t do it in onDraw, then where should we do it? The answer is quite obvious when we think about how often we actually need to create a new LinearGradient: only when the size of the TextView changes. Therefore, the most efficient place to do this is actually in onLayout:

public class GradientTextView extends TextView
{
    public GradientTextView( Context context )
    {
        super( context, null, -1 );
    }
    public GradientTextView( Context context, 
        AttributeSet attrs )
    {
        super( context, attrs, -1 );
    }
    public GradientTextView( Context context, 
        AttributeSet attrs, int defStyle )
    {
        super( context, attrs, defStyle );
    }

    @Override
    protected void onLayout( boolean changed, 
        int left, int top, int right, int bottom )
    {
        super.onLayout( changed, left, top, right, bottom );
        if(changed)
        {
            getPaint().setShader( new LinearGradient( 
                0, 0, 0, getHeight(), 
                Color.WHITE, Color.BLACK, 
                Shader.TileMode.CLAMP ) );
        }
    }
}

So, whenever the layout changes we create and set a new LinearGradient based on the height of the TextView.

Running this gives us the following:

gradient_text

This same technique can be used to apply different kinds of gradients (LinearGradient, RadialGradient, SweepGradient), filling text with a bitmap (BitmapShader), or even combining shaders (ComposeShader). The more adventurous can even create their own custom shaders!

While we’ve only covered a really simple example here, we have covered a very useful technique which is pretty easy to implement, and can give us some impressive results.

The source code for this article is available here.

© 2013, Mark Allison. All rights reserved. This article originally appeared on Styling Android.

Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License

DeliciousStumbleUponRedditDiggBookmark/FavoritesShare

03 Apr 04:34

The Opening Ceremony

by greatbong

The IPL, as we all know, is characterized by good taste and subtlety. The opening ceremony of this year’s IPL stayed true to that spirit of understatement, with an aesthetically choreographed show that brought out the essence of what the tournament is all about.

Being held in Kolkata, the birthplace of the Indian Renaissance and the home of Kobiguru, it was but natural (and poetic) that the ceremony should begin with one of his works being recited, in English, by Shahrukh Khan, as Bengali as Ilish maach and nolengurer sandesh.

I might have been carried away but I could not help feeling that somehow, somewhere, we were celebrating the cosmic connection between these two brand ambassadors of Bengal, one who brought the Nobel Prize to Bengal and one who brought the IPL cup. What made it even more poignant were the words “Where The Mind is Without Fear”, capturing brilliantly the state of Kolkata and Bengal today, where those who forward cartoons are celebrated by being thrown into jail, and where those who dissent are tenderly called Maoists.

Truly magical.

And as East-European “Bideshinis” , clad in traditional Bengali skimpy-wear and fake smiles, cavort to Shahrukh Khan’s emotion-drenched voice, one cannot but feel how happy Rabindranath Tagore would be, up in heaven, looking down at the spontaneity and honesty of the performance below.

Of course Tagore is no more. But Ravi Shastri is evermore. A poet among commentators, he is tracer-bullet-like as he sets the cat among the pigeons, calling the captains out to sign the Spirit of Cricket Declaration, a charter of “good behavior rules” that are held in as much esteem and regard as traffic lights on India’s roads. And there they are…the captains as they walk over to the giant touch-screen—Jayawardene (banned in Chennai), Sangakkara (banned in Chennai), Angelo Matthews (banned in Chennai). Oh look there is Ricky Ponting signing the declaration, binding himself to the spirit of fair play, as he has done all through out his career. Did Virat Kohli sign his name? If he did, why does his finger-path look like a giant “Behenchod, teri maa ki” from where I am sitting? Never mind.

Because Deepika Padukone is here,  with this former brand ambassador of Royal Challengers, capturing through her energetic moves, the happiness of Kingfisher employees who were recently paid for the month of June and July. In April.

Which is however but an opening act for Katrina Kaif, the “Kat” inside Kol”Kat”a, known for being to item dancing what Vadhra is to real-estate investing. With the predictability of Gambhir edging to slip or chopping the ball onto his stumps, she executes her “Sheila ki Jawani” and “Chikni Chameli” steps, with the spontaneity of a customer service representative reading from the “Hello sir, how are you doing today?” script.

But wait. Why is the theme from Don playing? Who could it be? Surely not Priyanka Chopra? No.

It’s the Ambassador. No not the white battle-tank that is the vehicle of choice for safari-suited bureaucrats.

But the Brand Ambassador. King Khan. Shahrukh Khan (Banned at Wankede)

The audience is exhilarated by his energy,as he zips from one corner of the stage to another. So frenetic is everything that at least two of the backup dancers seem like they may have a heart attack any second. And yet, they keep on dancing.

Because as the saying goes— You dance Jab Tak Hain Jaan. Jab Tak Hain Khan.

And then he introduces two of the greatest musical talents the country has ever produced.

Bappi Lahiri and Usha Uthup.

Today’s kids won’t get this. Nor will most non-Kolkatans. But seeing this dynamic duo at Salt Lake Stadium, brought back  memories, memories of times gone by. Of Hope 86, the first time Bollywood truly came to Kolkata at Salt Lake Stadium, (organized if I remember right to raise money for striking cine artistes in Mumbai) with Sridevi and Jeetendra and Usha Uthup and Bappi Lahiri and Prabhuji giving us a slice of forbidden fruit. It was the day, many old-timers say, when Bollywood breached the gates of Bengali culture castle. I remembered those tumultuous times, of Left Front strong-man Jatin Chakraborty flying into a tizzy, calling the state-supported (CPM was ruling then) jamboree as “apasanskriti” (Bad Culture) which is possibly the most hurtful thing you can say to a Bengali, and then Usha Uthup in protest singing “Ami shilpi, ami shilpi, ami chai shilpir somman” (I am an artist, am an artist and I want to be respected as one), to which Jatin Chakraborty responded by painting the head of the Ochterloney Monument (called Shaheed Minar) red.

Ah those days.

Sukhen Das DancingMaybe it was just my misty eyes but I think I saw Sukhen Das, the tragedy king of Bengali cinema who always danced before he died (so that people do not understand what pain he is in), prance across stage  clad in his iconic jean jacket, stopping for a second to shed a tear before donating his kidney to the Sunrisers with his patented “Bhai, amar theke eta tomar dorkar beshi” (Brother, I think you need this more than I do).

Sukhen-da. Wish you were here.

I guess after the nostalgia unleashed by Bappi-Usha, I am expecting a representative of contemporary Bengali culture—a modern hero like the dashing Jeet or even better the pushing Deb, whose song “Lal juto paaye khokababu jaaye” (“Wearing red shoes, Mr. Boy moves”) from the movie “Khokababu” was reportedly Pope Benedict’s favorite song ( he being also a Khokababu who wore red shoes).

But that does not happen.

Pitbull comes onto stage.

Evidently, the organizers had wanted Jeniffer Lopez. It kind of made sense because if she is facing right she looks, from the side, kind of like the map of West Bengal. But what the organizers had not realized was that while “Love Don’t Cost a Thing”, JLo does.

So they got Pitbull.

I don’t know but I am guessing what probably happened was that someone saw this picture, and decided “Well if not the one on the left, why not the one on the right?”

This is not to imply that Pitbull and his Bald Headed League of Bob Christo Fans are not awesome. They are. They totally blend in like a Rabindrasangeet group from Santiniketan performing on the beaches of Cancun during Spring Break.

And Pitbull gives it his all, like Ricky Ponting did for Kolkata in the first IPL. I would say that with his strategic “Come on”s and “Yeaaah”s and his “Negative to Positive” , Pitbull provides as much value for his Put-Bill amount of $600,000 as the marginally more expensive ($650,000) Mashrafe Mortaza did for Kolkata Knight Riders in the 2009 series with his 21-runs-giving last over to Rohit Sharma. As a matter of fact, the only way we could truly thank Pitbull for this performance would be to make him sit through a 5-hour  presentation of “Invest in Bengal” and then, after that, make him memorize the full “Tum to thehre Pardesi” song before he is allowed to leave.

Now it’s done. Pitbull has left the building. Thanks are being said. The lights are being dimmed. Salt Lake Stadium slips steadily back into silence.

But the fun…the fun.

That’s just started.