Skip navigation

Category Archives: Uncategorized

 

 

 

Version control systems are important, and Git is one of the nicest one’s out there.  If you’re new to version control systems (VCS), or have mainly worked on small projects in the past, then it might not seem worth it to use one. However, once you start working on larger projects or need to collaborate with others, VCS’s become very important. Here’s a good explanation of Git and how it works that I wish I had found when I learned:

http://progit.org/book/ch1-3.html

Advertisements

As Isaiah and I were hiking the Appalachian Trial this past July 4th weekend, he told me he had a fun riddle. Liking the logical nature of riddles and the thought process to solve them, I excitedly encouraged him to continue. The riddle is as follows:

There is a town with a small number (~200 but not really important) of married couples. Everyone in this town takes cheating very seriously. Once a woman cheats on her husband, everyone in the town will know except the husband. However, the day a husband catches his wife cheating he will kill her. One day, the Mayor of this town announces, “Some number of people in this town are cheating.” Note we do not know how many people are cheating, we only know that cheating is occurring. After this announcement no cheating occurs.

Seven day’s later, seven husbands kill their wives. Why did this happen?

Two hints and the answer are below spaced out by images [My photos from the Chattahoochee section of the Appalachian Trail in northern Georgia]:

Hint1: Think about the rules of the system. If cheating occurs, everyone in the town will know except the person who is being cheated on. What information does the Mayor give away? Also, It doesn’t matter if cheating or not occurs after the announcement, as long as no new cheating occurs.

Hint2: Review what happens after one day passes. The significance of the sentence “the day a husband catches his wife cheating he will kill her.” It might help to consider the other possible case of this riddle where if only one person is cheating. Then consider another case where two people are cheating: if the Mayor were to announce the cheating, and then two days later two husbands killed their wives. What happens after the first day that allows the husbands to know that their wives are cheating?

Answer: First let’s start with a single wife cheating with another husband. Say Alice cheats on Alan. If a Alice were to cheat, then upon hearing this announcement Alan would not know of any cheating going on and would be forced to kill her since he hasn’t heard of any cheating.

If we consider the case the second hint makes where if after two days two husbands kill their wives, then we can see what is learned after the first day. Consider two couples, Alice and Alan, and Bree and Bob. Say that Alice and Bree are both cheating on their husbands. If the Mayor announces the cheating, then both of their husbands will have knowledge of someone else cheating and not kill their wives after the first day. Then once this day passes, they will each realize that since no wife was killed like in the case above with one wife cheating, then there must be at least two people cheating. But they each only know of one person cheating, so the other must be their wives.

This process can be repeated up to seven days.  So the general form of this riddle would be told having N days pass and N wives killed. Pretty Sweet!
Related Riddle Links:

http://www.puzzlelog.com/

http://gurmeet.net/puzzles/

http://exdandd4e.wordpress.com/riddles-and-puzzles/

When I got my new T410s a couple of months ago, the first thing I did was pop in a live cd of 10.10 and check out the hardware support. I found that the Lenovo’s red pointing stick scrolling nor the two finger trackpad scrolling worked with a fresh version of Ubuntu. I relied on these navigational controls, so I set out to remedy this situation.

To fix the red pointing stick + middle button scrolling do the following:

create file /usr/share/X11/xorg.conf.d/20-thinkpad.conf and add:

Section "InputClass"
Identifier "Trackpoint Wheel Emulation"
MatchProduct "TrackPoint"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "Emulate3Buttons" "false"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
EndSection

Restart X session
$>sudo service gdm restart

Now you should have middle button + trackpoint scrolling. Let’s get two finger scrolling back too:

Now /usr/share/X11/xorg.conf.d/20-thinkpad.conf looks like:

Section "InputClass"
Identifier "Trackpoint Wheel Emulation"
MatchProduct "TrackPoint"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "Emulate3Buttons" "false"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
EndSection

Now append to it:

