Wednesday, April 27, 2011

Copy Your Hard Drive with Windows 7

I got a new SATA hard drive and decided to make it my primary drive. My current hard disk was IDE and was pretty old, so the decision made sense. But I really didn't want to reinstall everything, so I looked into copying the old hard disk into the new one. This is called Disk Cloning and there are lots of programs that do this. I just wanted the easiest way.

I first looked into Hiren's Boot CD because I had used Hiren's Recovery Tools before. You burn a CD, boot from it, and one of its tools clones the hard drive. I was too lazy to create a boot CD, so I read on. I read about Clonezilla, Aconis (not free), and Paradigm (maybe free?), which all required you to make a system image (a file that's a snapshot of a hard disk), but ultimately decided I didn't want to look into third party software if possible. (It takes me a while to read enough to convince myself that third-party software isn't going to mess up my computer and is going to be user friendly enough to use.) I'm using Windows 7 and read that the built in Backup and Restore program worked well. I didn't have to download anything or burn anything, so I decided to try that first.

To use it, you need:

  • The Windows 7 Installation CD (or you'll need to create a system repair CD)
  • Your original hard drive
  • Your new hard drive
  • And some other storage system (DVDs/External Hard Drive/Internal Hard Drive) to store the image of your original hard drive.

WARNING: The new hard drive and other storage system must be at least the size of your original hard drive. The other storage system CAN NOT be the new hard drive.

To use Windows 7's backup and restore tool:

  1. Go to Start Bar -> Control Panel -> Backup and Restore -> Create a System Image
  2. Choose where you want to store the image and press next
  3. Choose the drive (the other storage system) you want to back up and press "Start Backup"

It took about an hour and a half to create a backup image for a 200GB system. When the backup is done, shut down your machine.

THIS IS IMPORTANT: You now need to unplug the power to your original hard drive (or otherwise remove it from your system.) Your new hard drive and other storage system must remain accessible.

Then boot from your Windows 7 Installation CD (or a system repair disk.) You'll get the Windows 7 Installation Menu. Choose your language, then choose "Restore from System Image."

The system image you just made should already be selected. Choose it and press next.

By default, the system restore program will take every hard disk on your system (except for the one holding the system image), delete it, format it, and restore the system image on it. So make sure to exclude any hard disks you don't want to be replaced on the next screen, then continue.

When I first tried this, I got an error that said no suitable disks were found. I wasted half an hour trying to figure out what was wrong. I ended up needing to cancel, select "Command Prompt" from the tools menu, and then doing the following:

  1. Type "diskpart"
  2. Type "select disk=disk0"
  3. Type "detail disk"
  4. (Read the output and make sure this disk is the new hard drive)
  5. Type "clean"
  6. Type "exit"

Select "Restore system from System Image" and this time there hopefully won't be an error.

Your system should restore and you should boot up into windows (you may need to go into your system BIOS to make sure your new drive is set as a boot device.) You can shut down the computer and plug your old hard disk back in if you'd like to continue using it for storage. Make sure it's not your primary boot device in BIOS! If windows doesn't show the old drive, you may need to right click "My Computer", select "Manage", select "Disk Management", and then right click your old drive and select "Online."

When I finished switching my primary drive, I brought up my Windows System Rating. Up to a 5.9 ... ... ... ... it makes me want to upgrade my machine more. Microsoft and your achievement points.... *sigh*

English Challenge

While I was in Taiwan, I would meet with Taiwanese students to exchange language. I'd help them with their English for an hour, then they would help me with their Chinese for an hour. It was a lot of fun.

Before doing it, I didn't fully realize how difficult a language English was. The grammar has so many special cases and confusing rules. Just being able to read a word doesn't necessarily help you with its pronunciation, there is a lot of memorization. Case in point, try reading this poem named Chaos: http://www.hep.wisc.edu/~jnb/charivarius.html

I still think English is easier to communicate in than Chinese. Even if you mangle the sounds up or use very messy grammar, you're still understandable... you just sound like a foreign speaker. If you mangle Chinese sounds or grammar, there's a good chance you won't be understood.

Tuesday, April 26, 2011

Taiwan Visa and Visa Extension

So, I went to Taiwan over the summer to study Chinese. I'm American and I was there for a little more than three months, which means I needed a Vistor Visa and that I needed to extend my Visa while I was there.

I live in California, San Diego. The nearest Taiwan embassy was in Los Angeles (which is about a 2 hour drive away) and I didn't have enough time to do my Visa through mail. The embassy is only open on weekdays, so I chose a day and drove through traffic to get up there. The office was not too easy to find. It's on the 4th floor of some huge building with a bank of the first floor. The visa application process itself was a lot smoother than I expected and the line moved pretty quickly. As long as you have your passport and proof of a reason to need a Visitor Visa, you're good to go. You do need Passport Photos, but you can take them once you're there. You can make free copies of documents there as well.

I expected them to have to mail the visa back to me, but it actually only takes a few hours to process. So I went out to lunch and picked up my Vistor Visa before I left LA. You have the option between a single visit and multiple visit visa. A multiple visit visa allows you to leave the country during your stay without voiding your visa. I got the single visit visa because it was faster to process and slightly cheaper. In the end, I wish I got a multiple visit visa so I could have taken weekend trips out.

The Visitor Visa is only valid for about two months, so if you're going to be there for longer than two months, it needs to be renewed from Taiwan. (Multiple Visit Visa will be renewed automatically if you leave the country and come back.) Renewal is free and I believe you can keep renewing it for about two years as long as you can prove a need for it. I think you can renew your Visa as early as a month after arriving in Taiwan, although I waited until the week before expiration. Renewing your Visa is free, the process is immediate and only takes 10 minutes or so once you make it to the front of the line. The attendants all speak enough English to get by if your Mandarin is really bad. The only problem I had was trying to renew my Visa at Taipei City's Office instead of Taipei County's Office; I didn't realize I was living in Taipei County. The Taipei City office is really easy to find. The Taipei County office is a bit more difficult to find, so leave yourself a lot of time if you have to go there.

If you have a multiple visit visa, renewal is much easier. Just leave the country and when you come back, it will be extended for you. One of my classmates extended his visa this way.

Monday, April 25, 2011

CLD Program Impressions

I attended the CLD Program at NTU (台大) over summer 2010 and I thought it would be useful for people considering the program if I wrote my impressions about it. I'll just write about my experiences and you can make of it what you will.

First, my background. I'm currently 27 and am studying Mandarin for purely personal reasons. I basically want basic conversational skills and good listening comprehension. Although I've previously studied French and Japanese, I'm only fluent in English. Before going to Taiwan, I self-studied Mandarin college textbooks, listened to audio tapes, and practiced conversational skills with my wife. I decided to go to Taiwan in order to strengthen my foundational skills so I could study more effectively with my wife at home. After reading about several programs from forums and other people's reviews, I decided to attend NTU (台大) over NTNU (師大), and then the CLD Program over the ICLP Program. I'm very happy with my choices.

The application process was simple. My application probably didn't get to them until the day before their "deadline", but I got in anyway. It only left me with a month to prepare for the trip, the main hassle being getting my visa. CLD doesn't offer any housing, but that wasn't a problem for me because I already had a place to stay. I had classmates that didn't take care of housing until after they arrived with very little hassle, although their rent tended to be more expensive than those that planned earlier.

The CLD is located on the NTU campus on the second floor of the language center (語言中心.) It was very easy to find, even though I'd never been to the campus before, as there are plenty of campus maps. NTU itself is very nice. The campus is beautiful and has a large library that's great for studying in. The cafeteria near the language center (in the 學生活動中心) is pretty good. There's a lot of stores, housing, and restaurants within five minute walking distance of the campus... finding things in Taipei in general is really easy. On the bottom floor of the language center is a bulletin board that makes it very easy to find language exchange partners. Finding an native speakers to practice with is very, very important if you want to really learn Chinese.

New students are required to show up at NTU a week before classes start in order to register and take a placement test. Registration went very smoothly and the staff was very nice. The optional placement test had no time limit. The first part was a written test broken into three sections. The first section was correcting grammar, the second was answering reading comprehension questions, and the third was writing an essay. The first two sections were graded immediately, after which I was sent to a different room for an oral test. A teacher looked over my results, read my essay, and then talked with me a bit in Mandarin. Afterwards, the teacher placed me. My Mandarin was very limited and although I could read many characters, I could barely write any, so I was just happy to not be placed in the lowest class. Although I didn't realize it at the time, you can buy your books from the CLD office at this point since you know your class level.

On the Friday before classes started, we had an orientation. The orientation was pretty useless, but only took an hour or two.

I bet the program quality really varies based on your teacher and classmates. I feel my teacher, 蔡美雲, was excellent. My classmates were also very good and hard working. We all refused to speak English to each other, even though we often spent time together outside of class. Their ages varied between 22 and 37, they came from all over the world. I had 5 classmates total. By looking at the class list, it seemed almost all classes had the full 6 students.

The program itself was basically working through the Practical Audio and Visual Chinese textbooks. (Although the most advanced classes moved on to different texts.) My class started at Book One Chapter 6 and ended at Book Two Chapter 8. We covered a chapter every three or four days. It seems all the classes working on the Practical Audio and Visual Chinese textbooks covered about one book in the three months.

Each day we had class for three hours. Only Mandarin was spoken. Homework takes at least half an hour if you rush through it, but it's much better if you spend more time on it. My teacher would correct whatever I wrote, no matter if it was assigned or not. After getting the introductions and review done, classes basically followed a four day loop.

- First Day -
Give an oral presentation. Usually this was reciting a memorized essay from the textbook.
Take a test over the previous material. This usually took one and a half hours.
Begin learning the vocabulary for the next chapter. The teacher would add many comments and the students were required to form sentences using the vocabulary.
Homework: Practice writing the new vocabulary words.

- Second Day -
Listening and Writing test. The teacher would say a sentence twice and the students must write the pinyin and Chinese characters for that sentence.
Finish the vocabulary and begin going over the grammar.
Homework: Write sentences using the vocabulary

- Third Day -
Listening and Writing test.
Finish going over the grammar.
Homework: Do the Workbook chapter, which is grammar and writing drills.

- Fourth Day -
Listening and Writing test.
Role Play situations, practice listening to dialogs, and work through more examples.
Homework: Write an essay.

The main benefit in all this is the teacher's guidance. In addition to the teacher pointing out gotchas, she also constantly corrected errors, whether in speaking or writing. I felt she did very well in pointing out problems I hadn't noticed by myself and explaining problems to me my wife was unable to explain clearly. I felt I learned a lot in the three months I was there. The program is what you make of it.

As a side note, to help make the most of my short time in Taiwan, I also had one on one Mandarin lessons on the side. My teacher was Peter Su and he was really excellent. His times and lessons were very flexible. These additional lessons allowed me to learn the subjects I wouldn't be able to cover during my short stay in the CLD program. I'd definitely suggest looking him up for some one on one lessons, here's his web site: http://petersonsu.blogspot.com/.

Thursday, April 21, 2011

PS3 Controller on PC

(This was actually a really old post, which I dredged up so I could add a notice mentioning MotionInJoy, which I'm currently using. It has a lot of options and works perfectly on Windows 7 with no problems. It shows ads, but I'm pretty sure it doesn't install anything nefarious on your system. So... use MotionInJoy instead of whatever I talked about here. MotionInJoy avoided all the annoying driver signing this old post talked about too.)

I got a Playstation 3 controller to work with windows as a game controller, which is awesome. I'm not using it over Bluetooth, I have the controller plugged into the USB port. I've found a lot of fun indie games that I intended to play for the PC (La Mulana, Cave Story, Knytt), but wanted a controller to maximize enjoying them.

Besides the hardware, all you need is the driver and setup executable. You can get these over at http://ps3-hacks.com. It may not necessarily work very easily... I couldn't get the controller to work on my XP desktop (I'm almost positive it's due to conflicts with other drivers, but don't want to waste anymore time debugging), but it worked immediately without any problems on my Vista laptop. My suggestion would be to give up (or reinstall your entire system) if you follow the instructions and it still doesn't work. Make sure to press your PS Home button before complaining that it doesn't work.

I also have a x64 Windows 7 machine at home. By following this guide, I've been able to get the PS3 controller working. The (huge) downside is that the application uses an unsigned driver, which means you have to run Windows 7 in a special mode. The guide will explain that a little more. By the way, I do not suggest changing system properties to always allow unsigned drivers. It just doesn't seem like a good idea, plus, it puts an annoying watermark on your background.

After getting the controller to work, I had problems with actually using it to play games. Some of my games didn't give me very good joypad mapping options, mainly in not supporting all of the PS3's 16 buttons. But then I found XPadder... check out http://www.xpadder.com! (Note that versions 5.3 and below are free (softpedia link), but versions above 5.3 must be purchased. I suggest supporting the other Jonathan's efforts.) XPadder easily lets you map keyboard key(s) to any button on any gamepad supported by windows. It is REALLY awesome. I can even play Guilty Gear and pull off supers with the press of one button since it lets you map sequences.

Suddenly, fighting games (Guilty Gear), platformers (Cave Story), and RPGs (Ys) are something I'm willing to play on my PC.

Also, using PS2 Emulators with save states for my old games is pretty awesome.

Sunday, April 17, 2011

Wayback Machine

So, the internet wayback machine has proven useful to me time and time again.

If you don't know, the internet wayback machine makes text backups of... pretty much the entire internet. Text only... but really, the text is generally the most devastating loss of a missing website. The site does a really good job of keeping timely backups of changes.

I've used the wayback machine to recover an old site I had made when I was in middle school. I thought I had lost all of it forever... granted what I found was very embarassing and much less amazing than I remembered, but I was very happy to find it again.

I've used the wayback machine to find pages that had been removed, sometimes with information that the webhost was hoping to get off the internet.

And I've used the wayback machine in my job, to find tutorials that had lost their home. I'd follow links to dead pages, but be able to read the information anyway thanks to the wayback machine.

The wayback machine is more than a toy and when you need it, it's definitely nice it's there.

Sunday, November 28, 2010

Hex Editing Programs

So, I got obsessed over the past two weeks or so "solving" archive files. This involved trying to extract the resources from video game archive files. Even if I don't care about the result, it was like solving a puzzle to figure out how to get the resources out. I'll probably write about it sometime.

What I wanted to point out now is the hex editor I used. To solve archive formats, you need to open up the archive files as binary. I started off using Textpad, since it's my text editor of choice on windows. It's not that convenient though... after reading some tutorials, I settled on Hex Workshop.

Hex Workshop lets you easily copy and paste binary, allows you to easily set bookmarks to binary fragments, easily lets you color-code the binary, easily lets you jump to specific offsets, lets you have multiple files open simultaneously, and has a hex calculator. I heartily recommend it. It is pretty pricey (~$90)... but that's pretty much the price of two video games. I think it's worth it as I've had so much more fun doing this than playing games recently. Hex Workshop



On another note, on a slow day, I played around with Cheat Engine. It was a lot of fun. Cheat Engine lets you easily mess around with Windows memory. The most obvious use is changing game memory to give you unlimited whatever. It's really fun to play with in general and comes with a great tutorial that'll get you started. If you have some time, give it a try. http://www.cheatengine.org/

Sunday, October 31, 2010

C# Web Service Plain Text Response

It took me far longer than I expected in order to figure out how to return plain text from a C# web service. I'm not sure why this took so long for me to figure out, but if it wasn't just me, then maybe this post can help other people out.

The Problem: When writing a web service endpoint in C#, if the return type is a String, the result will be an XML formatted string.

For example, the following web service:
  1. public String TestServiceA(Stream input)
  2. {
  3. return "Some kind of Text";
  4. }
returns the following string:
  1. <string>Some kind of Text</string>
It isn't that big a deal and the contained text can be easily parsed out, but it wasn't what I wanted and extra parsing code somehow seems wrong. I wanted the result to simply be the text I set.

The Solution: The return type needs to be a Stream.

So now the following web service:
  1. public Stream TestServiceB(Stream input)
  2. {
  3. MemoryStream ms = new MemoryStream();
  4. StreamWriter sw = new StreamWriter(ms);
  5. sw.Write("Some kind of Text");
  6. sw.Flush();
  7. ms.Position = 0;
  8. return ms;
  9. }
returns the expected result:
  1. Some kind of Text

Thursday, September 30, 2010

Router and Bridge

Router and Bridge

At home we're basiscally using five computers, one computer for each one of us. We all need internet access, we don't want anyone to have to use wireless, and it would be nice if we can all see each other's shared data. We have two 4 LAN Port routers, a D-Link 624 (wireless) and a D-Link 604. Those routers have worked very well for us, much better than Linksys routers have worked. We decided to have one router act as a bridge. Since one port from 604 would connect to one port from 624 (making them kind of act as a single router) we would have a total of six LAN ports. I feel it's really common knowledge how to set up a router, but making the other router act as a bridge isn't as clear. These are the steps to do this and they should be pretty adaptable for any routers.

1. Set up the first router as normal.
2. Connect a PC directly to the second router (and not the first router.)
3. Reboot the PC.
4. Log in to the secondrouter (usually defaulted at 192.168.0.1, with User Name = admin and no password).
5. Go to the DHCP menu and disable DHCP by checking "Disabled" for DHCP Server and Static DHCP.
6. Go to the LAN menu and change the IP Address to 192.168.0.99. (It can't conflict with the first router.)
7. Click Apply to save the settings. (You lose the connection to the second router since its IP address changed.)
8. Connect one of the second router's Local (LAN) ports to the first router.

Tuesday, August 31, 2010

Free Quality Burning Software

http://www.imgburn.com/

This summer I needed to burn an DVD ISO Image, but I was away from home and didn't have any burning software on my laptop. So I needed something free. A quick search turned out ImgBurn, which worked for me very well, seemed very well made, and was very simple to use. So if you need free CD/DVD burning software, I recommend that you try ImgBurn.

Missed Time

Whoops, missed a few months. I was out of the country and didn't have the time to post anything. I'm back home now so I'll make up for it.

Thursday, July 08, 2010

Subversion Intro

I've been using subversion (nope, not a git guy yet) for most of my own work, even got our projects at my current job onto subversion. It's much better than source safe/offsite (which I used at a previous job) and I even prefer it to CVS. Subversion is designed specifically to be a modern replacement for CVS and shares a number of the same key developers. It uses a copy-modify-merge for file sharing. To read more about subversion, you can read their very good documentation at http://svnbook.red-bean.com/. The following is a link to an appendix from the svnbook that introduces subversion for cvs users. I think that it will be a very helpful and painless way to quickly understand subversion with a cvs background. You can read it starting at http://svnbook.red-bean.com/en/1.2/svn.forcvs.html.

Subversion’s homepage is http://subversion.tigris.org/. I install it using the instructions found on http://www.excastle.com/blog/archive/2005/05/31/1048.aspx.

The most direct way of using subversion is through the subversion client tool called svn. You can download the tool from subversion’s site, http://subversion.tigris.org/. For directions on using the tool, refer to the appropriate section at http://svnbook.red-bean.com/.

Another subversion client option for Win32 users is TortoiseSVN, which is implemented as a Windows shell extension. TortoiseSVN can be downloaded from http://tortoisesvn.tigris.org/. It is very simple and intuitve to use as all commands are added to the right click context menu when using windows explorer. Special icons are used to show which files and folders are under revision control.

If you're using Eclipse, there is a plugin called SubClipse that will integrate Eclipse and Subversion. You can download the plug-in from http://subclipse.tigris.org/. A good guide to installation and usage for the plug-in can be found at http://dev2dev.bea.com/pub/a/2005/11/subclipse.html?page=1.

Monday, May 31, 2010

Hiren Boot CD

I'd heard about Hiren's Boot CD before, but I never needed it until last weekend. There were a few Windows machines that none of us knew the passwords or even account names to anymore. Using Hiren's Boot CD, we were easily able to get back in. We could see the accounts on the machine, we could reset the passwords, and we could lock/unlock accounts. It was very convenient.

There aren't many times most people would need a tool like this, but it's nice that it's there just in case. Read more about it (and get links to it) at http://en.wikipedia.org/wiki/Hiren's_BootCD A mac version of this type of program seems to be Boot-123.

Friday, April 30, 2010

Got API

I really like the website gotapi while programming. It provides a quick and easy interface for various APIs for many programming languages. Wish they included C#.

Wednesday, March 31, 2010

Sharp Develop

Thought I'd point out Sharp Develop, a free alternative to Visual Studio. In some ways, it's much more convenient and friendly. I'd suggest giving it a try, C# is a pretty good language to work in.

Sunday, February 28, 2010

iPhone Headphone Issue

The sound from my iPhone when using headphones was coming out funny. The speaker was perfectly fine, but when using headphones, any voices (whether in music or while on the phone) had a weird tinny echo. I tried resetting the phone a few times, but that didn't do anything. I took out a flashlight and looked in the headphone outlet... it turned out there was lint in the jack. Using a toothpick, I fished it out and then the sound was back to normal. Just thought I'd post, in case anyone else is having the same problem.

Monday, January 04, 2010

Driverless Network Printer on Windows 7

Sheesh, I spent like half an hour trying to add a network printer on my new Windows 7 machine. When I tried to add an HP Laserjet 1200 PCL5 printer, it said a driver couldn't be found, even though I saw Windows 7 had the driver when I tried to add it locally. This is how I ended up adding the printer (instructions were found at: http://www.sevenforums.com/drivers/2726-printer-network-no-driver.html). You'll need some computer know-how, but it's not too tough. Essentially, you create a local printer, then change its settings to your network printer:

0. Go to "Devices and Printers" from the start menu.
1. Add Printer (click)
2. Choose local printer
3. Choose use existing port
4. If your network printer type is not listed, click windows update (requires internet).
5. Wait...
6. Check to see if your printer is now listed. If not, this guide won't work.
7. Choose newly listed printer.
8. Printer will then install.

And to now use your network printer...

1. Right click printer icon. Left click printer properties.
2. Click port tab.
3. Add new port. Local port
4. Type in address of shared printer ie \\Name or ip address of computer with attached shared printer\Shared printer name
5. Click general tab. Print test page. See if your test page printed.

Thursday, December 31, 2009

Computer Upgrade

I upgraded my computer this holiday season and ran into some problems. Thought I'd document some of them here. I built my rig from parts; I spent a lot of time this month reading up on new technology. It had been a few years since I last built a higher end PC. In the end I basically went with newegg recommendations and I wasn't disappointed with their parts choices. It was easy to figure out compatibility too.

My first small problem was with my power supply. I had a CORSAIR CMPSU-750TX and I couldn't find the 4-PIN connector. Turns out that the 8 PIN connector could be separated into two 4 PIN connectors. I had to read the manual before I noticed. I don't know if this is standard in power supplies nowadays, but I had never encountered it before.

The second problem was with my motherboard. The screen stayed black after powering it on; I heard no beeps, it wasn't going through POST. I got a M4A79XTD EVO with a Phenom II X4 955 CPU through a newegg combo deal. I read a lot of reviews that said the combo was bad because the 955s being sent out were C3, which are incompatible with the BIOS shipped on the mobo (motherboard.) Furthermore, you couldn't update the BIOS without a compatible CPU. After googling, I found that C3 was the revision number of the processor. On ASUS's page, http://support.asus.com.tw/cpusupport/cpusupport.aspx?model=M4A79T%20Deluxe, I found the list of supported CPUs for the mobo. Each revision of AMD's CPUs has its own model number. Mine was HDX955FBK4DGIBOX. Took me a second to realize that the "BOX" could be ignored. It turned out my CPU was C2, which worked with bios on the motherboard. In the end, it turned out my RAM was bad on arrival. I'm glad I was able to figure out the CPU issue or else I would have probably tried to return the motherboard.

Lastly, I gave my wife most of my old parts, one of which was an ASUS A8V DELUXE motherboard. I was unable to install Windows, I kept getting a BSOD (blue screen of death) saying that "The bios in this system is not fully acpi compliant." However, the bios was ACPI compliant and I never had problems while I was using it. The bios even had an "Enable ACPI" option, which was on. I decided to reset the CMOS and see if that would fix it. Since I lost my manual and couldn't tell where the jumper was, I simply removed the motherboard's battery for 5 minutes (make sure all power to the computer is unplugged first.) That did the trick.

Those were the trickier errors I ran into, but I had lots of other issues such as bad drives, configuring jumpers correctly, making things reach... stuff that required opening the machine a lot, but nothing that wasn't obvious. So, I spent a lot of time building systems for my wife and I, but now that they're running, I'd say it was worth it. Hopefully, you can avoid the problems I ran into.

Monday, November 30, 2009

Javascript Effects

I've been busy this month, but I found a lost blog post from 11/2007. I think it's still relevant. At least the links are still alive. And Javascript is still really handy to know well:

Well, I've been doing web page mock-ups at work, and I've gotten some pretty cool effects down. It always amuses me how important the appearance is to a project. It makes sense, since rock solid systems can't really be demo'ed, but one cool transparency effect can knock an audience off their feet in a couple seconds. Not just anyone can comment when you describe how you brought your algorithm from O(n!) to O(log n), but everyone can say "Wow, that dragging and dropping is pretty nifty." So don't ever neglect the appearance of your project if you want normal people to use it. Luckily, effects are usually pretty easy to do on a web page, since someone else has probably done it before. I wanted to take this post to share some links that I had found really useful.

First of all, just in case you don't know css, read this. CSS is really important to making a web page. I'd suggest reading everything at that link for anyone who isn't an expert.

For transparency effects, this webpage was my guide: http://www.mandarindesign.com/opacity.html. It described everything needed to have mouseover transparency working in all the major browsers, using css and javascript. Very helpful.

For drag and drop, I referred to this website: http://www.walterzorn.com/dragdrop/dragdrop_e.htm. He did a really good job providing tons of examples and his own implementation. From simple dragging and dropping to resizing images and sliding bars, this was a great reference to me. He even provides javascript if you want to use his code directly.

By the way, if you're one of those people who puts javascript programming on the same level as html/css programming, then read Rediscovering Javascript. Hopefully, you'll change your mind. If you are new to programming, a great Javascript guide is "Eloquent Javascript." It has a nice interpreter, which means you can test javascript code quickly.

Saturday, October 31, 2009

Removing and Ejecting Disks

Requires: Windows XP Professional

So, you plug in a USB drive, do your stuff, and then you want to take it out. Pretty common today, right? So you've got to go to your taskbar, right click that "Safely Remove Drive" icon, and so on. I thought it was kind of annoying, so I looked for a way to do this without having to use the mouse (and that was free.) And I eventually found it at this site. His english isn't too great, but he's not a native speaker and it's not -that- hard to understand.

As he says, there are several tools that claim to do this. Don't use them because they don't work correctly. For example, in XP, DevEject fails to let you know if the operation failed. If you google "safely remove usb xp command line" you'll get articles talking about the devcon tool. Don't use that either because devcon causes the device in question to be uninstalled. This is not desired and does NOT cause the device to be "unplugged." So use the tools from http://www.uwe-sieber.de/usbstick_e.html.

So yay, now you can do usb stuff from command line. Sometimes you'll get a failure message. Unless you accidentally specified a non-removable drive, the most likely reason for this is that Windows has "locked" some of the files on the drive. So annoying, especially since you'll not know how to unlock them, since you probably already closed all he programs that were using it. If that's the case, use this program, "Unlocker", to free up those files. It works like a charm and appears in the right click menu for easy use. Download unlocker: http://ccollomb.free.fr/unlocker/