Minggu, 06 Februari 2011

Scrum Startup Founders Cash Out in One Year

Founders of TableNinja went to Scrum Inc. ScrumMaster Course in Los Angeles (see next course in LA) and one year later cashed out and retired. You can play 75 simultaneous online poker hands with this software.


Table Ninja Review

Table Ninja is a standalone program for Windows XP, Vista, and Windows 7 that allows a user to implement a set of fully customizable hotkeys and tools to make playing on PokerStars a much more efficient process. Features such as automated betting amounts, highlighting tables requiring action, and hotkeys make multi-tabling easier.
We recommend TableNinja for all players who play multiple tables at a time and would like more gameplay options.

Documenting functions and named parameters

Sometime ago someone asked me how I’d pass custom paramaters to event listeners. I don’t remember the exact use case neither who asked me but basically he was asking for something like:

mc.addEventListener(MouseEvent.CLICK, myListener, "myCustomParam", 2);

functoin myListener(event: MouseEvent, custom :String, custom2 : int) : void;


While the exact syntax above would not be possible, closures are in any case the way to go. I explained him how I’d do it and I forgot about the topic until today.


Today while waiting for a long compilation process to complete I’ve came up with an idea on how to improve code readability on cases similar to this. Here’s the cleaneast syntax I’ve came up with (ideas are more than welcome to improve it):



mc.addEventListener( MouseEvent.CLICK, createListenerAdapterBasedOn(myListener, withParameters("myCustomParam", 2)));


Does it look too verbose? I guess it will highly depend on the exact use case where this is used. But under some circumstances I think the readability can be substantially improved.


createListenerAdapterBasedOn is a package level method. I could have used a utility static method like FunctionUtils.createListenerAdapter. But instead I’ve used a package function because I can reduce the length of the Class + method name (or use the same number of characters to add verbosity and clarity). On the other hand it’s unlikely that this utility class would have more methods.


Documenting functions


This is a concept I’ve never read about or used before, but I think I’ll start using in different places. withParameters method is a completely dummy method that simply returns the parameters it gets but giving them a semantic and contextual meaning. The solely purpose of this method is to improve the readability by converting the method invocation in a Fluent API that can be read as natural language. The method is simply documenting the usage of the call. Putting this together with the Builder pattern and named parameters I discussed a while ago it gives us an incredible weapon to create self-documented code that doesn’t need most-of-the-times useless, needless and confusing ASDoc or inline comments.


If necessary when you have a method accepting several parameters of the same type and that can be confusing to read you could used Documenting functions to create kind of named-parameters:



myMethod(name("John"), surname("Green"), age(33), weight(70))


Here are the details of the implementation in case you are interested in seeing the internal details and some of the tests.


createListenerAdapterBasedOn.as



package com.rialvalue.utils

{

public function createListenerAdapterBasedOn(callback:Function, args):Function

{

return function( rest):*

{

if (args.length == 1)

return callback.apply(null, rest.concat(args[0]));

else

return callback.apply(null, rest.concat(args));

}

}

}


withParameters.as



package com.rialvalue.utils

{

public function withParameters( args):Array

{

return args;

}

}


createListenerAdapterBasedOnTest.as



package com.rialvalue.utils

{

import flash.display.MovieClip;

import flash.events.Event;

import flash.events.IEventDispatcher;

import flash.events.MouseEvent;



import flashx.textLayout.debug.assert;



import org.flexunit.assertThat;

import org.hamcrest.object.equalTo;

public class ListenerUtilsTest

{


private static const ORIGINAL_PARAMETER:String = "originalParameter";


private static const FIRST_PARAM:String = "firstParam";


private static const SECOND_PARAM:String = "secondParam";



[Test]

public function createCallbackAdapterWithNoParameters():void

{

var callbackAdapter:Function = createListenerAdapterBasedOn(function(data:String):void

{

assertThat(ORIGINAL_PARAMETER, equalTo(data));

});


callbackAdapter(ORIGINAL_PARAMETER);

}


[Test]

public function createCallbackAdapterWithIndividualParameter():void

{

var callbackAdapter:Function = createListenerAdapterBasedOn(function(data:String, p1:String):void

{

assertThat(ORIGINAL_PARAMETER, equalTo(data));

assertThat(FIRST_PARAM, equalTo(p1));

}, withParameters(FIRST_PARAM));


callbackAdapter(ORIGINAL_PARAMETER);

}


[Test]

public function createCallbackAdapterWithIndividualParameterNoFluent():void

{

var callbackAdapter:Function = createListenerAdapterBasedOn(function(data:String, p1:String):void

{

assertThat(ORIGINAL_PARAMETER, equalTo(data));

assertThat(FIRST_PARAM, equalTo(p1));

}, FIRST_PARAM);


callbackAdapter(ORIGINAL_PARAMETER);

}


[Test]

public function createCallbackAdapterWithIndividualParameters():void

{

var callbackAdapter:Function = createListenerAdapterBasedOn(function(data:String, p1:String, p2:String):void

{

assertThat(ORIGINAL_PARAMETER, equalTo(data));

assertThat(FIRST_PARAM, equalTo(p1));

assertThat(SECOND_PARAM, equalTo(p2));

}, withParameters(FIRST_PARAM, SECOND_PARAM));


callbackAdapter(ORIGINAL_PARAMETER);

}


[Test]

public function createCallbackAdapterWithIndividualParametersNoFluent():void

{

var callbackAdapter:Function = createListenerAdapterBasedOn(function(data:String, p1:String, p2:String):void

{

assertThat(ORIGINAL_PARAMETER, equalTo(data));

assertThat(FIRST_PARAM, equalTo(p1));

assertThat(SECOND_PARAM, equalTo(p2));

}, FIRST_PARAM, SECOND_PARAM);


callbackAdapter(ORIGINAL_PARAMETER);

}

}

}

如果你的心裏裝得下另外一個女人,那我的床上就可以睡得下另外一個男人









 


1.有人把你放心上,有人把你放床上。
2.
如果你的心裏裝得下另外一個女人,那我的床上就可以睡得下另外一個男人。
3.
我愛你時,你說什麽就是什麽,我不愛你時,你說,你算什麽?
4.
他跟我演戲,我回報以演技。
5.
我要讓全世界都知道我很低調。
6.
你來我信你不會走,你走我當你沒來過。
7.
我是你轉身就忘的路人甲,憑什麽陪你蹉跎年華到天涯?
8.
對男人好,不如勾引男人來對自己好。
9.
好男人就是反覆睡一個女人,一睡就是一輩子。
10.
等待你的關心,等到我關上了心。
11.
馬不停蹄的錯過,輕而易舉的辜負,不知不覺的陌路。
12.
總有一天你的名字會出現在我家戶口簿上。
13.
不是故事的結局不夠好,而是我們對故事要求太多。
14.
我必須學會新的賣弄,這樣你們才會繼續的喜歡我。
15.
脫了衣服是禽獸,穿上衣服是衣冠禽獸。
16.
其實你我都一樣,人人都在裝,關鍵是裝像了,裝圓了,有一個門檻,裝成了就邁進去,成為傳說中的性情中人。沒裝好,就卡在那裏,那就是卡門。
17.
欺騙一個人的最好辦法,就是利用自己的真感情,也許不是我遺忘了,只是我不願意想起而已。
18.
敏感的人,都是很自尊與很自傲的,同時也有著自卑的情結。
19.
又到了這個學長勾引學妹,學妹勾搭學長,學姐垂涎學弟,學弟攀附學姐,學姐嫉妒學妹,學妹憎恨學姐,學長拋棄學姐,學姐報復學長,學長欺瞞學弟,學弟巴結學長,學弟追求學妹,學妹拒絕學弟的季節。
20.
悶騷就是自己對自己放蕩。
21.
愛,從我們開始那天,已經偷偷倒數計時,安安靜靜地走向結束。
22.
選擇最淡的心事,詮釋坎坷的人生。
23.
一個人要令另一個人討厭不是難事,能讓所有的人都討厭也是一種本事。
24.
請不要把我對你的容忍,當成你不要臉的資本。
25.
時間對了,地點對了,感情對了,卻發現人不對了。


