Firefox Without cntrl+t

July 12, 2009 at 9:39 pm (Uncategorized) ()

I recently discovered the wonders of StumpWM, a tiling window manager that is written entirely in Lisp. I was startled to find that all key combinations started with cntrl+t, leaving my then favorite keyboard shortcut by the wayside. Me, not being one to give up on opportunities to not use my mouse, pushed on!

Here are some cool shortcuts I used to replace it:

cntrl+l to go to the location bar and then alt+enter to load the url in a new tab

cntrl+k to go to the search bar, cntrl+up/down to select the search engine, and then alt+enter to search in a new tab.

In the end I prefer these methods as I don’t have to wait for a new tab to load and I can watch the screen for that much longer. In a time where pages are updated constantly with Comet and AJAX, this is pleasent

Permalink Leave a Comment

Reflecting “Java” Method Param Names

April 29, 2009 at 10:25 pm (Uncategorized) ()

There is a legitimate use case for the ability to discover the names of method parameters at run-time: building clean DSLs. Certainly Java is too clunkety to build any sort of usable DSL, but JVM languages like Scala and Groovy excel in that department.

Permalink Leave a Comment

Robo-ethics

February 14, 2009 at 11:03 pm (Uncategorized) ()

I just wanted to plug a fantastic podcast on the ethics of robotics and AI. Most of the points made transfer over to other longer lived debates, with the only difference being that metal is included, but some good questions are raised. Here it is: http://www.robotspodcast.com/podcast/mp3/robots-20090213-episode19.mp3

Permalink Leave a Comment

Howto kill that annoying system bell (GNU/Linux)

April 2, 2008 at 2:55 pm (Uncategorized) (, , , , , )

Recently my boss shelled out the cash to get me a new laptop (HP Pavilion dv675us). Well, after two days of being made physically ill by the limitations and bugs of Long-thorn (Microsoft Windows Vista), I grabbed a beta Live CD of Ubuntu 8.04 (Hardy Heron) and traveled through the desert and into the promised land. There was one problem, however; when I tabbed a loud bell rang out from within the monster’s belly. So I went searching for a solution and once finding it  killed the beast.

Here’s what worked for me on on Ubuntu:

sudo rmmod pcspkr
echo “blacklist pcspkr” | sudo tee /etc/modprobe.d/pcspkr-off

The first command is temporary, but the second is permanent.  Now, supposedly this wont work on OpenSuse, but one of these will:

setterm -bfreq 0
echo “setterm -bfreq 0″ >> ~/.bashrc

or

sudo -i
echo “setterm -bfreq 0″ >> /etc/bash.bashrc

Good luck! I got this info from the following thread: http://lists.us.dell.com/pipermail/linux-desktops/2007-June/000467.html

θέλημα

Permalink Leave a Comment

Bottles of Beer in Scala (one line)

December 5, 2007 at 9:43 pm (funny, scala)

for(x <- 1.to(99).reverse) printf(“{0}{3}, {0}.\n Take one down and pass it around, {1} bottle{2} of beer{3}!\n”, x + (if (x > 1) ” bottles” else ” bottle”) + ” of beer”, if (x > 1) x – 1 else “no more”, if (x > 2 || x == 1) “s” else “”, ” on the wall”)

There you have it!

Output:

99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles of beer on the wall!
98 bottles of beer on the wall, 98 bottles of beer.

2 bottles of beer on the wall, 2 bottles of beer.
Take one down and pass it around, 1 bottle of beer on the wall!
1 bottle of beer on the wall, 1 bottle of beer.
Take one down and pass it around, no more bottles of beer on the wall!

Permalink 10 Comments

Scala!

November 3, 2007 at 3:06 pm (Uncategorized)

There has been a throng of JVM languages quickly gaining popularity. Why? Because since they compile to java bytecode and run in the JVM, they are able to use the libraries that Java and other JVM languages have while doing everything that Java can’t. In the future of Free software, not only will problems be solved once, but their solutions will only be written once.

