Sunday, February 14, 2010

Web Development: Windows PowerShell in Plain English

Microsoft Windows PowerShell™ 2.0 is an extensible automation engine, consisting of a command-line environment and scripting language designed especially for local and remote system administration by IT professionals and power users.

Simple built-in commands called cmdlets (pronounced "commandlets"), each a specialized .NET class, perform common system administration tasks such as managing the registry, services, processes, or event logs. More than a hundred cmdlets are provided with PowerShell; and the user can develop and extend cmdlets, as well. Cmdlets can be scripted and chained such that the output from one can be used as the input to another, providing the ability to accomplish very complex tasks. The PowerShell scripting language is consistent with higher-level languages used in .NET Framework programming, such as C#.

cmdlet names consist of a verb and noun separated by a dash (-), such as Get-Process and Start-Service. The "get" cmdlets retrieve data, the "set" cmdlets establish or change data, "format" cmdlets format data, and "out" cmdlets direct the output to a specified destination. Each cmdlet has a help file that you can access by typing: get-help <cmdlet-name>.

PowerShell provides access to the file system, and ships with providers that enable access to data stores such as the registry and digital signature certificate stores by means of the same techniques used to interact with the file system. PowerShell also enables access to the COM and Windows Management Instrumentation (WMI) subsystems.

Unlike command-line environments such as cmd.exe and Unix shells, PowerShell accepts and returns .NET objects rather than text, bringing new tools and techniques to the management and configuration of the operating system and applications. For example, when interacting with a service in PowerShell, the user is really manipulating an object that represents the service. Service information is represented in the form of object properties. To start or stop a service, the developer invokes one of the object's methods.

The user can also continue to use traditional tools, such as the Service Control Manager, ipconfig.exe, net.exe, reg.exe, and shutdown.exe; and can take advantage of cmdlets like Select-String to manipulate the text that those Windows programs return. The user can also start Windows programs that have a graphical user interface at the Powershell prompt.

The PowerShell runtime can also be embedded in other applications. Microsoft Exchange Server 2007 and SQL Server 2008, for example, expose management functionality by means of PowerShell cmdlets and providers. All future Microsoft applications are to be PowerShell-aware.


Windows Powershell (Microsoft TechNet)

Windows PowerShell (Wikipedia)

Windows PowerShell Cmdlets (Microsoft TechNet)

A New Scripting Language (Microsoft TechNet)

Processing Objects (Microsoft TechNet)

Object Pipelines (Microsoft TechNet)

Saturday, February 13, 2010

Spanish Expressions Using Parts of the Body: The Eyelash

As in English, many Spanish idioms and other expressions involve parts of the body. This example refers to the eyelash:

quemarse las pestañas or dejarse las pestañas (familiar)
literal translation: to burn the eyelashes
to work very hard, to study hard, to burn the midnight oil
e.g. Su marido se quemaba las pestañas: Her husband worked very hard.

The word pestañas can also mean stiff hairs that are placed on the edge of a surface.


Vocabulary Quiz (mouse over for answers)

pestaña

I had to get an eyelash out of my eye.

pestañas postizas

pestañear

sin pestañear

pestaña (of a Web page or computer screen)

pestaña (of a container)

pestaña (of a book)

pestaña (mechanical)

quemarse

pestaña (WordReference)

pestaña (en español, RAE)

pestaña (en español, informática)

Saturday, February 6, 2010

Bertrand Russell's Famous Table

"Suppose that, with your eyes shut, you let your finger-tip press against a hard table. What is really happening? Although you think you are touching the table, no electron or proton in your finger every really touches an electron or proton in the table, because this would develop an infinite force. " --Russell

As I mentioned in an earlier post on Intuition, our day-to-day tendency to classify the persons, places, and things that we encounter leads us to make assumptions that, upon close examination, turn out to be self-contradictory and even grossly misplaced.

Bertrand Russell's famous table discussion serves as an example of how our unquestioning acceptance of the physical nature of objects reveals an even deeper misunderstanding of subtler, more complex, and infinitely more important aspects of ourselves, the world we inhabit, and the invisible forces of cause and effect that impact our every experience.

The important thing to keep in mind is that the perception that occurs in our brains as we attempt to classify information received via our senses is not that same as the reality that stimulates those senses. This is true both of our perception of the physical world and, by extension, of nature and of the ultimate intelligence that controls all things.

"To say that you see a star when you see the light that has come from it is no more correct than to say that you see New Zealand when you see a New Zealander in London."

