skip page navigationOregon State University

OSLUG Planet

Code Cosmetics With Komodo and vim

Frederic Wenzel - Fri, 11/06/2009 - 09:13

The source code for the Mozilla Add-ons project tries to follow the PEAR Coding Standards. One of these standards is to use 4 spaces per level of indentation, and no tabs.

Over time, unfortunately, some files start to contain a significant amount of mixed-up indentation (both from badly set-up IDEs and third-party contributions that came with tab indentation but went un-noticed). That’s both tedious and error-prone to fix by hand.

A similar problem poses trailing whitespace. While it’s just annoying in general, especially in HTML template files, it also increases page size unnecessarily by leading to more bytes transmitted on the wire, with no benefit to neither the users nor the developers.

Luckily, there are two quick fixes for these problems in both the editor vim and my IDE of choice, Komodo:

To remove tabs and replace them with spaces…

  • in Komodo, select a code block, then click Code -> Untabify Region.
  • in vim, type :%s/\t/    /g (those are four spaces) — or, as oremj points out in the comments, you could just to :retab .

And to wipe out trailing whitespace…

  • in Komodo, in Preferences -> Editor / Save Options, activate the option “Clean trailing whitespace and EOL markers”. Then open your document of choice and just save it again. However, when writing patches, you might want to refrain from keeping this option on at all times: It might result in confusion if a lot of lines are touched that do not have anything to do with the current patch. I wish there was a one-time way to run this, instead of a config option.
  • in vim, type :%s/\s\+$//g which the regex-savvy among you have quickly decyphered as: “in the entire document, replace all one or more whitespace characters that are followed by a line ending with the empty string”.

Happy cleaning!

Categories: OSLUG Planet

Shortcut to Internet

Frederic Wenzel - Tue, 11/03/2009 - 02:01

For work, I have a virtual machine serving one little purpose: To run Microsoft Internet Explorer 6, for the rare instances when I have to test a website with it. To make that a little more convenient and a little less painful, I just created a “desktop shortcut” for it, and look what it showed up as:

Haha, “Shortcut to Internet” — this is classic.

Categories: OSLUG Planet

Oregon State Students Beat the “Thriller” Student Record

Frederic Wenzel - Mon, 11/02/2009 - 06:28

This is just awesome: This Halloween, 638 students from Oregon State University beat the college record of the most students performing Michael Jackson’s “Thriller” at Reser Stadium, Corvallis, Oregon.

Over 600 people was way more than the previous (student) record:

The previous college record was set at the College of William and Mary in Richmond, Va., where 242 people participated in the dance routine that student Kevin Dua organized. Dua’s group beat the previous record of 147 people in an event at a British secondary school.

Here is the official footage of the event:

Of course, this has not been the first attempt to spectacularly perform this music video. Here’s another video of a group of prisoners doing the same thing:

Finally, if you want to get a fix of the real thing, it’s on youtube too.

Update: As a commenter points out, the OSU admissions blog has blogged the whole thing too, and provided some HD-quality video of the event, which I have replaced the old video with.

Categories: OSLUG Planet

Auf (nimmer) Wiedersehen, StudiVz

Frederic Wenzel - Fri, 10/30/2009 - 00:47

Spätestens nach der jüngsten Datenpanne bei SchülerVz, dem kleinen Bruder von StudiVz, war klar, dass man im Hause StudiVz seit Jahren nichts zum Thema Datenschutz gelernt hat — allen Versprechen zum Trotz.

Es wurde also allerhöchste Zeit, meinen schon lange brach liegenden Account dort endlich zu löschen. Zwar hatte ich dort von Anfang an außer dem Allermindesten keine persönlichen Daten hinterlegt — aber selbst diese Daten sind im Hause “Vz” offenbar nicht sicher.

In diesem Sinne, liebes StudiVz, auf nimmer Wiedersehen!

Categories: OSLUG Planet

Fail-Hampster?

Frederic Wenzel - Wed, 10/28/2009 - 10:08

Instigated by Twitter’s fail whale, more and more Web 2.0 companies feel the necessity to add a fail-pet to their “OMG” error pages.

I’ve been loosely collecting those before, so my friend Tobi was so nice to send this one from Facebook over:

I think it’s from an app and not Facebook itself, but I may be wrong. Anyhow, apparently their hampster made a boo boo. That’s more information than I needed, but at least it eases the pain of the failed application. And that’s gotta count for something, right?

Categories: OSLUG Planet

Cui fidem, fidem

Frederic Wenzel - Tue, 10/27/2009 - 04:39

Da hat der niederländische Journalist Rob Savelberg die neu-und-alt-Kanzlerin Merkel aber ganz schön aus dem Konzept gebracht:

