Posts

Showing posts from March 14, 2010

Emacs: How to Turn a Minor Mode on/off/toggle?

Perm url with updates: http://xahlee.org/emacs/emacs-tip_mode_on_off_toggle.htmlEmacs: How to Turn a Minor Mode on/off/toggle?Xah Lee, 2010-03-20, 2010-07-11This page is a short tutorial on how to turn a emacs mode on, off, or toggle.You know, in emacs, “t” is true, and “nil” is false. So, for example, if you want to turn off a minor mode always, you might put this in your emacs init file:;; turn off some modes? (desktop-save-mode nil) ; WRONG! (cua-mode nil) ; WRONG! WRONG!Why is it wrong?Yes, “t” is true and “nil” is false, but for modes, the proper way is to use “1” to turn it on, and “0” to turn it off. Why? Because a mode function isn't designed to take a true or false value as argument. Because, for example, most minor mode need to also act like a toggle. For example, typing “Alt+x auto-fill-mode” will toggle it.So, the design is that, for minor modes, a positive number is to turn it on, 0 or negative number is to turn it off. To toggle, no argument will do (no argument is…

CSS Text Flow Around Image

Image
Perm url with updates: http://xahlee.org/js/css_flow_over_image.html(css effect may not show in blogger. Visit the link above to see full effect.)CSS Text Flow Around ImageXah Lee, 2010-03-20This page shows you how to use CSS so that text wraps around image. The Time Traveller (for so it will be convenient to speak of him) was expounding a recondite matter to us. His grey eyes shone and twinkled, and his usually pale face was flushed and animated. The fire burned brightly, and the soft radiance of the incandescent lights in the lilies of silver caught the bubbles that flashed and passed in our glasses. Our chairs, being his patents, embraced and caressed us rather than submitted to be sat upon, and there was that luxurious after-dinner atmosphere when thought runs gracefully free of the trammels of precision. And he put it to us in this way—marking the points with a lean forefinger—as we sat and lazily admired his earnestness over this new paradox (as we thought it) and his fecundity. …

CSS Example of Text over Image

Image
Perm url with updates: http://xahlee.org/js/ex_css_text_over_img.html(css effect may not show in blogger. Visit the link above to see full effect.)CSS Example of Text over ImageXah Lee, 2005, 2010-03-20This page shows a example of using CSS to lay text over image.The following is a example of the desired effect:The Cat only grinned when it saw Alice. It looked good- natured, she thought: still it had very long claws and a great many teeth, so she felt that it ought to be treated with respect.‘Cheshire Puss,’ she began, rather timidly, as she did not at all know whether it would like the name: however, it only grinned a little wider. ‘Come, it's pleased so far,’ thought Alice, and she went on. ‘Would you tell me, please, which way I ought to go from here?’ Try to drag the image. You can see that it is a image with a blank corner. Now, try to drag over the text to select it. You can see that it is text, not part of the image. The text is actually laid on top of the image.The image ca…

Facebook's Ethics

Perm url with updates: http://xahlee.org/js/facebook_ethics.htmlFacebook's EthicsXah Lee, 2010-03-18You know? Facebook.com today is the 2nd largest trafficked site as estimated by alexa.com, after google.com.Just spent about 2 hours reading about Facebook. Looks like the technology is quite good, however, its stance on ethics, is quiet shady, tracing back all the way to its origin at Harvard. I fully support capitalism and the free growth of ideas, but judging from facebook's track record on issues as discussed on wikipedia, its ethics is quite questionable. Here's a summary, followed by quotes from Wikipedia.Facebook started as some Who's Hotter by student males. That is, 2 photos are shown, and you can click on who's hotter. Originally, one of the photo was suppose to be a animal. (thats how it became popular)The guy broke into university photo database to steal the photos.Facebook stole mate's ideas, betrayed trust, with tactics such as registering domain …

importing old articles here

Dear my blog readers,in the coming weeks, i may import a lot pages from my website xahlee.org, so that readers can comment on articles from my website, also as a way for blog searchers to find my articles. This means, you will probably get a lot articles in your feed reader, some of which may not be related to programing. (but most will be interesting ☺, i hope! )Sorry about this inconvenience. If you prefer more focused articles on programing subjects, you can subscribe just that blog topic from xahlee.org .The most popular is emacs: http://xahlee.org/emacs/blog.htmlits feed is here: http://feeds.feedburner.com/XahsEmacsBlogOther blog topics, on web dev, programing, math, all have separate blog pages, all linked from the emacs blog above.Thanks a lot. O, please do leave a comment to say hi. :D—Xah

