Jump to content

Wikipedia:Reference desk/Archives/Computing/2011 April 30

From Wikipedia, the free encyclopedia
Computing desk
< April 29 << Mar | April | May >> May 1 >
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 30

[edit]

Services not available in Netbeans

[edit]

I just installed Netbeans 6.9 in Ubuntu 10.10. The problem is, when I go the services window, it shows only "Hudson Builders" (no databases etc). I seem to remember that these were available in the windows installation right from the start, but do I need to install additional plugins or something on Ubuntu? Chamal TC 02:26, 30 April 2011 (UTC)[reply]

Nevermind. A re-installation fixed the problem. No idea what was going on before. Chamal TC 15:23, 1 May 2011 (UTC)[reply]

mac sound problem

[edit]

Hi, I have a little G4 powerbook running macosx 10.5.8 and I've bought a USB logitech headset for use with skype. But I can't change the system to use the headset because "system preferences" doesn't have a "sound" icon. I'm sure there used to be a loudspeaker icon in there. I've tried rebooting. Any advice? Robinh (talk) 05:01, 30 April 2011 (UTC)[reply]

Go to /System/Library/PreferencePanes and check to see if the file Sound.prefPane is still there. If it is, try double-clicking on it directly. If it isn't, then somehow part of the core System Preferences has been removed. I have no clue how that could happen (you're not even supposed to be able to edit any of the /System subdirectories unless you're root), but if it has you should probably think about doing an "archive and install" with your original system disks. Horselover Frost (talk · edits) 19:04, 5 May 2011 (UTC)[reply]

Two .NET questions

[edit]

I am having two problems with .NET code at work:

1) One of our testers reported that a web application wasn't working correctly when she clicked on links. It turns out that the URLs in those links contain URL-encoded Nordic letters (ä and ö, encoded as %E4 and %F6). This was working fine on my computer, but not on the test server the tester used. This is apparently because the test server had an earlier version of Internet Explorer than my computer. It turned out that it didn't work for Mozilla FireFox 3.6 either. I made a quick test by URL-encoding the Nordic characters using UTF-8 encoding instead of ISO-8859-1, and then it worked for FireFox but not for Internet Explorer. I thought the letters should be URL-encoded using the encoding that the browser understands, but how do I know what it is? I've looked at the HttpRequest object coming from the client, but have found no difference between the encoding attributes. All attributes containing the word "encoding" always have their values set to "UTF-8".

2) I developed a custom X509 certificate validator to be able to use multiple client certificates in a WCF service. According to the documentation I've found online, the validator's Validate() method runs successfully if the certificate is valid but throws an exception if it's not. This is working fine, but I found that no matter what exception I throw when the certificate is invalid, the message I see at the client browser is always "...The connection is in the faulted state." which is rather cryptic. How can I transmit a more informative error message to the client browser, without resorting to dirty work-around tricks like assuming every exception is because of an invalid certificate? JIP | Talk 09:30, 30 April 2011 (UTC)[reply]

for 1), URL encoding says "For a non-ASCII character, it is typically converted to its byte sequence in UTF-8, and then each byte value is represented as above [percent encoded]" So if we take that as true (ah, but what is ever universally true between browsers...) then the page encoding is irrelevant: that non-ascii chars in URLs are always utf8 encoded. As an example, I looked at how Mediawiki and Firefox handle the å in Småland. The url is http://en.wikipedia.org/wiki/Sm%C3%A5land (although Firefox hides the percent encoding and shows an å when displaying in the url bar), and indeed the utf-8 encoding for å is 0xc3a5. -- Finlay McWalterTalk 13:53, 30 April 2011 (UTC)[reply]
And sure enough (because you're asking about Finnish letters specifically) Todennäköisyysteoria encodes as http://fi.wikipedia.org/wiki/Todenn%C3%A4k%C3%B6isyysteoria - so that U+00E4 for ä is still utf8 encoded to 0xc3a4 and percent encoded. -- Finlay McWalterTalk 14:01, 30 April 2011 (UTC)[reply]
This is how I thought it was supposed to be, but when I made the software encode ä and ö as %C3%A4 and %C3%B6 instead of %E4 and %F6, the links stopped working in IE, although they did work in Mozilla FireFox. This was on my own computer, I didn't test it on the test server yet. Why is that? Is it simply a bug in IE? Note that I'm not at work right now so I don't remember the exact version of IE my work computer uses right now. JIP | Talk 14:16, 30 April 2011 (UTC)[reply]
The hex coding is assuming a particular character encoding; the two-byte representation is almost certainly UTF-8, while your one-byte encoding could be just about anything. Almost all canonicalization algorithms mandate UTF-8 for the character encoding. This will be particularly important for your certificate validation, as you want to guarantee that there are zero possible namespace collisions due to character encoding. Require UTF-8 at all points in your application. If you ever receive non-UTF-8 strings, convert them; make conversion-to-UTF-8 a part of all string sanitization for secure applications.
Also, note that %C3%A4 and %E4 are equivalent in Unicode; they render as an identical glyph, ä, in most fonts on most operating systems. But they are not the same character. Treat this very carefully if you are validating security certificates. You might want to check your web server's (or your server file-system's) support for unicode equivalence matching on URLs. If you want to be secure, you should disable character equivalence; if you want to allow users to type either code-point to reach the same site, you should manually add a redirect from the alternate characters to the canonical URLs. Nimur (talk) 15:56, 30 April 2011 (UTC)[reply]
%E4 is not a valid UTF-8 sequence. Any webserver interpreting urls as UTF-8, shouldn't accept %E4 in URLs (or 'too long' byte sequences that encode to the same character). Unilynx (talk) 20:01, 30 April 2011 (UTC)[reply]
I've tested the URL encoding issue (see User:Finlay McWalter/sandbox) on a pretty wide range of browsers, comparing the "naked" url (the Finnish chars in the page's own encoding), the one-byte percent encoding, and the two byte utf8 encoding percentage encoded, and all the browsers I tried, back to IE5.5 (which is nearly 11 years old) handle all three encodings okay.If you check the html source it confirms Mediawiki hasn't tried to do something clever and rewrite the URLs as it generated the page. Feel free to add to that page any other (reasonably distinct) browsers/useragents you try. -- Finlay McWalterTalk 18:50, 30 April 2011 (UTC)[reply]

The two issues are entirely separate, the URL character encoding issue has nothing to do with the certificate validation issue. The certification validation issue is only concerned with certificate thumbprints, which are represented as hexadecimal numbers. I still found out that encoding the ä and ö characters as UTF-8 stopped them from working in IE, although they did work in FireFox. I haven't tested it yet on the test server. The actual URL is a JavaScript function call to open a pop-up window, with the URL of the window given as a parameter to the JavaScript, might that possibly have something to do with it? JIP | Talk 20:07, 30 April 2011 (UTC)[reply]

This is really weird, it seems it's just IE on my computer. IE on the test server, or any other test server, works like described above. IE on my computer doesn't. They are the exact same release version. It's the browser, not the website, because I tested it by connecting to the test server with IE running on my computer, and it didn't work, although it did with IE running on the test server itself. The links are JavaScript function calls like this: <a href="javascript:void window.open('http://testserver/testpage.aspx?name=Todenn%C3%A4k%C3%B6isyysteoria');"/>. They don't work in IE on my computer, but they do in IE on the test server. Typing the URL directly into the URL bar works though, and so does creating a new web page from scratch, only containing the links. It must be something on the actual web application page that is causing this. Does anyone have any idea what it might be? JIP | Talk 18:05, 2 May 2011 (UTC)[reply]
This is getting strange. Are you sure the systems are otherwise identical? It sounds like IE can handle the URL except when it's opened via Javascript. Might it be the Javascript engine that is not compatible with the character encoding? I don't think you can swap out JavaScript engines in IE, but maybe your script source can specify the character-encoding it uses. Consider placing an HTTP Meta-Equivalent in your page source:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
... and see if that helps. Nimur (talk) 18:26, 2 May 2011 (UTC)[reply]

XML regular expressions syntax (2)

[edit]

Hi, everybody! Can someone answer the question I asked a week ago? Or can you direct me to a place in WWW where the answer can be found? --CiaPan (talk) 19:58, 30 April 2011 (UTC)[reply]

If you're having trouble getting an answer to a rather technical computer language question, I recommend trying at Stack Overflow. They're pretty good about that sort of thing... --Mr.98 (talk) 21:22, 30 April 2011 (UTC)[reply]
Many thanks, Mr.98, I got a reply there. --CiaPan (talk) 16:58, 3 May 2011 (UTC)[reply]

Notebook doesn't start at first but then start later problem.

[edit]

I have a problem with my inspiron 1526 notebook. When I try to start the notebook, the computer doesn't start, the notebook shows nothing on the screen and doenst emit sound (before even POST), but the "turned on" led in on.

Then, if I turn off the notebook and then turn on again, the notebook will start and will show a screen saying to me change the setup configuration and the notebook hour changes to 2008.

On the next day or sometimes even on the same day, if I turn off the notebook and then after some housrs try to turn on the notebook, this same problem happens again. Sometimes I have to turn on and off the notebook 3 or more times before it really start.

Sometimes when it really starts, it auto shuts down in the Windows Vista logon part, but then, if I turn on the notebook again, he will not shut down in this part and will them load Windows.

After vista loads, the notebook works in a normal way (I am typing this from the notebook).

What can be the problem??? 201.78.220.24 (talk) 22:56, 30 April 2011 (UTC)[reply]

It could be a problem with the power switch having an intermittent connection. StuRat (talk) 23:16, 30 April 2011 (UTC)[reply]