Posted by: alexvy86 | December 7, 2009

Tool fail

Por esto no hay que usar una botella de plástico como martillo para golpear una aguja:

Y menos si tiene agua mineral adentro.

Posted by: alexvy86 | December 1, 2009

Analyzing the world through their search queries

Prioridades (Brasil):

Sin qué hacer (Canada):

Sospechoso (República Dominicana):

Otros sin qué hacer (Hong Kong):

Consistencia (Suecia):

(btw según Google Translate, systembolaget significa “systems company”… who knows)

One-hit-wonder hysteria:

And finally, media hype (global):

Posted by: alexvy86 | December 1, 2009

Donald Knuth on his writing style

Yes, I always try to keep a potential reader in mind – basically somebody who is reading my book because they want to, not because they must, and somebody who has a natural ability to do computer programming. Only about 2 per cent of the population really “resonates” with programming the way I do; but somebody ought to write books for that 2%, and I try to be one of the authors who does so. Instead of trying to impress the reader with what I know, I try to explain why the things I’ve learned impress me. [My emphasis]

Full interview here.


Posted by: alexvy86 | December 1, 2009

+1 for interdisciplinarity

Ending quote from The Emperor of Scent:

“My father always said if you translate a proverb from one language into another, you pass for a poet. The same for science. Work strictly within one area, and it’s diminishing returns, hard to make progress. But translate a concept from its field for use where it is unknown, and it is always fresh and powerful. In buying outside, you are doing intellectual arbitrage. The rate limiting step in this is your willingness to continuously translate, to force strange languages to be yours, to live in between, to be everywhere and nowhere.”

Posted by: alexvy86 | November 28, 2009

Smells, music, antibiotics, and other things

Estoy leyendo “The Emperor of Scent”, de Chandler Burr, acerca de Luca Turin, un científico con una teoría interesante acerca de cómo olemos. Propone que tenemos un espectroscopio de efecto túnel (electron-tunneling spectroscope) orgánico (hecho de proteínas) en la nariz, que analiza las vibraciones características de enlaces atómicos en las moléculas, y cada combinación diferentes de enlaces tiene un olor particular (como acordes musicales).

El libro está interesante, y he encontrado varias ideas/frases de él que me han gustado/entretenido, so I’ll just stick them here.

Este es un extracto donde vienen sus ideas acerca de la belleza en los olores y del dilema natura VS nurtura acerca de cómo apreciamos los olores (los franceses con sus quesos, por ejemplo):

His second view on the nature versus nurture of smell, firmly held, is that one should seek the full spectrum of smells in one’s life. “France”, he says, “is a country that understands that, much as in music an orchestra is not just violins, the range of smells that makes life interesting includes some rather severe ones.” So what determines what we like to smell? “Your taste in smell is part biology and part culture. Everyone who smells rotten cheese the first time — take Époisses, where you smell it about three rooms away, and one that is even more rare and heavenly and makes the Époisses positively spartan by comparison: Soumaintrain, from Bourgogne, specifically from Saint-Florentin, near Auxerre. When they smell that, Americans think, ‘Good God!’ The Japanese think, ‘I must now commit suicide.’ The French think, ‘Where’s the bread?’

Theres’ a vibrational fifth in esters, you know. I’ve always thought that esters, fruity, are Mozart. The melon notes — helional, for example — strike me as the watery Debussy harmonies, the fourths. Beethoven in his angrier moments is quinolines, which you get in green peppers. Thus Bandit, a dark, angular Beethoven string quartet. There’s a lot of perfumery that smells like Philip Glass’s minimalism, a deceptive simplicity. Mitsouko I think is pure Brahms, the string sextets, extremely intricate but rather monochrome. Tommy Girl gives you Prokofiev’s First Symphony.

But the rotten cheeses. Put it this way: Sauternes, this incredible thing, is a wine that is the direct result of rotting grapes being eaten by a mold. I mean, in an American hospital they’d hand out antibiotics to exterminate half the food in France.

Hablando de un vino (Sauternes):

A great Sauternes is a perfectly proportioned thing. Rieussec makes big-boned, stocky affairs. The ‘59, in a bottle for forty years, comes out the way James Bond emerges from a wet suit in a perfect tuxedo. It looks at you and murmurs, ‘What kept you?’

Posted by: alexvy86 | November 28, 2009

Day C

Corny cornered corns crankily chop crooked crocodiles’ crumbs. Can cheese crops create cold cancer? Cream crushes cyanide cans. Cool.

Posted by: alexvy86 | November 28, 2009

Best. Beer name. Ever.

