Jump to content

Wikipedia:Reference desk/Archives/Computing/2012 March 12

From Wikipedia, the free encyclopedia
Computing desk
< March 11 << Feb | March | Apr >> March 13 >
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.


March 12

[edit]

Wireless fails at single hotspot

[edit]

The wireless connection on my laptop (a Lenovo ThinkPad running Windows 7) works fine at home, work, the library, and the train. It does not work at a local lunch place; this has been going on for at least four visits over more than a month. The manager there says nobody else has complained and that it is a standard Comcast wireless router. The connection shows up on my list of available connections, generally with four or five bars, and lets me connect, but never successfully completes the connection. Other than eating lunch somewhere else, any suggestions? Matchups 10:33, 12 March 2012 (UTC)[reply]

It would be interesting to see what happens if you borrow someone's little USB WiFi dongle and try it with that. Obviously this shouldn't be necessary, but trying this tests several hypotheses:
  1. that for some reason the Comcast router is blacklisting your MAC address (a dongle will have a different MAC)
  2. that there's some weird setting in your wireless networking stack that's incompatible with the settings of the Comcast (you get a fresh set of settings with a new adapter)
  3. there's just some darn incompatibility between your network stack and the Comcast (that's really clutching at straws, but you never know)
I wouldn't recommend buying a WiFi dongle just to test this, as these are all pretty long shots.
But apart from that, I'd suspect that the security software on your laptop (perhaps a personal firewall) is blocking some part of the login sequence - something that the Comcast does (that's valid, but unusual) that the other routers you visit don't do. So you can check the windows event log, and the firewall's log (if it has a separate one) to see if it's doing anything. From a purely diagnostic perspective, turning off the firewall might be instructive - but obviously I'm reluctant to tell you to turn off a firewall in such an environment. 46.208.220.25 (talk) 15:01, 12 March 2012 (UTC)[reply]
Lunch is a popular time. I wonder how many other people at the lunch place are also using the connection. Could it just be slow to respond and your PC thinks it has timed out? Astronaut (talk) 07:20, 13 March 2012 (UTC)[reply]
  • Interesting ideas, .25. I'll see if I can borrow one from somebody. I checked the event log. There were multitudinous errors from threads reporting that they had no internet access (duh), but nothing about the attempt to connect to the local wireless.
  • Astronaut, the last time I went there didn't seem to be many people online. And I'm 0 for 4 where the manager claims not to have heard any other complaints, so that seems unlikely.
  • Is there a way to find out what kind of router I'm connecting to? It would be interesting to see if any of the other routers that I successfully connect to are the same model. Matchups 02:39, 15 March 2012 (UTC)[reply]

Codes for a Universal Remote Control

[edit]

I have bought a second hand TV (a JVC) but had to buy a universal remote control for it. The codes that where in the little booklet that came with the remote didn't work so I thought I'd 'google' it instead. But all I can find are 3 or 5 digit codes, the remote I've got uses 4 digit codes. I've tried tvcodes.com & when I click on the jvc service link, all I get is a white screen. Can any one help me ? 80.254.146.140 (talk) 14:32, 12 March 2012 (UTC)[reply]

I know it sounds silly, but verify that the remote itself works okay (e.g. that the batteries are fine). One way to do this is to view the business-end through a digital camera, and confirm that it sees the infra-red LED light as you push buttons. Next verify you're doing the programming sequence correctly - these sequences are often rather mad (hold down this for three seconds, stand on one leg) - try programming the remote for a different TV you have access to (Sony is a good choice, as Sony have been extraordinary consistent about keeping their control codes compatible over decades - the basic volume/channel/1,2,3.. stuff for any Sony should run any other). If you can't control the Sony, you know it's you or the remote that's at fault. AS for your books.jvcservice.com link, that gives me a working website with a "Enter as much of the model number as you know" search box. 46.208.220.25 (talk) 14:46, 12 March 2012 (UTC)[reply]
Many remote controls also have an option to step through every code, and that could help you when the code is unknown. It may take an hour, so do it while doing something else, like using the computer. StuRat (talk) 00:10, 13 March 2012 (UTC)[reply]