White Rabbit by Jefferson Airplane

Image
Perm url with updates: http://xahlee.org/Periodic_dosage_dir/sanga_pemci/white_rabbit.htmlWhite RabbitXah Lee, 2008-07Dearly beloved logicians, amateur and pro among us,We've been slaving in newsgroup all day and night over dry academic subjects. I thought we could now have some amusement on logic at this moment!Yesterday i discovered a song (while slaving (literally) in Second Life) from the 1960s that is based on the book Alice In Wonderland. The song is called White Rabbit by Jefferson Airplane.I SO love it. Of all books i've red in my life, may it be formal logic treatise, may it be non-fiction as encyclopedia Britannica, may it be technical manuals such as GNU Emacs Lisp Reference Manual, may it be fictitious such as The Tragedy Of Titus Andronicus, may it be artistic of Emily Dickinson's poem compendium, may it be comics Batman, may it be porn like the Story Of O or Penthouse Mag, may it be, may it be, but that if i'm pressed to pick one book as my all-time favor…

Solid-State Drive Comes Of Age!

Perm url with updates: http://xahlee.org/comp/solid_state_drives.htmlSolid-State Drive Comes Of Age!Xah Lee, 2010-03-17Solid-state drive has come of age! When i started using a computer, in 1990, the standard hard drive capacity is 20 mega bytes. Its physical size is larger than a big hand, weights like a small brick. It costs some 5 hundred dollars. Today, a cheap $40 usb stick has 32 giga byte capacity. Its size is about 1 finger, and weights like 2 pencils.The capacity is 800 times larger, price is some 10 times cheaper, physical size is perhaps 30 times smaller, weight is perhaps 50 times smaller. Access time and thru-put, is some 50 or more times faster.Solid-state drive has come of age! So, looking in the near future, hard drive is about to go extinct. Many small laptops already don't use hard drives. They have solid-state drives, i.e. a storage device that does not have mechanical moving parts. So, when would majority of consumer laptops use solid state drives? I'd s…

MS Paint Drawing Video Record

Perm url with updates: http://xahlee.org/arts/ms_paint_drawing.htmlMS Paint Drawing (video record)Xah Lee, 2010-03-17Someone drew a firearm with a primitive drawing program, Microsoft Paint.Bushmaster ACR in MS:Paint. Drawn by FuggedabouditNL. According to his reply on comments, he's “A gun fan who can draw.”. The drawing is made by mouse (not pen tablet). To a non-artist, this is quite amazing. Though, the subject of drawing is a machine, so there's not much artistry involved.Though, in my mixing-in with illustrators in LiveJournal during 2006-2007, i found this person, who drew with MS Paint exclusively. See: Art of Jacquelyn Jilek. The style of her work is extremely idiosyncratic. Excruciatingly beautiful. What is Technical Drawing, Descriptive Geometry, Projective Geometry, Linear AlgebraWhat Is Perspective DrawingIntro To Firearms From Second Life Military

Cross-posting & Language Factions

Perm url with updates: http://xahlee.org/Netiquette_dir/cross-post.htmlCross-posting & Language FactionsXah Lee, 2007-03-29(The following article is originally cross-posted on 2007-04-16 to the folowing newsgroups: comp.lang.perl.misc, comp.lang.python, comp.lang.lisp, comp.lang.java.programmer, comp.lang.functional.)Dear tech geekers,In the past year i have crossed-posted (e.g. recently What are OOP's Jargons and Complexities, Is laziness a programer's virtue?, On Java's Interface (the meaning of interface in computer programing), there are some controversy, and lots of off-topic and careless following.I think there are few things today's tech geekers should remind themselves:• If you deem something off-topic to “your” newsgroup, and want to tech-geek by changing the “follow-up group”, start with yourself. Please do not cross-post yourself, and tweak the follow-up, and proudly proclaim that you changed the follow-up as a benign gesture.• Please remind yourself wha…

Website And Domain Lookup Tools

Perm url with updates: http://xahlee.org/js/website_domain_lookup_tools.htmlWebsite And Domain Lookup ToolsXah Lee, 2010-03-17A few misc tips and tools about domain names and websites.Domain and IP Toolswhois is a tool to find out tech info about domain names. On a unix command line, you can just type for example “whois example.com”. For good web based ones, see:whois.domaintools.comwhois.bw.org/www.robtex.comWebsite InfoFor web site popularity, demograph, trustworthiness, the best few are:Wikipedia articleSite Home PageAlex RankPurposeAlexa.comalexa.com◇Ranking etc.Quantcast.comquantcast.com1012demographWOT: Web of Trustmywot.com4784site safetySymantecnorton.com2573site safetyConnection SpeedA popular site for testing your connection speed is:http://www.speedtest.net/Domain Names, Cybersquatting, Resell MarketWeb Browser Market Share 2010-02

