Code Review Archives - Digital Tool Factory blog Code Review Archives - Digital Tool Factory blog

The Digital Tool Factory Blog

A non definitive list of 64 html escape characters for currency

'Currencies on White Background' photo (c) 2011, Images Money - license: http://creativecommons.org/licenses/by/2.0/I recently had to integrate html escape characters for currency symbols on a project, and much to my surprise I could not find any good definitive list html escape characters for currency codes. These are also known as escape characters, character entities or extended characters.  I had to find them all more or less one by one.  Here is what I came up with. For some reason WordPress is not letting me post the escape characters as escape characters, so I have attached a simple text file containing a list of 64 html escape characters for currency symbols. Hopefully this will save someone else 45 minutes.

Here is what is in the file – it is in the Name – Abbreviation – Symbol format.

Australian Dollar – AUD – ₳
Barbados Dollar – BBD – $
Bulgarian Lev – BGN – л в
Bermudian Dollar – BMD – $
Brazilian Real – BRL – R$
Belize Dollar – BZD – $
Canadian Dollar – CAD – $
Swiss Franc – CHF – ₣
Chilean Peso – CLP – ₱
Chinese Yuan Renminbi – CNY – ₩
Colombian Peso – COP – ₱
Costa Rican Colon – CRC – ₡
Czech Koruna – CZK – Kč
Danish Krone – DKK – kr
Dominican Peso – DOP – ₱
Egyptian Pound – EGP – £
Euro Dollar – EUR – €
Fiji Dollar – FJD – $
British Pound – GBP – £
Guatemalan Quetzal – GTQ – Q
Hong Kong Dollar – HKD – $
Honduran Lempira – HNL – L
Croatian Kuna – HRK – kn
Hungarian Forint – HUF – Ft
Indonesian Rupiah – IDR – Rp
Israeli New Shekel – ILS – ₪
Indian Rupee – INR – ₨
Iraqi Dinar – IQD – Ű
Iceland Krona – ISK – kr
Jamaican Dollar – JMD – $
Jordanian Dinar – JOD – Дин.
Japanese Yen – JPY – ¥
Kenyan Schilling – KES – KSh
Korean Won – KRW – ₩
Kuwaiti Dinar – KWD – Дин.
Cayman Islands Dollar – KYD – $
Lithuanian Litas – LTL – Lt
Latvian Lats – LVL – Ls
Moroccan Dirham – MAD – MAD
Mexican New Peso – MXN – ₱
Malaysian Ringgit – MYR – R&:#77;
Norwegian Kroner – NOK – kr
New Zealand Dollar – NZD – $
Omani Rial – OMR – ﷼
Peruvian Nuevo Sol – PEN – S/.
Philippine Peso – PHP – ₱
Pakistan Rupee – PKR – ₹
Poland Zloty – PLN – zł
Qatari Rial – QAR – ﷼
Romania New Leu – RON – lei
Russian Rouble – RUB – р&#1091б
Saudi Riyal – SAR – ﷼
Swedish Krona – SEK – kr
Singapore Dollar – SGD – $
Thai Baht – THB – ฿
Turkey Lira – TRY – ₤
Trinidad and Tobago Dollar – TTD – $
Taiwan Dollar – TWD – $
US Dollar – USD – $
Vietnamese Dong – VND – ₫
East Caribbean Dollar – XCD – $
South African Rand – ZAR – R
Bahamas Dollar – BSD – $
Bahrain Dollar – BHD – $


17
Oct 13


Written By Steve French

 

How to fix problems with ReSharper LINQ Intellisense

The Problem

Resharper’s Intellisense, while generally awesome, does not find navigation properties in Linq statements

The Cause:

No Idea

The Solution

Switch back to Visual Studio 2012’s Intellisense, then go to Resharper > Options > Environment > General and make sure that the “Store Caches in the System Temp Folder

Close and Reopen Visual Studio 2012 and everything should be working well.


18
Oct 12


Written By Steve French

 

Which jQuery cropping plugin should you use?

