Sunday, 14 June 2015

Chinese Name

My chinese adopted name is 小山 which consists of two chinese characters. Sometime ago I was informed that there is a single chinese character that combines 小 and 山. The ideographic description character sequence is ⿱小山

This combined character is encoded in Unicode in SIP (Supplementary Ideographic Plane), CJK Unified Ideographs Extension C at codepoint U+2AA24. The only font I have, so far, found which contains a glyph for this character is hanazono which is available for download from osdn.jp/projects/hanazono-font/releases/62072 Hanazono is actually provided as two ttf font files:  HanaMinA and HanaMinB. Here is what the combined character, which is in HanaMinB, looks like in TextEdit on OSX.



Is there a sound for this uncommon character? After much searching I discovered cns11643.gov.tw/MAIDB/query_general_view.do?page=c&code=263f which represents the sound as shān (Hanyu Pinyin) and ㄕㄢ (Zhuyin). Same sound for both forms of representation. CNS 11643 is a Taiwanese character set.

Friday, 12 June 2015

New gTLDs CSV

There is a regularly updated ICANN csv file which summarises key New gTLD information in 6 fields. It is available at newgtlds.icann.org/newgtlds.csv (ref: cabforum.org/pipermail/public/2014-September/003907.html)

field 1: ASCII form (A-label)
field 2: unicode form (U-label) if an IDN otherwise empty
field 3: registry operator
field 4: date registry agreement signed
field 5: application number
field 6: date of delegation (empty if not yet delegated)

Fields 1,2 (if an IDN),3,4 from this csv are incorporated into the public suffix list publicsuffix.org/list/public_suffix_list.dat

For example, the csv entry for .コム is

xn--tckwe,コム,"VeriSign Sarl",2015-01-15,1-1254-37311,

It seems as though Chrome browser uses this public suffix list. One interesting (and IMHO good) consequence is that Chrome will recognise a .コム IDN (eg anything.コム ) as a domain name to be resolved even though it is not yet delegated. Chrome does not resort to a search. So Chrome is ready to go as soon as .コム is delegated.

Tuesday, 10 March 2015

Nottingham

Орёл и Решка is a russian language ukrainian TV travel programme. Season 9 episode 14 was all about Nottingham which in russian is Ноттингем. The presenters were Регина Тодоренко and Евгений Синельников. I watched this episode and found it fascinating to see and hear of Nottingham from a different point of view and language.

There is an English wikipedia article about Орёл и Решка https://en.wikipedia.org/wiki/Oryol_i_Reshka

A russian language writeup of the visit to Nottingham/Ноттингем is available on the programme's website orel-reshka.net/9-sezon/321-orel-i-reshka-07-12-2014-nottingem-velikobritaniya.html

Регина Тодоренко stayed in the Edwards room at Langar Hall Country House Hotel langarhall.com/rooms/edwards/

The London RouteMaster Bus was hired from Blackmore Commercials blackmorecommercials.co.uk

Throughout the video there are popups specifying the cost of various items. Interestingly, three different currencies are used - Russian Rubles (РУБ), British Pounds (£), US Dollars ($).

I used a Unicode savvy shortening service to create links to the below video - ta.gd/nottinghamta.gd/ноттингемta.gd/诺丁汉ta.gd/ノッティンガムta.gd/노팅엄ta.gd/नाटिंघमta.gd/Νότιγχαμdoiop.com/น็อตติ้งแฮม

Letʼs also have an emojified link ➜ 🍆😁🌊🏂🎳🐤🎉🍣.🆒🔗.ws


Monday, 9 March 2015

Duang

There has been much buzz about the invented word duang. It consists of both a Chinese character (well actually two) and a romanized form. The romanized form has even acquired the Chinese 1st tone, duāng

The Chinese character is constructed from Jackie Chan's Chinese name which has both Simplified and Traditional Chinese forms - Simplified ➛ 成龙 and Traditional ➛成龍. The Chinese character for duāng is constructed by placing the first character on top of the second to form a single composite character. Using Ideographic Description Characters, the two new duāng characters can be represented as the sequences:
  • ⿱成龙
  • ⿱成龍
