Wikipedia:Reference desk/Archives/Computing/2009 August 13

= August 13 =

Compositing doesn't work when using dual monitors
I'm using Linux-x86 with an NVIDIA driver 180.44- I don't know particularly much about drivers but compositing worked perfectly back when I had one monitor. Then when I dual-monitor (with something called Xinerama it seems) all of a sudden I can't use desktop effects. What gives? It isn't possible to have desktop effects on two screens with a NVIDIA card? --BiT (talk) 04:08, 13 August 2009 (UTC)

excel calculations
how can I place preceeding zeros before 1-99 in an excel sheet to look alike with 100-999? thank you```` —Preceding unsigned comment added by 124.43.40.114 (talk) 04:23, 13 August 2009 (UTC)


 * In Excel 2007, select the cells you want to format in this way, make sure the "Home" tab is chosen, then from the popup menu in the "Number" area choose "Custom", then there's a field under the word "Type:". In that field, type "000" and then click OK.  I don't have a previous version of Excel handy but would expect it would be in the Format menu under "Number" or something similar.  Tempshill (talk) 04:57, 13 August 2009 (UTC)


 * In Excel 97: Format, Cells, Number, Custom. Mitch Ames (talk) 09:37, 13 August 2009 (UTC)

It's also worth noting that if you put an apostrophe ' at the start of the cell it will display whaever you input into it (e.g '0800800800 will display as 0800800800 rather 800800800 without changing the formatting). This is particularly useful if you want to 'show' a formula e.g. '=sum(A3:A6) would usually display in the cell the sum value of A3:a6, but with the apostrophe it would show =sum(A3:A6) 194.221.133.226 (talk) 13:55, 13 August 2009 (UTC)


 * It should be further noted that using the apostrophe makes the cell a text item, so it can not be used in calculations (unless you use the VALUE function). -- LarryMac  | Talk  17:30, 13 August 2009 (UTC)

Is there software available that shows how a person looks when they wear different spectacle frames?
It looks to be such an obvious application. The person who needs glasses tries on the frames but having vision difficulties cannot see themselves properly. So you get a digital photo of the person’s face, and then the software adds different spectacle frames to that image, for the consideration of the customer. OPSM is Australia’s largest supplier of spectacle frames but there is no mention of any such application on their website. If such a computer program does not yet exist, I would like some feedback from those who eventually write it. By “feedback” I mean 5% for the first 10 years. Myles325a (talk) 05:34, 13 August 2009 (UTC)


 * There is a cheesy little Flash app where you can do this on goggles4u.com (lower left, "virtual try-on"). It doesn't work very well, in part because it's hard to actually match up the size. --98.217.14.211 (talk) 13:13, 13 August 2009 (UTC)

Linear-time Fibonacci generator?
Heya,

After reading dynamic programming, I am wondering why the algorithm on that page for calculating terms of the Fibonacci sequence is O(n). The algorithm:

function fib(n) var previousFib := 0, currentFib := 1 if n = 0 return 0 else if n = 1 return 1 repeat n − 1 times var newFib := previousFib + currentFib previousFib := currentFib currentFib := newFib return currentFib

Isn't that pseudopolynomial time? Linear in the value of the input (n) but exponential in the size? I don't understand the difference between this example and those given in pseudo-polynomial time. Can anyone explain this?

Thanks a lot, -- Aseld  talk  10:52, 13 August 2009 (UTC)


 * I would say, in this example we aren't really concerned about the number of bits (since in practice, finding the 2^1000000'th Fibonacci number with this algorithm would take forever anyway; we only ever give it inputs with not much more than 30 bits). So we call the algorithm O(n) if it's linear in n. This is widespread practice. You could imagine a (physically impossible) computer that takes a constant amount of time to process any integer, and then this algorithm runs in linear time. 193.40.5.245 (talk) 11:29, 13 August 2009 (UTC)


 * Thanks for the response. That use of big-O is standard then? -- Aseld  talk  15:56, 13 August 2009 (UTC)


 * In computer science it is standard. In mathematics, it is something completely different.  So, since this is computer science, you base big O on the worst case scenario.  If the input is n and n is not zero or one, there will be n-1 calculations.  So, it is O(n-1).  However, when n is huge (say a trillion or so), who cares about that "-1" on it.  So, we just say O(n). --  k a i n a w &trade; 19:09, 13 August 2009 (UTC)


 * It is O(n) but not linear-time. On that page it does not say "linear-time." n is understood to be the n that is the input to the function from the pseudocode given. n does not mean the size of the input. --Spoon! (talk) 18:58, 13 August 2009 (UTC)


 * There's always some ambiguity. It's linear time if the input is encoded in unary, which is reasonable enough in this case since that is effectively how it's consumed. It's O(n2) if the output is an arbitrary-precision integer as opposed to a machine "integer" (integer mod 2k). It's O(1) if the input is a machine integer, since there's an upper bound on the run time in that case. -- BenRG (talk) 19:24, 13 August 2009 (UTC)


 * Fantastic, got it now. Thanks Spoon! - for some reason I thought the two were synonymous. In retrospect, as so often happens, my mistake seems obvious. Thanks for the responses everyone. :) -- Aseld  talk  16:34, 14 August 2009 (UTC)