Natürlich ist das löblich, löblich, dass Merkel ihrem zukünftigen Kabinett voll und ganz vertraut. Hunderttausend deutsche Mark zu vergessen, kann schließlich jedem einmal passieren. Andererseits entbehrt es nicht einiger Ironie, dass ausgerechnet der scheinbar unter selektiver Amnesie in Finanzfragen leidende Schäuble zum Finanzminister ernannt wurde. Bleibt nur zu hoffen, dass er bei den Finanzen von 83 Millionen Deutschen nicht ab und an mal eine Milliarde vergisst. Und falls doch, müssen wir ihm eben noch ein bisschen mehr Vertrauensvorschuss gewähren — schließlich hat sich Schäuble schon als Innenminister wichtige Vertrauenspunkte im Kampf gegen den Bürger gesichert, und mit seiner süßen Schäublone für immer einen Platz in unseren Herzen gewonnen.

PS: Cui fidem, fidem, heißt “Vertrauen, wem Vertrauen gebührt”.

Categories: OSLUG Planet

Keeping SSH from disconnecting automatically

Frederic Wenzel - Wed, 10/21/2009 - 10:20

For work, I often develop on a remote Linux box that I SSH into. Now, as a web developer, one of the big advantages of interpreted languages is that there are no big compile steps to wait for.

One of the big disadvantages is that nothing exciting is happening when you take a break (no sword fights, for example). The screen is just sitting there. Unfortunately, OpenSSH servers in their default settings take this silence as a perfect excuse to cut the cord after 5 minutes.

If that happens a lot during the day, this can be pretty annoying! But fear not, dear reader. On a Redhat-like system, you want to edit /etc/ssh/sshd_config and add the following line (note: only the second line is needed, read below):

TCPKeepAlive yes
ClientAliveInterval 60

Restart the SSH server, and it shall henceforth not punish you for prolonged periods of silence anymore.

Update: Two of my readers pointed out interesting things. First, Sancus mentioned that TCPKeepAlive is different from ClientAliveInterval and serves a different purpose. To avoid your connection dropping, the latter is likely to be the better option.

Jeff says, if you set this in the ~/.ssh/config file on your client, you’ll achieve the same effect without the need to modify the server settings:

Host *
ServerAliveInterval 300

This is obviously a highly charming alternative because more often than not, you are won’t have (write) access to your server’s sshd_config.

Categories: OSLUG Planet

Upcoming maintenance: Another great migration

Frederic Wenzel - Fri, 10/16/2009 - 02:09

It’s been awhile since I last had to announce planned maintenance here, so here we go:

My current domain service provider closes down its consumer services at the end of the year, prompting me to transfer all the domains that I own (including fredericiana.com) to a different service provider. I have chosen domainfactory, a well-established player in the market that I read good reviews about.

Please bear with me while the transfer is in progress and the name servers are being switched over. It should soon be smooth sailing again. But, if problems persist, as always, just shoot me an email.

Thanks!

Update: I am glad to report my domains have all been transferred properly and everything should be back to normal now.

Categories: OSLUG Planet

Meet Lizzy

Frederic Wenzel - Tue, 10/13/2009 - 13:14

Lots has happened since the last time I posted — I got married, for example. Once the professional photographer gets back to us with the pictures, I might even share some

Today, however, I am able to introduce someone else to you, dear readers: Meet Lizzy!

Lizzy is a mixed breed, part (Miniature) Schnauzer, part unknown. The young lady is about 1 year and 3 months old, and Tara and I got her from an animal protection association, where she was dropped off by a family that suddenly decided they didn’t want a dog anymore… She is very well behaved, hardly ever barks, and after a few moments of shyness, loves just about anyone she meets.

Tara and I are very happy to have adopted her and are gladly sharing our apartment now

Categories: OSLUG Planet

Clearning Dalvik’s cache

