Wikipedia:Reference desk/Archives/Computing/2012 June 3

Computing desk
< June 2 << May | June | Jul >> June 4 >
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.


June 3

edit

fast lexical scanner

edit

I'm interested in writing a fast lexical scanner that recognizes 50 or so English words. The scanner also has to be able to say "this word is not on the list" if it sees a word that's not part of the fixed vocabularity. Two traditional ways to do it are:

  1. Hash each incoming word (maybe with a perfect hash) generator, and if a hit is found, use strncmp or equivalent (maybe a SSE4 STTNI instruction) to make sure that it's a real hit. I think this is what gcc does.
  2. Use a hard coded state machine to recognize incoming words character by character. Tinycc and lcc do this.

I would have expected the second approach to cause a lot of pipeline stalls because of all the conditional branches, but so far I haven't run benchmarks. Before I do a bunch of work making such measurements, does anyone know if this has already been studied? Thanks.

69.228.171.139 (talk) 00:19, 3 June 2012 (UTC)[reply]

Yes it's already been studied. ¦ Reisio (talk) 00:35, 3 June 2012 (UTC)[reply]
Um, thanks. Got a link? 69.228.171.139 (talk) 22:56, 3 June 2012 (UTC)[reply]
You don't have to test character by character. You can do something like:
lodsdw              ; Get 4 characters.
or eax,20202020h    ; Force lower case.
cmp eax,"isnu"      ; Test for beginning of "unsi"(gned), little-endian.
93.95.251.162 (talk) 13:21, 5 June 2012 (UTC) Martin.[reply]

How? (video illusion)

edit

Somebody has to tell me. I have been mystified all day. How is this done? KägeTorä - (影虎) (TALK) 04:47, 3 June 2012 (UTC)[reply]

Curse you for making me listen to that music! It's being projected onto a screen, I think. Looie496 (talk) 05:30, 3 June 2012 (UTC)[reply]
Sorry about that :) But if you look at some of the other videos, the characters are on a catwalk, with people behind them. KägeTorä - (影虎) (TALK) 05:39, 3 June 2012 (UTC)[reply]
Your answer is at about 5:15 of this video. Start at about 3:15 for a more complete answer. Dismas|(talk) 06:28, 3 June 2012 (UTC)[reply]
Oh my god those people are annoying. For the sake of everyone's sanity: it's just an image projected onto a semitransparent screen. -- BenRG (talk) 18:26, 3 June 2012 (UTC)[reply]
Tupac Shakur#Legacy -> Pepper's ghost ¦ Reisio (talk) 19:24, 3 June 2012 (UTC)[reply]
I made the title more useful, by adding to it. StuRat (talk) 19:35, 3 June 2012 (UTC) [reply]

Problem with MuseScore

edit

Hey, seems like I cannot authorize MuseScore to interact with musescore.com. The website shows me the error message which is at http://musescore.com/oauth/authorize?oauth_token=null. What to do? 123.24.125.166 (talk) 08:42, 3 June 2012 (UTC)[reply]

It was a problem introduced with the latest update. It has been fixed now and should be working fine again. Toemaz (talk) 15:02, 5 June 2012 (UTC)[reply]

question on VM's in Rich Internet Application

edit

our article Rich Internet Application starts,

"A Rich Internet Application (RIA) is a Web application that has many of the characteristics of desktop application software, typically delivered by way of a site-specific browser, a browser plug-in, an independent sandbox, extensive use of JavaScript, or a virtual machine"

Could you give me more information about or examples in practice of the last of these? (Virtual machines). The article doesn't mention a VM or the words Virtual Machine again. --80.99.254.208 (talk) 09:10, 3 June 2012 (UTC)[reply]

Well the ref is dead, and due to the nature of virtual machines (being just another implementation of a machine), I'm not sure it even bears mention anyways. ¦ Reisio (talk) 19:13, 3 June 2012 (UTC)[reply]

Phishing email

edit

Is it possible for someone to send a phishing e-mail using a personal email address, like one that you keep in your Contacts list? 173.2.164.121 (talk) 09:23, 3 June 2012 (UTC)[reply]

