What’s Going On In .cn?

Okay, so we had a domain name country quiz.

Now let’s take this week to visit some of the domains in the quiz!

I’m going to be linking to pages that are in the English language, because I’m one of those isolationist Americanos that never learned a second language (I took Hindi for two semesters in college, but unfortunately very little of it stuck).

So, just realize that whatever I’m reading might be tailored for an English-reading audience.

Anyways, what’s going on in China?

_____________________________________

Jet Li alters script to suit western viewers (People’s Daily Online — March 10, 2008)

China approves second-phase lunar probe program (People’s Daily Online — March 26, 2008)

Reporters at Lhasa riot condemn distorted media coverage (China Economic Net — March 28, 2008)

Facing high cost of dying in cities (People’s Daily Online — April 2, 2008)

The Official Website of the Beijing 2008 Olympic Games

_____________________________________

If you want to do your own searching of the .cn domain, you can use Google to enter your search criteria, adding the text site:.cn. This will limit your search to websites within the .cn domain.

For example, here’s a search for Splotchy:

Check out the fourth search result! Woo for SamuraiFrog! Or at least his Technorati page.

Domain Name Country Quiz!

Hiya.

Here’s another quiz for you.

I’ll give you the domain name extension (e.g. .com, .net, .org) and you tell me what country it’s for.

No cheating!

01) .sg
02) .br
03) .uk
04) .dk
05) .cn
06) .fr
07) .yu
08) .sa
09) .es
10) .gr
11) .jp
12) .us
13) .nl
14) .in
15) .de
16) .cz
17) .cu
18) .iq
19) .pk
20) .ca

UPDATE:

Oops. #9 was marked as .sp (a domain that doesn’t exist). I have changed it to what I had intended — .es

All the other questions are correct.

SECOND UPDATE:

Here are the answers:

01) .sg (Singapore)
02) .br (Brazil)
03) .uk (United Kingdom)
04) .dk (Denmark)
05) .cn (China)
06) .fr (France)
07) .yu (Yugoslavia)
08) .sa (Saudi Arabia)
09) .es (Spain)
10) .gr (Greece)
11) .jp (Japan)
12) .us (United States)
13) .nl (Netherlands)
14) .in (India)
15) .de (Germany)
16) .cz (Czech Republic)
17) .cu (Cuba)
18) .iq (Iraq)
19) .pk (Pakistan)
20) .ca (Canada)

I believe Matty Boy did the best with this quiz, missing only #1 and #8. His stellar performance doesn’t surprise me, as I am aware of his intense Flags Of Many Lands™ obsession. Congrats to Matty Boy!

I am going to make a point of visiting some websites having these domain name extensions this week.

I know that I’ve definitely been to some UK, Canadian, even German sites relatively recently, but I don’t believe I have accessed a domain in a majority of these countries. Won’t you please join me, and let me know if you find anything nifty?

People I Hope To Someday Meet

1) Jack Pickle
2) Cyrus Niftypants
3) Peter Wasabi Peters
4) Nancy Treaty-Tweety
5) Eleanor Wonderdrier
6) Chester Noble Balls
7) H. Livid
8) Pudgely Goober
9) Ira Antipasto
10) Harry Gut
11) Thom Thom Olgersonowicz
12) Hubley Mumps
13) Yanni Chrome
14) Alabaster Cranberry
15) Dr. Piffle
16) His Honorable Jumpsuit Algae Ring Toss
17) Sue Hug
18) Crazy Will Carburetor
19) Iris Anagram
20) Hops Sprightly

UNIX Script Goodness And Variable Prefix/Suffix Stripping Fun


Here’s something you probably have no interest in, but it’s a script I wrote to help me with UNIX shell programming that I engage in from time to time.

There’s a nice way of easily taking a piece of text (often called a “String” by programmer-types) and stripping off pieces of it, either from the front or the back, using variable evaluation.

One thing to note about UNIX is that are many, many different ways to do the same thing. This is just one little feature of UNIX I like to use.

I wrote a script to help me when I want to do this prefix/suffix stripping kind of variable evaluation.

Here is the script in its entirety:

