Posts

Programming language notes, links

Time machine Here is a post for years and years ago that was stuck in drafts. Some of it is still useful, but a lot is amusing to look back on. Oh, those were the days ... General Programming Lots of good multi-language examples at this site. It's nice for comparing how similar algorithms are implemented in different languages.   http://en.literateprograms.org/ This is an awesome page, full of useful and interesting bit-twiddling tricks. In particular, with the trick to count set bits in a word, I've been able to reduce by a factor of 50 (!) the amount of time it takes to count bits in a range of memory.   http://graphics.stanford.edu/~seander/bithacks.html Lots of information about regular expressions: http://swtch.com/~rsc/regexp/ Programming Challenges Sites to keep you in shape:    http://projecteuler.net/    http://www.programthis.net/ Mathematics The Haskell implementation of the Sieve of Eratosthenes is just cryptic. I'm not sure

Questions to ask about yourself, your job, your company

Are you taking on a new project? A new role? A new job? There are questions you should ask to make yourself more successful. Questions about your project ABC as a business initiative What are success metrics for ABC? How core is this project? Periphery? Likely to be cut? What is the core set of values that tie all XYZ projects together? How does ABC roll up into that? How automated is the testing? What is limiting the rollout to more devices? How heavy is the client? Can customers walk away from the ABC product? Have any done so? If so, what reasons did they give? How much support have the company's partners given? Aren't there already widgets like this on the market? Why develop your own? Or, is the company leveraging a 3rd party one? Who are the competitors? What is the ranked set of features for this project? Is it well defined and well understood? Are the criteria for the ranking clear and fair? Questions about your company How does XYZ deci

Muting the MacOS startup sound

Auto-mute your Mac's speakers each time you turn it off Got this great tip from lifehacker . It actually turns off all sounds (mute) each time you shut down. Not the exact thing I was looking for (I only wanted to disable the one startup sound), but we've used it for a year or so on our Mac and love it. Create a file named /Library/Scripts/mute.sh #!/bin/bash osascript -e 'set volume with output muted' Then run these commands: sudo chmod u+x /Library/Scripts/mute.sh sudo defaults write com.apple.loginwindow LogoutHook /Library/Scripts/mute.sh

Patching VMware Tools in Fedora 18

Patching VMware Tools so HGFS (host-guest file system) will run in Fedora 18 There are several bugs in the current release of VMware Tools (VMwareTools-9.2.2-893683). Below are some patches and scripts to fix those. You can download these files from my GitHub repo: https://github.com/ebdevrepo/bin People have also had good results with this patch:  http://communities.vmware.com/message/2130250 (1) Kernel include file bug There is currently a bug in the vmware-install.pl script. It will fail to find header files. To fix that, run this script [ download ] and then re-run vmware-install.pl: #!/bin/bash KVER=`uname -r` cp /usr/src/kernels/$KVER/include/generated/uapi/linux/version.h /lib/modules/$KVER/build/include/linux/ (2) VMCI driver bug There is a second bug in the vmware-install.pl script. It will fail to compile the vmci driver. See these posts: https://patchwork.kernel.org/patch/1963371/ http://communities.vmware.com/message/2182440#2182440 You know you

Configuring the Fedora window manager

Pick a different window manager There are lots of window managers out there. Right now, Gnome is having some trouble running in a VM because VMWare's 3D acceleration does not work with it. Pick a lighterweight one like Cinnamon.   sudo yum install cinnamon Reboot. When you are entering your password to log in, use the services dropdown to change to Cinnamon (or whatever other window manager you selected). Smaller title bars The default title bar on Fedora windows is too tall. It wastes a lot of screen real estate. After trying several of the suggestions out on the 'net, I found that this one works for me (Fedora 18 with Cinnamon window manager). http://mikeyshelpdesk.blogspot.com/2011/04/gnome-3-massive-title-bar.html * Find your metacity theme files. They should be in /usr/share/themes/Adwaita/metacity-1 * Find each instance of "title_vertical_pad" and change it to zero *** NOTE: You'll need to make this change each time the .xml files are update

Adding Ruby on Rails to the development environment

Ruby on Rails Once you have your basic development environment up and running, you may want to add Ruby on Rails to it. Follow these steps. Tools to install $ sudo yum install ruby $ sudo yum install ruby-devel $ sudo yum install sqlite-devel $ sudo gem install rails $ sudo gem install therubyracer Install MySQL This page is far more informative and covers many other use cases and linux variants:  http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch34_:_Basic_MySQL_Configuration But, if you want a super-quick startup, here goes... $ sudo yum install mysql $ sudo yum install mysql-server $ sudo yum install mysql-devel $ sudo chkconfig mysqld on $ sudo service mysqld start    # or reboot $ mysqladmin -u root password "the password" $ mysql --user=root --password="the password" mysql> create database dev; mysql> grant all privileges on dev.* to devuser@"localhost" identified by 'a password'; mysql> q

Acronyms

Acronyms that I run into from time to time There is a set of acronyms that I run into often enough to need to know what they are, but not often enough to actually remember what they are. I'm hoping that by writing them down it will help me remember them. ACID - Atomicity, Consistency, Isolation, Durability. The properties that make up a reliable database updating mechanism.  http://en.wikipedia.org/wiki/ACID AJAX - Asynchronous JavaScript and XML. This one is slippery. XML is not required; JSON is usually used. The requests do not need to be asynchronous. Essentially, this is a way of building UIs wherein the UI is responsible for polling information from the server at the UI's desired update rate. This is all on the UI; there is no server control over the rate.  http://en.wikipedia.org/wiki/Ajax_(programming) CRUD - Create, Read, Update, Delete. These are the basic functions needed to implement persistent storage.  http://en.wikipedia.org/wiki/Create,_read,_update_and_