Wikipedia:Reference desk/Archives/Computing/2007 August 8

= August 8 =

simple webcam app
What WindowsXP application can I use to make my webcam take regular pictures every 4 seconds and just store them all in some folder on my computer (not publish or upload anywhere?--Sonjaaa 02:06, 8 August 2007 (UTC)
 * Do you want to try to capture an event? Consider googling for 'CatSpy', which will record a short video when it detects a change in the frame.  Useful for security. --Mdwyer 05:32, 8 August 2007 (UTC)


 * Hi Sonjaaa: It sounds like you want to do time lapse photography. Try googling '"time lapse" webcam'.  Lot's of hits.  Saintrain 17:01, 10 August 2007 (UTC)

Firefox Spellcheck
Firefox has an auto spell checking feature which I rely on since I can't spell. I accidentally added a misspelled word to its dictionary. How do I correct that? Mrdeath5493 03:33, 8 August 2007 (UTC)
 * http://kb.mozillazine.org/Deleting_spellcheck_entries 67.169.185.206 23:45, 8 August 2007 (UTC)

Rules in Microsoft Outlook
I use Microsoft Outlook for email at work. Recently, when I went on holiday I set up a rule in Outlook to forward my incoming email to my home email address. Now that I'm back, I want to cancel the rule, but I can't. First I turned the rule off, but the emails kept getting forwarded. So I deleted the damn rule, and still they keep getting forwarded. Why is this happening, and what can I do to stop it? Many thanks. --Richardrj talkemail 06:19, 8 August 2007 (UTC)


 * Are you sure that it is only Outlook which is forwarding the mail? That you didn't set up vacation forwarding on the server as well? Just something to check... --140.247.238.85 18:01, 8 August 2007 (UTC)
 * Thanks for the suggestion. How would I check and fix that? --Richardrj talkemail 19:55, 8 August 2007 (UTC)

AVG Detected virus Obfustat.EVN
What is that please? ... Pharrar 08:37, 8 August 2007 (UTC)
 * AVG is an antivirus program, of which there is a free version. However, I assume you know that and are asking for details about the specific virus. Googling yields no hits whatsoever, but does turn up one hit (in a Japanese list of recognised viruses for an antivirus program) for an "Obfuscated.EVN" which seems to be a Trojan. Other than that, I can't find any information whatsoever about it. Angus Lepper(T, C, D) 14:12, 8 August 2007 (UTC)

prog...........
am a serious student who intends to teach himself programming.i know its going to be a long short but i know i can pull it off.i have downloaded several tutorials {if anyone knows a few good ones i can use give me a link} from the net and am starting with just basic and c languge.i wanted to know from anyone with experience who can recommend a good tutorial he or she has found useful can give me a link i download.or probably give me some nice tips(probably from a teacher)on how to basically cover programming.i know its an inexhaustive course but am in no hurry.am basically a beginner in programming,my only experiece being messing with game mods —The preceding unsigned comment was added by Ianmwash (talk • contribs).
 * Have you tried searching Wikibooks? Try a search for programming in the Wikibooks search function, it may pop up a few useful tutorials. – sebi 09:32, 8 August 2007 (UTC)
 * Learning a programming language is relatively easy &mdash; learning to program well and effectively in a particular paradigm is harder. Your initial choice of language is fairly irrelevant since more or less any programmer worth their salt will have solid knowledge of at least 2 or 3 and be able to tinker in another half dozen or so. However, what I would say is that C (programming language) isn't necessarily the easiest language to begin with: in particular, the standard library is particularly minimalist (as it was originally designed for systems programming) and the language contains relatively few high-level constructs whilst maintaining a large number of low-level constructs. Some version of BASIC (QBASIC, DarkBASIC, Visual Basic .NET) is a reasonable suggestion, as are languages such as C# and Python (programming language). C++ is another programming language that is sometimes recommended to beginners because it's the 'main language': this is true, however it still has a fairly compact standard library and maintains the low-level features of C (although it does provide many more higher level constructs). It does share certain unpleasant (for beginners) characteristics with C, such as that of undefined behaviour. My personal (subjective) recommendation for a beginner's language is C# because (apart from the fact that I'm quite familiar enough with it to know what I'm recommending) it has a free IDE (Visual Studio C# Express); the .NET Framework provides a rather extensive standard library, of sorts; it is a managed language, meaning that you can avoid (for the large part, unless you are specifically dealing with an APU such as DirectX, or you choose otherwise) pointers and directly manipulating memory. Other than this overview of a couple languages, I will also provide a couple pieces of advice: some beginners are obsessed with optimization: try to avoid this. They are often worried about micro-optimizing irrelevant pieces of code unnecessarily and concerned with machine-level optimizations (whether it's faster to multiply than divide, for example &mdash; incidentally the answer is now that they're the same speed on most platforms, although it used to be the case that multiplication was faster NOTE: See discussion below) rather than algorithmic optimization (i.e. if you want to find a specific word in a dictionary, you could check every single entry from the beginning to the end, stopping only when you find the word; alternatively, you could use a binary search algorithm and find it in no more than &mdash; and probably fewer than &mdash; $$2\lceil log_{2}\ n\rceil$$ comparisons, where n is the number of entries in the entire dictionary). Most of all: remember to program! It's easy to read books or tutorials (if you choose a language, it's worth asking to try to find a good one, incidentally; such a one for C++ is C++ A Dialog) through to the end but not learn anything. Do all of the examples, but don't just copy them out of the book: try to understand what each section does (and ask a knowledgeable friend, a forum, or an instructor if you can't) and then try to change it to improve it or add something else that you understand, to help reinforce your knowledge. You won't become an expert overnight, but after a few months you should find yourself completely lost a lot less often if you do this. Angus Lepper(T, C, D) 14:40, 8 August 2007 (UTC)
 * I don't know if you want to learn web programming, but if you do, http://www.w3schools.com probably has the best web language tutorials on the Internet.69.205.180.123 19:26, 8 August 2007 (UTC)
 * I feel obliged to point out that multiplication and division are nowhere near the same speed on modern processors, at least in the x86 family. According to Intel's docs, on Core 2 the instruction latency is 3 cycles for IMUL and 22 for IDIV. The throughput is half a cycle per IMUL and 22 cycles per IDIV. For a bunch of 32-bit divisions on a 2GHz processor this means a maximum throughput of only 350 MiB/sec, which is well below the main memory bandwidth of a modern machine, so this is a real performance concern. The times for MULPS and DIVPS are 4/1 and 18/17 respectively (latency/throughput), so even for maximally parallelizable float division you're limited to less than 2 GiB/sec. There are still very good reasons to avoid divisions in inner loops. Premature optimization is bad, but so is pointless inefficiency. Programmers still need to learn how hardware works, though probably not in an introductory course. -- BenRG 20:36, 8 August 2007 (UTC)
 * Mea culpa. Having just checked, I see you're quite right, latency and throughput are only a little less than an order of magnitude higher for both FDIV and IDIV compared to F/IMUL &mdash; I'm not sure where I managed to pick up that piece of misinformation and apologise for repeating it (although, of course, the fact that almost any architecture in common use now is at least slightly parallel means that you will only notice it in a tight loop &mdash; which, in fairness, as an arithmetical instructions is where it's likely to be used). I guess it is still faster to calculate the reciprocal before the loop and then multiply inside the loop, if possible (although, if this optimization is possible, then the compiler can perform it assuming a language where pointer aliasing isn't a problem). Perhaps I should have used a better example. However, I would argue that you need (assuming you aren't doing something highly specific) only a bit of common sense in terms of optimization. First, recognise that the compiler is probably better than you (assuming you're using a recent compiler); second, profile to find where the 10% of your code that's using 90% of the time is and then tune that rather than the menu-display code. Pointless inefficiency is not a problem if that inefficiency is not greatly affecting the performance of your program (i.e. if the multiplication is dependant on a bunch of IO operations, then it's probably irrelevant; if it's being used to normalize the pixel value of an 10 megapixel HDR image, then it's probably worth tuning to the n-th degree). That said, algorithmic enhancements will still almost always be the greatest source of performance increases in standard use. Also, I apologise for this comment as it's partially aimed at you and partially at the original poster, and so comes across as being at two different levels. Angus Lepper(T, C, D) 21:18, 8 August 2007 (UTC)
 * Why do you want to learn programming? If there's something specific you want to make computers do, I'd tend to advise learning a language that's good at doing that thing. Even if the language is horribly designed, you'll likely learn more about general programming principles this way, just because people learn better when there's a palpable reward. -- BenRG 20:36, 8 August 2007 (UTC)


 * If you're looking for a C language tutorial, I've heard good things about http://www.eskimo.com/~scs/cclass/cclass.html, although I'm admittedly rather biased. :-) —Steve Summit (talk) 02:04, 9 August 2007 (UTC)
 * ooh, you maintain the comp.lang.c faq? I had no idea we were in the presence of such greatness :) --⁪frotht 16:45, 9 August 2007 (UTC)


 * BASIC is by far the simplest to learn, but the least powerful. It's fun to pull off optimization tricks with (and it's not as daunting mathematically with all the bitwise operation optimizations you get into in lower level languages) and it's a good way to learn to get used to the idea of programming. PHP is a quite powerful scripting language and highly flexible- I recommend that be the first real language you learn. It is an interpreted scripting language, not a programming language, but it's C-like (well, sort of) and a good launching pad, especially as it's so very forgiving. There are no distinctions between similar data types, there's a function for absolutely everything, and a massive but readable manual for every function and construct at php.net. And since it's designed for the internet, it integrates seamlessly with network connections, gd (scripted image generation), and database engines. The interpreter can be hard to set up for a beginner, but if you just use php.exe (the CLI interpreter) and stick with text based output, you can do a lot. There's always something to do with php because it's such a flexible language. Try to write a script that downloads a web page and parses data from it, or converts text into a png image. Or write a CMS! It's easy with php, but you have to be very familiar with internet-specific things like sessions, POST/GET, and of course HTML, which you should know anyway if you're comfortable enough with the internet to post on wikipedia --⁪frotht 16:43, 9 August 2007 (UTC)

