Steve Jobs, 1955-2011
Thursday, October 6, 2011 12:57:14 AM
Rest in peace.
http://www.apple.com/stevejobs/
http://en.wikipedia.org/wiki/Steve_jobs
Mind of the machine
Sticky post
Friday, April 21, 2006 10:09:24 PM
Monday, December 19, 2011 8:42:12 PM
So what are we to do about this? How can we bring "infinity" to something more reasonable? Here are my suggestions, which are the product of experience and of nothing else. Thursday, October 6, 2011 12:57:14 AM
Monday, July 18, 2011 4:42:35 AM
(defn quicksort [list]
(if (< (count list) 2) list ;if the list has 0 or 1 items, return
(let [
pivot (first list) ; our pivot will be the first item
rl (rest list) ; compare against everything else
lt #(< % pivot) ; our less than predicate
gte #(>= % pivot)] ; our greater than equal predicate
(lazy-cat
(quicksort (filter lt rl)) ; recurse on filtered less
[pivot]
(quicksort (filter gte rl)) ; recurse on filtered greater than equal
))))
(def mylist (shuffle (range 1 25))) ; make some shufled list of items (println mylist) ; take a look before sorting (time (quicksort mylist)) ; time our three runs (time (quicksort mylist)) ; the first should take the longest (time (quicksort mylist)) ; magic!
[1 2 13 20 19 21 3 22 17 14 16 7 18 10 11 5 12 4 6 8 15 24 9 23] "Elapsed time: 1.975864 msecs" "Elapsed time: 0.109321 msecs" "Elapsed time: 0.107011 msecs" (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24)
Thursday, July 14, 2011 12:37:52 AM
public static void switchOnString( String string )
{
switch( string )
{
case "kevin":
System.out.println( "In Kevin" );
// fall through
case "rob":
System.out.println( "In Rob" );
break;
default:
System.out.println( "In Default" );
}
}
// before Map<Integer,String> myMap = new HashMap<Integer,String>();
// after Map<Integer,String> myMap = new HashMap<>();
// Diamond lets us do this cleanly Map<Integer,Map<Integer,String>> myMap = new HashMap<>(); // sadly, we can't do this, the new HashMap has to be fully qualified myMap.put(new Integer(5), new HashMap<>());
long phoneNumber = 555_555_1212L; double someCash = 12_526_123.45;
try(
BufferedReader br = new BufferedReader(new FileReader(new File(fileName)))
){
// do something
}
catch(Exception ex)
{
// catch some exception as a consequence of doing something
}
public class MyAutoCloseable implements AutoCloseable
{
private String name;
public MyAutoCloseable( String name )
{
this.name = name;
}
public void close()
{
System.out.println( "Closing:" + name );
}
}
try(
MyAutoCloseable mac1 = new MyAutoCloseable( "1" );
MyAutoCloseable mac2 = new MyAutoCloseable( "2" );
MyAutoCloseable mac3 = new MyAutoCloseable( "3" );
)
{
System.out.println( "Do something..." );
}
catch( Exception ex )
{
System.out.println( "Exception:" + ex.getMessage() );
}
Do something... Closing:3 Closing:2 Closing:1
public void close()
{
System.out.println( "Closing:" + name );
if( name.equals("2") ) throw new NullPointerException("Closing resource two is exploding!");
if( name.equals("3") ) throw new NullPointerException("Closing resource three is exploding!");
}
Do something... Closing:3 Closing:2 Closing:1 Exception:Closing resource three is exploding!
Wednesday, October 20, 2010 11:37:22 PM
Wednesday, June 30, 2010 11:29:16 PM
function applyEarth(int damage,Object target)
{target.life.interpretDamage(damage, DamageType.EARTH);}
function applyFire(int damage,Object target)
{target.life.interpretDamage(damage, DamageType.FIRE);}
function applyWater(int damage,Object target)
{target.life.interpretDamage(damage, DamageType.WATER);}
Object target{EARTH_RESIST=5;FIRE_RESIST=4;WATER_RESIST=3;}
{Fire->(Damage-Fire Resist)}
{Earth->(Damage-Earth Resist)}
{Water->(Damage-Water Resist)}
{Fire->(Damage-Fire Resist),Fire->(Damage-Fire Resist)}
{Fire->(Damage-Fire Resist),Earth->(Damage-Earth Resist)}
{Fire->(Damage-Fire Resist),Water->(Damage-Water Resist)}
{Earth->(Damage-Earth Resist),Earth->(Damage-Earth Resist)}
...
Wednesday, April 28, 2010 11:37:47 PM

Wednesday, January 20, 2010 2:59:16 AM


Tuesday, December 15, 2009 3:00:06 PM
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
| ||||||
| 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 | |||
Gamasutra sat down with Jonathan Blow, creator of the successful independent game Braid. He talks about going through the three-year-plus development cycle as a one-man team, and how his concept of the game changed as he worked on it. He also discusses what he feels is the difference between "na ...
Activision finally unveiled the full 86-song track list for Guitar Hero: World Tour, which is set to come out October 26th in the US. The list contains a wide variety of artists, from Creedence Clearwater Revival to Tool to Ted Nugent. Activision also recently acquired FreeStyleGames to "develop ...
IceDiver writes "I used to be an avid PC gamer. However, I have only bought 1 game in the last 18 months because I am sick and tired of the problems caused by the various intrusive, and sometimes damaging DRM schemes game publishers insist on forcing upon their customers. Once burned, twice shy! ...
Kotaku reports that a demo for the much-awaited PS3 port of Bioshock will be available on October 2nd. 2K Games launched a new interactive website to promote the game, which comes out on October 21st in the US. GiantBomb took a brief look at the PS3 version, saying, "... quality seems perfectly ...
Rock, Paper, Shotgun's Kieron Gillen has combined and updated a series of guides he wrote for getting into the development of game mods. He provides a detailed explanation of the process from concept to reality as well as a look at some of the obstacles you're likely to run into. Quoting: "First ...
The Sandman author reads from his new book, about a boy who hangs out with dead people, and posts the clips online for free. Gaiman talks about Graveyard in a video interview with Wired.com. Wired.com
A California company has a billion dollars worth of orders in hand for a new solar product that could soon blanket the tops of flat-roof buildings across the nation. Wired.com
Gas gas hovers around $4 a gallon, your Prius-driving neighbors are cruising smugly all the way to Whole Foods. Sure, you could join their self-satisfied ranks. Or you could commute in style — on a horse (if your city's ordinances allow it). The timing is good: Equestrian gear recently got ...
1959: The space probe Luna 3 takes the first photographs of the dark side of the moon. The radio-controlled Luna 3 was part of the Soviet Union's highly successful lunar program, which completed 20 missions to the moon between January 1959 and October 1970. Although the United States ...
: Photo: Jon Snyder/Wired.com FREMONT, California -- Solar photovoltaics make up a tiny percentage of the world's power largely because they just cost too much. Burning fossil fuels remains cheaper than even the best solar panels. But Solyndra's new thin-film technology could substantially cut ...