Interesting discoveries #04

Again, a week has passed since and I’ve been really swarmed by the incoming work.

1. Flu trends

Google shows the trends in flu. Interesting thing to investigate. This comes right after US is having a flu epidemic as according to CNN. ANd I had a bit of flu through the weekend too myself.

2. On the price of lego

I always wonder why Lego is so mad expensive. According to Wired, they’re incredibly consistent.

3. Advertisement tracking is hard

Seeing what Tremor Video does, I can tell you the amount of shit that go through data mining is crazy. I never learnt as much as this since after I finished from my university undergraduate course. The mysterious pixel tracks so much things it is scary. I’ll elaborate more in a better post.

4. Lui Tuck Yew

I feel bad for Lui Tuck Yew, the local transport minister. I’m largely ignorant of local politics and when I hear about Lui Tuck Yew it’s always something bad. He’s being blamed for the poor quality of local transportation system of late. It’s probably the predecessors’ fault and he has to act upon the mistakes of the past. And now he becomes the face of public transport failures; this is definitely not a good position to be. I wish him well.

5. SimCity

Okay I leave you guys with SimCity:

I’m really keen on this game!

How to install Laravel to a subdirectory

Simple! Just need to change a setting in the .htaccess file. I am using Laravel 4, you might be using some other version but the method should apply nevertheless. I use an alias to point to this directory.

Add this line “RewriteBase /l4″ to your .htaccess where l4 is your sub directory or folder.

[code language=”php”]<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /l4
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>[/code]

Have fun!

How to install Composer in Windows

I wanted to install PHP Composer in Windows. And to begin, I already have a copy of XAMPP 1.8.1, I think if you have a different way to get your PHP that should not matter. I tested this to work for Windows 7 but it should work for all versions of Windows.

0. Download and install XAMPP

You can download XAMPP here. I got the 7zip version rather than the installer itself. The ZIP version is similar, just with a larger file size. I extract the xampp folder into my C: drive, i.e. to C:xampp. Then install it by opening the file C:xamppsetup_xampp.bat. That will set the paths in XAMPP’s configurations.

1. Setting up environment variables

Continue reading “How to install Composer in Windows”

Ponies aren’t baby horses

I just came to this realization that ponies aren’t baby horses.

Pony

People who are unfamiliar with horses may confuse an adult pony with a young, immature horse. While foals that will grow up to be horse-sized may be no taller than some ponies in their first months of life, their body proportions are very different. A pony can be ridden and put to work, while a foal is too young to be ridden or used as a working animal. Foals, whether they grow up to be horse or pony-sized, can be distinguished from adult horses by their extremely long legs and slim bodies. Their heads and eyes also exhibit juvenile characteristics. Furthermore, in most cases, nursing foals will be in very close proximity to a mare who is the mother (dam) of the foal. While ponies exhibit some neoteny with the wide foreheads and small size, their body proportions are similar to that of an adult horse.

You can read more on ponies in Wikipedia.

How to use sudo without a password

This may sound like a bad idea in general but I do this in my testing virtual machine (VM) with Ubuntu or Debian operating systems. It makes it easier to restart servers.

First you need to edit your /etc/sudoers file through:

[code language=”bash”]visudo[/code]

In the editor, locate this:

[code language=”bash”]# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL[/code]

Change to this:

[code language=”bash”]# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) NOPASSWD:ALL[/code]

Now you can use sudo without a password.

How to add Ruby string interpolation highlighting for Sublime

To add Ruby string interpolation highlighting for Sublime Text 2, you need to edit your .tmTheme file. It can be found in your SublimeText 2, go to Preferences, then Browse Packages. This will open up your finder or Windows Explorer. Look for the folder “Color Scheme – Default”, you should be able to find themes like Monokai and others inside.

In order to add the syntax highlight for Ruby’s ${} in strings, for example:

[code language=”ruby”]puts "Working in #{pwd}"[/code]

Open up your .tmTheme file and add the following lines:

[code language=”xml”]
<dict>
<key>name</key>
<string>Embedded Ruby Punctuation</string>
<key>scope</key>
<string>string punctuation.section.embedded.ruby</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#75715E</string>
<key>background</key>
<string>#444444</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Embedded Ruby Source</string>
<key>scope</key>
<string>string source.ruby.embedded.source</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#FFFBF7</string>
<key>background</key>
<string>#444444</string>
</dict>
</dict>
[/code]

You can change the colors of background and foreground to your liking too. Hope you’ll find this useful!

Israel now bans skinny models

According to Jpost, Israel now bans skinny models for benefit of impressionable teenagers.

Starting on Tuesday, female and male models who have a body mass index (BMI) of less than 18.5 may not be shown in the media or on Israeli websites or go down the catwalk at fashion shows.

The law, initiated by then-Kadima MK Rachel Adatto, aims to protect impressionable teens from eating disorders.

Good idea? Maybe. Too much control? Definitely!

Interesting discoveries #03

So! A fortnight has passed quickly due to the holidays in between. I wanted to make this post a weekly affair but I have my laziness to blame.

One interesting side effect to writing what I encounter is that it kinda slows me down reading which is welcomed. So these are the key things I discovered and/or rediscovered:

1. Backbone.js

I never had to touch this for a while. Backbone.js makes large JavaScript applications manageable again with MVC methodologies. I implore every JavaScript developer or enthusiast to at least make a todo list with this. More on the website.

2. Lo-Dash

One of the dependencies of Backbone.js is Lo-Dash (or Underscore.js) which promise some improvements. You can more about Lo-dash here. Lo-dash is designed as a drop in replacement for Underscore.js that provides better consistency among browsers. Take a look at this video:

3. Paid subscribers model a success online

Paid subscription model is actually working out for The New York Times. Not that it is expected not to work but that it is working better than expected. Digital subscriptions will generate $91 million this year, according to Douglas Arthur, an analyst with Evercore Partners. The paywall, by his estimate, will account for 12 percent of total subscription sales, which will top $768.3 million this year. That’s $52.8 million more than advertising. Those figures are for the Times newspaper and the International Herald Tribune, largely considered the European edition of the Times. Bloomberg has more.

4. Exporting old people

The question on ethics is called when Germans start to export their elderly to other countries with more affordable healthcare. This move is determined as an “inhumane deportation.” Guardian has more. According to Germany’s federal bureau of statistics, more than 400,000 senior citizens are currently unable to afford a German retirement home, a figure that is growing by around 5% a year.

Artur Frank, the owner of Senior Palace, which finds care homes for Germans in Slovakia, said that was why it was wrong to suggest senior citizens were being “deported” abroad, as the VdK described it.

“They are not being deported or expelled,” he said. “Many are here of their own free will, and these are the results of sensible decisions by their families who know they will be better off.”

5. Humans triumph over turtles

Clemson University student Nathan Weaver set out to determine how to help turtles cross the road. He ended up getting a glimpse into the dark souls of some humans.

Weaver put a realistic rubber turtle in the middle of a lane on a busy road near campus. Then he got out of the way and watched over the next hour as seven drivers swerved and deliberately ran over the animal. AP has more.

Really disturbing case this one is.

6. Superfreakonomics

I finished this book and find it okay. I haven’t read the first book so I can’t compare. It’s interesting to read things from a point of view of an economist. The way the book is written makes it hard to read though — there are just too many thoughts going on. The way one idea leads to another conflicting idea and then the economists brought about their own debates and deductions is somewhat distracting. However it might just be the way the mind works, there’s just too many things to digest. The book is engaging nevertheless. I heard the first book is better though. You can order it from Amazon.