Section "InputClass"
Identifier "touchpad catchall"
MatchProduct "SynPS/2 Synaptics TouchPad"
MatchDevicePath "/dev/input/event*"
Option "VertTwoFingerScroll" "on"
Option "EmulateTwoFingerMinW" "8"
Option "EmulateTwoFingerMinZ" "40"
EndSection

Save and close it. Now open a terminal (ctrl+alt+t) and type:
$>gconf-editor

Now change desktop->gnome->peripherals->touchpad->scroll_method to 2.

Restart Gdm. Now you should have two finger scrolling and trackpoint scrolling.

Sources:
Trackpoint info
http://psung.blogspot.com/2010/04/thinkpad-trackpoint-scrolling-in-ubuntu.html
Two-finger Scrooling method 1 (didn’t work for me)
http://sunilgarg.com/2007/10/enable-two-finger-scrolling-in-ubuntu/
Watch dmesg
http://www.backtrack-linux.org/forums/beginners-forum/35966-continuous-dmesg-output.html
Two-finger scrolling
http://ubuntuforums.org/showthread.php?t=1603657

The command:
$>dmesg

Prints out the driver message buffer in Linux. If you want to catch device events (eg. when inserting new hardware like a usb stick), dmesg is one way to print out these events. To watch them in real-time, use the watch command:

watch "dmesg | tail -20"

Today I got tired of Rhythmbox and decided to do some investigation of the music players for ubuntu. Two of them popped out after reading some inital reviews: Songbird and Guayadeque. Both music players have some really cool features and they both use audio scrobbling through last.fm. Here’s a quick rundown:

Songbird

Songbird has a very nice iTunes like appearance but in a dark theme. So if you’re a fan of darker colors this player is for you. There are some very cool features in song bird such as the 7digital store, which gives you very easy access to buy music. It is also fairly customizable options menu with a very clean interface and supports tabs in the library display area. However, it’s not officially supported but you can still download the source code here. On some distributions it takes some additional setup and configuration. The code downloaded comes with some internal libraries (in the “libs” folder) which Songbird uses to decode various audio files types instead of using codec’s already installed on your system. I followed this link to fix these problems.

Note, the page above says to use the command
sh -c "export SB_GST_NO_SYSTEM=1 ; exec /usr/bin/songbird"

but the one that ended up working for me was:
sh -c "export SB_GST_SYSTEM=1 ; exec /usr/bin/songbird"

Guayadeque

This player is very cool and has just about the same amount of customizability as Songbird, but also lets you completely customize the layout of the GUI. You can drag and drop the library, song queue, player controls, lyrics, etc.  Then once you’ve created a layout you like you can save it and create others. This is really cool IMO, but what really makes this player standout from any other I’ve used so far is the Smart Playlist. Once you choose a song, or search for an artists in your library, it will automatically use last.fm’s Audioscrobbler based music recommendation system to add and then play 3 (the default number) songs to your “current” song queue.  Once you’ve listed to all of these and reach the end, it will grab three more songs, all using what you have in your library and your listening preferences.  You can always remove songs, queue up new songs, delete songs it picks, or rearrange the order!  This is a feature you grow to love and will miss when trying to use other music players. Get Guayadeque here!

Other good overviews on the two players here:
Songbird
Guayadeque

 

I will be using this blog to update my learnings in the world of the web, courses, and simple hack I’ve come to learn. Currently, I am running Ubuntu 10.04 on a Dell XPS M1330. This summer I am researching with professor Valeria Betacco, working on the FunSAT research project through the SURE program at U of M. The following posts are my learnings.

-Jkrez

John Krzemien
John Krzemien

Ahh, yes. The famous first words. Hello World!

I have just started this Blog as a kind of experiment. I have linked it to my blackberry so I can update it with pictures and events of life. Blogging seems like it’s a modern version of scrap booking, though a little more public depending on how you use it.

Expect regular updates with pictures! :)

That’s all for now!