Making videos
How can I make videos like this which has no moving image, but only a series of photographs with an added background music? Is there any software for making videos like this? And if I compose a video consisted only of photographs, will there be any problem on the copyright of the photographs? Can I use copyrighted photos in a video? Please help. --InternetTraveller (talk) 11:40, 13 August 2009 (UTC)


 * Although I can't access YouTube, Photo slideshow software lists some software which can make videos such as you describe. There would almost certainly be copyright issues if you use the work of other people.  -- LarryMac  | Talk  11:53, 13 August 2009 (UTC)

x86 CPUID instruction in Delphi
I tried to obtain the "GenuineIntel" string from my Intel processor using Delphi asm:

It do not work, for I get an access violation exception. However, if I move  to another procedure (e.g. the Form1.OnClick event procedure), it works perfectly. (I do also get the exception if I write the entire code above in OnClick. Apparently, there is some problem with updating the GUI (Form1.Caption) immediately after the asm code.) What is the problem, and how do I avoid it? --Andreas Rejbrand (talk) 11:53, 13 August 2009 (UTC)
 * I don't know Delphi, but in GCC's inline assembler feature you have to tell the compiler which registers you wrote into. CPUID writes into eax, ebx, ecx, and edx.  Perhaps there's a similar "clobbered register list" feature (assuming the Delphi compiler doesn't actually know Intel assembler)?  --Sean 16:19, 13 August 2009 (UTC)


 * I found the problem. I am not allowed to alter the EBX register, so I have to push and pop the value of it. --Andreas Rejbrand (talk) 21:06, 13 August 2009 (UTC)

Java applets
Is it possible to include Java applets in Blogger or Wordpress pages? If yes, how? 202.124.190.37 (talk) 11:53, 13 August 2009 (UTC)


 * If you are self-hosting wordpress then you can . If you are using the Wordpress.com hosted site then I don't think you will be able to. -- Q Chris (talk) 12:17, 13 August 2009 (UTC)

Automatically opening programs slowing down reboot
When I reboot certainly programs open automatically and I have to wait for all of them to finish loading before I can do anything. Some I guess I need to do this, such as the horrible all around speed bump that is Norton, but others I don't see any need for, such as Quicktime, Windows Live Messenger, Yahoo Messenger, Ares and so on. If I want to access these I can open them as needed. So my question is, is there a way to set these programs to not automatically load?--Fuhghettaboutit (talk) 13:30, 13 August 2009 (UTC)


 * Many can either be individually configured (in their own config screens) not to start up automatically, or their shortcuts can be removed from the "Startup" menu. But some things don't play nice - for them, Microsoft's AutoRuns program is the big stick. -- Finlay McWalter • Talk 13:36, 13 August 2009 (UTC)


 * I recommend a program called Startup Control Panel, which I've always found a reliable method of knocking startup crud on the head. In many years using it, I've not spotted any problems with it. (That said, I was not aware of Autoruns for Windows v9.53, so what do I know - it sounds good too.) --Tagishsimon (talk) 13:37, 13 August 2009 (UTC)


 * Running msconfig usually works for me, but that can seriously screw up your computer, so the others would probably work better. It's only advantage is that you don't need to install it. To use it, just open up the run window, and type msconfig. Thanks,  gENIUS  101  14:52, 13 August 2009 (UTC)

