Posts

Showing posts from February 21, 2010

what is gamma in digital images

Tutorial perm url with updates: http://xahlee.org/img/what_is_gamma_correction.htmlWhat Is Gamma In Digital ImagesXah Lee, 2010-02-24Been quite familiar with the technology of bitmapped image, the mathematical gist of their formats, since about 1995. For example, the diff between gif, jpeg, png. There's RGB color model , but also HSL and HSV, and CMYK.In one sentence, a image is made up by a rectangular grid of pixels, and a pixel has 3 sets of values, for Red, Green, Blue, together they specify a color for the pixel, and all the pixels form the image. In early 2000s, Alpha channel became important. It allows you to have semi-transparent images. Transparency is important for images on computers, because for example, you might want a image partially transparent so users can see what's behind.One element of digital image i never understood is Gamma.Going to Wikipedia's gamma article, but it is unreadable. But then i found this: Gamma FAQ - Frequently Asked Questions about …

Web Share Widgets

Image
perm url with updates: http://xahlee.org/js/share_widgets.htmlWeb Share WidgetsXah Lee, 2010-02-22These days, there are lots of websites that have tiny icons that allow readers to add the article to blog sites, or bookmark sites, social networking sites, such as facebook, blogger, twitter, delicious, digg, stumble upon, etc. Sites that includes such share widgets includes times.com, nytimes.com, cnn.com, usatoday.com, washingtonpost.com. You can just go to http://news.google.com/ and click on news articles to arrive at a site and look at their share widgets. For tech sites that have share widgets, there's http://blog.wolfram.com/, http://arstechnica.com/, http://slashdot.org/, http://tomshardware.com/, etc. Is there a sharing widget plug-in for web masters?If you look at their sharing widgets on major sites, looks like most are home cooked.Adding A Share Widget To Your WebsiteI spend 10 min and found 2. One of them is addthis.com, and the other is sharethis.com. The sharethis.com…

Mac OS X Changes On Unix

perm url with updates: http://xahlee.org/UnixResource_dir/writ/mac_os_x_unix_changes.htmlMac OS X Changes On UnixXah Lee, 2010-02-15This blog is some random notes on Mac OS X.Recently, i was helping my friend, professor Richard Palais install and fix some svn repsotiory issues at his os x server at uci. I've been doing senior unix sys admin work during 1998-2002 on Solaris. But I haven't really been doing any serious sys admin since. It is a pleasure to dive into the unix quagmire again.As discussed in my The Unix Pestilence page, the best resource for unix admin is not some commercial books, but rather, the documentations published by the unix maker itself.The current documentation for Mac OS X 10.6 (Snow Leopard) is at: Mac OS X Server GuidesSource. They are excellent.Changes To UnixMac OS X, made many fundamental changes to the incompetent unix in the past decade since it adopted unix. Here's some of them as far as i know: The login account management and infrastructu…

Learning Notes On Goto, Continuation, Coroutine

perm url with updates: http://xahlee.org/comp/goto_continuation_coroutine.htmlLearning Notes On Goto, Continuation, CoroutineXah Lee, 2010-02-05, 2010-02-05Some learning notes on Goto, Continuation, Coroutine, in programing languages.I realized today that these concepts are not about implementation, hardware, efficiency, nor algorithm, but rather, they are a particular construct, choice of design, in the semantics of computer languages. For example, to express a repeatition, some languages has “for” loop, some has “while”, some has “do ... until”, some relies on “Nest”, “Fold”, “FixedPoint”, most languages have a combination of these, but any single one of them is sufficient with respect to expressing a algorithm. Same thing can be said for constructs like “case”, “which”, “switch”, “if then elseif ... elseif ...”, all can be expressed by just having a simple “if else” construct. Continuations and coroutine, are a bit more complex, but they are basically a form of GOTO statement.More…

mathematica optimization

Image
Perm url with updates: http://xahlee.org/UnixResource_dir/writ/Mathematica_optimization.htmlA Mathematica Optimization ProblemXah Lee, 2008-12-05Recently, in a discussion in newsgroup “comp.lang.python”, Dr Jon Harrop challenged me for a Mathematica optimization problem. In summary, he posted a Mathematica code in which he badmouths Mathematica. I challenged for him to pay me $5 paypal and i'll post code to show how lousy his code is. Then, someone named Thomas M Hermann offered me $20. This page discusses the code.Here's the full thread: Newsgroups: comp.lang.lisp, comp.lang.functional, comp.lang.perl.misc, comp.lang.python, comp.lang.java.programmer From: Xah Lee Date: Sun, 30 Nov 2008 Subject: Mathematica 7 compares to other languages Source. In the following, i'll just post the technical details of this optimization problem.Optimizing A Raytrace CodeHere's Jon's original code, to be run in Mathematica 6 (notebook: raytrace_v6_original.nb.gz): delta = Sqrt[$Mac…

nsa mass surveillance

perm url with updates http://xahlee.org/comp/nsa_mass_surveillance.htmlNSA Mass SurveillanceXah Lee, 2010-02-23(some blog comment about mass surveillance in USA)I watched parts of the movie The Taking of Pelham 123 (2009 film) and reading Wikipedia about it. It has this quote in the Critical Recption section: In a review for MSNBC, Alonso Duralde was critical of John Travolta's performance in the film, comparing it to his roles in Swordfish and Battlefield Earth: "Travolta remains singularly unbelievable as a villain. In movies like this and 'Swordfish' and, let's not forget, 'Battlefield Earth,' the actor strives for malice but generally can’t get much darker than playground-bully meanness."[26]Swordfish is a crime thriller about computer hacking, but i haven't seen it. Heard it isn't so good. Reading Wikipedia, it has this quote:Stanley Jobson (Jackman) is an elite hacker who infected the FBI's Carnivore program with a potent computer v…