To the reasonable person, a particular table might appear to have certain indisputable characteristics: it is brown, it is hard-surfaced, it is apparently old. However, the brownness of the table is certainly a simple matter of how the light at a particular time of day reflects off the specific pigment of the stain applied to the table and is perceived by the aforementioned reasonable person. Only another person positioned at exactly the same spot as the first at the exact time of day, with the very same degree of sensitivity to light would see the table the same way. A person with the visual condition called Daltonism would perceive the color of the table differently, as would a creature with the trichromatic color vision of a bee. Not one of these interpretations would be right or wrong. Light waves that reflect from an object would be interpreted one way by the human eye, another way by a bee, and a third way by a scientific instrument. The degree of brownness might change from mid-morning to late evening. The table is not, in fact, brown. We perceive brownness from the light reflected from the table.

"It is extrordinarily difficult to divest ourselves of the belief that the physical world is the world we perceive by sight and touch."

Along the same lines, what we perceive as a table would appear to be something differently entirely if we were microscopic in size and found ourselves somehow among the atoms that form the object. That the size and shape of the structure would be invisible from us is not to say that we are merely unable to see it. Our view at that moment is just as legitimate as the view of the reasonable observer mentioned earlier. These two views of the same so-called object again demonstrate that what we thought of as a table is simply one interpretation.

Continuing, the apparent durable or long-lasting nature of the table is relative to the perception of a human being typically destined to exist on this earth for perhaps a period of seventy to eighty years. If we were discussing a melting ice cube rather than a table, we might say that it would exist as an ice cube for perhaps a half hour on a warm day. This interpretation would affect our assessment of the ice cube and its value to us. If my glass of punch is warm, then I'd better use the ice cube before it melts. As opposed to the table, I'd better not become emotionally attached to the ice cube because it's not going to be around for long. However, to the Mayfly, with a lifespan as short as five minutes, if in fact the Mayfly would have thoughts about the ice cube, he might interpret it as a colossal glacier that lasts for six lifetimes.

However silly that thought, there is a consequential conclusion to this line of thinking. The body is a bundle of sensations. That multiple people cannot have exactly the same interpretation of an object, due to differences in the way light waves, sound waves, smells, and the other physical sensations -- not to mention the more subtle intellectual and emotional stimuli -- are interpreted, begs the question: What in fact is real about the world around us?

Ignorant face value acceptance of what was perceived to be the physical world by the medieval church is what put the physicist, mathematician, astronomer, and philosopher Galileo, whom Stephen Hawking called "perhaps more than any other single person, responsible for the birth of modern science," under house arrest for the final ten years of his life, as punishment by the Catholic church for writing that the Earth revolves around the Sun. If we ourselves misinterpret the nature of the physical objects before our very eyes, what are the odds that we're accurately assessing another person's expression or tone of voice or what is really being said? How are we to understand the larger, clearly more important questions of our times and of all time? These are the questions of philosophy.

"When you press, repulsions are set up between parts of your finger and parts of the table. The repulsion consists of electrical forces, which set up in the nerves a current whose nature is not very definitely known. This current runs into the brain, and there has effects which, so far as the physiologist is concerned, are almost wholly conjectural...the knowledge we derive from physics is so abstract that we are not warranted in saying that what goes on in the physical world is...intrinsically...what we know through our own experiences. "

Korean: Formality Levels with Regard to Proposals

Both intimacy and respect are highly valued in Korean culture. Different styles of proposal verbs and sentence endings are appropriate in Korean for different settings and audiences. 존댓말 (chon-daet-mal) is the polite level used for general courtesy, in formal social settings, news reports, and the like. 반말 (pan-mal) is a casual level used between good friends, an adult talking to someone considerably younger, etc. A new friend sometimes requests permission before using 반말.

There are four levels of formality for Korean proposals.

Formal (존댓말)
  1. 합시다 (hap-si-da)
  2. 해요 (hae-yo)
Informal (반말)
  1. (hae)
  2. 하자 (ha-ja)
Let's go to that store:
ku (that)
가게 ka-ge (store)
eh (to)
가다 ka-da (to go)
Formal
  1. 그 가게에 갑시다. (ku ka-ge-eh kap-si-da)
  2. 그 가게에 가요. (ku ka-ge-eh ka-yo)