Thank you all. I will attempt some mix of these when I get home later today (and ultimately report back here, probably long after you guys have moved on). Cheers!--Fuhghettaboutit (talk) 17:14, 13 August 2009 (UTC)

Quicktime X vs Quicktime 7
I'm a little confused about what exactly is Quicktime X. Reports say that under Snow Leopard, Quicktime 7 will be an optional install. So what is the difference? Does QT 7 contain all the legacy codecs (animation, cinepak, video, etc)? Is Quicktime X h.264 only? --70.167.58.6 (talk) 16:33, 13 August 2009 (UTC)


 * The Quicktime article states that Quicktime X is the next version, which will be shipped with Mac OS X v10.6 aka Snow Leopard, and lists a few new features. I wouldn't expect it to have any fewer features that QT7.  From what I can pick up around the web, QT7 will be available because there may be some programs/media that require it, due to QTX's new design/architecture.  -- LarryMac  | Talk  21:05, 13 August 2009 (UTC)

US and UK English versions of HTML in same file
Is it possible in the same HTML document to provide different translations of a word or phrase and have the browser choose among them according to user language settings? I'd be thinking of something like this:

Under-inflated tires waste gas. Neon Merlin  17:22, 13 August 2009 (UTC)
 * Usually the web page itself defines the language it's in..
 * However you can use javascript to detect the language the user is using eg see and
 * Unfortunately that just doesn't work on some browsers. I'm totally out of date. Maybe someone else knows a method that works?83.100.250.79 (talk) 20:08, 13 August 2009 (UTC)
 * This works better (lifted off some forum, can't remember where - hope they don't mind..)

 var m = ((navigator.browserLanguage) ? navigator.browserLanguage : (navigator.language) ? navigator.language : navigator.userLanguage); alert("The language of your browser is "+'"'+m+'"')

