from nonowarn

to everywhere

Posts

How do you simulate a dice? In javascript, It would be

function dice() {
  return Math.floor(Math.random() * 6) + 1
}

So how about biased dices, for example returns 1 in probability 1/4, returns 2 in probability 1/9, and so on?

If you get an interest in this, read this article.

The moon from earth is about 24.3px wide, for example. The Eiffel Tower from a mile away is about 550.5px tall. That means that when you do “{ width: 24.3px }” in CSS 2.1, you’re making something as wide as the moon looks to be.

What is internet? He says Internet is not just a technology, but a set of ground rules which enables us to build network. The network has no global control.

Three boys had drifted for 51 days without fish gears.

They tune language rather than their code. They created translator (HipHop) which converts PHP into C++. To debug generated code, they wrote another interpreter for them (HPHPi). HPHPi is painfully slow, so they wrote virtual machine to run them (HPHPVM).

Several stories from frazzled and overworked programmers.

My favorite story is this.

This scene is familiar to all game developers: It’s the day we’re sending out the gold candidate for our Xbox 1 game. The whole team is playtesting the game all day long, making sure everything looks good. It’s fun, it’s solid, it’s definitely a go in our minds.

In the afternoon, we make the last build with the last few game-balancing tweaks, and do one last playthrough session when disaster strikes: The game crashes hard! We all run to our workstations, fire up the debugger, and try to figure out what’s going on. It’s not something trivial, like an assert, or even something moderately hard to track down, like a divide by zero. It looks like memory is garbage in a few places, but the memory reporting comes out clean. What’s going on?

One dinner and many hours later, our dreams of getting out on time shattered, we manage to track it down to one data file being loaded in with the wrong data. The wrong data? How’s that possible? Our resource system boiled down every asset to a 64-bit identifier made out of the CRC32 of the full filename and the CRC32 of all the data contents. That was also our way of collapsing identical resource files into a single one in the game. With tens of thousands of files, and two years of development, we never had a conflict. Never.

Until now, that is.

It turns out that one of the innocent tweaks the designers had checked in that afternoon made it so a text file had the exact same filename and data CRC as another resource file, even though they were completely different!

Our hearts sank to our feet when we recognized the problem. There’s no way we could change the resource indexing system in such a short period of time. Even if we pulled an all-nighter, there was no way to know for sure that everything would be stable in the morning.

Then, as quickly as despair swept over us, we realized how we could fix this on time for the gold candidate release. We opened up the text file responsible for the conflict, added a space at the end, and saved it. We looked at each other with huge grins on our faces and said:

“Ship it!”

– Noel Llopis

Makes me want to try a Windows 8 phone…

My Kern Type score.

Update: Better score from my MacBook Pro (above score is from iPad.)

Trying track my activities (such as liking and posting articles, pushing something to GitHub) to Google calendar using ifttt.

Four Word Passwords - xkcd #936

mosx:

onethingwell:

Here’s how to generate a quick four-worder from the command line:

shuf -n4 /usr/share/dict/words | tr -d '\n'

Source: Command Line Fu

Unfortunately this only works on Linux. On OS X we could use something like jot (which is mentioned on Command Line Fu as well), but here’s a rather convenient Perl solution:

perl -le 'chomp(@words= <>); print join " ", map {@words[rand @words]} 1..4' /usr/share/dict/words

(Yes, this post took a while. I know…)

And ruby version here:

ruby -e 'puts $<.readlines.map(&:chomp).shuffle.take(4).join(" ")' < /usr/share/dict/words
Removing Font Anti-Aliasing Bookmarklet

Played with -webkit-font-smoothing: none. It’s ugly, but kinda cute.

I wrote a bookmarklet to remove anti-aliasing anywhere. I checked this works on Chrome, but also on Safari it should work.

Edit: Recommend to try this on Google web fonts gallery.

a Kanji gif (via Twitpic)

rei harakami / owari no kisetsu PV(2005) (by SUBLIMERECORDSTV)

R.I.P.

On Firefox. Its rendering on Chrome is still broken due to webkit’s bug but

Don’t you think it is beautiful somehow?

Photos

Information

Repos
Gists
Followers
Following

Repositories

Watched Repositories

abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz