Wikipedia:Reference desk/Archives/Computing/2015 April 27

From Wikipedia, the free encyclopedia
Computing desk
< April 26 << Mar | April | May >> April 28 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


April 27[edit]

Greek keyboard layouts[edit]

I'm hesitated if this question belongs to here or to WP:RD/L, but I hope here may be a person who knows something about l10n in MS. In Windows OSs why are there several Greek layouts? The list: simply "Greek", "Greek Polytonic" (both expected), but then go something strange: "Greek Latin" (!), which hardly different from the "US international", then "Greek (220)" and "Greek (319)", the both also have Latin variants. I wonder what's the origin and purpose of the last five, especially the Latin ones? I can suggest the "220" and "319" may have come from some Greek standards for Greek typewriters.--Lüboslóv Yęzýkin (talk) 01:13, 27 April 2015 (UTC)[reply]

Ultimately, this has to do with whether the keystroke pressed by the user will present to the system software as a character input in Unicode, in Windows-1252, Windows-1253, or ISO 8859-7 character encoding. In Windows, a "keyboard layout" manages not only the physical mapping of key location to character, but also manages text character encoding. Some layouts are only available if certain additional locale-management system components are installed (per the Keyboard Layout FAQ). This is why you may see multiple options that each appear (superficially) to have the same key mappings. Depending on how your software retrieves its text from Microsoft's various text service APIs, your software may receive character inputs at are already transcoded - and hopefully into Unicode! (Refer to the section on software that is IMM/IME "-aware", "-partially-aware", and "unaware" in the Input Method Management FAQ).
To make your life more complicated as an internationalization/localization developer, you also need to be aware that keyboard layouts are elements on "input locale" preferences, which are per-user settings; but keyboard device driver settings are global (affecting all users). If you are developing software for which this distinction matters, you should peruse Microsoft's documentation extensively, and you should try to use Unicode as much as possible at all layers.
Default Input Locales contains a table listing identifier-codes for all five Greek keyboards. What is not documented is the near-infinite number of plausible input locales (i.e., a unique pairing between any one of these keyboard layouts and any one of the hundreds of selectable system languages). For example, you can inform Windows that you intend to use Greek-319 keyboard to type Latin characters in the Afrikaans language and set your region preferences to Iceland - this is a legal, albeit implausible, configuration that appears to work on Windows Vista.
Nimur (talk) 02:40, 27 April 2015 (UTC)[reply]
It's interesting but hardly answer my questions. I'd like more definite information. For example, it is absolutely known that the "Russian typewriter" layout that have being shipped since Windows 95 is directly derived from the Soviet standard (GOST) for typewriters. Such cannot be said about the Greek variants, as Greek typewriters have had different layouts.--Lüboslóv Yęzýkin (talk) 07:16, 28 April 2015 (UTC)[reply]
I don't know anything about Greek keyboards, but they must have Latin letters on the key caps, and "Greek Latin" layouts must be layouts that use those letters instead of the Greek letters. The three-digit identifiers show up in other countries' layouts, so they aren't a Greek standard. They seem to be keyboard codes from the MS-DOS days—or at least 319 is listed as a Greek keyboard ID here. They may not have been used in new PCs in decades, but keyboard IDs never die, like IANA assigned port numbers. -- BenRG (talk) 18:43, 27 April 2015 (UTC)[reply]
Virtually every keyboard outside Latin-alphabeted countries has Latin letters alongside the local script. But your idea about old country codes and obsolete hardware seems legit. Unfortunately, there are hardly found pre-1995 Greek hardware keyboards in Google, I'm not sure how widespread they were and if existed at all then. One of their distinguishing feature must be " on the 2 key instead of @.--Lüboslóv Yęzýkin (talk) 07:16, 28 April 2015 (UTC)[reply]

Compressing representations of colors[edit]

I have lists of several specific colors, represented in RGB Hexadecimal format. Each list can vary from 3 to about 7 colors. What i want to know is whether there is a simple way to compress the representation of these colors, so that the length of a string for this is both small and easy to convert to the original list of colors.... in either hex or decimal format.

For instance, i have a list that contains the colors Red, Blue, Green, and gray, like so: #FF0000, #00FF00, #0000FF, #999999. One "Easy" way to represent these is to do something like this: "FF0000|00FF00|0000FF|999999". However, this results in a rather long string, that gets much more lengthy when the list contains 7 colors. I am trying to think of ways to mathematically compress this information in a better way, hopefully which can be represented alpha-numerically.

I've thought about using something interesting like base 36, but exact algorithms that would work and be elegant elude me. Does anyone have an idea? Thanks!

216.173.144.188 (talk) 04:10, 27 April 2015 (UTC)[reply]

Why not assign a single letter to each color? That way you would have a choice of 26 colors, or 52 if you use upper and lower case. Or am I misunderstanding what you want?--Shantavira|feed me 05:48, 27 April 2015 (UTC)[reply]

This could work, your solution does something which i was thinking about, which is reducing the number of colors available, in order to shorten the representation of these colors. I was looking at complete preservation of the color though, since this is art... and i wonder if i should keep with that, or maybe only reduce it to 16-bit color depth.

I am trying to use a short string to represent combinations of colors, a "scheme" if you will that would be used on an art piece. Since the customer will not be technical, i dont want them to have to paste to me a huge string of text. The best solution sadly might just be recording down the different schemes and enumerating in a simple way.... eg "Sch1", "Sch2", "Sch3", etc. I was hoping to have the color code tell me the colors themselves instead of looking it up.

216.173.144.188 (talk) 06:00, 27 April 2015 (UTC)[reply]

Well what is your application if the question is not answered? If You are using an text editor, type Your short codes, use find and replace (CTRL+H) to finish the text file and replace the short codes by the substituted text. Some interpreters allow to skipping of leading zeros, eg. #FF0000, #FF00, #FF, #999999. A reduced number of full colors is used as a color palette in the GIF file format. It usually picks a set of 256 from 16.7 million possible colors per picture. The algorithm of the JPG codec splits the picture into squares of different sizes of pixels and reinterprets the pixels inside the square by string interpolation. See also lossless and lossy compression. --Hans Haase (有问题吗) 13:34, 27 April 2015 (UTC)[reply]
A conversion to base 64 (which can be represented by upper case letters, lower case letters, numbers, and two other symbols) reduces each 6-digit colour down to 4 digits. Using - and / as your symbols will give you a nice looking alphanumeric-ish code (e.g. A8b-4jy9/oL2). 7 colours is going to be lengthy whatever you do, unless you reduce your colour space somehow (you have 16^42 options, which is a long number in any base with a practical number of symbols - at base 94, which is all the character keys on a Br.English keyboard both with and without shift, you'll have a 26 character code, which is a barely readable mash of symbols). MChesterMC (talk) 15:24, 27 April 2015 (UTC)[reply]
Sounds like you want a look-up table. So, in your example, you might have a header section where the colors are dynamically defined as:
FF0000=c1
00FF00=c2
0000FF=c3
999999=c4
Then, in the data section, that one color scheme would be listed as:
c1c2c3c4
You can have as many colors as you like with this method, but this method only makes sense if each color is repeated multiple times. (You could pad the color names to c01, c001, or c0001, if you anticipate up to 100, 1000, or 10000 colors, but you don't have to add those leading zeroes if you don't want to. I would, though, because it looks better and makes some coding a bit simpler.) StuRat (talk) 03:32, 29 April 2015 (UTC)[reply]