Monday, August 27, 2012

Running Greasemonkey functions from page events

As you know, I wrote a simple Greasemonkey script to hide multiple results from one domain in Google searches.  This script worked very well, and was easy to set up, but I had originally wanted to have the ability to click to show the hidden results.  Doing this in javascript is pretty simple, but Greasemonkey runs all scripts in a sandbox which cannot be accessed from the page.  This is somehow related to security, which I won't pretend to understand.

I was pretty content with how the script was, but someone on the script's page requested the click to show feature, and I figured I would give it a try.

Greasemonkey has something called the unsafewindow for stuff that must break out of the sandbox, and I got click to show working pretty fast using it.  The problem is that everyone has a dogmatic animosity towards using it.  So, I decided to try to figure out one of the alternatives

The most common suggestion was to use the location hack, which just puts the function in a bookmarklet and links to it.  If you don't know, you can run javascript on a page by just pasting it into your url bar.  Prior to Greasemonkey, I used a lot of these via bookmarks called bookmarklets.  Anyway, this is all relatively simple, but there is no actual example on the wiki.  I eventually just had to try something out that I thought would work rather than being spoon fed someone else's example.  Since the internet is no place for having to figure things out yourself I'll post the actual code I used.

Since the bookmarklet can be quite long I stored it in a variable first.  Since javascript ignores whitespace like a sensible language I broke it up over multiple lines.  The actual code is just wrapped in a self invoking function for reasons I still don't really understand.

showcode = "javascript:(function() {"+
"var results = document.getElementsByClassName('"+prevurl+"');"+
"for (i=0; i "document.getElementById('show"+prevurl+"').style.display = 'none';"+
"; } )()";


Pasting that into something with syntax highlighting will show that prevurl is a variable, and outside the double quotes.  Everything else is inside.  This function is then called by just making the variable the destination of a onclick event.  If you want to see more the source is on the script's page.

With this, my script is, at the risk of tooting my own horn, quite good.  It is probably the only thing I've ever made that doesn't look like it was made by a 5 year old.

Wednesday, August 22, 2012

How Hollywood Is Encouraging Online Piracy

http://www.scientificamerican.com/article.cfm?id=how-hollywood-encouraging-onine-piracy
And if you don't make your product available legally, guess what? The people will get it illegally. Traffic to illegal download sites has more than sextupled since 2009, and file downloading is expected to grow about 23 percent annually until 2015. Why? Of the 10 most pirated movies of 2011, guess how many of them are available to rent online, as I write this in midsummer 2012? Zero. That's right: Hollywood is actually encouraging the very practice they claim to be fighting (with new laws, for example).

Monday, August 20, 2012

Hiker Leaves Dog on Mountain, Charged With Animal Cruelty

http://news.discovery.com/adventure/hiker-leaves-dog-on-mountain-charged-with-animal-cruelty-120820.html#mkcpgn=rssnws1
When Ortolani and his friend finally made it safely off the mountain and called 911, however, they discovered that Mt. Bierstadt rangers are not allowed to send rescues for dogs.

Missy wasn't seen again until two hikers discovered her six days later. They, too, were unable to rescue her, but they posted a picture of the dog on a popular hiking website, which eventually prompted an eight-person volunteer crew to make a successful rescue -- despite a snowstorm.

The incident has sparked an outpouring of opinions. Ortolani goes to trial in October.
This is certainly interesting.  I suppose Captain Hindsight says you probably shouldn't bring a dog or person on a hike they can't physically do themselves. 

The Checkpoint: Terror, Power, and Cruelty

http://www.bostonreview.net/BR37.4/oded_naaman_israeli_defense_forces_palestinians_occupation.php
Threats. All day and all night he generates threats: he threatens people in order to extinguish their will. He does not know what their wills actually consist in. He can feel, by now, that part of them wishes he were dead. “If you didn’t have [your weapon], and if your fellow soldiers weren’t beside you, they would jump on you,” one soldier testifies, “beat the shit out of you, and stab you to death.” He imagines them charging his checkpoint by the hundreds: carpenters, doctors, teachers, farmers, mothers, uncles, children, grandparents, and lovers. How could so many people, people who look him in the eye every day, want him dead? How do the Palestinians see him? He does not recognize his own gaze reflected back at him from the windows of the cars he inspects or confiscates. He is no longer his own person.