It's easy to forge the sender's address, if that's what you mean, and many of the email addresses they send to are taken from other people's contact lists, but most phishers will want to make their emails look as though they came from your bank, or PayPal, or Amazon, or Facebook....--Shantavira|feed me 12:32, 3 June 2012 (UTC)[reply]
I don't know but it is very often the case that you receive a real email ACTUALLY sent by a contact...'s virus! In fact it's one of the best ways for a virus to spread to actually physically email itself using the infested person's email client. This is physically indistinguishable from if the person had really decided to send that email with that attachment. So the receipients, trusting the send (not knowing it's a virus) open it. And repeat... (It normally has something like: "LOL check out this dancing puppy.... " and virus attaches an link "Dancingpuppy.GIF.exe" ... — Preceding unsigned comment added by 188.6.68.250 (talk) 13:45, 3 June 2012 (UTC)[reply]
Yes, but the questioner was asking about phishing, which is quite distinct from distributing a computer virus.--Shantavira|feed me 20:30, 3 June 2012 (UTC)[reply]
There have also been lots of scams lately from people who actually hack into (one way or another) someone's e-mail account and then use it to send phishing e-mails along the lines of "I'm out of the country and I lost my wallet..." --Mr.98 (talk) 20:26, 3 June 2012 (UTC)[reply]
Most of the ones I've seen are more like 419 scams than phising. They get you to send some money to somewhere via legitimate services (usually Western Union or Moneygram) and you have no hope of getting it back since it's sent to a scammer not your friend or whoever you think you're sending it to. They don't get you to log in to a dodgy site or otherwise steal your account details so they can steal your money themselves. Nil Einne (talk) 07:34, 4 June 2012 (UTC)[reply]

Commodore 64 palette

edit

Look at this section of the article The Great Giana Sisters. It shows two screenshots from the Commodore 64 version, and the colours look different, despite the fact that the Commodore 64 can only display 16 colours. This doesn't happen with screenshots from Amiga software. I think I know the reason for this: Although both the Commodore 64 and the Amiga use indexed colour, the Amiga knows the exact RGB hues of the colours ("index 0 means colour #07F, index 1 means colour #FFF, index 2 means colour #000, index 3 means colour #F70..."), but the Commodore 64 only knows the general appearances of the colours ("index 0 means black, index 1 means white, index 2 means red, index 3 means cyan..."). So when emulating the Commodore 64 on hardware that does know exact RGB hues, such as the Amiga or modern PCs, there has to be a mapping from palette indices to exact RGB hues, and as there is only general appearance information available on the Commodore 64's colours, this mapping varies between emulators, sometimes even in the same emulator. Now my question is first, am I on the right track here? Second, how exactly does the Commodore 64 convert palette indices to actual colours that the TV or monitor is supposed to draw? Third, is there any attempt to make a global standard about mapping Commodore 64 palette indices to RGB hues? JIP | Talk 16:52, 3 June 2012 (UTC)[reply]

MOS Technology VIC-II#Colors has a quote from Robert Yannes saying the actual colour values were set (in the analog backend of the VIC-II) by on-chip resistor settings, and not with a great deal of regard for colour theory. Given the poor control you have (as a producer of colour signal) of how it actually looks on an all-analog PAL or NTSC (the latter being unkindly nicknamed "Never Twice the Same Color") it's not surprising that only a modest effort was put into thinking about the niceties of exactly what colours they were sending. -- Finlay McWalterTalk 17:48, 3 June 2012 (UTC)[reply]
This article, which is linked from the MOS Technology VIC-II Wikipedia article, discusses in some details the actual analog characteristics measured from real VIC-II signals, and the author of that concludes with a RGB palette he suggests is more accurate than emulators had used until that point. He also talks about the author of CCS64 producing code to model the crappiness of PAL to more accurately simulate what you'd have seen on a real TV. -- Finlay McWalterTalk 18:20, 3 June 2012 (UTC)[reply]
Looks like the two pictures were created by different methods. One used the VICE emulator, the other uses the word "screenshot" which could mean anything from an emulator, a proper screen capture card or even to a photograph. Astronaut (talk) 18:05, 4 June 2012 (UTC)[reply]
If it's a photograph, then it must be a pretty darned good one. Running xmag over the image reveals the correspondence between the pixels in the image and those in the original game is 100% perfect, if we don't take into account the mapping between palette indices and RGB colours. So it is obvious that it comes directly from a computer, bypassing the physical world. But that could still mean either an emulator, or a direct screen capture from the Commodore 64. JIP | Talk 19:45, 4 June 2012 (UTC)[reply]
Actually, further reading of the image page reveals this: Screenshot created an emulator running the original software. So it's now clear that it's from an emulator, just not which emulator. JIP | Talk 19:47, 4 June 2012 (UTC)[reply]