Hello, Dublin.
It is a change of scenery, and certainly, a change of direction in life.
But, why am I even here?
I do hope things will turn out right.
Only time will tell.
12:00 PM
|
|
0 Comments
If you think Rubygem is slow, that's because it is
If there is a good example of bad software, Ruby's Gem package management system will have to be it. I can't say how much irritation I've had every single time I had to do a gem installation, and I've really lost count of the times that I had given up waiting for it to complete execution.
It's incredible just how much memory that rubygem requires to work. I can't even use it on my laptop with 512M of memory, when if it's enough to run an entire operating system with all daily use applications, it should be enough for a package management system. But how very wrong I am! Rubygem uses so much memory that it swaps a gigantic amount of data into virtual memory, trashing my harddisk and driving my laptop into a state of near unresponsiveness. (Of course, that would have meant nothing if I was running Windows, but it's certainly nothing less of an amazing feat when it can bring down a Linux box.)
Perhaps it's time to start classifying rubygem as a DOS malware?
Since I couldn't get the bloody thing to run on my laptop to show you a measurement of how slow it is, I had to resort to using my higher-end desktop that has 1.5GB of RAM in it. Here's the result from the output from 'top':
To help you understand how much of a memory hog rubygem is, I've underlined in red how much memory it's been consuming. If you take a glance at the row underlined in red, that indicates rubygem using up 359M of RAM, which is even more than a well-known memory-hog, Netbeans, which uses up 273M of RAM (underlined in blue, where Netbeans is shown as a single Java instance.) Also, as you see from the screenshot, besides being a memory hog, rubygem was 47 minutes in execution and it still hadn't completed installing the gem that I've instructed it to.
I'm certainly not the only person encountering problems with rubygem, and so far, there aren't any solutions in resolving the situation. Plenty of unhelpful advices I've been able to google up, which include things like updating rubygems (I already have, till the latest version of 1.1.1), and other discussions and solutions that just don't work[1][2].
To quote Charles Nutter, a core developer of JRuby:
"Even on a high-end box, it's so intolerably slow that there's got to be a key fault keeping the speed down."That observation was made in 2006. If you've noticed the result from his execution, it took rubygem 62 minutes to complete execution, not unlike what I've observed myself, but two years later. And that's just dismaying.
To put it simply, Rubygem is just a piece of rotten software - avoid using it like plague. If a package management system like Debian's Apt can deal with the entire ecosystem of Linux software packages without chewing up massive amount of computer resources to do it, it's certainly no excuse for a smaller universe of packages like Ruby to perform that much substantially worse.
References:
[1] gem install SUPER SLOW in linux virtual machine
[2] trouble with slow rubygems
7:39 PM
|
Labels:
Ruby
|
0 Comments
An Emotion I Much Rather Not Have
Love, that is.
A friend left, and on my own, I sat down by myself and watched 'Becoming Jane' tonight, which had still left me with a barrage of thoughts as I type this. The film has accomplished what it had set out to do; to evoke emotions and feelings, in this case, a sense of empathy towards one's unrequited love, as if you were living in the same moment with Jane Austen, sharing her emotions of wanting but not having. Like all good movies on the genre of love, it leaves one with a feeling of longing for something more.
I could still feel the raw emotion coursing through, that feeling of want, the need to be desired and be loved. Ironically, as with the irony the film featured, love is exactly the feeling if given a choice, something that I willingly forgo.
Reel life, unlike real life, compresses a lifetime into a span of mere hours that is made up of only dear tender moments, and the soothing, lulling message that leads us to believe that life is an everlasting bliss of joy and happiness. Even as we accept it not to be so, it doesn't preclude us from wishing, and even willing to believe possibly that at a given moment in time, when we look deeply into the endearing eyes of that perfect someone, which at that precise moment of sheer intensity, it will be of an eternity.
If it's hard to pause for a moment to not believe in the eternity of love, then it is even harder to contemplate on just how transient it is. But love is exactly just that: as much as food is constantly on the thoughts of a hungry man, a man starved of love is just as much be seeking to satisfy his emotional fulfilment. But it is from this derision of hunger that we lose sight of the fact that satiety that is the nemesis of all wants. It is when we get enough of something that makes it so much less desirable. The scrumptious meal is merely a palatable one to the full tummy; the pair of endearing eyes is much less so for the umpteenth time; and all that is exciting simply becomes the mundane.
Some say that love is what makes us human, but perhaps what makes us human is what makes us weak. If we are always aspiring to be reach our potential each day, then maybe we should be trying to surpass the weaknesses of ours, rather than to be merely succumbing to it?
But even if it is a weakness, I have no qualms if love was merely a tempered emotion. However, it is nothing like the tame beast that we all wish it to be; rather it is more like a raging wildfire that engulfs us, leaving us at the mercy of its whims and fancy. I would have certainly been less disagreeable about the notion of romantic love had it been of one that leaves us with some measure of control and self-dignity in tact.
If romantic love was to be more like the selfless love and compassion to the fellow man, it would have been one that I would have preferenced towards, for it is unlike the selfishness of personal desire that leaves no room for rationality, and one that transcends above language, culture or creed.
But as much as my own personal internal intellectual discourse will and want to rationalise that love is merely a barbaric relic that is passed down for generations for the purpose of continuing our progeny, I know there'll be no way of not be ceding control to this ever insatiable feeling to want and be wanted, to desire and be desired. But had it been a matter of rational choice, it will have been an emotion that I'd much rather not have wanted.
1:25 AM
|
Labels:
Philosophy
|
0 Comments
Japanese vs. Singaporean Women
I'm not sure about the rest of Asia, but when I was growing up in Singapore, there was a huge consensus among Singaporean males that Japanese females are much prettier than our Singaporean counterparts. Given that most of my friends who claimed it as a fact only came to that conclusion based on seeing pretty Japanese actresses on TV, I've always felt quite ambivalent about this point - come on, people always put on prettier than average faces on TV, but does that prove the case for the general population?
Given that I recently had the opportunity to visit Japan, I decided to put the claims to the test and do some observations on my own, through the perennial hobby of mine - people watching. Given that I had time to spare on Sunday noon after checking out, and too lazy to lug my luggage around to do sightseeing before hopping on the train to Narita, I decided to sit down in Tokyo subway station and record my observations. It isn't surprising that I get funny stares by people, wondering what I was doing, but predictably, nobody did ever approach me and asked questions (not that I'll be able to answer them anyway, given my command of Japanese is utterly atrocious!)
I've done the same measurement at the linkway to Suntec City along the way from City Hall MRT station as a comparison, which my observation is carried out on a Thursday evening at around 6pm. Both measurements are timed at a 50 minute interval. There's nothing scientific about why 50-minutes was chosen, I would have much rather made it an hour if I could. But in Tokyo, I had to take off to catch my train to Narita, which explains the duration. You might think that it's a fun exercise to do, but it does get tiresome past the 40 minute mark. Try it out if you aren't convinced!
In my observations, only females are observed and also, only East Asian looking women are considered in the study, so that it's a fair comparison between apples with apples. I've also excluded young children who I deemed below the ages of 14 and people who looked over their 40's. It should however be noted that this process isn't scientific, given that there's no reasonable way to assess their age without any verification. This and other potential biased-ness are all recorded duly after the results presented. The observation is segregated into roughly 4 categories, which I'll briefly explain below:
- Definitely Good Looking - People I consider good looking, in which my opinion is unlikely to be subjected to change.
- Considered Good Looking - People I think are good looking, but which my opinion may change depending on conditions.
- Considered Not Good Looking - People I think are not good looking, but which may change depending on conditions.
- Definitely Not Good Looking - People I think who are not good looking, in which my opinion is unlikely to be subjected to change.
The results are tabulated below:
| Japan | Singapore | |
| Definitely Good Looking | 7 | 0 |
| Considered Good Looking | 149 | 96 |
| Considered Not Good Looking | 130 | 157 |
| Definitely Not Good Looking | 49 | 151 |
| Total People Sighted | 335 | 404 |
Before we go into the analysis of the results, I'll just like to note all the potential biases that can occur in this observation.
- Beauty is always in the eyes of the beholder. I'm judging beauty by my standards, so this is definitely a case of 'your mileage may vary'.
- I've noticed that internally, if I had a period when I'm seeing a string of consecutive good looking faces, I'll have the tendency of becoming stricter in my grading criteria. The same principle applies in reverse, which means that the results may be possibly skewed, but it should hopefully be equally skewed in both observations.
- Given there is no means of checking the ages of all the people I've scanned, I did notice my tendency of adding attractive middle-aged women, and possibly excluding less good looking women who may be in actuality, under the 40's criteria. This is has myself convinced that the perception of age is highly dependent on how a person looks, however unfair it sounds!
- The stream of commuters are not uniform, and are more spiky in nature, given the fact of increases in traffic only happens during the arrivals of trains. This results in uneven observation times, where I'll have longer periods to scan during non-peak periods vs peak periods.
Analysis
When it comes to beauty, I've always maintained my thesis that the ratio of beautiful women to the general population should remain roughly the same, irrespective of regions - which means it is the size of the population that determines the number of pretty faces that you'll see on the streets, which I've reasoned that it is why you naturally see more pretty faces in populous countries like Japan, China and Korea, than say, a small country like Singapore. But as the results show, it doesn't appear to be so. I had classified 46.5% of the Japanese females sighted as pretty, compared to 23.7% for Singaporean females.
A possible factor may be in the differences in their attitudes towards cosmetics and dressing. From casual observation, I had the impression that Japanese women put on much more make up than Singaporeans. Almost all Japanese women, young and old, are dabbed in cosmetics of some sort. The second observations I had, is that Singaporeans have the tendency to dress much more casually than the Japanese, which may have also have been a factor. Both trends seem to be more pronounced with younger Singaporean teenagers and women in their early 20's, probably either because they have less spending power on such 'frivolities', or perhaps that they are letting their youthfulness compensate for the lack of need to dress up.
Talking about women is always a touchy issue, and that said, I'll profess that my opinions are not meant to be taken as fact of any sort, and neither do I imply any sort of preference toward women of either country. My observations are solely done for fun, and mainly in response to my personal curiosity in trying to debunk the broad assertions of attractiveness that Singaporean males seem to profess over Japanese women. But somehow, it does correlate with my personal observations, which means the next time I hear any of my Singaporean mates sprouting such 'nonsense' again, I'll should just learn to keep my mouth shut!
7:29 PM
|
Labels:
Personal Life
|
1 Comments
Show Tables equivalent in Postgresql
The equivalent of mysql 'show tables' command in postgresql:
\dt
To see more information about the table, do
\dt with the table name:
\dt table_name
If you want to see more than just tables (eg. sequences), use:
\d
To see all databases, like '
show databases' in mysql:
select datname from pg_database;
6:00 AM
|
Labels:
Postgres
|
0 Comments
Printing Syntax Highlighted Source Code
Sometimes, reading code from paper can be easier than reading it from the screen. However, if you printed it straight with the 'lpr' command, you'll lose all your syntax highlighting. There is a way of solving this problem by using GNU 'enscript'.
For example, if you wanted to print syntax highlighted ruby code:
enscript --color=1 -Eruby your_source_code.rb
The '
-E' flag tells enscript that the code is ruby, while '-color' is self-explanatory. If you wanted to find out what other syntax highlightings are availabe, use this command:
enscript --help-highlight
However
enscript is more than just that. For example, if I wanted it with line numbering, landscaped and in two-columned format (thus saving space), I can do this:
enscript --color=1 -Eruby -c2 -C1 -r -j your_source_code.rb
where:
-c2: 2 columns-C1: start line numbering from 1 onwards-r: print in landscape-j: print border around the columnsIt can even generate syntax highlighted code in html, which makes it useful when you want to blog about source code:
enscript --color=1 -w html -Eruby your_source_code.rb
Its '
man page' describes it as "convert text files to PostScript, HTML, RTF, ANSI, and overstrikes" probably doesn't do it much justice, given that it's capable of doing much more; my examples have barely skimmed its surface, so I highly recommend you read more into it to find out enscript's full capabilities.
5:50 PM
|
Labels:
Linux
|
0 Comments