Jose Cedeno - Tue, 10/06/2009 - 23:02
If you are running into problems after trying out a new version of cyanogenmod or things are a bit laggy you should try deleting dalvik’s cache: /data/dalvik-cache/*. adb remount adb shell rm -rf /data/dalvik-cache/* After you remove the cache reboot and your phone should feel a bit faster. This helped fix my lag problems with 4.1.99. The adb [...]
Categories: OSLUG Planet

Google Donates $300,000 to the OSU Open Source Lab

OSEL News - Mon, 09/21/2009 - 21:23

Google has done it again!Google generously donated $300,000 to the OSU Open Source Lab, demonstrating continued support to the Lab and ongoing open source education in the university.  Google has been donating to support the OSU OSL for three subsequent years now, providing more than one million dollars in contributions.  Contributions will make it possible for students to keep working for the OSUOSL, supply hardware for better hosting, and allow the OSL to take more development projects.Official Press Releases:

Thank you Google!

Categories: OSLUG Planet

Upcoming LUG/OSEL Events

OSEL News - Sun, 09/20/2009 - 21:39

Join us for the start of the new year!

Coming up in the near future:

  •  LUG room moving
    • When: Tuesday, September 22 from 5PM until we’re done or tired
    • Where:  South Pole (BAT349) and the new room (HOV010)
    • Why: Because we must.  There will be pizza and socializing while hauling furniture and LUG boxes to the new room.  Come help us arrange and rearrange how we use our new space.
  • Beaver Community Fair
    • When: Friday, October 2 from 12 to 4PM
    • Where:  MU quad
    • Who:  LUG members to man the booth - sign up on the LUG wiki
    • Why:  To tell new students about the LUG so we have more interesting people joining us in the future.  Besides, there is no joy like chasing people with our remote controlled Tux.
  • Beaver BarCamp 4
    • When: Saturday, October 17 from 10AM until 7PM
    • Where:  Kelley Engineering Center – Parking is available in the lot behind Kelley
    • Why: To get together and share ideas.  Bring your hobbies, research, projects, or questions.  This BarCamp should feature an all day install fest for all your Linux needs as well as great presentations.  More details will be available in the coming in the next week or so.  If you would like to help organize BarCamp, please e-mail the OSEL mailing list.
  • Weekly LUG meetings
    • When: Every Thursday at 6PM
    • Where:  KEC1007
    • What we do:  Work on projects, socialize, listen to guest speakers from the LUG or outside world, help others with their CS, FOSS, or Linux problems.  Maybe more!  If you have ideas for the LUG, contact us!

Categories: OSLUG Planet

What the US Health Care Problem Boils Down to

Frederic Wenzel - Fri, 09/04/2009 - 00:01

This is — hands-down — the best summary I have seen so far on the US health care dilemma:

I must say, even though our German health care system is f-ed up in many ways, and even though it is a “fat pig” (like the example in the video) as well, it is still a million times better than the US’s. I don’t know why the US don’t finally get that straight: in this respect, they are the laughing-stock of the countries…

Categories: OSLUG Planet

YouTube Calls Shenanigans

Frederic Wenzel - Wed, 09/02/2009 - 02:51

Click on the screenshot to see the error message YouTube just gave me when logging in:

And no, I have no idea what that’s supposed to mean…

Categories: OSLUG Planet

Voted!

Frederic Wenzel - Tue, 08/25/2009 - 08:21

On September 27, 2009, the Federal Republic of Germany will vote for their 17th “Bundestag”, i.e., its federal parliament. Due to my absence on the actual election day, I went to the ballot today already for early voting. Here is proof:

The staff were very helpful and interestingly, there were actually a lot of people asking for absentee ballots.

Another observation struck me as odd while reading the ballot: Of all people, the direct candidate of one of the nationalist parties*) is a “Fremdsprachensekretärin”, or certified multi-lingual secretary. Yup, a foreign-language secretary by day, moonlighting as a xenophobe. Life’s ironic.

*) whom I didn’t vote for, just in case that was unobvious.

Categories: OSLUG Planet

Reflecting on gsoc program

Jose Cedeno - Sun, 08/23/2009 - 14:54
Last week, MartinL tested the timeline course format and he found a couple of bugs. I got those bugs fixed, and submitted a task to the moodle tracker to get the test site updated. As soon as the test site is updated, I will make a call for new testers. Earlier in the week, I [...]
Categories: OSLUG Planet

Changing gmail account associated to android phone without factory reset

Jose Cedeno - Sun, 08/23/2009 - 11:41
A couple of days ago, while I was in irc I read a good tip that James_B found. You can change the gmail account that the google apps use without having to do a factory reset on the phone. Just go to: Settings>apps>manage apps and clear the data for “google apps”. This works on Android [...]
Categories: OSLUG Planet

Adding Empty Directories to git-svn

Frederic Wenzel - Tue, 08/18/2009 - 07:34

Just a reminder, because I always forget it: When you use git-svn on an svn repository and your code base contains empty directories (say, for temporary files, or log files), they will be ignored by git unless they contain at least one file.

Paradox? Maybe. There’s a good reason however: git ignores empty directories because it tracks (file) content, not a bunch of directories some of which happen to contain a file (the concept of tracking files might be the only thing git has remotely in common with good ol’ CVS — though git also does not deeply care about file names, only content).

The “common” way to handle this is by adding a .gitignore file to the repository. This won’t harm svn-only clients, but it’ll make git-svn clients pick up the (almost) empty directory properly.

This is what you need to do.

mkdir empty_dir
echo '*' > empty_dir/.gitignore
echo '!.gitignore' >> empty_dir/.gitignore
git add empty_dir
git commit -m 'adding empty directory' empty_dir

The .gitignore file tells git what file names not to track inside the directory in question. The asterisk means, ignore all files, but the second line makes sure the .gitignore file itself is recognized and added to the repository.

Categories: OSLUG Planet

Actual update on last week’s work

Jose Cedeno - Mon, 08/17/2009 - 02:41
Since I forgot to click on ‘publish’ last week (I got two blog posts today), here’s my actual moodle update for last week: * Updated code in cvs repo with latest 1.9.x version of course format * I found a typo in the 1.9.x version of the course format (wasn’t causing a bug) * Read documentation on how [...]
Categories: OSLUG Planet

GSOC Pencils down is nearing

Jose Cedeno - Mon, 08/17/2009 - 02:33
Last week I spent reading and doing some research on Moodle 2.0. I also fixed a couple of minor usability bugs in the course format. Nothing too big. I tested the course format some more. After reading more in the forums, it looks like I should start to focus on porting the timeline course format [...]
Categories: OSLUG Planet
Syndicate content