New Computer - Network setup

In rebooting my computer about 20 times while trying to install my printer, one thing that was driving me nuts was that every time, the network setting would reset and I’d connect to some random neighbors wifi point instead of mine.

I was going to get mad and uninstall the built in software from Acer, but instead found the solution. I had never joined the computer to my network.

When you add a wireless router, you either use the default name (”Linksys”) or you set your own network name.

On your computer, and this is true for Windows XP and Vista, you need to join the computer to this network to see other computers on it. (You don’t need to do this to connect to the access point to surf the web.) Since I have other computers and my printer on my network, this is kind of important.

In Windows Explorer, go to “My Computer”. Right click on it to bring up properties.

In Vista, this will bring up a page giving computer info. One of the sections on it is “Computer name, domain, and workgroup settings”. In this, click on the link to change them. (In Windows XP, you won’t see this, it goes directly to the properties.)

One of the tabs on the properties is “Computer Name.”

Click the button to rename the computer name.

In the box for Workgroup, enter your name (or the default name from the router).

Click OK. You’ll need to reboot.

Presto, now you can see the other computers on your network. And in my case, now the computer is saving my network settings and connecting my correctly.

The default software installed by Acer is safe for another day…

Vista - issue installing HP All-in-one printer

On my new computer, (Acer Extensa running Vista Home Premium), I needed to add my old printer. It’s an HP all-in-one, HP 7200, connected through my network.

First, I tried running setup under my standard user account. No-go, need to run in the administrator account, since the setup doesn’t recognize “Run As…”.

Okay, log in under the admin account, and I still get the error.  Strange. Reboot to make sure everything is cleared out, but still have the same problem.

So, go to Control Panel, choose “Programs”, and try installing from there in compatibility mode.

Click through the default, and make sure “Run this program as adminstrator” is checked on one of the screens. (I choose to run it as “Windows XP SP2, since I know the printer installs on that.)

Looks like this works, but after a few minutes, there is an error finding the drivers:

(Error is “Now Launching=x:\hpzpr101.exe -m preloadproductdrivers -ll… SetupCopyOEMInf (X:\hpzius12.inf) failed. error 0×2…)

It goes through some stuff about analyzing, the uninstalls everything and says it needs to reboot to complete.  Bad design here, it forces you to reboot, there there no “Cancel-Reboot later” option.

Guess it’s time to try Google. Eh…too much junk. Go to HP.com. Search for the printer, look in support and drivers.  Eventually, you get to a page that installs the driver. You’ll hit the Vista protection thing that makes sure you want to continue…then you wait, since it’s a 163 meg download. (HOLY MOSES! Whats in this driver?)  Do yourself a favor and make sure you click the “Save for Later” option instead of “Install Now”. If you have to reboot, the temp file may be erased. (I learned this new feature of Vista the hard way.)

Woohoo. This program works. However, being a new computer, it wasn’t part of my home network. So, go to My Computer->Properties->Computer Name.  Choose change, go to the workgroup and add myself to my home workgroup. Unfortunately, Vista requires a restart, which means starting the whole setup over again.

Okay, a couple hours of work (mainly spent waiting for downloads and rebooting), I have a working printer.

Question of the Moment - declaring variables and including the type

[intro to "Question of the moment"]

I’ve been a VB coder for years. I like it. Heck, I started programming in basic in 6th grade, when a friend and I used to sneak into the computer labs at the local university and try to do stuff on their system. (It was a VAX terminal hooked up to a mainframe or mini computer. I don’t recall all the details.)

At work, there’s been a lot of talk about converting everything to C#. So, since working on C# has been on the to-do list for quite a while, I’ve started working in it too. After about a week, it’s actually pretty easy to make the switch over from VB.Net. But then, most of my work is relatively straightforward console apps.  Now, to make sure I know what I’m doing, I picked up a couple books from the library and started going through them.  As I see things that seem interesting at any particular moment, I’ll post the topic and try to discuss it. I welcome any feedback.

