Tuesday, March 21, 2006

It was last Friday night getting around 9:30, and it was time to take our old dog out. It takes us, Lory and I, longer to get ready than Agatha, the old dog. So I opened the front door and let Agatha mosey down the walk while I went into the garage looking for a flashlight and Lory rummaged through the hall closet looking for Agatha's doggie jacket; yes, it was cold this night.

Then, she was gone. Agatha, I mean. I ran up and down the driveway, looked up and down the street, ran through the house, crashed through our bushes. “Agatha,” I shouted. “Where is she?” I shouted again. Still no flashlight, and I gave Lory a penlight from my desk. We went from “Where is that damn dog?” to “Christ, the goddam dog is missing and where is that effing flashlight?”

By 4:30AM we were cold, saddened, and discouraged. We had walked and drove around the inner and out circles of our subdivision several times. We went down the asphalt trail by Rock Creek and took all the muddy side trips, down those slippery trails that ended in piles of trash and in one case an old cracked toilet.

We walked the length of Rock Creek Blvd back and forth several times all the way to Powerline Park. Sometimes we would walk with her that far. but she never went all the way to the park on her own. In fact the farthest she's ever gone on her own is like down our driveway, turn left and the 50 feet or so to the corner, and that was rare. I'd say in the 15+ years we've had her, something like 99.99% of the time, she's sniffed around our front yard bushes or waited impatiently at the foot of our driveway.

Past tense. Nostalgia. She was a good old dog. That was our mood during that last trudge home.

We slept a couple of hours and then walked some more. The animal shelter opened at 11AM and we were right there, reporting a lost dog. We left and then came back because we had put Washington Country for her license and then remembered that we had transferred her to Clatsop because in these, her autumn days, she spends most of her time at our beach house.. There was a woman there who looked at us strangely as if we knew her and had forgotten.

We called the Clatsop pound and yes (wow!) someone had reported finding her. On Route 26, near North Plains around 10PM. There was no way she could get there that fast; someone had to have taken and dropped her. The lady at Clatsop said well, they could be mistaken about where Agatha was found. She then put us in touch with a guy in Rock Creek, and he said he found her around Kiwanda, a few blocks from our house.

And so we drove to his place immediately; he was around Powerline Park. He was waiting outside with another guy, and Agatha was on a brand new leash. She looked good, alert and happy to see us. I put her in our backseat. I asked if we could give him a reward. He said yes, but that's not why he did this; it was cold, Agatha was a dog in trouble, and he was glad to help.

So Agatha is back. We just got back from a walk along Chapman Beach. There was a slight rain. Agatha was wearing her jacket, and I had my hood up. The wind and rain stir up the sand and stings your face.

I was thinking about walking Agatha back in Rock Creek the day after her ordeal. She likes to turn left at the end of the driveway and go down Rock Creek Blvd toward Kiwanda because I think there are more dogs and more smells down that way. But this night she very purposely turned right into the subdivision. Smart dog.