Introducing Scala. It’s Functional, Object Oriented, and compiles to Java Byte Code so that it runs in the JVM. Message passing concurrency? Pattern Matching? Multiple-inheritence? Pure Object Orientation? First class functions? All that and more :-) . It’s the most flexible typed language I have ever worked with.

Check it out! http://www.scala-lang.org/intro/index.html

θέλημα

Permalink Leave a Comment

Fibonacci Sequence – Lisp, Erlang, and Bash

October 31, 2007 at 6:21 pm (Uncategorized)

Welcome to the Fibonacci blog post. The first thing I do when I learn a new language is express the Fibonacci sequence. Here are some strange ones. Unfortunately wordpress is killing my styling, if anyone knows how I can fix this, please let me know!

The Fibonacci recurrence relation expressed in Common Lisp

(defun fib(n)
(or (if (< n 2) n)
(+ (fib (- n 1))
(fib (- n 2)))))

The same function expressed in Erlang

fib(N) when N < 2 -> N;
fib(N) -> fib(N – 1) + fib(N – 2).

Finally, in Bash

fib ()
{
if [ $1 -le 1 ]; then
echo $1
else
echo $[$[`fib $[$1 - 1]` + `fib $[$1 - 2]`]]
fi
}

More to come :-)

θέλημα

Permalink Leave a Comment

Installing Elbuntu – E17 for Ubuntu

October 29, 2007 at 2:50 pm (Uncategorized) (, , , )

NOTE: This tutorial is out of date and currently inaccurate. However, with the right  adjustments you could probably get it to work, if you know what you’re doing. I will load E17 on my new laptop (when I get it) and update this post accordingly. If you have any hints or suggestions that will help me update this, please comment them!

This tutorial steps you through the process of installing Elbuntu on a computer currently running Ubuntu.

“Elbuntu is a sister distro of Ubuntu that delivers the eye-candy and configurability of Enlightenment, alongside the clean and beautiful design of Ubuntu Linux.” Visit https://wiki.ubuntu.com/Ebuntu for more information.

DISCLAIMER: Remember, E17 is still under development. You are installing “Beta quality” software. If you fry something, it’s not my problem… but I’ll do my best to help you find a solution.

Target Environment: This tutorial is intended for users of Gutsy. So if you have not already, please upgrade to Ubuntu Gutsy Gibbon before continuing. As some background, I wrote/followed this tutorial on a 64bit laptop with, regretfully, a ATI Radeon Graphics Card.

Let there be Light!

1) You must first update /etc/apt/sources.list so that apt, ubuntu’s package manager, can find the elbuntu packages. The following command appends the needed entry to the end of your sources.list. “bash -c” is needed because a limitation of sudo and piping.

sudo bash -c "echo deb http://edevelop.org/~lut1n/ubuntu gutsy e17# Elbuntu >> /etc/apt/sources.list"

2) Update apt’s package list. (note: you will probably get a GPG warning. If some one hunts down an answer before I do, please share?)

sudo apt-get update

3) Now install the window manager (e17) , the display manager (entrance), and a system tray (stalonetray)… yes, e17 doesn’t have a system tray by default.

sudo apt-get install e17 entrance stalonetray

4) Create a .desktop file for stalonetray so that you can add it to start.

gksudo gedit /usr/share/applications/stalonetray.desktop

and paste the following:

[Desktop Entry]
Encoding=UTF-8
Version=0.6.2
Name=stalonetray
Type=Application
Comment=a stand-alone freedesktop.org and KDE system tray
Exec=stalonetray
Icon=
Categories=Applications;Tray;Startup
Term=

5) Create a .desktop file for your nm-applet

gksudo gedit /usr/share/applications/nm-applet.desktop

and paste the following:

[Desktop Entry]
Encoding=UTF-8
Name=Network Manager
Comment=Network Manager applet
Icon=nm-device-wireless
Exec=nm-applet --sm-disable
Terminal=false
Type=Application
Categories=Application;Network;

6) Edit~/.e/e/applications/startup/.order to contain the following

stalonetray.desktop
nm-applet.desktop

7) Reboot and comment this post with any problems/challenges you encountered

Again, if you have any problems/solutions/suggestions/requests, please post a comment :-)

θέλημα

Permalink 3 Comments