[Today's questions]

A sample was given of declaring some decimal variables:

decimal d1;   //sample 1 - good
decimal d2=50; //sample 2 - better
decimal d3 = 50M; //sample 3 - best

The problem with sample 1 is that you need to take the time to set d1 to a value later on. Might as well just do it now, as sample 2 shows.

The interesting one is sample 3. Does having the value explicitly entered as a decimal type make a difference. (That’s what the “M” does.) In memory, d2 may be equal to 50.000001, whereas d3 is definitely set to 50. No possiblility that their is a hanging decimal place way out in right field somewhere.

That’s what I’m interested in. Does it really make a difference?

Throwing together the simplest example possible (only key stuff included here):

 decimal d2 = 50; //sample 2 - better 
 
decimal d3 = 50M; //sample 3 - best 
 
Console.WriteLine(“Sample 2: {0}”, d2); 
 
Console.WriteLine(“Sample 3: {0}”, d3);

Gives a output of:

Sample 2: 50
Sample 3: 50

Looks like there is no difference.  Now the interesting part.

Go open a Visual Studio command prompt, navigate over to the sample program, and open it up in ILDASM. Double click on the Main method to see the disassembly.  Looking at the two lines of declaration, looks like they are the same:

//000013:             decimal d2 = 50;    //sample 2 - better
    IL_0001:  /* 1F   | 32               */ ldc.i4.s   50
    IL_0003:  /* 73   | (0A)000010       */ newobj     instance void [mscorlib]System.Decimal::.ctor(int32)
    IL_0008:  /* 0B   |                  */ stloc.1
//000014:             decimal d3 = 50M;   //sample 3 - best
    IL_0009:  /* 1F   | 32               */ ldc.i4.s   50
    IL_000b:  /* 73   | (0A)000010       */ newobj     instance void [mscorlib]System.Decimal::.ctor(int32)
    IL_0010:  /* 0C   |                  */ stloc.2

 The lines in blue look identical to me, showing that the value is saved the same way each time.

Now, lets make it a little more interesting. lets set d3 to 50.0M to see if that makes a difference. Looking at the IL, it does something:

//000014:             decimal d3 = 50.0M;   //sample 3 - best
    IL_0009:  ldc.i4     0×1f4
    IL_000e:  ldc.i4.0
    IL_000f:  ldc.i4.0
    IL_0010:  ldc.i4.0
    IL_0011:  ldc.i4.1
    IL_0012:  newobj     instance void [mscorlib]System.Decimal::.ctor(int32,
                                                                       int32,
                                                                       int32,
                                                                       bool,
                                                                       uint8)
    IL_0017:  stloc.2

Woah! something else is going on now. A quick search on Google led me to this discussion. Sounds like the Decimal overload is being used to ensure the decimal places aren’t lost, since the declaration is explicitly stating that there is a decimal place. (Gee, does that sentence even make sense?)

Where does that leave us? I don’t know.  As I get to know some of this better, maybe I’ll be able to make more sense of it.

There was some more interesting reading here, and it shouldn’t be hard to find addition resources for this.

My new laptop computer

I just got a new laptop. My trust Compaq V2030US, that’s around 4 years old has been cleaned off, and will be used for travelling.

My new bad-boy is an Acer Extensa (model 5620-4801). It came with 3 gigs ram, 250 gig HD, a nice big 15.4 inch screen, and a web cam. One thing I like is the keyboard is slightly curved, to make typing a little easier.

It came with Vista Home Premium on it, which I’ll leave for now. I thought about loading up Vista Ultimate on, but looking at the difference in features, I’m not interested. (And yes, I would have a legal copy of it. :) The big thing that Vista Ultimate has is Bitlocker. This encrypts the harddrive. Instead of this, I use Truecrypt (which I’ve now installed, version 6, which went without a hitch).

The first thing I always do when I get a new computer is make a backup! This is important! Computers these days don’t come with restore disks, and so it’s your responsibility to make one. Do it! Even if you’re going to wipe the computer and put your own stuff on. You’ll want to be able to get drivers and restore to factory defaults if you need to. (Okay, that does it for the public service announcement portion of this entry.)

Okay not sure what else to say at this point. Here’s some basics:

  • Ran Prime95 stress test for a day. I should probably run it some more.
  • The HD is partitioned into a data and system. Cool, but setting software to use it is a hassle.
  • So far, my photo processing (converting RAW to jpg) is a heck of a lot faster than the old computer.
  • I’ve started uninstalling the preconfigured stuff, but have decided to keep some of it just to see if it’s handy.

 Well, that’s about it for now. If I think of something else to say about it, I will.

The Disk Project – Disk 1

Way back in the day, I read “Soul of a New Machine”, one of the classics for people interested in computers. It tells the story of building a machine up from scratch, programming the chips and designing the architecture. It was fascinating stuff, and of course, as kids will do, I decided that’s what I wanted to do. Hardware programming is the path for me.

 

Now, 20+ years later, I still have this dream of working at the hardware level, writing microcode and stuff like that. But I realize, that’s not the skill set I have, and sadly, don’t see myself picking it up. (Although doing some embedded programming on smaller chips is something I’d like to try one of these days.)

 

Over the last few years, I’ve had a number of hard drives fail on me. It’s rare that I’ve lost important data, but the fear is there. Recently, I was talking to a friend (who we’ll call P) who had years worth of family photos and his whole music collection on an external drive that failed on him. While I wouldn’t call it a panic, he was a bit stressed out. So, I thought, I have an interest in hardware, and I know enough to recover my own disks, let me give it a try.

 

And so, The Disk Project is born. The project is to attempt recovering data off failed drives using readily available tools. I’m not going to build a clean room and try to swap out platters, but simply use various pieces of software to try to get stuff off the drives.

 

My first disk, a Western Digital 160G USB external drive wouldn’t respond when plugged in. My first though was that the USB cable seemed really loose, so maybe that connection was bad. I took the disk home and tried another cable, but still no response.

 

Okay, guess I’ll try cracking open the case to see if I see a blow fuse or something. After talking with P to confirm his data was important, not the hard drive casing, and making a few jokes about using my Dremel, I attempted to open the case. It looks very well sealed, but if you look at the back, there are a couple notches that looked promising. So, using a very specialized tool (“no honey, butterknives are meant to be used for this”), I was able to get the case open. And heck, I think it will re-assemble as stay together with no more than a single piece of duct tape.

 

Visually inspecting the PC board, I didn’t see anything obviously blown out. A multimeter showed that voltage was still getting through okay. That’s okay, it’s not like I was planning on soldering anything on anyhow, but it’s always good to play with my toys.

 

So, the next logical step: connect the drive to the slave cable on my desktop. After slapping a jumper on it to make it a slave, the next hardest part of the project: extracting my computer from my desk and putting the drive in. 20 minutes later, I’m ready.

 

I hit the power.  BIOS recognizes the drive.  Windows loads, and presto, it shows I now have another hard drive.

 

Three hours of moving the data to a spare external drive I have brings this project to a close. The disk can be recycled with a new drive enclosure, but P has volunteered it for the next project instead. (He’s buying a bigger external drive, since this one was about filled up.)

 

Next up…using the spare drive to replace a damaged drive in a Tivo.

 

Hello world!

Welcome to Tech @ GoneSomewhere.

I’ve played with the idea of this blog for quite a while, since there’s occassionally the bit of technical know-how or interesting piece of software that I want to share, and I’ve lacked a place to put it. Well, the good news is, the place now exists.

My plans include:

  • Code Samples and projects
  • LInks to other coding stuff that I find interesting
  • Anything else of a technical nature that doesn’t fit into my regular blog.

Note that at work, I’m a Visual Basic developer, so the majority of what you see here will probably be coded in VB. I do a lot of SQL too, and the occassional bit in C#, so we’ll see where it takes us.  

My particular area is EDI, which roughly means, I work on moving data around and rarely make fancy web pages and Windows Forms…Most of my work is hidden as console applications and Windows Services. Sure, it’s not glamourous, but really, who needs it to be?