Now that guilt is impossible, the soldier realizes that part of him is dying. The soldier starts to think that he is the real victim in all this, especially since no one understands that he is bound to fail, that his power makes him helpless. No one knows that since arriving here he has not made a single choice. Sure, the Palestinians are helpless too, but it is easy to see that they are victims, he tells himself. He, the soldier, is a powerful nobody—that is his tragedy.

Anger accumulates. Palestinians come up to him, one after the other, all day long, begging him to let them pass. Telling him they need to get to their schools, universities, hospitals, jobs; they need food; they want to see their children, their parents; they need to get to their funerals and weddings, to give birth. But how the hell should he know? Why do they think he has any clue as to whether they can pass through his checkpoint? He cannot tell the difference between them; they all act the same, the way terrified people act.

Sunday, August 19, 2012

Configuring Linux or: How I Learned to Stop Worrying and Love the Command Line

Foreword
The 7 year old HDD in my laptop died.  This gave me an excuse to switch from Windows XP to Linux.  Since there was a lot of configuration to set things up I figured I'd document my trials and tribulations here for future reference.  Note, this was written over about two weeks as I set things up.  It sometimes reflects this, but I tried to edit it to make sense overall.


Setup
Years ago, I had previously used Slackware with Fluxbox.  So, I installed Slackware 13.37; the install was exactly the same as it had been 10 years ago.  The network didn't work, and as I didn't really have another computer for troubleshooting I really didn't feel like dealing with Slackware.  I have been wanting to give Ubuntu a try,  and so I had also downloaded the newest Ubuntu, and I installed that.

Ubuntu used Gnome as its default desktop environment, although it seems to have switched to Unity, which I think is still Gnome based.  I've never liked Gnome, and now both it and KDE have gone out of their way to be unusable.  Luckily, there is a version of Ubuntu with lightweight xfce called Xubuntu.  This didn't matter much as I planned on using the even more lightweight Fluxbox again.

It helps if you are familiar with the general structure of files in Linux.  Here is a good overview:
http://www.thegeekstuff.com/2010/09/linux-file-system-structure/ 
http://lowfatlinux.com/


Installing Programs
When I used Slackware I used to install everything by compiling source, however, Ubuntu is well known for its friendly package manager and I made extensive use of it.  It's nice because if you enter the name you think a program will have on the terminal it will tell you if it's installed.  If it's not it will suggest similar names you may have meant.  If there is a program called that, but it's just not installed it will tell you the command to run to install it: sudo apt-get install program-name, which can then be selected and middle clicked to install right away.


Extra Programs
I had to install a lot of random utilities to do everything here.  I won't bother mentioning them all; if you try something and it complains that something isn't installed, then just install it with apt-get.  Rather, I will list the programs that I actually use directly that I had to find.

Geany is a text editor that I found as a replacement for Notepad++.  It's ironic because when I first moved from Linux back to Windows one of my complaints was that I couldn't live without syntax highlighting provided by whatever text editor I had been using.  I found Notepad++ as a suitable replacement on Windows and grew to love it.  Now, moving back to Linux I don't know how I'll live without all the features of Notepad++.  I'm liking Geany more as I use it.  I'd say it may even be better than Notepad++.

For bit torrent, I went with qbittorrent. By default I had Transmission installed, which seemed good for people that didn't like bit torrent (I promise this opinion isn't biased by the fact that I associate Transmission with Macs).  Anyway, qbittorrent is an open source clone of uTorrent, which is good because every since uTorrent was sold it was becoming increasingly annoying.