26.我允許你走進我的世界,但不許你在我的世界裏走來走去。
27.
人哪有好的?只是壞的程度不一樣而已。
28.
一個錢幣最美麗的狀態,不是靜止,而是當它像陀螺一樣轉動的時候,沒人知道,即將轉出來的那一面,是快樂或痛苦,是愛還是恨。
29.
全部都很好,只是我不喜歡。
30.
過去的一頁,能不翻就不要翻,翻落了灰塵會迷了雙眼。
31.
有的人對你好,是因為你對他好,有的人對你好,是因為懂得你的好。
32.
談錢傷感情,談感情傷錢。
33.
那是你唯一一次放我鴿子,一放就是一輩子。
34.
一見鐘情,再而衰,三而竭。
35.
理想很豐滿,現實很骨感。
36.
一生至少該有一次,為了某個人而忘了自己,不求有結果,不求同行,不求曾經擁有,甚至不求你愛我。只求在我最美的年華裏,遇到你。




(圖文/網路 夢筠蒐輯整理分享)

What is carbon?

This question and answer is part of the Guardian's ultimate climate change FAQ

See all questions and answers
Read about the project

Carbon is a chemical element, like hydrogen, oxygen, lead or any of the others in the periodic table.

Carbon is a very abundant element. It exists in pure or nearly pure forms – such as diamonds and graphite – but can also combine with other elements to form molecules. These carbon-based molecules are the basic building blocks of humans, animals, plants, trees and soils. Some greenhouse gases, such as CO2 and methane, also consist of carbon-based molecules, as do fossil fuels, which are largely made up of hydrocarbons (molecules consisting of hydrogen and carbon).

In the context of climate change, 'carbon' is commonly used as a shorthand for carbon dioxide, the most important greenhouse gas released by humans. Technically, however, this isn't accurate. Carbon only becomes carbon dioxide when each atom of carbon joins with two atoms of oxygen (hence the chemical formula of carbon dioxide, CO2).

This shorthand can sometimes cause confusion, because although 'a tonne of carbon' will often be used to mean 'a tonne of CO2', in a scientific context the same phrase could mean 'CO2 containing a tonne of carbon' (which is a much smaller amount, as oxygen accounts for most of the weight of each CO2 molecule).

The term carbon also crops up in the phrase carbon footprint, which describes the total amount of greenhouse gases released as the result of a given activity. In this context, 'a tonne of carbon' may mean something else still: 'a mix of greenhouse gases with a combined warming impact equivalent to that of a tonne of CO2'.

Carbon molecules move around the Earth system in the carbon cycle.

The ultimate climate change FAQ

• This answer last updated: 21.01.2010
Read about the project and suggest a question
Report an error in this answer

Related questions
Is the world really getting warmer?
Are humans definitely causing the warming?
What are climate change feedback loops?


guardian.co.uk © Guardian News & Media Limited 2011 | Use of this content is subject to our Terms & Conditions | More Feeds

EU urged to overhaul fishing policy

Unprecedented alliance of retailers and conservationists urges drastic reform to prevent fish stocks from passing point of no return

Europe's fishing practices must be drastically reformed in order to prevent dwindling fish stocks passing the point of no return, a coalition of British supermarkets and conservationists warned today.

The unprecedented alliance, which includes Sainsbury's, Marks & Spencer, members of the UK's Food and Drink Federation and WWF, is making the strongest statement from business to date on the failures of the European Union fishing policy.