Covers other browsers.. Can you take it from there with the javascript? 83.100.250.79 (talk) 20:21, 13 August 2009 (UTC) (These two pages contain enough info hopefully - how to 'print' with javascript, and  making decisions. Also consider the switch statement. It's even possible to scan and convert a whole body of text for US/UK english and convert - but that comes in lesson 2..83.100.250.79 (talk) 20:26, 13 August 2009 (UTC)
 * Actually I've noticed that the above may give "en-US" when "en-UK" is set - I think it's the "navigator.browserLanguage" property - that returns the default language, rather than the set language. In practice it could get fiddly.83.100.250.79 (talk) 13:19, 14 August 2009 (UTC)
 * Scanning over and converting has got to be more trouble than it is worth. (There is nothing so deceptively simple looking as automatic text conversion.) If you really wanted to do this, you could definitely use your SPAN method above, and then have the Javascript just go through and adjust as needed. I think it's kind of unnecessarily, personally. --98.217.14.211 (talk) 21:38, 13 August 2009 (UTC)

iGoogle contacts
How do I remove a contact from my list oif contacts in iGoogle Talk? 91.106.55.230 (talk) 17:55, 13 August 2009 (UTC)

Float vs. int performance
How much faster is integer arithmetic than floating-point on modern processors? Neon Merlin  18:50, 13 August 2009 (UTC)
 * It depends strongly on your processor. The range can be anywhere from "slightly slower" to around 50-100 times slower; and if you do not have a FPU (as many embedded processors lack this hardware), a good rule of thumb is 5000 - 10,000x slower (using integer operations to software emulate the FPU).  My i920 Nehalem (a new Intel processor) can execute floating point operations faster than integer operations, depending on cache conditions.  It's safe to say that a mid- to high-end cpu will probably be on the order of 4x faster at integer calculations in general.  Nimur (talk) 19:27, 13 August 2009 (UTC)
 * This all assumes that you do some heavy number crunching on a small set of data that fits entirely in the cache. Fetching a non-cached memory location takes much longer than a floating point operation.195.128.250.174 (talk) 20:44, 13 August 2009 (UTC)
 * A software library for floating point would probably only slow it by a factor of 50 perhaps compared to hardware. Using interrupts to do the business instead of subroutine calls might slow it by another factor of two or three. Dmcq (talk) 21:00, 13 August 2009 (UTC)
 * I must have been thinking of some floating-point sqrt or log, which is not one floating-point operation! Woops... my numbers were pretty off, my memory failed me... Nimur (talk) 23:07, 13 August 2009 (UTC)
 * Assuming that you mean using integers for integer calculations, and not for emulating floating-point operations (in which case it's orders of magnitude slower): it depends on the processor, but floating-point performance is generally superior. The baseline operations are addition and multiplication. On most modern processors, a floating-point addition and multiplication both take 1 cycle; an integer addition takes 1 cycle, while an integer multiplication takes perhaps 2-4 cycles. However, the answer is more complex because processors are able to execute more than one instruction in parallel. For example, the Software Optimization Guide for AMD Family 10h Processors says "The processor is capable of performing three independent 64-bit additions each clock cycle and a 64-bit multiplication every other clock cycle." and "The AMD Family 10h floating-point unit can sustain up to two floating-point operations (one in the add unit and one in the multiply unit) per clock cycle." The actual performance depends strongly on whether the code has been optimized to take advantage of the pipelining capabilities of the given processor. Fredrik Johansson 21:15, 13 August 2009 (UTC)
 * Here are some latency and throughput numbers from Intel's optimization manual:

Nehalem Enh.Core  Core SSE/x87 float add  3, 1     3, 1     3, 1 SSE float mult. 4, 1    4, 1     4, 1         x87 float mult. 5, 2    5, 2     5, 2

MMX int add        1, 1/2   1, 1/3   1, 1 SSE int add        1, 1/2   1, 1/2   1, 1/3 x86 int add        1, 1/3   1, 1/3   1, 1/3 MMX/SSE int mult. 3, 1    3, 1     3, 1         x86 int mult. 3, 1    3, 1     3, 1/2
 * I don't know why they're so complicated and I suspect there are some typos, but at any rate integer math is substantially faster. However the fastest way to do math is to issue integer and floating point operations in parallel, since they run on different execution units. -- BenRG (talk) 00:20, 14 August 2009 (UTC)

Windows Live Mail Auto spellcheck
Does anyone know how to turn off the auto spellcheck when composing new e-mails on windows live mail, that is the red squiggly lines under the words. It is infuriating & I can't find any setting to turn it off. The help function is no help either. Thanks AllanHainey (talk) 18:52, 13 August 2009 (UTC)
 * (Tools), options , select spelling tab , unselect everything - see if it works.83.100.250.79 (talk) 19:51, 13 August 2009 (UTC)
 * or (ALT + M key), options , select spelling tab , etc .83.100.250.79 (talk) 19:55, 13 August 2009 (UTC)
 * Excellent, thanks. AllanHainey (talk) 19:56, 13 August 2009 (UTC)

Multiple Related iTunes/Bluetooth/Laptop-Phone Questions.
1. Why, when I create and buy a ring-tone from the iTune's store, will the ringtone not Blue-tooth from my HP G60t to my Motorola ROCKR Z6 using a WINCOMM Bluetooth Software Adapter, when other songs will?

2. Is there any free music editing software where I can cut clips from my iTunes songs to make ring-tones that would be compatible with the above setup?

3. Also, when all of my other songs (whether iTunes Store Downloaded or from an outside source) will transfer via the previously listed setup, for some songs I can select them as a designated ring-tone (they are listed as "Apply: Yes"). However for others, I can use the music player on the phone to access the song, but it us listed as "Apply: No." What can I do to resolve this?

So, in summary, I need:

1. Knowledge on how to transfer purchased iTunes ring-tones to my ROCKR

2. Free music-editing software to create ringtones that will be able to be transferred and be applicable.

3. Knowledge on what is causing some songs to be applicable and others to not; as well as how to change the songs to a format that will make them applicable.

Hubydane (talk) 20:12, 13 August 2009 (UTC)


 * Help, please? Hubydane (talk) 00:41, 14 August 2009 (UTC)
 * Sometimes an answer can take more than a few hours to be posted, as it says on the top of the page, so be patient.
 * The ringtones that are sold by the iTunes store are designed for the iPhone. Correct me if I'm mistaken, but I don't think they are compatible with other brands of cell phone, which would explain why it won't show up on your MotoROKR.  The regular songs aren't restricted in this way.
 * Check out the website MyxerTones for creating your own ringtones. You can upload .mp3s, select a clip, and it sends it to your phone in a pix message.  I don't think it works with Verizon right now, but there is a simple manual way to do it yourself.  Download Audacity, which is a free audio-editing software.  Edit the desired song into a 20 or 30-second segment, and save it as an .mp3.  Then, you can email that file to your phone in a pix message.  Simply attach the file, and send it to @vzwpix.com (this is the address for Verizon, I'm pretty sure other phone companies have a variation on this, where you can send an email to a cell phone as a pix message).  Then, save the sound attached to the pix message as a ringtone, and there you go.
 * Check the file format of the songs that are 'applicable'. Then, just make sure that the files that you want are in the same format (you can convert them using iTunes).  Hope this helps &mdash;Akrabbimtalk 14:56, 14 August 2009 (UTC)
 * After I re-read your question, the whole MyxterTones/e-mailing the files to your phone doesn't apply to you, since you are able to do the BlueTooth thing. Editing the clips in Audacity is probably all you'll need to do to get your perfect ringtone.  Sorry if there is confusion. &mdash;Akrabbimtalk 15:00, 14 August 2009 (UTC)

Thanks, the Audacity thing worked brilliantly! Hubydane (talk) 21:58, 14 August 2009 (UTC)

Optimize Computer Performance
I have recently purchased a HP G60t series laptop with 4GB RAM and 320GB Hard Drive. I want to know what I could do to optimize performance and totally lock down my computer from viruses/spyware/adware/etc.

So far I have installed for protection: Norton Internet Security (60 day trial w/ laptop) CCleaner Ad-Aware (Free Version) Spybot Search and Destroy

...for optimization: WINCOMM Bluetooth Software

Suggestions (Please include what suggestion will do)?

Hubydane (talk) 20:23, 13 August 2009 (UTC)


 * Skip Norton, get AVG. The rest are fine. If you want to really avoid the viruses and spyware and etc., keep your security patches updated, and don't use Internet Explorer. To really optimize, turn off all the shiny bells and whistles in Windows. --98.217.14.211 (talk) 21:34, 13 August 2009 (UTC)


 * What shiny bells and whistles? —Preceding unsigned comment added by Hubydane (talk • contribs) 21:38, 13 August 2009 (UTC)


 * The most important thing you can do is to practice "safe computing": Don't download and run any executable files from a website you do not trust; and never from an e-mail.  In order to minimize the damage in the case that you do, you should create two accounts on the computer:  one account with administrator access, used only for installing software that came from a trusted source; and a "user" account with no administrator access.  Use the "user" account always.  If you "accidentally" run an executable file, it won't be able to infect or damage your system as badly (though of course a Trojan horse executable could always just delete all the files accessible to the "user" account, upload them all to Bulgaria, or whatever.)  Tempshill (talk) 21:54, 13 August 2009 (UTC)


 * Any other suggestions? Such as Firefox/Opera for safe browsing? (I use Firefox now) —Preceding unsigned comment added by Hubydane (talk • contribs) 22:31, 13 August 2009 (UTC)
 * Most people would agree that Firefox is generally safer than internet explorer, and it won't bother your system resources at all. There are also plugins available (for example one comes with AVG) that help you steer away from notorious websites in google searches, etc.  I don't know much about Opera, you could read here about it, it looks like it contains a lot of extra features that if you won't be using them would just be extraneous.
 * The shiny bells and whistles that 98 mentioned are things like Windows Aero, which are both optional and pretty, but can use up processor and/or video memory resources. &mdash;Akrabbimtalk 14:41, 14 August 2009 (UTC)


 * One thing with AVG Free vers is that it doesn't have real time protection. So if you download a virus it won't tell you 'till you run a virus scan. Personally I use Avira Anti-Vir Free which has free real time. Also an user-friendly firewall is Comodo Firewall. If you use Comodo disable Windows Firewall, and when Comodo asks you about a program don't randomly accept/block it. As for an on-demand scanner I'd use Malware Bytes-Anti Malware instead of Spybot. But most important is common sense prolly. —Preceding unsigned comment added by 66.133.202.209 (talk) 06:45, 15 August 2009 (UTC)

BEGIN...END in prepared MySQL statement
Does MySQL support BEGIN...END in prepared statements? If so, is an unusual syntax required? If not, how do I prepare several statements as one? Neon Merlin  21:21, 13 August 2009 (UTC)


 * A simple Googling of "MySQL BEGIN" seems to indicate they support them, and gives the syntax. --98.217.14.211 (talk) 21:27, 13 August 2009 (UTC)

Learn to Program
I want to learn how to write programs. Nothing complicated, but is there a free how-to or something out there that can get me started? —Preceding unsigned comment added by Hubydane (talk • contribs) 21:56, 13 August 2009 (UTC)
 * You might find some useful tutorials in this Google search.  The left orium  22:00, 13 August 2009 (UTC)
 * First, you need to decide what you want your program to do. There are thousands of programming languages you could possibly learn. Of those, about 10 are considered easy and mainstream enough for a beginner. Without knowing what you want to do, it is very difficult to choose which language best suits your needs. Therefore, I suggest learning C++. There are many many many books in every library and bookstore that I've been to that teach C++ for beginners. If you begin with C++, all other common languages will appear to be C++-lite. If you begin with something like Java or Pascal, programming that requires C++ will seem very difficult and complex. -- k a i n a w &trade; 22:02, 13 August 2009 (UTC)

Personally I would recommend starting with a 'teaching language' like Pascal (programming language). I believe it is much easier to program (and learn to program) in almost any language once you have learnt 'how' programs and programming work. Once you've got a good grasp of what you're expecting to do (and how you're expecting a program to be setup) then a lot of the learning a new languge is a case of learning the syntax and structure that are unique to that programming language. ny156uk (talk) 22:06, 13 August 2009 (UTC)


 * We have a WikiBook, C Programming, which is a good trainer. You need to decide what language is suitable for the tasks you want to do; I have found that Java is a very suitable tool for most applications tasks, while C is much better suited to certain problems.  As a beginner, I strongly recommend Java for the following reason: the standard compiler from Sun spits out very friendly and informative error messages when things break (whereas C or C++ will simply tell you "segfault").  The importance of this will become apparent as you start programming.  Kainaw accurately points out that transitioning to the more systems-oriented languages will be difficult; but I think it's easier to learn those concepts after you understand the basic structured-thinking approach of programming.  Nimur (talk) 23:29, 13 August 2009 (UTC)
 * At the risk of being pelted with eggs, for a total beginner I'm tempted to recommend learning javascript - it can be edited in a text editor, and run in a browser, you'd also have to learn simple html - the site http://www.w3schools.com/ has a good step by step introduction to both, that is really simple to follow. I'd worry about starting with C/java/C++ since they require a lot of input that just wont make much sense to someone starting out. If you're already familar with variables, for/next loops, if/then statements etc then ignore this advice.83.100.250.79 (talk) 14:06, 14 August 2009 (UTC)
 * I agree that it's better for a beginner than C or C++ (I just received a 20,000-line error message from g++!), but I think Javascript is horrible for development. The runtime environment is poorly documented with massive dark corners on every platform, there's no freaking #include/import directive, variables default to global, and even when declared with "var" their non-block scope is idiotic, they screwed the pooch with for/in iteration, and it does all this vigorous sucking at a snail's pace.  --Sean 20:54, 14 August 2009 (UTC)
 * It's worth noting that Java (programming language) and Javascript are very different languages - their common name is a historical artifact but they are otherwise entirely separate entities. I would not recommend JavaScript, because of its limited capacity for application development outside of web development.  Java, on the other hand, is suitable for a wide range of systems- and applications- programming (including web development).  Nimur (talk) 22:28, 14 August 2009 (UTC)


 * Educational programming language might be a good article to read. Tempshill (talk) 16:37, 14 August 2009 (UTC)


 * I have just started learning Java and I have found to be excellent. It is free, well written, easy to read, includes programming exercises with full solutions and even a custom Java class (programming class, not school class) with subroutines to make text I/O simpler for a beginner. 131.111.146.85 (talk) 11:11, 15 August 2009 (UTC)