I found gmusicbrowser as a replacement for Foobar2000.  I don't have many requirements in a music player, just a simple interface that can handle a lot of files.  This wasn't hard to find, however, I couldn't find anything that simply had a random song feature.  I should point out they all had shuffle, which randomizes the order of songs and plays them back.  What I wanted was a button that when pressed would play a random song, but then playback would proceed in the normal order.  I like to have that command mapped to one of my mouse buttons.

The closest I could find was a random album button, and to get this I had to manually edit the skin file to add the button to the system tray popup.  As far as I can tell there is no command for it, so I have to use the button in the system tray.

Note this is no longer true.  I'm using mpd, and wrote a section about it below.


Shell Scripts
Linux shell scripts are just a way to run commands that would normally be entered on the terminal via a text file.  This is similar to batch files in Windows.  The difference is that since everything in Linux is built on the command line from the ground up, they're much more powerful, and sensible to figure out.  Just put commands in a text file and then run it with the command sh file.  For more complex stuff I'll just use Perl.  The output of a script can be redirected to a text file with sh file > text.txt.  I used several shell scripts where I needed to combine several commands into one.


Fluxbox Menu
Fluxbox is pretty simple.  There are a handful of config files that control just about everything.  These files are in a folder called ~/.fluxbox.  One is called menu and it contains the Fluxbox menu that comes up when you right click the desktop (similar to the Windows start menu).  This menu is pretty easy to edit, here are some good guides.  There is one important note though.  It doesn't update unless you update it yourself.  There's a program called MenuMaker that will scan the system for programs and build a menu.  You can run this with mmaker fluxbox -f, but if you want to have a custom menu you'll need to combine its output with your custom menu.  I made a simple shell script to do this:
echo "[begin] (Dale)"
mmaker fluxbox -c -i
cat custommenu.txt
echo "[end]"


This will just dump the menu to the screen.  Redirect it to the menu file with:  sh createmenu > .fluxbox/menu.  Just put the custom part of your menu in the text file, and you're set.  This is the custom menu I used, which includes easy access to several of the commonly edited Fluxbox config files:

[separator]
[submenu] (Mine)
[exec] (Thunar File Manager) {Thunar}
[exec] (FireFox) {firefox}
[exec] (gmpc) {gmpc}
[exec] (Pidgin Internet Messenger) {pidgin}
[exec] (qBittorrent) {qbittorrent}
[exec] (Calculator) {gcalctool}
[exec] (Geany) {geany}
[exec] (Leafpad) {leafpad}
[end]
[submenu] (FluxBox)
[workspaces] (Workspaces)
[submenu] (Styles)
[stylesdir] (/usr/share/fluxbox/styles)
[stylesdir] (~/.fluxbox/styles)
[end]
[submenu] (Config Files)
[exec] (startup) {geany .fluxbox/startup}
[exec] (menu) {geany .fluxbox/menu}
[exec] (keys) {geany .fluxbox/keys}
[exec] (layout) {geany .fluxbox/init}
[end]
[config] (Configure)
[reconfig] (Reconfig)
[restart] (Restart)
[separator]
[exit] (Exit)
[end]



Music Player Daemon
I eventually got tired of not having a random song button.  I asked on stackexchange about a music player that had a random song command.  The answers seemed to indicate that I was not explaining the concept of what I wanted to do very well. Reguardless, the common suggestion was to use mpd, which is a background command line music player, designed to be controlled by some other frontend.  Note, mpd still doesn't have an actual play random song command, but I made a shell script to emulate that functionality.

To begin, I had trouble getting mpd to work at all.  First it wouldn't connect to my gvfs music shares, and then it didn't produce audio.  I ended up following this guide after which, despite being the same stuff I was doing, it worked.  I'm sorry I can't give more details on what I actually did to fix my problems for anyone following this (ie future me).

After that, I had to figure out what client to use.  mpc is a command line client that just issues commands.  I also had Gnome Music Player Client installed, and it was suggested elsewhere, so I went with that.  I must say, I must listen to music in a very different way from every other person on Earth, as I always find default music player's 'libraries' to be very unnecessarily complicated.  I just want all my music in one giant list which will play back in order.  Anyway, gmpc worked ok once I figured out how to set it up.

