I recently encountered an error where when I do a less
in cygwin it goes WARNING: terminal is not fully functional
Quite some people seem to have encountered this problem before and there are some discussion threads on the Web, but I couldn’t find a page that pointed out the direct solution after some googling. Here’s what I did to fix the problem: It turns out that the environment variable TERM
is somehow set to dumb
instead of the normal cygwin
. Apparently the dumb
terminal is not as fully functional as cygwin
. Here’s what I did to confirm the problem:
$ echo $TERM
dumb
I got less
working properly again by doing:
$ export TERM=cygwin
$ less
It turned out that somehow the $TERM environment variable got set to dumb
. To fix that, simply run sysdm.cpl
from a Windows command prompt, and delete the environment variable TERM
. cygwin will then default TERM
to cygwin
Today I bumped into this very addictive game called TypeRacer. A picture says is all:
At first I thought “Oh it’s just another Flash game, I’ll give it a try because I like typing”, then volia! It’s not your ordinary everyday Flash game. For a Web-based game, it offers a complete feature set and a smooth experience of that of a real, installed game!
The random matching process is as smooth as it can be – just clikc “Race against others” and you’ll find yourself typing away in seconds! Simply click “race again” after a race and you’ll be instantly matched against other players. The time I tried, there were enough players on the server that I never had to wait for more than 10 seconds to be matched against other players.
They also have a “Invite friends” features where you can open a private room for invited friends only. That can be done by simplying sending the URL to your friend, and they can instantly start playing – no forced registration, no nothing – that’s what you call fun!
Talking about the registration, the sign up process was really smooth. First off, you don’t have to go through a clumsy registration process to start playing. Anyone can play as Guest, and if they find that they want to keep their records, just click on Sign up which only required you to fill in the username and password – all in an AJAX box that required 0 page reloads.
Give it a try, my hats off to the developer (Yeah I heard it’s a one-man project.) Great job!
We’ve all been in situations where we are expected to give. Let’s say I’m in a team project and I’m expected to contribute a fair amount; maybe when I see an elderly trying to cross the street, I’m expected to give a helping hand; even when I want to fill my stomach and go down the convenience store, I’m expected to give money.
On a very primitive level, we can think of the reason that we give is because we’ll receive. If I contribute my fair share in the team project, we all enjoy a good end result. Obviously if I paid in a convenience store for some food I get a satisfied stomach. Yah, even if I help the elderly across the street I’d get a warm feeling in my heart.
And then there are cases where I don’t know why the fuck I’m giving, or giving more than I’m expected. Those are cases where I feel very fucking bad. When for some very weird reason I’m expected to give more than other people in a team, and other people seem to take it for granted.
Don’t get me wrong here. I think giving is generally a good thing. I once thought nothing was more divine than unconditional giving. Jesus Christ is worshipped by many because he gave his life unconditionally to wash the sins of all people, for all of our greater good. But hey, I’m just a human, why should I give more than necessary for other people, when I don’t get anything in return?
…when I don’t get anything, not even some kind words of appreciation, because other people fucking take it for granted?
Giving is a beautiful thing, but it turns into the synonym of “stupid”, “being used” quickly when it is not reciprocated.
I have been thinking very hard about this. I’ve been trying to make this world a better place for everyone, by giving a little bit more. But most of the time, the world has not become a better place for me. So tell me, why should I be the guy who makes more contributions than it needs be? If no one in a group of people is going to take the last extra mile to get something done, then why should I be that guy if nobody will appreciate it? Why shouldn’t I, like everybody else, let the whole thing sink and we all lose?
I have failed to find the answer, and the more I searched for it, the more I’m leaning into that the only rational answer is,
“You shouldn’t.”
Stare at the black cross below. You’ll see the purple dots start to disappear! You’ve got to stare at it pretty hard for this trick to work. Probably about 30 seconds to a minute.
Update: Check out the new tool cmd-recycle which is a lot more robust, written much more cleanly and just more cool!
I wrote this simple utiltiy some while ago, thought I might as well publish it here.
Just copy recycle.exe to WINDOWS\system32 and you can start using
recycle
Full source code included (using C#). Enjoy!
Found an inspirational story on the Web today:
Jerry is the kind of guy you love to hate. He is always in a good mood and always has something positive to say. When someone would ask him how he was doing, he would reply, “If I were any better, I would be twins!” He was a unique manager because he had several waiters who had followed him around from restaurant to restaurant. The reason the waiters followed Jerry was because of his attitude. He was a natural motivator. If an employee was having a bad day, Jerry was there telling the employee how to look on the positive side of the situation. Seeing this style really made me curious, so one day I went up to Jerry and asked him, I don’t get it! You can’t be a positive person all of the time. How do you do it?” Jerry replied, “Each morning I wake up and say to myself, Jerry, you have two choices today. You can choose to be in a good mood or you can choose to be in a bad mood. I choose to be in a good mood. Each time something bad happens, I can choose to be a victim or I can choose to learn from it. I choose to learn from it. Every time someone comes to me complaining, I can choose to accept their complaining or I can point out the positive side of life. I choose the positive side of life. “Yeah, right, it’s not that easy,” I protested. “Yes, it is,” Jerry said. “Life is all about choices. When you cut away all the junk, every situation is a choice. You choose how you react to situations. You choose how people will affect your mood. You choose to be in a good mood or bad mood. The bottom line: It’s your choice how you live life.” I reflected on what Jerry said. Soon thereafter, I left the restaurant industry to start my own business. We lost touch, but I often thought about him when I made a choice about life instead of reacting to it. Several years later, I heard that Jerry did something you are never supposed to do in a restaurant business: he left the back door open one morning and was held up at gun point by three armed robbers. While trying to open the safe, his hand, shaking from nervousness, slipped off the combination. The robbers panicked and shot him. Luckily, Jerry was found relatively quickly and rushed to the local trauma center. After 18 hours of surgery and weeks of intensive care, Jerry was released from the hospital with fragments of the bullets still in his body. I saw Jerry about six months after the accident. When I asked him how he was, he replied, “If I were any better, I’d be twins. Wanna see my scars?” I declined to see his wounds, but did ask him what had gone through his mind as the robbery took place. “The first thing that went through my mind was that I should have locked the back door,” Jerry replied. “Then, as I lay on the floor, I remembered that I had two choices: I could choose to live or I could choose to die. I chose to live.” “Weren’t you scared? Did you lose consciousness?” I asked. Jerry continued, “…the paramedics were great. They kept telling me I was going to be fine. But when they wheeled me into the ER and I saw the expressions on the faces of the doctors and nurses, I got really scared. In their eyes, I read ‘he’s a dead man.’ I knew I needed to take action.” ” What did you do?” I asked. “Well, there was a big burly nurse shouting questions at me,” said Jerry. “She asked if I was allergic to anything. ‘Yes,’ I replied. The doctors and nurses stopped working as they waited for my reply. I took a deep breath and yelled, ‘Bullets!’ Over their laughter, I told them, ‘I am choosing to live. Operate on me as if I am alive, not dead.'” Jerry lived thanks to the skill of his doctors, but also because of his amazing attitude. I learned from him that every day we have the choice to live fully. Attitude, after all, is everything.
I just saw Google advertising their new experiment venturing into the Web browser scene. The Chrome browser, like everything else from Google, is in BETA.
Now that is what concerns me most: Will this beta software just adds to foes Web developers have to fight when combating cross-browser compatibilities? Does the fact that it is beta imply that it will be constantly changing, which mean we’d have to cope with like 10 more different cases of different versions of Chrome?
Update: I’ve done some extensive research and this graphic tablet DOES NOT work in Windows Vista. The Vista driver in the official homepage doesn’t work, and I see no signs from the vendor updating it. Considering all P-ACTIVE tablets use the same driver, I’d advice against any Vista user to buy from them :p
Update #2: After some time, I accidentally got this tablet working again in Vista. The problem seem to be related to wisptis.exe
. If you don’t see this running in your tasklist, try Win + R -> wisptis
. I did this before I installed the official Vista driver. It worked fine as a pointing device (without pressure detection), then I installed the official driver and voilia! It worked like a charm!
After all these years of comptemplating, yesterday I finally bought the my P-Active XP Pen graphic tablet:
Played around with it for a while. It was not as difficult to pick up as I thought. Here’s a quick sketch I did after like 10 minutes of practice:
Pretty fun to play with, not bad for around $500 HKD 🙂
Under normally circumstances, if you request an HTTP protected resource with your Web browser, the server would return 401 Unauthorized and an popup would appear to ask you for the correct credentials:
That doesn’t look too Web 2.0-ish. Currently there is way to work around this using an AJAX request first (there’s an article that discusses the specific technique used). That way, the browser would “remember” the Authorization header used in the previous AJAX request, so when the user requests another protected resource in the same domain, the browser would also try to include the previously used Authorization header.
However, I couldn’t get it to work.
It turns out that the difference between my approach and the approach used in the article above is this:
// My way (doesn't work)
var xhr = new XMLHttpRequest;
xhr.open ( 'GET', '/url/to/resource', false );
xhr.setRequestHeader ( "Authorization", "Basic " + Base64.encode ( username, password ) );
xhr.send ( null );
// The working way
var xhr = new XMLHttpRequest;
xhr.open ( 'GET', '/url/to/resource', false, username, password );
xhr.send ( null );
Unbeknown to me was the fact that the 4th and 5th parameter of XMLHttpRequest.open()
could be used to specify the username and password for the request.
Apparently, the browser doesn’t remember the credentials if I call XMLHttpRequest.setRequestHeader
directly.
Note: All these have only been tested to work with MSIE/Firefox. Opera for instance, doesn’t seem to remember the credentials no matter what I tried – it would still pop up an authorization box when the user request a protected resource.
I fumbled with this problem for quite some time without much success after reinstalling Windows XP on my eee PC. Then I found the solution at Ben Shoemate’s article. I’m directly quoting his contents here:
I am trying to install Office 2007 onto a clean install of Windows XP (on a friends eee PC – it is really a sweet little laptop.. anyway), I get the error above about protected files. Here is the solution. (This may have happened because in optimizing XP down, some files were deleted). 1. From Windows install disk goto E:\I386 folder and open open (Double click) on the FP40EXT.CAB file. It should open. (or – if you do not have the disk, find a working XP computer and go to C:\Program Files\Common Files\Microsoft Shared\web server extensions\40\bin). 2. find fp4autl.dll in the list and copy it (ctrl-c) 3. go to c:\program files\common files\microsoft shared\web server extensions\40\bin and paste it (ctrl-v) 4. Restart the 2007 office install