Informal
  1. 그 가게에 개. (ku ka-ge-eh kae)
  2. 그 가게에 가자. (ku ka-ge-eh ka-ja)
  • The 합시다 style is mostly used among adults who are about the same age and are familiar with one another.
  • The ending might be used for gentle suggestions such as 같이 가요 (let's go together) to one the speaker doesn't know well. (Use the very polite form 같이 가세요 ka-chi ka-se-yo when speaking with someone much older.)
  • The slightly less formal 하자 style is often used in place of the  form, perhaps because  sounds more like a command.

Remember that even though 존댓말 and 반말 are often referred to as the "polite" and "casual" styles, in reality neither style is necessarily always polite or not polite. The formal style can seem distant when used with a friend and is in fact used when people quarrel. And an inappropriately casual style in a formal situation can be perceived as impolite.

Inline Display of CSS Block Elements #2

Click here for the post, as it contains wide images.

Tuesday, February 2, 2010

Looking Up a Sinograph in the Kangxi Dictionary

Whereas it is possible for even the young schoolchild to memorize the sequence of the 26 English letters, the sheer quantity of Chinese characters (47,000+ in the Kangxi dictionary[1]) makes it impossible to do the same in Chinese. In this post I'll describe the system the Chinese use for looking up characters in their dictionary. For the beginner, this act is a sort of philosophical experience. It takes much patience and it's slow going and even frustrating. Before one can begin, it's essential to become familiar with two concepts:
  1. Strokes. Each radical and character is composed of a number of strokes.
  2. The Chinese radicals, not pro-democracy revolutionaries but rather, the 214 components that form the basis for the Chinese character set.

Strokes

Each character in the Chinese alphabet comprises up to 30 strokes, a stroke being defined as one the portions of a character that can be drawn with a writing device without removing the nib from the page. Chinese schoolchildren spend long hours practicing each of these named strokes as they learn the characters.

The character (一, which means one) serves as a simple example, consisting of one horizontal stroke.

The 8 basic forms of strokes: CSUN (Cal State University)


Radicals

Radicals are simple characters or portions of characters that were popularized during the Qing dynasty, when the emperor Kangxi commissioned the dictionary. Knowledge of the radicals aids character look-up dramatically.

This list from YellowBridge displays English names for the radicals.

Once you have attained proficiency with the 214 radicals, you will be in a position to examine a character you wish to look up and identify the radical. Having done so, and by now being able to discern a radical's stroke count, you would look the radical up, perhaps in an online dictionary such as this page from mdbg: Radical/Strokes Lookup[2].


Having located the radical in an online lookup page such as mdbg's, you would click it to reveal another page displaying all the character candidates based on that radical.

For example, having located the 2-stroke radical yán(讠), you would click it and thereby find yourself at this page, which renders all the characters based on this radical:

Next, extrapolate an index into this chart by subtracting the stroke count of the radical from the stroke count of the entire character in order to find the row containing the character you're looking for. Click that character and you'll be rewarded for your efforts with a page containing the definition of the character.

You would use a hard-copy dictionary the same way, but online tools are much more convenient.

Pretty easy, right? Now that you're familiar with the Simplified Chinese character set, we'll move on to the more complex Traditional set in a future post. I'm just kidding. It's frustrating as hell, really.


1. A relatively literate person need "only" be proficient at 3,000-4,000 characters.
2. Most dictionaries also allow the user who might not be able to identify a character's radical to look up the character based on total stroke count, but there are typically and extraordinarily large number of characters with the same stroke count, so this is typically done only as a last resort.

Monday, February 1, 2010

Spanish: Relative Pronouns Que Versus Quien

During your studies, you might come across quien and que used as relative pronouns referring to people as in the following sentences. Both are correct:

Los hombres que viste están en peligro.
The men that you saw are in danger.

Fue él quien me enseñó la casa.
He was the one who showed me the house.

Obviously, quien refers only to people. When referring to a thing, que is used:

El libro que le he prestado a Hector es extenso, no es corto.
The book that I lent to Hector is extensive. It's not short.

La casa que fue diseñado por el arquitecto mexicano es de color amarillo.
The house that was designed by the Mexican architect is yellow. (Remember that the true passive voice isn't used in Spanish as much as it is in English.)

When the person being referred to is the direct object, remember to use the personal a with quien:

La señora que conocí anoche es la madre de Julio.
La señora a quien conocí anoche es la madre de Julio.

The woman whom I met last night is Julio's mother.

Vocabulary of the Day

margarita daisy (the first thing that came to mind was Margarita, the drink, right?!

dar (o echar) margaritas a los cerdos (o puercos) means the same as to cast pearls before swine

deshojar la margarita means to play "she loves me, she loves me not." deshojar means to pull the petals off (or to rip the pages out of)

By the way, the word margarita is of Greek origin, via Latin and means pearl. Interesting article in Spanish on the etymology of the word.