How to make a folder password protected in Windows XP.
I want to make a folder password protected (not hidden(attribute)) in Windows XP. How many ways are there to do this and how to do?


 * The easiest way is to just compress it with a password, that is, make it a password-protected ZIP or RAR file. That doesn't depend on any external software to be working correctly.
 * You can also set up certain folders to be accessible only to certain user accounts in XP, and make them be encrypted. But that requires you to either set up your user account with a password, or set up a separate user account for just that data with a password. And if your windows crashes, it can be hard to recover the encrypted data, I believe.
 * Those are the two easy ways I know about off-hand. --24.147.86.187 13:33, 8 August 2007 (UTC)

One of my friends had once created a folder with /(or\) as the folder name and it was a kind of password protected as he used to put a password to access the contents of the folder.

I don't know what he exactly did as I know that the folder name in Windows cannot have / or \.


 * Operating systems usually aren't designed with this in mind. Don't give anyone else access to your user account and make the folder readable only by you. This is possible, though ridiculously complex, in windows. Well vista at least, and probably XP pro. --⁪frotht 16:31, 9 August 2007 (UTC)

USB Bandwidth warning
I keep getting an insufficient USB bandwidth warning on my Dell 2400. The only USB devices attached are the ADSL modem and a scanner. The scanner is not active when I get the warning. Any ideas on why I should get this msg and is it safe to ignore it?--SpectrumAnalyser 11:52, 8 August 2007 (UTC)
 * You're connected to your network over USB?! X_X you're probably sharing internet bandwidth with your scanner since chances are it's one controller. You should NOT use usb for network connections. Other mediums like wifi and ethernet are designed for network traffic, usb is not, and it's extremely slow. --⁪frotht 16:33, 9 August 2007 (UTC)


 * No Im connected to the Internet via my DSL modem which is connected to the computer by a USB link. that's how the instructions said to connect the modem. Its only recently Ive been getting these warnings though.--SpectrumAnalyser 16:42, 9 August 2007 (UTC)


 * Well yeah that's what I meant, of course your modem connects over the phone line but it goes directly to your computer over usb. USB is taking over everything, and it's an engineer's worst nightmare of an interface. But I don't know what your problem could be if it was working before. Did you try http://www.google.com/search?q=%22insufficient+USB+bandwidth%22? Apparently not --⁪frotht 16:54, 9 August 2007 (UTC)


 * HMMm! This exactly describes my problem: same modem same ISP! So it could be the line?--SpectrumAnalyser 17:14, 9 August 2007 (UTC)


 * Of course it is.. multiple other people have had the exact same problem with the same modem and the same isp. Their solution is your solution --⁪frotht 19:44, 9 August 2007 (UTC)
 * OK. so why is it flagged a USB bandwidth problem and not a connection problem?--SpectrumAnalyser 22:32, 9 August 2007 (UTC)


 * USB is not extremely slow, it just uses a lot of CPU, if operated at high speeds (USB 2.0 has PHY layer data rate of 480MBit/s, which is more than any wireless (802.11abg) network or 100MBit/s ethernet). -Yyy 16:47, 9 August 2007 (UTC)


 * I didn't mean total bandwidth I mean all the trouble of encoding it so it can go over usb and apparently software-emulating (famous last words) a real network device since it's not connected to one. There might even be additional processing involved since his computer is connected directly to the modem without a router. This is a terrible idea! Almost all computers have network devices, why go through all the extra cpu load to go over usb? And you really do need a dedicated network switch sitting at the top of your home network even if you have just one computer. -⁪frotht 16:54, 9 August 2007 (UTC)