Another problem I had was that mpd purposely only supports one directory.  If you have music in more than one directory and wish to add it all you are expected to set up symlinks in the one directory to the others.  This is all well and good, but as I mentioned before all my music is on Windows Samba shares mounted via gvfs.  Despite having write access in Linux to them, I couldn't set up symlinks in one to the other.  After some experimenting to find the actual problem I found I could create symlinks to them, just not on them.  So the solution was to just set up symlinks in my home directory to the various shares.  This worked well, as it simplified the 20 levels deep nature of the shares at the same time.

All this and mpd still doesn't have an actual random command.  It did have a random mode though.  I got the functionality I wanted with this shell script:
mpc random
mpc next
mpc random


This turns on random mode, skips to the next (now random) song, and then turns off random mode.  Since mpd is very lightweight this is fast enough for me.


The Mouse and Media Buttons
I have a Logitech Performance Mouse MX, which I like very much.  Unfortunately, Logitech doesn't support Linux at all.  This meant I had to configure all the extra buttons myself.  I found these two commands gave a good speed (which I like to be very fast):
xinput set-prop 9 "Device Accel Velocity Scaling" 30
xinput set-prop 9 "Device Accel Profile" 2


As for the mouse buttons, I had to first find what the buttons were called.  There's a simple program called 'xev' which displays the names of buttons that are pressed.  After I found the names I added these lines to the Fluxbox config file keys:
Mouse9 :Exec sh random
Mouse7 :Exec sh tabright
Mouse6 :Exec sh tableft
Mouse13 :Exec xte 'key F5'
Mouse8 :Exec xte 'keydown Control_L' 'key W' 'keyup Control_L'


Note the shell scripts.  I did this because I use the mouse wheel left and right to switch tabs (Ctrl+page down/up).  Since the sideways motion is not very good it would send a lot of key presses all at once and was unusable.  I fixed this by adding some delays via this shell script:
xte 'keydown Control_L'
sleepenh 0.1
xte 'key Page_Up'
sleepenh 0.1
xte 'keyup Control_L'


I had to install sleepenh to get sleep times < 1 second.

Next, to get the media buttons (play, next, mute, etc) on my laptop to work I added these lines to the keys file:
None XF86AudioLowerVolume :Exec amixer -q set Master 5%- unmute
None XF86AudioRaiseVolume :Exec amixer -q set Master 5%+ unmute
None XF86AudioMute :Exec sh togglemute

171 :Exec mpc next
172 :Exec mpc toggle
173 :Exec mpc prev
174 :Exec mpc stop


A note about mute.  There appears to be a bug in amixer where the mute toggle mutes three channels, but only unmutes one.  This means you have to go in and manually unmute in the gui.  I wasted a good hour trying to figure out what was going on with that.  I had to write a shell script to mute and unmute all the channels.  Here it is:
if amixer sget Master | grep "\[on\]"
then sh muteall
else sh unmuteall
fi


and muteall is just:
amixer set Master mute
amixer set "Master Mono" mute
amixer set PCM mute



Startup File
One of those Fluxbox config files is the startup file.  As the name implies it runs any commands in it when Fluxbox starts.  It's important to note the command exec fluxbox is what runs Fluxbox itself.  Any commands after that won't run until Fluxbox exits.  Also, any command that will continue to run needs to have an ampersand placed after it.  Here are the lines I added to my startup file:
xinput set-prop 9 "Device Accel Velocity Scaling" 30
xinput set-prop 9 "Device Accel Profile" 2
xrandr -s 1440x900 -r 60
fbsetbg -c -r ~/.fluxbox/backgrounds/
sh createmenu > .fluxbox/menu
xfce4-power-manager &
gvfs-mount smb://Server-PC/Media &
python ~/gmail-notify/notifier.py &


I already explained some.  xrandr sets the resolution.  fbsetbg sets the wallpaper to a random one.  The xfce4-power-manger gives popup alerts when the laptop switches to battery power.  gvfs mounts windows samba shares.  And, gmail notify is a Linux equivalent to the Windows gmail notifier by Google.

