Wednesday, July 14, 2010

Creative Theory Machine Buttons



In the category of creative Theory Machine buttons:
  • ifSixWasNine, by Jared Hendricks (a.k.a. "Jimi" ;-)

    alert(ifSixWasNine(6)) ==> 9
    alert(ifSixWasNine(12)) ==> 18

Tuesday, July 13, 2010

The replace() method for Strings

String theory?Image by trailfan via Flickr
The replace() method searches for a match between a substring (or regular expression) and a string, and replaces the matched substring with a new substring. It searches the string on which it is called for matches.

If the g flag is set, the method replaces all matches in the string with the replacement string; otherwise it replaces only the first match it finds.

EXAMPLES

//replaces first match
//wasit a rat i saw
var s = 'was it a rat i saw'; alert(s.replace(/[ ]/, ''))

//replaces all matches
//wasitaratisaw
var s = 'was it a rat i saw'; alert(s.replace(/[ ]/g, ''))
Enhanced by Zemanta

Monday, July 12, 2010

On Palindromes

la porte du palindrome / the palindrome doorImage by TisseurDeToile -[*] via Flickr



Example from class:

var s = "Too Hot, to Hoot!!"
var arr = s.split(' ')
var result = ''


//process all words in sentence
for(var i = 0; i < arr.length; ++i)
//result = result + encode(arr[i]) + ' '
arr[i] = encode(arr[i])



Example from Class

var s = "Radar, mom!"
var arr = s.split(' ')
var i = 0


//check words
//not quite there yet..
while(isPalindrome(arr[i]) && i < arr.length){
++i
}

//determine result
if(i == arr.length)
//every word is a pal
else
//not all words are pals
Enhanced by Zemanta

xhtml: logical vs physical tags

Just a random blob with "XHTML" writ...Image via Wikipedia

HTML includes two types of Style Tags:

  • logical (a.k.a. phrase elements)
    tag the information according to its meaning (e.g., abbr, acronym, code, etc.)
  • physical
    tag the exact appearance of the information (i.e. b, i, etc.)
Both <em> and <i> display italics. CSS is the preferred way to style content rather than logical tags. Logical style tags are preferred over physical tags (which is why the latter are deprecated in xhtml).

Rationale: the goal in xhtml is to separate structure elements from style elements, and remove the latter from xhtml. Content should be styled with CSS rather than xhtml. Logical tags describe the structure or semantics of content and are, therefore, preferred over style elements like <b> and <i>.
Enhanced by Zemanta

Tuesday, July 28, 2009

The Matrix but w/money: high-freq trading (HFT)

CHICAGO - OCTOBER 30:  Traders signal offers i...Image by Getty Images via Daylife

From ars technica: The Matrix, but with money: the world of high-speed trading.
"Supercomputers pitted against one another in a high-stakes battle of attack and counterattack over a global network where predatory algorithms trawl the information stream, competing every millisecond to gain an informational advantage over rivals. It sounds like Hollywood fiction, but it's just an average trading day on the stock market."
Note that NJ is the center of this HFT cloud, in order to minimize latency in the NYSE ECN trades.

Note also that "those pit traders who pose for the cameras are mainly there for the cameras." I.e., they are props for a set.

This is reminescent of the PR for the first public demonstration of the ENIAC (one of the world's first stored-program, electronic computers):
"In planning their public demonstration in 1946, it occurred to the ENIAC team to place translucent spheres-- ping-pong balls cut in half-- over the neon bulbs that displayed the values of each of ENIAC's twenty accumulators. Ever since, flashing lights have been part of the scene involving computers and science fiction."
One thing that hasn't changed in the intervening 60 years: Stagecraft.

Reblog this post [with Zemanta]

Wednesday, July 22, 2009

Google’s Chiller-less Data Center

Main areas and places in BelgiumImage via Wikipedia

Google has begun operating a data center in Belgium that has no chillers to support its cooling systems, a strategy that will improve its energy efficiency while making local weather forecasting a larger factor in its data center management.
Reblog this post [with Zemanta]

Monday, June 29, 2009

Data Centers as Information Substations

Quotes from:

Data Center Overload
Tom Vanderbilt, NYT, June 8, 2009.

The data center is our railroad; it doesn’t matter what kind of train you put on it. . . .

While it once took 30 to 50 years for electricity costs to match the cost of the server itself, the electricity on a low-end server will now exceed the server cost itself in less than four years — which is why the geography of the cloud has migrated to lower-rate areas. . . .

The specter of infinitesimal delay is why, when the Philadelphia Stock Exchange, the nation’s oldest, upgraded its trading platform in 2006, it decided to locate the bulk of its trading engines 80 miles — and three milliseconds — from Philadelphia, and into NJ2 (a data center located in NJ), where the time to communicate between servers is down to a millionth of a second. (Latency concerns are not limited to Wall Street; it is estimated that a 100-millisecond delay reduces Amazon’s sales by 1 percent.) . . .

We’re at the beginning of the information utility. The past is big monolithic buildings. The future looks more like a substation — the data center represents the information substation of tomorrow. . . .
Reblog this post [with Zemanta]

Wednesday, April 29, 2009

How to Subscribe to this Blog

If you have a question about a project, add a comment to the project post. Anyone in class with an answer may reply-- our own version of the wisdom of crowds and crowdsourcing.

You can subscribe to this blog's RSS feed by using Firefox's Live Bookmarks feature. Then all new posts will be "pushed" to your browser. Here's how to do it:

1. In Firefox choose Bookmarks > Organize Bookmarks, and create a "Feeds" folder on the bookmarks toolbar.

2. Open this blog in Firefox, scroll to the bottom and click on "Subscribe to: Posts (Atom)". A new page will open in the browser: select Live Bookmarks in the drop-down list, and click Subscribe Now. Add the bookmark to your Feeds folder. Presto!

The drawback to using Live Bookmarks is that the bookmarks exist only on the computer you used to subscribe. An alternative is to use a hosted feed reader such as Google Reader. Then your feeds are stored in the "cloud" and may be accessed from any machine by logging in to your Google account.

Reminder to use Google ReaderImage by Sue Waters via Flickr



Reblog this post [with Zemanta]