3/21/2006 4:19:38 PM (Pacific Daylight Time, UTC-07:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Monday, March 06, 2006

Last time I included notes I made for the first ten chapters in the book Developing XML Web Services and Server Components with Visual C# and the .NET Framework by Amit and Priti Kalani.

I noticed as I reread these notes for the last study group meeting that I had a bunch of typos. I’ve updated my own copies but I decided not to update the copies on this blog. I mean I will update the copies if they change technically, but not for spelling and grammar as embarrassing as that might be.

I also completed notes for Chapter 11, Security Issues, and I’ve included that file in this entry.

320Chap11.ZIP (1.17 MB)

A while back I ported a testing application from Visual Basic .Net to C#. It’s since mutated much beyond the original port. The application presents questions and multiple-choice answers to the user. You get to take a test and grade yourself. The app reads an Access database for those questions and answers. Here’s the latest version of the app.

In the study group, we’ve copied a bunch of questions from the backs of books like the one mentioned above. We can give away the code for the testing app, but the database contains copyrighted information from books and so we can’t distribute that. I did make up a small database about Cannon Beach, Oregon that I included as a sample.

Below is a screenshot. Click on it to download a zip that contains a Windows setup for the testing program.

 

3/6/2006 2:24:19 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, February 27, 2006

For a little more than a year now (wow that long…) I’ve been reading and studying Web Services, Windows Services, .NET Remoting, and Component Services.

I’ve been meeting online with a couple of other guys. We’ve been reading a book called Developing XML Web Services and Server Components with Visual C# and the .NET Framework by Amit and Priti Kalani.

I like this book; it’s different from many of the other computer books I’ve read. It has a lot of examples, but the difference is more than that. The examples (they call they StepBySteps) are not there to illustrate the concepts; they are the concepts. Want to read about how to use IIS as an activation agent for remotable objects? Well, it’s StepByStep such and such on page such and such. There’s not a lot of text to read. Instead you read the code. And run the code, which is just fine by me. If I have any criticism of the book, it’s the same as my praise. You get good at doing what you want to do, but you’re not that articulate telling someone about it in words.

So you read something else for that skill. But you know, when you’re reading about some concept, you remember how that concept is implemented in a simple, straightforward example. Neat.

So I’ve made a bunch of notes about the Kalanis’ book. They’re really meant for the study group I joined, but if anyone else wants them, here they are. The Kalanis haven’t updated their book since the 1.0 Framework days, alas. My notes point out discrepancies between 1.0 and 1.1, but I make no comparisons with 2.0.

The book has 11 chapters. I have notes for the first 10 here.

320Chap1.ZIP (103.41 KB)

320Chap2.ZIP (855.6 KB)

320Chap3.ZIP (565.85 KB)

320Chap4.ZIP (917.64 KB)

320Chap5.ZIP (455.41 KB)

320Chap6.ZIP (420.13 KB)

320Chap7.ZIP (1.52 MB)

320Chap8.ZIP (1.14 MB)

320Chap9.ZIP (2.24 MB)

320Chap10.ZIP (3.19 MB)

2/27/2006 9:00:24 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Sunday, February 19, 2006

Today I joined to a live webcast a friend told me about.  It was put on by a group of amateur astronomers, but very interesting and professionally done. The title was Advanced Spectroscopy, so I didn’t really know what to expect.

It started off with a description of the speakers amateur setup – some amateur setup! I think there are some colleges that would consider themselves privileged to have such equipment.

Dale Mais was the speaker. He calls himself an amateur but I suspect the only difference between him and a professional is that he gets paid for doing something else. He was very knowledgeable and has published several astronomy papers.

http://www.mais-ccd-spectroscopy.com/

So what’s he doing? Let’s see if I can remember correctly, no guarantees however. Basically, Dale is measuring the emission spectra of  Mira stars, which are red giants and reside on the asymptotic branch of the Hetzsprung-Russel diagram. They’re also called long-period variable stars because their luminosity varies with a period of 100 to 1000 days or so.

He mentioned that contrary to what many popular publications say, heavy elements could come from such stars. Once people thought the Big Bang produced heavy elements and later suggested that they came from supernovae. But he says they can really be made in Mira stars and suggests some nuclear equations. Someone a while back detected an isotope of technetium in such a star (half-life is such that it had to be made in the star; could not be hanging around from formation).

He has an automated setup that can collect data all night long. He said he had 87 DVDs worth of data. Over 3.5 years he detected very few flares and estimates just one every 20 years per star. I guess not having a flare means that measuring emission spectroscopy is not that useful, so he concentrated on photometric measurements. He detected a knee in the luminosity curve of some Mira stars.

I don’t know if luminosity curve is the correct name for this, but I think the graph is like brightness vs. time where time is the period; and so you overlay the graph with each period, and for some stars you see a knee progress to the right and then reappear on the left. Other stars overlay the knee exactly.

Dale and a colleague are currently writing this up, but hoping to find a theorist to help them explain the knee. He suggested something like an oscillation that reflected off a stellar core.

The web conferencing software was www.ivocalize.com . It worked well, but it is not a desktop sharing program. Basically, it allows a presenter to share slides and talk. Attendees can write text messages or talk. Writing a text message seems to be considered more polite than interrupting.

I participate is some other meetings where we really do need desktop sharing. We want to share running programs and do collaborative debugging for example. For desktop sharing, I’ve used www.gotomeeting.com which is excellent. (It’s not free, but certainly affordable for a company, like $50 a month). We use www.skype.com for conferencing audio, which is free.

2/19/2006 3:09:27 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, February 13, 2006

The neat thing about PartitionMagic is that you can repartition your disk without losing any data. It also comes with a utility called BootMagic that runs in its own partition and lets you choose which operating system you want to boot.

You don't have to use PartitionMagic or BootMagic for that matter. There's even a video on the net that describes how to set up a desktop to boot either Windows XP or Ubuntu without using any third-party software; but it also wipes your disk. I decided to keep Windows and use PartitionMagic.

By the way , watch the video if you have time. It does show how easy it is to do this dual booting stuff, but it's also just a lot of fun. It's a couple of guys from West VirginiaUniversity cutting up.

The last section I wrote shows a screen capture of a PartitionMagic screen. It has four primary partitions; a disk can only have four primary partitions.

The first primary is called G:, and it's the BootMagic partition. BootMagic must run from a FAT or FAT32 partition that's at least 50M and starts below the 8G boundary. I made a FAT partition right at the beginning of my hard drive. The next primary partition is called /boot. It's a bootable Linux Ext3 partition and is where I loaded GRUB during the Red Hat installation. It's also where I put GRUB for the Ubuntu installation. The third primary partition is C:, and this is where Windows XP lives. The fourth primary partition contains several extended partitions.

The extended partitions are called F:, /, and /home. F: is a FAT32 partition that I set up to transfer files between Windows and Linux; / is where Linux lives, and /home contains my home directory and the directories of any as yet uncreated users. I wanted to separate my own files form the system files, thinking that I can upgrade and reformat / but leave /home alone.

When I installed Ubuntu, my Windows partions appeared mounted, apparently by default. They were called hda1, hda2, and hda5. hda1 is the BootMagic partition, and there is little of interest for me there when I am in Ubuntu. hda2 is C:, and it gives me access to all my Windows files. Unfortunately, I have to be root to access hda2, but I can copy a file and then chown , chgrg , and chmod to make it accessible to my non-root user. hda5 is F:, and I do not have to be root to access this partition. If there's a way of getting non-root access to C:, then I don't need F:.

So Ubuntu comes up pretty easily. I choose a custom installation, but then took most of the defaults. I did choose not to put GRUB (The Grand Unified Bootloader). I chose to put the bootloader in the first sector of /boot and not in the MBR, the Master Boot Record. If I put it in the MBR, I would overwrite PartitionMagic’s BootMagic loader. Red Hat wanted /boot to be placed before the 1024 cylinder limit. It still is, althugh I don't know if this is important for Ubuntu. Anyway BootMagic works as before, and I can choose to boot either Windows XP or Ubuntu.

You can customize the Ubuntu desktop  to look however you like, but the default is a brown, earthy motif that looks neat. I clicked on Evolution and easily configured email to work. It was very much like an Outlook configuration, and Evolution reminds me of Outlook, It's probably heresy to say that. I'm sure Linux people can point to lots of new features, but I use it in much the same way as Outlook.

The default Ubuntu installtion does not include gcc. A Linux installation without a compiler, I was shocked, but then when you think about it Windows XP doesn't come with a compiler. I wonder if that statement is still true. I mean if future Windows installation  come with the Framework , doesn't the Framework come with a command line C# compiler? I don't know, but Ubuntu does come up with no C++ compiler. This may have something t do with the requirement that the installation fit on one CD.

Getting and installing a C++ compiler is not difficult. Searching for Ubuntu and gcc, I came across a forum entry where someone was complaining about having no gcc and the response was, well, just type sudo aptitude install build-essential . First of all that didn't work for me because I din't know how to confiugre sudo (more on that later), but I just became root and typed the command without the sudo and gcc got installed. And here's a screenshot showing how gcc can compile a helloworld program.

gcc

I really want to have some kind of IDE and decided to try out Eclipse, which is what people tell me they use. But before trying to install Eclipse, I wanted to solve two related problems.

First, when I click on “Add Applications”  in the Applications menu, I get a box asking for a password. If I give the root password, I get an error. If I give my own password, I get no error, but nothing happens. The actual command line for “Add Applications” is /usr/bin/gksudo /usr/bin/gnome-app-install . I can get the Application editor running by becoming root and typing just   /usr/bin/gnome-app-install . So the second problem is that sudo was not working for me.

I discovered that sudo must be configured. I think this is probably an obvious thing to most Linux users, but it's not something I had come across before. The way sudo works is that you get a prompt for a password and you give it your own user password, not the root password. Then, if you are one of those special users allowed to run root commands, you run the command on the sudo line and then you can be root for some configured length of time like a few minutes. gksudo is a frontend to sudo that lets you run graphical commands like “Add Applications.”

To become one of the special users allowed to run root commands, you have to edit the file /etc/sudoers. You have to become an sudoer. If you become root and open the file with vi , you open a read-only version with a warning that you should use the command visudo to edit the file.

The syntax of the file is straightforward. All the information you need is in the manpage, but on first reading I found the manpage confusing. Lots of information about syntax and little upfront about how the feature actually works. I pulled out one of my old Linux Administrator books (still in print too, check out Amazon), Red Hat Linux Administrator's Guide by Kerry Cox. Yes it has a lot of Red Hat specific stuff in it, but the section on sudoers is generic enough and well-written. What I did was add a user alias specification  User_Alias IT=ted  followed by a user privilege specification  IT ALL=(ALL) ALL. This lets any user in IT (just ted so far) run any command on any host as any user.

 

 

2/13/2006 5:33:44 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Sunday, February 12, 2006

A few days after installing Ubuntu, I took my Ubuntu CDs and my laptop to my local library. It's a small library in the Tanasbourne Shopping Mall; it sits between Pasta Pronto and Beard's Framing. Unlike Starbuck's or Barnes&Noble, the wireless connection there is free.

I'm old enough to remember when libraries were quiet places with tables, chairs, and books. The carrel where I can plug my laptop in is next to the children's video section, and pre-teens with their Moms whisper and chatter and seach through the shelves behind me. There is a quiet place in the library, but there's no electrical outlet there.

I had arranged to meet a friend there. I used to work with Shannon years ago. I had 128M of extra laptop memory that I offered him in an email, and he said he'd bring both his laptop and his wife's in and check if the memory was compatible. I was using a Dell Latitude D800 that I bought with 2G, its max, but I had upgraded my IBM Thinkpad R40. Windows says it runs with 128M, but it's really slow. I think if I had known it had only 128M, I would have added memory a long time ago, but I kept thinking it had 256M, and Windows should run fine with that.

But when I noticed it had 128M, I bought two 512M DIMMs, one for each of my two memory slots. The manual says the R40 maxes at 1G, so I was reluctant to try a 1G DIMM. Anyway, the IBM runs nifty now with 1G, and I had that 128M DIMM free to a good home.

Shannon came in with a screwdriver and two laptops, and gave him my wrist strap, and while he hunted for a place to clip it, looking suspiciously at a metal outlet plate, I booted Ubuntu from the Live CD and showed him its Display Manager. He said, how can you save any files that way and I thought why would you want to, it's a demo to check out drivers, but I later thought you might be able to mount an external drive, possibly even a partition from the laptop's internal drive.

Back home (this is jumping ahead I know) I have a Dell workstation that can boot to either Windows XP or Ubuntu. Ubuntu has automatically mounted the Windows partitions (I even have icons on my desktop), but these mounts are unfortunately only accessible by root. What I can do, though, is open a terminal window, become root, cd to the mount, and copy files to my home directory, careful to both chown and chgrp back to my non-root user. This partitioning is the same I used when I dual booted between Windows XP and RedHat 9, except then I had what I called a transfer partition, formatted as FAT32, that I manually mounted. I had read that Linux had difficulty reading NTFS; that why I made that FAT32 transfer partition. However, Ubuntu seems to have no difficulty reading NTFS, and I don't have to manually mount the Windows partitions.

So, I don't know, but it may be possible to boot from the Live CD, mount a Windows partition and save files.

Shannon asked how you take out the memory card, and I muttered something about clips. I was preoccupied because Ubuntu was not recognizing my internal wireless card, and I kept poking through network configuration screens. I saw Shannon out of the corner of my eye trying to pry the memory out with a screwdriver. “I'm not sure that's a good idea,” I said and reached over to pop the clips with my fingers. He brushed my hand away; well, after all, he was the one wearing the grounding strap. It was a bust anyway; it turned out that both of Shannon's laptops were a few years old, and my memory fit in neither.

About not finding the wireless card. The wireless connection in the library is somewhat unstable. I don't know why and neither do any of the library clerks. About every hour or so, you lose the connection; but then, if you just wait, the connection comes back. Someone once suggested that it might be due to interference from a 2.4 Ghz phone, but it seems more likely that the access point periodically reboots itself. I checked with one of the librarians, and she assured me that the library did not perodically boot people off their Internet connection and that she had no idea what was causing the problem.

But this is a different issue than Ubuntu not finding the wireless card. The card in my Dell, although identified as a Dell Wireless WLAN 1350 is actually a Broadcom card, and Broadcom refuses to release specifications and drivers to the opensource community. The result is that for Linux to work with this card, you have to use a utility called ndiswrapper, which as I understand it is essentially a windows emulator for wireless drivers. The only way to access those closed-source drivers is to make them think you're a Windows machine. The other alternative is to use an Intel/Cisco wireless card, which is what I actually ordered when I bought my laptop, but it came with the Dell card, and it was cheaper and for months it worked fine. There is an opensource reverse-engineered project called bcm43xx, but it'll be some time before it produces any results.

I don't want to put Ubuntu on my laptop anyway. I do a lot of Windows work on it, Visual Studio, SQL Server, Virtual PC. It's full of sample programs and documentation. I take it with me to meetings about Windows. I decided to put Ubuntu on a Dell workstation I had at home, a Dimension 2350.

I was still thinking about whether to dual boot or not and didn't decide until right up when I was putting in the Install CD. It wasn't so much that I wanted another Windows machine; I just thought that if for some reason the Ubuntu installation failed, I'd have an unworking machine and would have to reinstall Windows, which is not only time-consuming but I worry about all that activation nonsense. My original Windows CD is pre-SP2, which could mean a series of time-consuming updates.

The last time I loaded Linux, I partitioned the drive with PartitionMagic. I decided to keep that partitioning. Here's how it looks.

partitioning

 

2/12/2006 8:34:12 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Saturday, February 11, 2006

I'm using dasBlog as my blogging software and have noticed an interesting anomaly between runnning it locally and running it on my Web hoster. The dasBlog on my Web hoster consists of the very same files that I built locally. I ftp'ed these files to my Web hoster.

I  add images by ftp'ing the image to my content directory and then using the "Insert Image" button. I see a different menu screen when I run locally than when I run on the Web hoster. I think the menu screens should be identical -- or at least I don't see a reason why they shouldn't.

Here's how the menu screen looks locally...

local button

Here's how the menu screen looks when I run on the Web hoster...

remote button

2/11/2006 3:07:48 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, February 08, 2006

I have a friend who’s working on a game engine in his spare time. I think it would simulate this experiment well. The experiment is  not technically a game, but it exhibits many game characteristics. Although three dimensional, the motion is in two dimensions.

There are simulators for this experiment available on the net. One is obviously Java; I don’t know what the others are.

The mathematics may at first appear a little complicated, but it is actually a lot simpler than a real game I think. The complication arises from having to understand the gravitation and electrical forces involved for the simulation to make sense and from having to manipulate the equations to get a numerical result.

The experiment is tedious to perform in real life. It takes a long time to collect a little data; and the effort involved does not improve understanding. It involves a lot of squinting, focusing, and luck. I think it’s an experiment ideal for a simulation that would produce realistic data that you can then analyze.

Here’s a quote from an MIT lab manual. The timing measurements are like a video game in which practice makes perfect. N repetitions of any given measurement will reduce the random error of the mean in proportion to N1/2.

 http://web.mit.edu/afs/athena/course/8/8.13/JLExperiments/JLExp_02.pdf

Background

The Millikan oil-drop experiment is a famous experiment done in 1909 that measured the magnitude of the charge on the electron. It works because the oil drop is so small that the change of one charge makes a noticeable difference. The experiment is a typical high-school or freshman physics lab. Millikan got the Nobel Prize in 1923 for this work.

You get an atomizer filled with oil, spray the oil as a mist into a two-level chamber. The drops fall through a little hole into the lower chamber.

Here’s a schematic picture from http://www68.pair.com/willisb/millikan/experiment.html 

 

schematic Millikan

 

Although the figure below does not show it, Millikan, pointed an x-ray source into the lower chamber to charge the drops. The lower chamber is between two capacitor plates. The drops are small enough that you have to use a microscope, and you often illuminate the lower chamber with a bright light (also not shown in the figure,)

This is more or less how Millikan did it. Today, people fill an atomizer with tiny latex balls, often have just one chamber, and skip the x-rays. Instead, you let the drop get its charge from rubbing against the nozzle of the atomizer or from encounters with stray charges left in the air by cosmic rays.

Here’s a photo from http://www.juliantrubin.com/bigten/millikanoildrop.html of Millikan's actual apparatus.

 

Photo Millikan

 

The experiment consists of varying the voltage (hundreds of volts) until you can get a drop to be rising at a constant rate. The distance between the plates varies from about 0.5 to 2 cm. More on the equations later.

There exist some simulations on the net. The URL http://www68.pair.com/willisb/millikan/experiment.html has the nicest one I’ve seen. It’s two-dimensional and a Java applet. That bottom line always reads 0V; I think it should increase as you increase the electric field. Here’s how  it looks.

 

simulation Millikan

 

Here’s a website that describes a version of the experiment using latex balls, one chamber, and no x rays.

 http://www.phy.davidson.edu/StuHome/MiLee/JLab/Ex4/title.htm

 You can buy an apparatus that makes the experiment easier and more reproducible. It even has a connection that allows you to project what the microscope seen onto a screen for an entire audience to see

 http://store.pasco.com/pascostore

The Experiment

Time the trips an oil drop makes over a known distance at various voltages. The falling velocities ud (in the absence of voltage) are all the same because the oil doesn’t evaporate (early versions in Millikan’s lab used water droplets) and hence the weight is constant. The rising velocities (the drop rises when you turn up the voltage) vary with the charge q (which we know, but the experiment proves is an integral number of electronic charges, ne.)

The Equations

The symbols here all represent positive quantities so that the signs are explicit.

The force on a falling oil drop is

equation 1

 equation 2

 

where w is the drop’s weight due to gravity, B is the buoyant force of the air and kud is the air resistance, which depends on the velocity. ud is the downward velocity where the d means down. At terminal downward velocity the force is zero; the buoyant force and the air resistance exactly compensate for the weight. Note that the resistance is opposite to the weight because it is always opposite to the motion, and the drop is falling.

The force on a rising drop is

 equation 3

 equation 4

 

Note that in this case the weight and the air resistance have the same sign because the drop is rising and the air resistance is opposite to the motion. Also the velocity is a constant upward velocity so the subscript is u.

Replace w – B with kud and solve for q and you get

 

equation 5

 

This looks deceptively simple. You set and measure the voltage V and measure the velocities. The electric field E is V/s where s is the distance between the plates. Fringe effects at the edges of the plates are negligible so the complication does not arise from that.

The complication comes from getting k, the Stokes constant. It depends on the radius of the drop and the air’s coefficient of viscosity η,

 

equation 6

 

First of all we don’t know the radius of the drop. We do know it’s small, so small that the  equation above needs a correction because the radii of the drops is of the same order of magnitude of the mean free path of an air molecule which is 2.2 x 10-6 cm.

High school versions often ignore these complications. You can read how to deal with them in an MIT lab manual at http://web.mit.edu/afs/athena/course/8/8.13/JLExperiments/JLExp_02.pdf

 

 

2/8/2006 1:03:28 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  |  Trackback