I have tried the remote on two other TVs, a DVD player, a VCR & a Freeview box & it worked on all of them. I have even tried the scanning through every code thing but that hasn't worked. Should I just get a different model remote & try with that instead ? As for the link jvc service, it must be these computers that I'm using (computers in the public library). 80.254.146.140 (talk) 14:00, 14 March 2012 (UTC)[reply]

You could try another remote, but it might be a problem with the receiver on the TV (a small black square on the front panel). Make sure it's clean. Does the remote that came with the TV still work ? StuRat (talk) 21:29, 14 March 2012 (UTC)[reply]

Thats the thing, I never had one for that TV thats why I thought I'd get the universal remote to operate it. 80.254.146.140 (talk) 11:39, 15 March 2012 (UTC)[reply]

How did you manage to obtain a TV without the remote ? I ask because the person you got it from might be able to tell you if the remote worked back when he still had it. StuRat (talk) 07:29, 17 March 2012 (UTC)[reply]

Email address or a P.O. box of Mike D’Antoni

[edit]

To whom it may concern,

Would it be possible to contact Mr. Mike D’Antoni (New York Knicks coach)by email or p.o. box as a fan?

Thanks,

Joe — Preceding unsigned comment added by 99.144.168.46 (talk) 15:14, 12 March 2012 (UTC)[reply]

There's an address here. --Colapeninsula (talk) 16:07, 12 March 2012 (UTC)[reply]

PHP and MySQL

[edit]

Hi, I'm learning both PHP and MySQL and what I am trying to do is to search my database from a dropdown list on my webpage, for example it will have in the dropdown list a placename and when chosen it will return all the information from the database related to that placename. I am using XAMP for my server, can anyone point me to a tutorial where I can learn to do this. — Preceding unsigned comment added by 84.203.243.10 (talk) 16:33, 12 March 2012 (UTC)[reply]

First, I recommend using a MySQL PHP class for this; it's easier than coding all of the database lookup stuff yourself. There are a lot of them out there; this one seems pretty straightforward to me, though for a new PHP user the object-oriented stuff might be a little confusing, but just follow the examples.
Second, make sure you understand what an SQL injection attack is, and how to use mysql_real_escape_string() to sanitize any data received from the user.
Third, here's the basic scheme for what you want. Let's imagine you have one page with the dropdown, and another that receives the data. (Once you get the hang of the concepts, it's easy to make it all the same page.) The page with the dropdown will have an HTML SELECT element, filled with OPTION elements. All of this needs to be inside an HTML FORM element which directs the selected data to the script which receives the data, and specifies the form METHOD (either GET or POST). Add a INPUT submit button to the form, and you're good. The form data then goes to the PHP script. You access form data according to these instructions. What you'll want to do is grab the data from the FORM, and then create an SQL SELECT query based on its contents (don't forget to sanitize it!). Then you run the SQL query (see the MySQL class above) and output the data to the browser.
If you break the above up into small pieces, it becomes pretty easy — no one step is very hard. Once you've gotten the above working, it's a lot easier to see how you'd have the list and receiver pages being the same page (have just one page which checks for form data every time it loads), and from there graduate on to playing with AJAX queries (so the page doesn't even have to reload). --Mr.98 (talk) 17:37, 12 March 2012 (UTC)[reply]

Exponential algorithms

[edit]

Are there any yes-or-no problems for which a solution can be verified in polynomial time, but finding the solution in polynomial time is mathematically proven to be impossible? I would use Google, but I don't know what terms to start with. --140.180.0.112 (talk) 20:35, 12 March 2012 (UTC)[reply]

First see NP-complete. NP-complete problems fall into that category, except that they have not proven to require exponential time (but they certainly seem to). Bubba73 You talkin' to me? 20:49, 12 March 2012 (UTC)[reply]
In fact, NP is defined to be precisely those problems that have solutions which can be verified in polynomial time. If it turns out that P = NP, no problems fit the OP's description. (But most experts think that there really are problems in NP that aren't in P.) Paul (Stansifer) 20:59, 12 March 2012 (UTC)[reply]
Regarding your subject line: note that there are algorithms that run in super-polynomial but sub-exponential time, such as the best known algorithms for integer factoring and graph isomorphism. -- BenRG (talk) 23:45, 12 March 2012 (UTC)[reply]