Writing Outline with Emacs (org mode tutorial)

Image
Perm url with updates: http://xahlee.org/emacs/emacs_outline.htmlWriting Outline with Emacs (org mode tutorial)Xah Lee, 2010-03-15, 2010-07-30This page is a tutorial, showing you how to use emacs to write document or notes with tree structure.Sometimes you need to write some notes with a tree-structure. For example, headings, subsections, and content text. This is called outline format in word processors. You want to be able to view just the top level headings, or up to 3rd level headings, or view all content of a particular section, or hide a section.In emacs 22 and 23, there's a mode called outline-mode and org-mode. org-mode is a major improvement of outline-mode, and provide much more features. Both uses the same plain text format.This page shows you the basics of org-mode.Star * for HeadingIn your file, any line that starts with a star “*” is considered level 1 heading. Any line starting with 2 stars “**” is level 2 heading. And so on. Here's a example file: * to do Reme…

Styling <table> tag with CSS

Image
Perm url with updates: http://xahlee.org/js/css_table_style.html(css effect may not show in blogger. Visit the link above to see full effect.)Styling <table> tag with CSSXah Lee, 2010-03-15This page shows you how to style the html “<table>” tag with CSS.Styling a html table with css is pretty easy. Here's a example of a table:ABCDHere's the source code: <tableclass="xyz"> <tr><td>A</td><td>B</td></tr> <tr><td>C</td><td>D</td></tr> </table> In the above table, we give it a class name “xyz”, so we can use CSS to pretty up all tables of this class.Here's the CSS:table.xyz {border:solid 1px black; border-collapse:collapse; margin:.5ex} table.xyz th, table.xyz td {border:solid 1px gray; padding:.5ex} The “border:solid 1px black” means give the border a solid line style, with 1 pixel width, and black color.The “border-collapse:collapse” means draw a single line between neigh…

Hacker News, Xahlee.org, and What is Politics?

Perm url with updates: http://xahlee.org/Netiquette_dir/hackernews_xahleeorg_politics.htmlHacker News, Xahlee.org, and What is Politics?Xah Lee, 2010-03-14Today, i noticed that one of my article Why Emacs is still so useful today on my blogger site (xahlee.blogspot.com), is linked as a news entry from Hacker News site here: Source.Note that my site XahLee.org was unceremoniously banned around 2009-02 by the admin geekers there. (see bottom of: Ban Xah Lee). But, apparantly, someone found my article useful. Now, in order to submit my articles, you'll have to use my article mirror at xahlee.blogspot.com instead of xahlee.org.Tech Geeker's Ignorance Of PoliticsThe human nature of power struggle never ends. Many of these tech geekers think they are apolitical, that they are peace loving, they ride bikes not driving machines that pollute, they don't have interest in business, they embrace the Free of “freedom” Software or Open Source of “openness” software. The problem of huma…

Perl One-Liner Screw

Perm url with updates: http://xahlee.org/comp/perl_one-liner_screw.htmlPerl One-Liner ScrewXah Lee, 2000-11-06 From: Xah Lee <xah@xahlee.org> Newsgroups: comp.lang.lisp Subject: Re: Q: on hashes and counting Date: Mon, 06 Nov 2000 02:28:07 -0800 Message-ID: <B62BC7B7.3CBD%xah@xahlee.org> The Glauber <theglauber@my-deja.com> wrote:P.S.: the Perl version is a "one liner":$c{substr($_,0,5)}++; END { foreach$x (sortkeys%c) {print"$x,$c{$x}\n"}}Screw you with your screwing "one-liner".Erik Naggum <erik@naggum.net> wrote:Perl looks the way it does because 110-baud Teletypes were once upon the time the best people had on Unix, and with lousy typers who had to correct their mistakes all the time, it made sense to abbreviate everything down to one or two characters. Lisp has a different heritage, to put it mildly: Better typers, better use of brainpower than to remember thousands of subtly similar abbreviations, better terminals. So we ar…

web based instant message systems