I made a bunch of 1440x900 wallpapers from various Hubble shots, and posted them here:
http://daleswanson.blogspot.com/2012/08/astronomy-wallpapers.html


Fluxbox Theme
Fluxbox themes are simple text files.  I downloaded a few, but really didn't like most.  I finally settled on the included 'squared blue' but modified it somewhat.  I'll include my custom theme in the zip of all my custom files at the end of this post.


Cronjobs
Cronjobs are the Linux way of running a script or program automatically at set times, however, they are much more powerful than the Windows equivalent.  The 'crontab' stores the various cronjobs set to run.  It isn't stored as a simple file on the computer (while the system is running).  To edit it enter the command crontab -e (-l will list the current one).  This will allow you to edit it in a terminal based text editor, a concept I don't think I will ever embrace.

The format is somewhat interesting.  It is in the form of: Mi H D Mo DOW command.  Or: minute (0-59), hour (0-23, 0 = midnight), day (1-31), month (1-12), weekday (0-6, 0 = Sunday).  For example: 38 6 4 8 0 command would run at 6:38 am on Sunday Aug 4th.  Much greater flexibility comes from wildcards (*), multiple entries (,) and multiples (/):
12 4 * * * command - Every day at 4:12 am
12 4,8 * * * command - Every day at 4:12 am and 8:12 am
*/10 * * * * command - Every minute that is evenly divisible by 10 (ie every 10 minutes).

Many more examples and a more thorough explanation are in this guide.

I wrote a simple backup script that currently consists of just a copy command, but I will likely expand it.  I set it up to run every hour with 38 * * * * nice -n19 ionice -c3 sh ~/backup.  Note the ionice.  In Linux, nice is program which sets priority.  The idea being that higher priority processes will get CPU and memory before lower priority ones will.  In theory, this means that if a process is set very low it won't have any impact on the overall speed no matter how much CPU it eats up.

For things being run as cronjobs it is likely that you just want them to run with whatever idle resources there are, and to not get in your way.  You can do this by making the command in your crontab that calls the script have a lower nice level (note -19 is highest priority, 19 is lowest, 0 is default, so kind of backwards [also it seems to be perhaps 20, at least sometimes]).

This is all well and good, but a backup script probably won't eat up too much CPU.  What it will eat up is HDD I/O.  That is where ionice come in to play.  As you've probably already guessed ionice is a similar concept but just for I/O priority.  In this case, class 3 is the lowest priority, and what I set the above backup script to.


Thunar Custom Actions
Thunar is the default file manager for xfce.  It has something called custom actions which give you the ability to run commands on files from a right click menu.  This has proven to be a very useful feature, which I've used to replace (and expand upon) the features of file menu tools in Windows.

They are stored in an xml file at ~/.config/Thunar/uca.xml.  I've included that file in the zip of my custom text files at the end of this post.



Custom Text Files
As promised I've compiled a bunch of the text files I edited and uploaded them here:
http://daleswanson.org/blog/custom.7z

Saturday, August 18, 2012

JavaScript For Cats

http://jsforcats.com/

I'm pretty much posting this for the picture at the end.

Thursday, August 16, 2012

Hiding multiple results from the same domain in google search

A few months ago Google changed their search result behavior.  Before, it would display one or two results from a single domain, and then give a link for more.  After the change, it simply displayed all of them.  This was made much worse by setting your results per page above the default 10.  This was ridiculously annoying, to the point where I'm inclined to believe the conspiracy theories I read that Google did it to discourage people from setting the results higher than default and thus seeing less ads.  I simply can't believe that Google thinks this is a legitimate improvement.

At this point, I should point out that all this really only applied if you turned off that crazy automatic search thing, and set your results per page to something high.  I had pretty much assumed that everyone on Earth did this, but the fact that there wasn't a solution online after months tends to suggest that they don't.

I asked about this on stackexchange, but was surprised to get no solution.  Although the fact that the question got a few votes suggested that other people were annoyed by this as well.