Force MinGW to install in Program Files

[edit]

Unfortunately, I am a stickler for naming conventions. Is there anyway I can force MinGW to install in C:\Program Files? --Melab±1 20:59, 12 March 2012 (UTC)[reply]

Chiptunes

[edit]

Am I correct that a chiptune is usually (at least in the case of the Commodore 64) a small machine language program to instruct the sound chip? If that is the case, then I could theoretically be able to download PlaySID files from the Internet, load them up on VICE, and then type SYS something and the emulated Commodore 64 would play music. Is there any documentation about the internal structure of PlaySID files, or for that matter, D64 files? JIP | Talk 21:04, 12 March 2012 (UTC)[reply]

Hmmm. I have a SID synth but am far from an expert on the details. You're probably better off going straight to the c64 communities and forums for questions as specific as this.. Here are a couple I found: almighty c64 , sidplay and a page about the playsid format. Or even one of the many chip tune communities. Vespine (talk) 02:14, 13 March 2012 (UTC)[reply]
(Terminology: I think chiptune describes more how the music sounds, not what file format it's in. For example, a chiptune may be stored in a tracker file (a module file), which isn't machine language. Since you're really asking about SID files, it might be clearer to say "SID file" instead of "chiptune".)
I found documentation of the SID file format at the High Voltage SID Collection (FAQ 7). Browsing over the file format, it looks like the main data section is indeed machine language, but the headers can specify a few important addresses: load address (where to put the data in memory), init address (set accumulator to song number, then call this address to initialize a song), and a play address (call this address frequently to produce sound). The specification seems to say it's possible for the machine language data to include code that installs its own interrupt handler to keep calling its own internal play routine (in this case, the play address in the header is set to zero). But if there's a play address specified, I guess you'll need some auxiliary code (a SID player) to play the file. --Bavi H (talk) 04:04, 13 March 2012 (UTC)[reply]
Here are various file formats used by Commodore 64 emulators. If you want to experiment with loading machine language into your Commodore 64 emulator, may I suggest the much easier to use PRG format, described in the Binary link on that page. The first two bytes are the load address (low byte, high byte), then the rest is just the data bytes you want to load. (This is exactly what the contents of a PRG file on a Commodore 64 disk would be.) If I remember correctly, your emulator will let you select a folder of files to act as a disk (instead of a D64 file), then you can LOAD"FILE.PRG",8,1 then perform the correct SYS address if you know it (not always the same as the load address). Check your emulator's documentation to make sure. --Bavi H (talk) 04:46, 13 March 2012 (UTC)[reply]

Linux: why load environment variables when not using them?

[edit]

A while back, while investigating a buffer-overflow bug in a C program, I discovered that the environment variables had been loaded onto the heap at launch, even though I wasn't using them and had declared only

int main (int argc, char **argv)

Doesn't it waste time and memory copying the environment variables onto the heap for a program that doesn't use them, especially when using a large number of small processes? Shouldn't the executable file have flags that indicate whether to load the arguments and/or environment variables, and shouldn't the compiler set these flags according to which parameters main() actually declares? NeonMerlin 23:29, 12 March 2012 (UTC)[reply]

How long do you think it takes a multi GHz microprocessor to copy a few hundred bytes of data, that is already in cache, into a page of process memory, that is already in cache? How much kernel and engineering effort should be devoted to a change that means processes will start, at most, a few millions of a second sooner? 46.208.220.25 (talk) 23:52, 12 March 2012 (UTC)[reply]
And just because you don't declare env as an arg to main, that doesn't mean the library calls you make don't use it anyway (by calls to getenv). 46.208.220.25 (talk) 23:55, 12 March 2012 (UTC)[reply]
In UNIX-like operating systems, new programs are started with fork-exec. The environment is simply inherited by the child created with fork(), which will give the new process a virtual copy of the old processes memory, and uses copy-on-write to make physical copies as necessary. All versions of exec either explicitly set a new environment, or keep the inherited one. In the latter case, the environment of the child process is shared with the parent until either is changed, so no unnecessary copying takes place. In the former case, you ask for an environment, so you get it ;-). --Stephan Schulz (talk) 01:25, 13 March 2012 (UTC)[reply]