Could the problem be to do with the DSL line itself? It seems to be dropping out rather frequently lately.--SpectrumAnalyser 16:51, 9 August 2007 (UTC)

Apache SMTP server?
Does the Apache 2.2 server come with a built-in SMTP server?

69.205.180.123 13:30, 8 August 2007 (UTC)


 * I think there is a way for it to have easy support for sendmail. There is also, apparently, Apache James, though I don't know anything about that. --24.147.86.187 13:36, 8 August 2007 (UTC)

Okay, the problem is, the PHP mail function refuses to work. We have the server in place on our computer, it runs all the PHP script, does the server-side validation and returns a conformation page in the browser, but it refuses to mail a copy of the conformation page to our email account. What are we doing wrong? Do you have to specify what part of the file to mail? If so, how do you do that?69.205.180.123 15:00, 8 August 2007 (UTC)


 * The server must have a configured Sendmail server (as well as Apache and PHP). PHP's mail function will work directly with the Sendmail functions of the server if they are available.  If your server doesn't have a properly configured Sendmail service, PHP cannot send mail.  For more info on ensuring PHP has access to Sendmail, see http://us2.php.net/manual/en/ref.mail.php -- Kainaw (what?) 17:09, 8 August 2007 (UTC)

Force a file to play with a specific media player
Is there any way to make an mp3 open with, say, Quicktime Player? I mean, if you set Windows Media Player so that it's file types includes mp3, when you click on a link to an mp3 on the internet, WMP opens and plays the file. If Quicktime is set to play mp3s, when you click the same link, Quicktime opens and plays the file. When making a web page, how can you force a specific program to play the file using the link in the HTML?69.205.180.123 15:06, 8 August 2007 (UTC)


 * I think your best bet would be to have an inbrowser based player that manages the file. Like Myspace has its own player. If you leave it as .mp3 or whatever then I suspect the individual's file-extension preferencing will take over anything you input into the code. ny156uk 16:48, 8 August 2007 (UTC)


 * For obvious reasons (not every user will have certain media players installed, not to mention different browsers and operating systems), there can be no portable way of doing this. Angus Lepper(T, C, D) 17:16, 8 August 2007 (UTC)


 * If you stream the file with a MIME type header (as shown in the example above), you can often specify what type of player you'd like to open the file. The host browser doesn't have to listen to that, though — you can't force a user to use a file in exactly the way you want them to (don't be such a fascist!).
 * Anyway, using the example above, instead of, you could use   or   to try and recognize it as QuickTime or WMP files, respectively. But again, the user has control over what programs the browser uses to open files (on my Mac, WMV is always opened in QuickTime player because that's all I have which can watch them), so all you're doing here is trying to be more specific than generic filenames (specifying proprietary video formats). (I don't even know if the above will totally work, since they are specifically video formats, but that's what I would try.) --140.247.238.85 18:09, 8 August 2007 (UTC)


 * Incidentally, there are two problems with that. Firstly: many servers already do that by basing the MIME type off the file extension (I know Apache does: I just used its list when writing a minimalist web server for a specific purpose); secondly: Internet Explorer (currently IE6 and IE7 alone make up about 60% of the market, as far as I'm aware) completely ignores the MIME type sent in the headers of the server's response (which is daft) and tries (and sometimes fails) to interpret it itself. Angus Lepper(T, C, D) 18:51, 8 August 2007 (UTC)

Bustin' outta my iframe (javascript question)
I have an HTML file which has an object in it. From the iframe source, I want to create a DIV element on the parent page (that is, the HTML page with the iframe in it). I would have assumed that it would be something like window.document.parent but that doesn't seem to work. Suggestions? How to I reference the page which calls the iframe?

(Pretend the parent file is "parentFile.html", and it contains an iframe whose src tag is "sourceFile.html". I want to use some Javascript in sourceFile.html to create a DIV in parentFile.html.)

(Why would I want to do such a thing, you ask? Because I have the ability to edit content inside an iframe but I don't have the ability to edit the parent page calling it. Sound foolish? I agree. But it's not up to me on this one, I'm stuck with an existing interface.)

Thanks! --140.247.238.85 17:57, 8 August 2007 (UTC)


 * OK, I think I got it:  gets me access to the top window's Document object. Hurrah! --140.247.238.85 18:16, 8 August 2007 (UTC)


 * Also I think you could use window.parent.document. And be careful, firefox at least is crippled by myriad anti-XSS restrictions on javascript across frames or windows. --⁪frotht 16:27, 9 August 2007 (UTC)