What few realise is that there exists a font which contains glyphs for the duāng Chinese characters - BabelStone Han PUA babelstone.co.uk/Fonts/PUA.html. This font maps glyphs to codepoints in the Unicode PUA (Private Use Area) in the BMP (Basic Multilingual Plane). PUA codepoints can be used for any purpose by anyone, unlike the other codepoints which have to go through an approval process before they can be used. This font maps it's two duāng glyphs to PUA codepoints U+F4E2 and U+F4E3.

I installed BabelStone Han PUA font and here is how the duāng characters look in TextEdit on my iMac.


Update: The two duāng glyphs (using the same PUA codepoints U+F4E2 and U+F4E3 ) are also available in font BabelStone Han babelstone.co.uk/Fonts/Han.html

Sunday, 4 January 2015

India ccTLDs

India now has all of it's seven IDN ccTLDs delegated to the Internet's Domain Name Root Zone. These seven ccTLDs encompass an impressive diversity of languages and scripts. All of these seven ccTLDs mean India.

  1. .ভারত language=Bengali script=Bangla punycode=xn--45brj9c
  2. .భారత్ language=Telugu script=Telugu punycode=xn--fpcrj9c3d
  3. .ભારત language=Gujarati script=Gujarati punycode=xn--gecrj9c
  4. .भारत language=Hindi script=Devanagari punycode=xn--h2brj9c
  5. .بھارت language=Urdu script=Arabic punycode=xn--mgbbh1a71e
  6. .ਭਾਰਤ language=Punjabi script=Gurmukhi punycode=xn--s9brj9c
  7. .இந்தியா Language=Tamil Script=Tamil punycode=xn--xkc2dl3a5ee0h

It will take quite some time before there are live Domain Names using these ccTLDs. I will endeavour to provide examples as they go live.

  1. Hindi ➪ सीडैक.भारत
  • IDN= Internationalized Domain Name
  • ccTLD= country code Top Level Domain

Saturday, 8 November 2014

Be the change?

"Be the change you wish to see in the world"--It's no wonder this saying (let’s call it BTC) has become so popular. From its sense of immediacy to its spiritual turn of phrase, BTC hits all the right notes. It doesn't hurt that it is commonly attributed to Gandhi, even though, as writer Brian Morton has noted, the closest Gandhi came to BTC was a passage including these words: "If we could change ourselves, the tendencies in the world would also change." 

Although BTC echoes some of Gandhi’s themes, its phrasing and emphasis are notably different. What is clear is that its concise form delivers a potent message about the potential for transformation--and this provides us with a window into contemporary values.

BTC suggests that if, for example, you wish for more patience in the world, you should be more patient yourself. Presumably if you succeed in becoming more patient, then you have increased the global level of patience. Furthermore, your example may encourage others. This appears plausible, and in cases like this BTC seems to provide good guidance.

What if you seek a reduction in greenhouse gas emissions? You can’t “be” less greenhouse gas emission, but following the spirit of BTC, you should aim to produce less emissions yourself. But suppose you want an improvement in the human rights situation in Burma? How can you “be” such a change? Here, there isn't much guidance. BTC is sometimes interpreted to mean “If you want to see change in the world, then do something.” But this is too broad. BTC is more than an encouragement to take action--it’s about personal change as a vehicle for transforming the world.

Like many sayings, BTC is a mixed bag. To its credit, it encourages each of us to examine the role we play in larger-scale problems, and it calls us to take action. But troublingly, BTC hints that any problem can be solved by changing individual behaviours. Thus, the problem of greenhouse gas emissions could be solved if we carpooled and used public transportation, used less energy to heat and cool our homes, and so forth. But while individual lifestyle choices are clearly important, the problem is much more extensive and complex than this. Greenhouse gas emissions can be attributed not only to individual choices but also to large-scale industrial and agricultural operations, not to mention military activities. It might be argued that such factors can ultimately be traced to individual lifestyle choices: companies only produce what customers demand, governments simply respond to the public will. But this is simplistic: companies may be driven by the market, but they also affect the market through advertising and political influence; governments respond not only to the public will, but also to powerful people and corporations.