It follows public anger at the practice of discarding fish that was highlighted in Channel 4's Fish Fight series, which has prompted hundreds of thousands of people to sign a petition calling for reform.

Fishermen should no longer be forced to discard large amounts of their catch, as they do under the current system of EU fishing quotas, the coalition said, and the quotas should be reviewed so that stocks can recover.

Discarding is a long-standing and wasteful practice, resulting in as much as two-thirds of the fish caught being thrown back in the water, usually dead. About 1m tonnes are estimated to be thrown back each year in the North Sea alone. Discarding is a consequence of the strict quotas on the amount of fish that boats may land – when fishermen exceed their quota, or catch species of fish for which they do not have a quota, they must discard the excess.

The coalition is putting forward their proposals for a reformed common fisheries policy in a meeting with Maria Damanaki, the EU commissioner for fisheries, in London today.

The commission is in the process of reviewing the CFP, with a view to introducing reforms in two years. The EU is the world's fourth biggest producer of fish, both wild and farmed.

The coalition criticised the practice of discarding as 'the result of poor management and fishing practices that are not attuned to market and consumer needs', and said the CFP was not working.

The group, led by the green campaigning organisation WWF, said that fishermen would be better served by a different system, as the wasteful practice of discarding was a cost to fishing fleets.

Alternatives to discarding include allowing fishermen to land all the fish they catch, but restricting the days on which they are allowed to fish. Better technology can also help to ensure that fishermen are able to target particular species more closely.

The group called on governments to introduce long-term fishery management plans that would include fishermen, giving fleets a bigger role in 'co-managing' stocks rather than simply being handed quotas, as under the current system.


guardian.co.uk © Guardian News & Media Limited 2011 | Use of this content is subject to our Terms & Conditions | More Feeds

Super Bowl Movie Trailers: 'Captain America,' 'Transformers,' 'Pirates' and More

Filed under: , , , , , ,




The Big Game is upon us, and with it will come what is perhaps the most anticipated slate of movie trailers we've seen in years. The 2011 Super Bowl featuring the Green Bay Packers taking on the Pittsburgh Steelers will play host to a number of brand new movie previews for some of the year's biggest films, like 'Captain America: The First Avenger,' 'Transformers: Dark of the Moon,' 'Pirates of the Caribbean: On Stranger Tides,' 'Cowboys and Aliens,' 'Super 8,' 'Thor,' 'Rango,' 'Kung Fu Panda: The Kaboom of Doom' and much more.



This post will serve as your home base for all the movie trailers that premiere before and during this year's Super Bowl. Please bookmark this page and keep coming back as we'll be continually updating it with trailers as soon as they arrive online.



Head after the jump to see what Super Bowl trailers are available right now ...

Continue Reading

'The Matrix 4' and '5': Are the Rumors True?

Filed under: , ,
Even though this may well turn out to be just another cleverly orchestrated Keanu Reeves meme, the Internet is abuzz today with reports that the actor revealed to a group of London students that two more installments in 'The Matrix' franchise may be on the way -- in 3D, no less.



Now, before you start annoying all your friends by whipping out that lame 'There is no spoon' quote again, consider that the original source -- an anonymous Ain't It Cool News reader going by 'El-Nino' -- is questionable to the extreme and that Entertainment Weekly has already debunked the news. Still, we have to wonder if there isn't something to the rumors, given that the 'Matrix' franchise raked in more than $1.5 billion.



But after the debacles that were 2003's 'The Matrix Reloaded' and 'The Matrix Revolutions,' the two disjointed follow-ups to the truly groundbreaking 1999 original, the biggest question may be whether Reeves and the Wachowski brothers should expect anyone to care.



So, what do you think of this very intriguing and probably not true development? While you're contemplating, check our our pick for the best moment from 'The Matrix' trilogy below, and if you dare, click here to feast your eyes on the worst.

Continue Reading