'As night falls foggy on San Francisco, construction begins on @BalsaMan's moderately famous face.' photo (c) 2010, Aaron Muszalski - license: http://creativecommons.org/licenses/by/2.0/I recently had the need to do some automated image cropping.  I was already using the wonderful ImageResizing.Net plugin, which made all of the server code very easy.  It came with some sample code that uses the JCrop plugin (by Deep Liquid).

Jcrop does it’s job very well.  However…

In the modern web development environment, plugins are both a blessing and a curse.  The blessing portion is that the plugins work very well.  JCrop is no exception.  It does a great job selecting the proper portions of an image to crop in an easy and intuitive manner.  So far so good.

The curse is that every need is somewhat new to the world, and the factory settings ALMOST apply, but not quite.  I was pulling  a list of uploaded images from the server, and I wanted the images to pop up in a normal jquery ui modal dialog window.  It was trivial to display the large photos from a list of thumbnails.  So….

Now to integrate the two

I opted to have the JCrop appear after the thumbnail was clicked.  It did.  So far so good.

Then I ran into problems.  After you select one image, no matter what you select next, the first image will always show up in the modal window, which was a considerable problem.  If you disable JCrop the problem went away, but no matter what combinations I tried in terms of loading order, ready states and dailog and object creation I could not get jCrop to to work in this situation.

Mind you, this is not jCrop’s problem, but it was not the situation I was trying to use

Enter ImgAreaSelect

After quite a few hours I gave up and let my fingers do the googling for other plugins.  I was led to ImgAreaSelect – which was simple and easy to use, and did not have the problems with the dialog boxes that jCrop did.  The documentation was good too.


18
Jun 12


Written By Steve French

 

How to Truncate a Table in Sql Server

I hadn’t used this handy tool in sql server in a while and actually had to look it up recently, so here it is in the code review.

TRUNCATE TABLE “table_name”

Truncating not only deletes all of rows in the table, but it deletes all information about the table, which makes all auto numbering integer fields start over at 1.  Not complicated, but surprisingly few people know about it.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


15
Sep 10


Written By Steve French

 

The List in C#

The first entry in my Code Review is the List<>.

So far, the List is my favorite sort of array in C#.  It has the benefits of

  • being obvious in naming
  • you do not have to know the size when it is declared – the List can expand or contract as needed
  • adding items to the array is quite simple, as is looping through the array
  • finding items in the list is easy as well

The basic List syntax is this

List<string> lstContactList = new List<string>();

At first the syntax looks a bit off, what with the odd angle brackets<> and the () at the very end of the declaration, but that is the only counter-intuitive part of the List.  Please note, a list can hold any type of object or type, not just strings.

To add to the list simply use the .Add syntax, for example

lstContactList.Add (“Bob Raindorf”);.

You can find the index of a particular list item by simply using this syntax:

lstContactList.IndexOf(“Bob Raindorf”);

Once you identify the  identified, you can replace the value of the list item quite simply by

lstContactList[lstContactList.IndexOf(“Bob Raindorf”)] = “Robert Raindorf”;

If you want to loop through the list, just do this

foreach (string str in lstContactList)
{
InsertToDB(str);
}

To clear the list, just do this

lstContactList.Clear();

That’s all I need to remember (for now anyway), hopefully the act of writing this pushed it into long term memory.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


07
Sep 10


Written By Steve French

 

Introducing the new Code Review Category

WorkmodeOne of the lessons I learned from John Medina’s excellent book Brian Rules is that of elaborative rehearsal, which is (roughly) defined as remembering something more strongly by doing something with the new information, like giving a book report or relating that information back into something you already know.   Example: Say you already know the geography of Central Asia, if you wanted to remember the story of Genghis Khan, you could relate Genghis’ story to the already known geography, and then giving an oral report on old Genghis.

Like most coders, I sometimes forget code syntax of functions I don’t use that often.  I am now going to start writing up short expositions on the functions I have to look up in the hope that writing up the exposition will help transfer the function into long term memory.

photo credit: akaalias
Creative Commons License

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


07
Sep 10


Written By Steve French

 




Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.