So, I decided to learn some more javascript by making a greasemonkey script to fix the results.   I was almost deterred by the lack of formatting in the Google search results page, but a quick online formatter made it workable.  Then, I had to figure out more of that javascript dot notation that I hate.  All in all though, it went well.  I wrote a basic script and uploaded it to userscripts.

http://userscripts.org/scripts/show/141480

As of now, it just looks at each result and if it's the same as the previous result it hides it.  This means you will get less results displayed on a page than whatever you have it set to.  I wrote a second version that counts how many duplicate domains there are in a row and hides them if there are more than a set limit, but I kind of like the simplicity of the current version.  I will try to use it for a while and see what improvements I could make, as well as if anyone actually uses it.

How to (unsucessfully) reflow the solder on a motherboard

The HDD in my 7 year old laptop died recently.  Todd was nice enough to give me 2 old laptops he had laying around, one of which was much nicer than the one I had been using.  The catch was that neither of them worked.  I managed to salvage the HDD from the one, and put it in my laptop, which is now going strong for another 7 years.

The other laptop was a HP Pavilion dv6000.  When I turned it on the lights came on, but nothing else, no beeps or screen output, then it began to cycle endlessly.  It turns out this is a common problem with that model, due to faulty solders.  There had been much success online with people fixing this by heating the motherboard up hot enough to melt the solder and let it reflow.  As I had my other laptop working, and nothing to lose I decided to try it.

My first step was to disassemble the laptop gradually over a few days without following any guide or taking any pictures.  While taking it apart I kept noting how there was no way I would remember how to reassemble this thing, but I never let that distract me.  Once I had the motherboard removed, I had to remove everything that could possibly be removed.  Of particular importance were the motherboard battery and paper stickers.

Eventually, I had the bare board.  I decided to use my toaster oven as my regular oven is gas, and there seemed to be concern about airflow moving tiny components around while the solder was liquid.  I also read it was a good idea to cover most of the board in tin foil and only expose the parts you want to reflow.  I didn't do this, because there was no tin foil in the first place I looked.  One helpful tip I found online was to put a piece of solder on one of the exposed screw-in pads, and place that where you can watch it.  This serves as a useful temperature monitor.  I put a piece on each forward corner.

I placed it in the toaster oven and set it to toast at 400F.  It only took about 5 minutes for the one piece of solder to melt, however, the other piece remained solid for a minute longer.  I let it sit molten for about 5 minutes, and then shut it off.  Right after I shut it off I heard a lot of crackling sounds.  I suspect this might have been due to the board cooling very fast in the toaster oven, as opposed to a real oven that would have cooled much more gradually.

I let it sit for 30 minutes and then opened the door and let it sit for about 10 more.  I removed it and nothing seemed like it had burst into flames or exploded.  When I lifted the board up I noticed some solder on the pan, in a splatter like pattern.  I also noticed a tiny component that had fallen off.  I tried to match up where the part was and what part of the motherboard had been above it.  I spent about 5 minutes trying to find a spot it could have came from, but to no avail, not that there was any hope I was going to resolder this flea sized thing back on even if I did know where it came from.

Still, I figured it was possible that it would still work without it.  After all, the tinier something is the less important it is, right?

I reassembled the laptop only as far as I figured it would need to be to get any sort of screen output.  I put in the CPU and RAM and connected the power and power button connector.  I pluged it in and turned it on... and... it did the exact same thing as before.  I was somewhat surprised, with that missing part, but then again I guess if the solders were already bad then a missing part was pretty much the same thing.  I guess I should have flashed the bios instead.

I didn't really care, as I had already gotten my laptop working and spent days researching Linux and setting everything up.  But here are some protips for anyone else that may be trying this and actually wants to succeed:
  • I think I should have used the regular oven instead of the toaster oven.  Even with the gas, I don't think it would be a problem, and I think the fast cooling of the toaster oven was worse.  Also, the fact that the two test pieces of solder melted at different times told me that it wasn't a very even heating.

  • I probably should have wrapped the board in tin foil.  Perhaps this would have helped keep that other random part from falling off.

  • I definitely should have opened windows from the start.

  • There was red glue of some sort around the solders on the chipset.  Someone mentioned that you should carefully remove this.  That was probably good advice because it was charred black.