Tactical Nuclear Penguin.

Y para acabarla es la más fuerte del mundo (31-32% alcohol), según este artículo.

Posted by: alexvy86 | November 28, 2009

Day B

Blueberry brewers bark besides big, burnt barns built by brimstone blobs. Beer bunnies bend baskets behind boring bromide bubbles. Bah.

Posted by: alexvy86 | November 27, 2009

Notes on SQL

I’ll be posting notes and insights on SQL now that I’m preparing for the Microsoft SQL Server 2008, Database Development certification exam. Both as a way of improving my retention over the things I learn, and as a reference for my future self =P. Note that these will most probably NOT be a full-depth treatment of the topics, but isolated notes that are new or interesting to me (in other words, I strongly advise against using these notes as a tutorial for learning SQL). Without further ado:

ANSI_NULLS

The ANSI_NULLS option determines if “normal” comparisons, i.e. using the = and <> operators, can be done against NULL values or not. Setting ANSI_NULLS to ON, these comparisons won’t work (will return “unknown”) and thus IS NULL and IS NOT NULL should be used. When ANSI_NULLS is set to OFF, queries like the following work:

SELECT * FROM Table WHERE Column <> NULL

CONTAINS clause

“The CONTAINS clause is available only when you create a full text index on the column being compared.” This is a big topic, so I’ll summarize some of my findings here (I’ll definitely cover this to a deeper extent in a future post though).

Full-text capabilities in SQL Server 2008 allow us to go beyond Column = ‘Exact_text_match’ and Column LIKE ‘%Partial_text_match%’ and do searches like the following (or so I’ve read haha):

  • Two words near each other
  • Any word derived from a particular root (for example run, ran, or running)
  • Multiple words with distinct weightings
  • A word or phrase close to the search word or phrase

Everything needed for this functionality to work is included in SQL Server 2008 if it’s properly configured during installation (this was not true for previous versions of SQL Server, that depended on some components of the OS). A full-text catalog must be created on the database, and a full-text index on the table of interest (only 1 full-text index can exist per table, and it requires a unique key index on the table too). The index must then be populated. Full-text search can be done over columns of the following types: char, varchar, nchar, nvarchar, text, ntext, image, xml, varbinary, or varbinary(max). While creating these indexes, several options can be specified, like sensitivity to accents, the language of the text we’re indexing, a stoplist word list (‘a’, ‘an’, ‘the’, etc.), the extension of the file contents stored in a column (in the case of a varbinary, varbinary(max) or image column, that store documents in binary format), automatic/manual/off settings for index updates. SQL Server includes “language helpers” like stemmers (processes that conjugate verbs based on the linguistic rules of the language) and initially empty thesaurus. The CONTAINS predicate (along with the FREETEXT predicate, and their [command]TABLE function counterparts, which return the results in a table), is one of the ways to actually use full-text search in a query.

Note from the MSDN:

A LIKE query against millions of rows of text data can take minutes to return; whereas a full-text query can take only seconds or less against the same data, depending on the number of rows that are returned.

Boolean operators (AND, OR, NOT)

The NOT operator typically hurts performance because the query optimizer cannot use indexes for the WHERE clause when a NOT operator is specified. For indexes to be utilized when an OR operator is specified, all columns referenced by the OR condition must be included in an index or none of the indexes are used.

LIKE clause

  • A percent sign (%) replaces any amount of characters in the string (including 0)
  • An underscore (_) replaces exactly one character in the string.
  • Square brackets ([]) replace any one character within a set or a range of characters.
  • A caret (^) as the first character inside square brackets means “match any character NOT in this set/range”.

Just as the NOT operator, Wildcard characters at the beginning of a string do not allow the query optimizer to use indexes.

BETWEEN clause

It is inclusive, so “SELECT * FROM Products WHERE Price BETWEEN 4 AND 8″ includes products with price = 4 and price = 8. Note that this might cause weird behavior when using alphanumeric ranges (i.e. BETWEEN ‘S’ and ‘Z’ returns ‘S’, ‘Slice’, ‘Tom’, and ‘Z’, but not ‘Zebra’)

 

Posted by: alexvy86 | November 26, 2009

Day A

Rules: write a coherent phrase (little bit of nonsense and grammatical incorrectness allowed… a.k.a. encouraged =P) in which ALL words start with the day’s letter.

The phrase that started it all… (courtesy of Chac and Alex):

Annoying aardvarks are adamantly assembling an artificial arm as another asshole alligator astonishes ants and arising all animals alone.

Use the comments. Go!

Older Posts »

Categories