I have been reading a bit on database sharding.
Note: More update his post when I have a better understanding.
Monday, June 06, 2011
Sunday, June 05, 2011
Thursday, June 02, 2011
nomodeset
Note-to-self: About the Ubuntu black screen issue
Here is an explanation of what nomodeset does. (recommended: read the whole thread)
Update: it seems the recommended way is:
Older Intel devices: i915.modeset=1 or i915.modeset=0
Nvidia: nomodeset
Generic: xforcevesa or nouveau.modeset=0
Radeon: radeon.modeset=0
Update: it seems the recommended way is:
Older Intel devices: i915.modeset=1 or i915.modeset=0
Nvidia: nomodeset
Generic: xforcevesa or nouveau.modeset=0
Radeon: radeon.modeset=0
From my observations, setting *.modeset=0 seems to have similar effects with nomodeset.
Tuesday, May 31, 2011
Deep Copy in JS
Note: For those unfamiliar with the convention eval(uneval(_obj_)), this simply clones _obj_. It is cleaner than traversing each element of _obj_ and it will always be true that uneval(eval(uneval(x))) == uneval(x) and eval(uneval(x)) == deep_copy_of_x . The actual method uneval(_obj_) is a Spidermonkey specific (as of 1.7) extension that is not part of ECMAScript.
From Introduction to CouchDB Views
Monday, May 30, 2011
Setting up a Mac
As someone who came from a Windows + Linux background, setting up and using a mac was an irritating experience.
List of stuff I had to setup:
List of stuff I had to setup:
- Vim
- Git
- Eclipse
- OpenOffice
- Firefox, Chrome
- XCode 3
- Tree
- iTerm
- VirtualBox
- Gedit
- Adium
- Cyberduck
- MacPorts (sudo port install mercurial wget)
- Homebrew
- Relearning shortcut keys
- Witch, Isolator, Quicksilver
Fortunately, OS X comes with zsh, apache, mysql
Sunday, May 29, 2011
Access Virtualbox guest via ssh
Apparently, it is possible to access a Virtualbox guest machine running sshd via ssh from the host machine.
Using PCnet-FAST III (NAT) as network adapter,
On the host machine: (where [guest] is the name of your guest machine.
$ VBoxManage setextradata [guest] "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222
$ VBoxManage setextradata [guest] "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
$ VBoxManage setextradata [guest] "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP
Re/Boot your guest machine.
On your host machine:
$ ssh -l [user]@localhost -p 2222
Using PCnet-FAST III (NAT) as network adapter,
On the host machine: (where [guest] is the name of your guest machine.
$ VBoxManage setextradata [guest] "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222
$ VBoxManage setextradata [guest] "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
$ VBoxManage setextradata [guest] "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP
To delete an entry, set the value to an empty string.
Re/Boot your guest machine.
On your host machine:
$ ssh -l [user]@localhost -p 2222
Wednesday, May 18, 2011
Optimizations on ACM Timus
Some tricks I use on http://acm.timus.ru
Note: ACM Timus uses MS VCPP compiler, which differs from g++.
1. c++ is much much more efficient than java.
2. Use short/char instead of int whenever possible (to save memory), esp for arrays. Of course, there is a potential speed / memory trade off here since 4 byte ints register-size, but it doesn't seem to be issue on ACM Timus.
3. When memory is an issue, use stdio instead of iostream.
4. Using iostream may be "faster" than stdio?
5. "Implicit" stack overflow solution:
Use #pragma comment(linker, "/STACK:16777216")
6. Struct packing (for arrays) may not be memory efficient.
7. STL saves coding time.
8. Useful: #define FOR(i,n) for(i=0;i<(n);i++)
Java Optimizations:
1. Many prints are slower than one single print.
2. Buffered Reader/Writer is faster than Scanner.
Note: ACM Timus uses MS VCPP compiler, which differs from g++.
1. c++ is much much more efficient than java.
2. Use short/char instead of int whenever possible (to save memory), esp for arrays. Of course, there is a potential speed / memory trade off here since 4 byte ints register-size, but it doesn't seem to be issue on ACM Timus.
3. When memory is an issue, use stdio instead of iostream.
4. Using iostream may be "faster" than stdio?
5. "Implicit" stack overflow solution:
Use #pragma comment(linker, "/STACK:16777216")
6. Struct packing (for arrays) may not be memory efficient.
7. STL saves coding time.
8. Useful: #define FOR(i,n) for(i=0;i<(n);i++)
Java Optimizations:
1. Many prints are slower than one single print.
2. Buffered Reader/Writer is faster than Scanner.
Saturday, April 30, 2011
Summary of the Amazon EC2 and Amazon RDS Service Disruption
http://aws.amazon.com/message/65648/
This might be interesting.
Finally, we have identified the source of the race condition that led to EBS node failure.
This might be interesting.
Subscribe to:
Posts (Atom)