Regardless, we still face the question of how best to effect change. BTC encourages each of us to change ourselves. But even in problems where individual behaviour plays a central role, broader issues are often involved. For example, automobiles are a major producer of greenhouse gases. But our reliance on them is part of an intricate web of social and economic factors, such as urban sprawl, public transit options, tax policies, and government regulations. If complex problems are seen largely as personal lifestyle issues, structural factors may not get the attention they deserve. At its worst, a focus on personal lifestyle can become a fetish, and broader issues may be ignored.

During the American civil rights movement, many wished to see an end to racial discrimination. BTC would suggest that those people should have worked to end their own discriminatory behaviour. But discrimination was more than an individual behaviour, it was an entrenched institutional problem. The civil rights movement used political action such as protest marches to press for structural changes in American society, such as desegregation of schools and the outlawing of discriminatory employment practices. Of course, in many cases personal transformation and political change go hand in hand. However BTC tends to encourage--and reflect--a belief that personal transformation is sufficient.

Another interesting aspect of BTC is the distinctly spiritual tone in the words "be the change", echoing the transformative themes so common in religious traditions. The notion that transcendent meaning may be found in personal change need not stand in opposition to an understanding of the mechanisms by which broader change can be effected. But BTC conflates personal change with change in the world, hinting that in some mystical sense they are the same thing.

Equating personal and societal change obscures the mechanisms by which change is actually brought about. To understand these mechanisms, we need to pay closer attention to the messy connections between our efforts and their outcomes, including the role of other contributing factors, barriers to change, possible synergies, and the unanticipated consequences that our actions may produce. A commitment to change requires considering the pros and cons of various choices in the face of inevitable uncertainty. Unfortunately, BTC may cut this process short.

The popularity of BTC reflects a concern about our role in the problems of the world and a desire to bring about change, but it also reflects our society’s preoccupation with self-improvement, which sometime veers into self absorption. BTC deftly substitutes personal transformation for global change. The risk is that even as it empowers us to transform ourselves, BTC threatens to further disengage us from the world.

Friday, 5 September 2014

Difference between Free and FreeAndNil in Delphi: What to use when?

Difference between Free and FreeAndNil in Delphi: What to use when?

Free and FreeAndNil are the main concepts of memory management in Delphi. FreeAndNil is a function declared in the SysUtils unit and was introduced in Delphi 5. Below is the implementation of FreeAndNil:

procedure FreeAndNil(var Obj);
var
  Temp: TObject;
begin
  Temp := TObject(Obj);
  Pointer(Obj) := nil;
  Temp.Free;
end;

Difference between Free and FreeAndNil: 

FreeAndNil first sets the object reference to nil and then frees the object. 

When to use FreeAndNil instead of Free?

If you want a rational answer, the question to ask is, why would you want to set an object reference to nil once you’re done with it?  And there’s only one good reason to ever do that: If you want to reuse the variable later.  There are some times when you’ll have an object that may or may not be initialized. If it’s not, then the variable will be nil, and if you find it’s nil, then you create it before using it.  This is a pretty common pattern.  It’s called “lazy creation”.  But every once in a while, you want to use lazy creation on an object, then destroy it and create it again. This is when FreeAndNil comes in handy.

Use FreeAndNil for Defensive Programming

You can compare FreeAndNil with seat (safety) belts in cars: if you application runs normally - then FreeAndNil won’t be useful. But if your code mess up with something - then FreeAndNil (as seat belts too) will protect you from consequences. By clearing the reference, FreeAndNil will help you to catch your wrong access immediately. Without it (i.e. by using Free only), your code may continue to run (even without raising an exception) and will give the wrong results or damage global state. It is quite dangerous situation and may lead to corrupt your data too. By not setting it to nil (in case of Free)- you're lying to the compiler. You're telling that there is allocated memory at this location, and the truth is that it isn't. And lying to machine just isn't good. FreeAndNil is very strict in these situation will immediately give you Access Violation error which I think is good thing and you can fix the problem on the spot because you know the problem!! Compare this with case, when your code silently produce wrong results! By always using FreeAndNil you’ll make your code bullet-proof for modifications.

Example of FreeAndNil

var
  myList : TList;
begin
  try
    myList := TList.Create;
    ....
    ....
  finally
    FreeAndNil(myList);
  end;
end;