Python 3 CP950 Error When Printing to the Windows Command Prompt

Today, while teaching some juniors how to program, I tried to print a line of Chinese text to the Command Prompt with Python, but I got the error “UnicodeEncodeError: ‘cp950’ codec can’t encode character”. I tried all kinds of methods without success, and in the end I found the answer by searching online. When experienced developers see this error, their first instinct is to assume the string contains a special character, so they immediately add the ignore parameter, but that does not help. When I checked, the character that caused the problem was a Japanese character. As everyone knows, Python 3 uses Unicode strings by default, so it should not have trouble printing anything. It’s not like we’re dealing with the notorious Big5 again… ...

February 21, 2017 · 2 min

Some Tricks You Probably Didn't Know That Make Using Your Computer Faster!

Actually, I first learned these tricks while studying vi, a plain-text editor under Linux. Later, when I tried them in other text editors (basically anywhere you can type text~), I found they worked the same way. These little tricks can speed up how quickly you process documents a lot. Also, I’ve recently been preparing for the TQC Chinese-English typing test, and practicing these tricks has helped my typing to some extent. ...

May 21, 2011 · 2 min

Launchy - A Handy Helper for Quickly Opening Programs

I introduced Google Desktop to you before. It can quickly open files and programs. Launchy works in a similar way, but it focuses on quickly launching programs, so it doesn’t have as many features as Google Desktop. Google Desktop can search files and has a sidebar, while Launchy only does file search. Its file search works differently, though. You specify folders, and Launchy builds an index of the files in those folders before you search. Google Desktop indexes the files on every hard drive. The difference is that when you type a keyword, Launchy may show more accurate results, while Google Desktop may show results you don’t want. ...

March 1, 2011 · 3 min

Does Your Program Need to Run as Administrator? Make a .NET Program Run as Administrator by Default~

Sometimes when you develop a program in Visual Studio, it may need administrator privileges, for example to access system folders or to use certain high-level WinAPIs. On Windows XP, using administrator privileges is not a big deal. But if you want your program to run on Windows 7 or Vista, you have to grant the program administrator rights, or it will run into problems halfway through. Generally, you can ask users to right-click the program and select “Run as administrator,” but that feels odd, because users would have to set it up themselves. Actually, there is another way to make your program run as administrator by default, so users don’t need to configure anything. ...

February 16, 2011 · 1 min

How to Read Windows Environment Variables (System Variables) in a .NET Program - VB.NET Example

Anyone who has written CMD knows about environment variables. They let you easily get information that differs from one computer to another, such as the user name. In CMD, using an environment variable is simple: you just write it in the %environment variable name% format. In a .NET program, though, it isn't that simple. You need to use the Environ function. ...

February 11, 2011 · 2 min

[C++] Sending a File to a Console Application via CMD and Returning Data

Actually, in C++ there's another way to read files besides simply using fopen, and it's much easier to implement than fopen: feeding the file to your C++ program through CMD. For example, say you have a program called test.exe and a text file called x.txt, and you want test.exe to read the data in x.txt and display it. You open CMD and type test.exe<x.txt, and it reads and displays the contents of x.txt. This article teaches you this way of reading files. Thanks also to a reader named Canghai, who taught me this technique....

December 4, 2010 · 1 min

Simulating Internet Café and School Restore Cards with RVS 2011's Shadow System

What is a shadow system? I'm sure you've all seen school or internet café computers that come back perfectly clean every time they restart, with every non-default file wiped out. That's thanks to a hardware device called a restore card, which internet cafés install. The shadow system I'll introduce here gives you the same effect as a restore card without spending money on one, and it's even easier to use than a restore card. With a shadow system, you don't have to worry about viruses either. Just restart and the computer is back to normal~ In this article, the shadow system we'll introduce is Returnil Virtual System (hereafter RVS)...

September 19, 2010 · 2 min

Won't Boot After Installing a Dual-Boot System? Let's Repair the MBR~

Recently, while playing with Ubuntu, I ran into something: if you manually format the hard drive that Ubuntu is installed on, your computer will no longer be able to enter the operating system. This happens because the system’s MBR file has been damaged. Formatting Ubuntu directly isn’t the only way to hit this; sometimes it happens when installing a dual-boot system as well. When it does, don’t panic, because the MBR file can be repaired, and the steps aren’t very difficult. First, prepare a Windows installation disc, then set the computer to boot from the disc…. ...

September 11, 2010 · 2 min

Turning a Laptop into a Wireless Hotspot

Remember the iPod Touch I bought a while ago? The iPod Touch has to be slim and light, so it only supports wireless networking, not the Ethernet connections (such as ADSL) that are more common. So I’d been looking for a way to turn my home ADSL into a wireless signal. I originally planned to buy a broadband router, but the price was a bit high, so I held off. Then I did some research of my own and found that Vista (XP and Windows 7 work too) can use a wireless network adapter to turn the ADSL connection directly into a wireless signal, with an effective range of 30 feet. For someone like me who needs wireless internet, that’s really convenient. ...

April 3, 2010 · 3 min

Windows 7 (Win7) Overview and Installation Tutorial

There are already many nearly identical introductions to Windows 7 (Win7) online, so I'll keep this brief. Windows 7 is Microsoft's recent operating system. In many ways it's better than Vista (after all, Windows 7 was basically made to rescue Vista). It doesn't use many resources, either. For example, when I installed Windows 7 in a virtual machine (VirtualBox), I only gave it 1 GB of memory and it still ran without any lag. That said, even though Windows 7 doesn't consume much, I still recommend not installing it on a really old computer XD. Windows 7 (Win7) also fixes many of the shortcomings of XP and Vista, and file search is much faster too. Windows 7 Features: Supports DirectX 11 Full support for 64-bit CPUs Supports more Aero effects without consuming too many resources Better UAC protection Built-in Windows XP compatibility mode ...

November 29, 2009 · 4 min