Wednesday, August 15, 2012

Mountain Dew let the internet name its new soda

http://hypervocal.com/news/2012/dub-the-dew-update-mountain-dew-lost-to-the-internet/
Top-voted names for the soda’s new green apple flavor were Hitler Did Nothing Wrong, Diabeetus, Gushing Granny and Fapple.

Thursday, August 9, 2012

With All The Suffering in the World, Why Invest in Science?

http://scienceblogs.com/startswithabang/2012/08/07/with-all-the-suffering-in-the-world-why-invest-in-science/
Before trying to describe in more detail how our space program is contributing to the solution of our earthly problems, I would like to relate briefly a supposedly true story, which may help support the argument. About 400 years ago, there lived a count in a small town in Germany. He was one of the benign counts, and he gave a large part of his income to the poor in his town. This was much appreciated, because poverty was abundant during medieval times, and there were epidemics of the plague which ravaged the country frequently. One day, the count met a strange man. He had a workbench and little laboratory in his house, and he labored hard during the daytime so that he could afford a few hours every evening to work in his laboratory. He ground small lenses from pieces of glass; he mounted the lenses in tubes, and he used these gadgets to look at very small objects. The count was particularly fascinated by the tiny creatures that could be observed with the strong magnification, and which he had never seen before. He invited the man to move with his laboratory to the castle, to become a member of the count’s household, and to devote henceforth all his time to the development and perfection of his optical gadgets as a special employee of the count.

The townspeople, however, became angry when they realized that the count was wasting his money, as they thought, on a stunt without purpose. “We are suffering from this plague” they said, “while he is paying that man for a useless hobby!” But the count remained firm. “I give you as much as I can afford,” he said, “but I will also support this man and his work, because I know that someday something will come out of it!”

Indeed, something very good came out of this work, and also out of similar work done by others at other places: the microscope. It is well known that the microscope has contributed more than any other invention to the progress of medicine, and that the elimination of the plague and many other contagious diseases from most parts of the world is largely a result of studies which the microscope made possible.

The count, by retaining some of his spending money for research and discovery, contributed far more to the relief of human suffering than he could have contributed by giving all he could possibly spare to his plague-ridden community.

Tuesday, August 7, 2012

Astronomy Wallpapers

I was looking for a new wallpaper.  I figured I'd pick something from the APOD, and downloaded a bunch that looked good.  Well I decided to just crop them all, and set up random wallpapers.

I uploaded them in case there was any interest.  There are about 100 all 1440 x 900 (16:10), which I realize is a somewhat uncommon resolution.  They are mostly galaxies and nebulae, but there is some stuff from the solar system too.

Gallery:
https://picasaweb.google.com/DaleSwanson/AstronomyWallpapers?authuser=0&feat=directlink

Download:
http://www.mediafire.com/?3zl3nk4cxxe2493 - 30 MB

Random samples:





Monday, August 6, 2012

An Unexpected Ass Kicking

http://joelrunyon.com/two3/an-unexpected-ass-kicking/

Javascript Color Picker

I made a quick javascript color picker.  There are about a bajillion of these already, but that has never stopped me before.

http://daleswanson.org/things/color.htm

Friday, August 3, 2012

Two Ridiculous Stories

http://www.bbc.co.uk/news/world-us-canada-19112837
A farmer in the US state of Vermont who was facing a minor drugs charge is now in more serious trouble after driving a tractor over seven police cars.
http://www.bbc.co.uk/news/entertainment-arts-19109309
Los Angeles police and rescue crews surrounded the fomer Hannah Montana star's house in Hollywood on Wednesday, while helicopters circled the property. But they soon discovered there was no one in the building. Police say the incident may have been part of a trend of prank calls, which has been dubbed "swatting".