Discovered Mibbit. A web based application for IRC, Yahoo Messenger, Twitter. Written in JavaScript. I'll be trying it out in coming weeks.I haven't kept up with web tech for implementing instant messages, which is quite important and became popular in the past 3 or so years, especially by Google Talk. I looked into it about 4 years ago when a client needs chat functionality on a web site, but at the time i looked, there are like 3 or so Open Source ones i found in the few hours i looked. Most are implemented with PHP, and they are all pretty lousy.

Logitech G13 Advanced Gameboard (Review)

Image
Perm url with updates: http://xahlee.org/Periodic_dosage_dir/Logitech_G13_Gameboard.htmlLogitech G13 Advanced Gameboard (Review)Xah Lee, 2009-12-18, 2010-11, 2011-03-14In my foray into gaming mouses (see: Review Of Gaming Mouses), one interesting discovery is the “Logitech G13 Advanced Gameboard”.“Logitech G13 Advanced Gameboard” amazon After reading the many reviews and going to a local shop to see it, i think this is fantastic. Not just for gaming, but most importantly, it has some 20+ keys that are programmable. The greatness of the programmable keys isn't just from the company's spin-doctors, but highly liked from user reviews. The software is actually quite good, and comes with a programing language using Lua. So, if you are a emacs user with its 3 thousand commands, and or 3D modeler user, this extra keypad will be extremely useful.Video Reviews“Logitech G13 Advanced Gameboard”. amazon “Logitech G13 Review” Why Not Just A Gaming Keyboard?There are many gaming keyboard o…

A Review of The Microsoft Natural Ergonomic Keyboard 4000

Image
Perm url with updates: http://xahlee.org/emacs/ms_keyboard/ms_natural_keyboard_4000.htmlMicrosoft Natural Ergonomic Keyboard 4000 (review)Xah Lee, 2006-06, …, 2010-08-24, 2011-06-04In 2005, Microsoft produced a new keyboard called the “Natural Ergonomic Keyboard 4000”. This keyboard is a relative major change from their previous ergonomic keyboard.“Microsoft Natural Ergonomic Keyboard 4000”. amazon “Microsoft Natural Ergonomic Keyboard 4000”. amazon “Microsoft Natural Ergonomic Keyboard 4000”. amazon Summary: in the 20 or so keyboards i've used since 1990, i found this to be the best.Major FeaturesFront tiltFront tilt. The keyboard features a front-tilt, and large palm rest. e.g. The middle of space bar is about 2 cm higher than the F5 key. This is GOOD.Usually, people like to prop up the back legs of their keyboard so that they actually have to bend their wrists upward to type. That this bad.Rest your forearm on a table and let your hand relax, you'll notice that your wrist bends…

Microsoft Wireless Optical Desktop Pro Keyboard

Image
Perm url with updates: http://xahlee.org/emacs/ms_keyboard/ms_natural_keyboard.htmlReview of Microsoft Ergonomic KeyboardXah Lee, 2005-11, 2009-02, 2009-07In 2005, i bought Microsoft Wireless Natural Multimedia keyboard (MS WNM), introduced in 2004. This is basically a one-piece split keyboard with special buttons on top. (as of 2009-07, the keyboard is renamed to “Microsoft Wireless Optical Desktop Pro Keyboard”)I'm a input device nerd. I find this keyboard in general better than all i've used in my 14 years of computing experience.The Microsoft Wireless Natural Multimedia keyboard. amazon Outstanding Features• Quality split design. If you type than few hours a day, then try to get used to a split keyboard. It prevents your wrists from bending. Once you get used to split keyboard, typing on a flat keyboard will immediate feel discomfort.• Large Alt and Ctrl keys. Large modifier keys are especially nice if you are a programer, in particular, if you are a Emacs user.• The modifi…

TeX Pestilence

Perm url with updates: http://xahlee.org/cmaci/notation/TeX_pestilence.htmlThe TeX PestilenceXah Lee, 2004-08The following essay, is edited version of my email messages, on the harm of TeX.Problems of TeXTeX is detrimental because it harbors ignorance of the structural content embodied in most math notations in most fields. What TeX does is typesetting, as opposed to math expression encoding. In other words, what TeX does is pretty-printing.The language is designed in a way that any structural info in a math expression are botched. As such, TeX, even though it is a full-fledged computer language capable of great programing, but it understands zilch of math expressions, it encodes zilch math expressions. Now that is a egregious error of a computer language purporting to express mathematics. And more so because it is a product of a mathematician who should've known better.LaTeX mended TeX by turning a pretty printing system into a structured documentation system. However, since TeX …