It can be a pain reaching up to the ESC key everytime to exit insert mode in VIm. An alternative that’s built-in by default is Ctrl+[
Often pasting text into vim from an external source screws up the formatting (especially tabs). To prevent this, do:
Keeping this setting on screws up auto indentation while in insert mode, though. So to turn off, use
command | ./myscript does not work as expected.
./myscript $(command) instead
Forgive me for not being constructive and not submitting bugs to the devs and that sort of thing (I may later on…), but for now, I just have to let off some steam… and from the experience I’ve got using this application, I believe I have every right to!
So I was looking for Wordpad’s equivalent in Linux-world, and according to a post in the Ubuntu forums Abiword was it. So I apt-get install it, and try it out… (running Ubuntu 8.10)
1) I copy some text into the page… then I realize the font size is too big, so I Ctrl+A and highlight the “font size” box and replace the “12” with “10”… voila! the TEXT I selected gets replaced with “10” instead of the number in the “font size” field. Genius! So I guess I will just have to use the arrows to change font sizes…
2) Then I wanted to change the font. I look at the “font” bar, and there’s no way to type in it! I can’t even enter an ‘M’ to get to the fonts that start with ‘M’… I have to SCROLL through the 100 or so fonts on my system to find the one I want. This is not a bug per se, but c’mon!
3) Then I needed to paste in more text. I do so, then to look at the bottommost text I use my mousewheel to scroll all the way down. Good, its there. But… when I scroll back up, Abiword keeps slowly scrolling the screen down! I tried using my keyboard arrows and a bunch of other things to try to make it behave but it just wouldn’t quit. At this point I had no choice but to close the whole abomination.
Looks like I will just stick to the heavier OpenOffice for now. I am just in complete shock and awe that this software is in the Ubuntu repos and is classified as a “finished product”. It would be poor even if it was in beta. Lesson of the day: Beware of Abiword!
Time for a rant.
I can’t be the only person on earth annoyed about how MS Word doesn’t have the options to (let alone have any keyboard shortcuts for) zooming in/out by a certain increment. If you use Adobe Reader/Photoshop you will know what I’m talking about. Open up a PDF -> “oh, looks kinda small”, you think -> “Ctrl+=” -> Done!
But on MS Word 2007, to do the same you have to move your mouse all the way to a tiny slider at the bottom right of the screen to zoom in/out, and there’s no keyboard shortcuts to do this! I tried customizing my keyboard shortcuts to do this, but, alas, there was no command to zoom in/out. There were only commands like “Zoom100”, “ViewZoomPageWidth”.
Granted, you probably won’t have to zoom in/out in MS Word as often as in Adobe Reader, but I’ve still found it annoying enough to write a blog post about it. What do you think?
EDIT: Found just what I needed: http://word.tips.net/Pages/T001734_Zooming_With_the_Keyboard.html. Still sad that there’s no default for this in Word though.
THIS BLOG HAS
Please visit http://suanaikyeo.com instead
You have a treeview with an XML file as a data source, but XML files by default must have a single root element, which shows up on your treeview. A lot of us don’t want it to show up, and there’s no obvious way to hide it. After an hour or so of searching for a solution, I found it here. This solution really needs to be more visible on the web!
Basically you just need to set the XMLDataSource XPath property as XPath = “/*/*”. I’m not entirely sure what this means, but you can read up more about it here.
This probably applies to many other things while working with XAMPP or any webserver on your machine, but I specifically used it when using AJAX. Just determine your LAN/local/internal ip address and use that ip address as your domain name. For example, if this is what you had on another webserver,
var myDomain = "www.domainName.com/location/"; //where your proxy file is placed var proxy_name = "phpProxy.php"; //proxy's filename var actualReq = "http://search.yahoo.com/blablabla?=...." //actual request var url = "http://"+myDomain+proxy_name+"/?"+actualReq; httpRequest("GET",url,true,handleResponse); ...
and your local ip for example is 192.168.123.321, replace
So I’ve been working on some AJAX stuff, dealing with Yahoo! Weather, specifically, and I realized I needed some way to make cross domain xmlhttprequests. Using a PHP Proxy seemed for me to be the easiest way to go, so I first tried what was suggested by Yahoo! I then tried some similar methods from others here and here, both to no avail. I then did some asking around on forums and made the necessary changes to make Yahoo’s example work. Just thought I’d share that with those of you who have similar troubles.
This is the PHP Proxy that I used. Note that:
- Your webserver’s PHP needs to support cURL
- This code doesn’t support POST requests, only GET.
<?php // PHP Proxy example for Yahoo! Web services. // Responds to both HTTP GET and POST requests // // Author: Jason Levitt // December 7th, 2005 //(Modified by Suan-Aik Yeo) $path = $_SERVER["QUERY_STRING"]; $url = $path; // Open the Curl session $session = curl_init($url); // Don't return HTTP headers. Do return the contents of the call curl_setopt($session, CURLOPT_HEADER, false); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Make the call $xml = curl_exec($session); // The web service returns XML. Set the Content-Type appropriately header("Content-Type: text/xml"); echo $xml; curl_close($session); ?>
var proxy_name = "phpProxy.php"; //proxy's filename var actualReq = "http://search.yahoo.com/blablabla?=...."; //actual request var myDomain = "www.domainName.com/location/"; //where your proxy file is placed var url = "http://"+myDomain+proxy_name+"/?"+actualReq; //go on to do the usual httprequest steps... httpRequest("GET",url,true,handleResponse); ... ...
Hope this helps!
Yesterday a few of us went up to Chicago just for fun, and for Malaysians, no trip to Chicago is complete without dinner or lunch at the PENANG Malaysian restaurant at the entrance of Chinatown. We ordered Nyonya Tofu, Assam fish (which we didn’t know cost > $20), kangkung belacan, and beef rendang, along with chicken rice rice 😉 Anyways, the food was pretty good, and I already kinda knew what to expect as it was probably my 3rd or 4th time there. Praveen, Winnie’s classmate who also drove us there, also ordered some stuff to go for his roommates.
When the bill came though, it was about $140 with about $20 gratuity on top of that. Why were we charged gratuity? There were only 4 of us! And we also shouldn’t be charged tips for to-go food…..So Praveen went up to the guy who handed us the bill, and eventually was sent to a lady manager. She then said to another waitress, “他们本来有六个人， 过后四个就走到后面的桌子去了。” (“they had 6 people at first, and later on 2 of them went to the table behind them”). Then, to her astonishment, Praveen replied in Chinese that that wasn’t the case (he’s singaporean, btw). They were pretty much forced to take away the gratuity at that point, and we ended up giving them barely more than 10% tips for our troubles.
Granted, there was a table of other people we knew sitting behind us, but only one of them came and sat with us (she didn’t order anything) and none of us went over to their table. And, the restaurant was pretty packed that night. Still, what annoyed me was how they came up with the “theory” that there were 6 of us and that 2 left….why not 5 to 2 instead? Makes me wonder if they always take advantage of such situations to charge gratuity. I also wonder if they try to charge gratuity for to-gos all the time. If anything, it DOES sound alot like a Malaysian “get what you can out of the customer” business attitude. They also could’ve been more apologetic.
Bottom line is, just remember to check through your receipt the next time you’re there.