function showUsage {
print
print ‘USAGE:’
print ‘ksh -f variableTest.sh
print
print ‘=============================================================================================================’
print ‘${variable#pattern} evaluates variable, but removes the smallest portion of its prefix which matches pattern.’
print ‘${variable##pattern} evaluates variable, but removes the largest portion of its prefix which matches pattern.’
print ‘${variable%pattern} evaluates variable, but removes the smallest portion of its suffix which matches pattern.’
print ‘${variable%%pattern} evaluates variable, but removes the largest portion of its suffix which matches pattern.’
print ‘=============================================================================================================’
print
print ‘Special instructions:’
print ‘======================’
print ‘To stop the shell from interpreting wildcards you may use for patterns,’
print ‘run this script like the following:’
print
print ‘ksh -f variableTest.sh
print
print EXAMPLE: ksh -f variableTest.sh aabbcc \’a*\’
print
print
exit 1
}

clear

if [ $# -ne 2 ]
then
showUsage
fi

variable=$1
pattern=$2

print
print ‘=============================================================================================================’
print ‘${variable#pattern} evaluates variable, but removes the smallest portion of its prefix which matches pattern.’
print ‘${variable##pattern} evaluates variable, but removes the largest portion of its prefix which matches pattern.’
print ‘${variable%pattern} evaluates variable, but removes the smallest portion of its suffix which matches pattern.’
print ‘${variable%%pattern} evaluates variable, but removes the largest portion of its suffix which matches pattern.’
print ‘=============================================================================================================’
print
print ‘variable: ‘ $variable
print ‘pattern: ‘ $pattern
print
print ‘${variable#pattern} ‘ ${variable#$pattern}
print ‘${variable##pattern} ‘ ${variable##$pattern}
print ‘${variable%pattern} ‘ ${variable%$pattern}
print ‘${variable%%pattern} ‘ ${variable%%$pattern}

Most of this script is just printing stuff out to the screen. There’s a whole big piece of code that just tells you how to run the script.

Anyways, say you want to find out what directory you are in on a UNIX file system, and want to save this off in a variable, but without all the nested subdirectories your directory rests in (UNIX is all about the nested subdirectories).

You can use this script to figure out the right pattern to get your current directory minus the path.

Example:

Let’s say I’m in:
/usr/appl/abc/very/very/long/directory

After some trial and error running my script, I can eventually figure out how to get my current directory, minus the path.


>ksh -f variableTest.sh /usr/appl/abc/very/very/long/directory ‘*/’

variable: /usr/appl/abc/very/very/long/directory
pattern: */

${variable#pattern} usr/appl/abc/very/very/long/directory
${variable##pattern} directory
${variable%pattern} /usr/appl/abc/very/very/long/directory
${variable%%pattern} /usr/appl/abc/very/very/long/directory

Your current working directory (including the path) is stored in a variable called $PWD.

So, to get your current working directory only in a script you are writing, you can just write the following line:


MY_DIRECTORY=${PWD##*/}

Why did I write a script to do this? Because I can never remember how the pattern matching works, and thought it would be easier to write a script to show me instead.

Now, you’re probably asking me, “Splotchy, why would you put something in a program that many, including you, do not fully understand or remember how it works?”

As Matty Boy would say, that’s a great question, hypothetical question asker!

One thing that I neglected to mention about UNIX programming is that it is notoriously squirrelly. And this feature I am making use of is pretty damned squirrelly, too.

Negative Space Signage Update


Since I recently provided an update regarding A Blog Of Notes, I thought I’d also update you on another blog, The Signage of Negative Space.

In the two months this blog has been running, we have documented seventy-three instances of negative space signage.

I have complete confidence we will reach one hundred signs and beyond.

Besides me, there are currently four other contributors of signage photos:

Freida Bee (Austin, Texas)
PJ (London)
Tim (Springfield, Illinois)
Thornton (Boston, Massachusetts)

I really can’t adequately convey my happiness at having other people participate in this blog. It’s really quite, quite nifty to post photos from different people living in different parts of the globe.

I know that I have the occasional blog readers from different geographical regions, Missouri, Tennessee, New York, California, etc., that have yet to have their own negative space signage represented.

If you want to make this BoingBoing-neglected wreck the happiest l’il blogger this side of the Mississippi, I hope you’ll consider looking around for negative space signage in your neck of the woods.

Stay Negative,

Splotchy