Jump to content

Wikipedia:Reference desk/Archives/Computing/2011 February 20

From Wikipedia, the free encyclopedia
Computing desk
< February 19 << Jan | February | Mar >> February 21 >
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.


February 20

[edit]

My CD drive has disapeared

[edit]

I have an old computer running WinXP SP3. My computer had a DVD ROM drive and a CD RW drive, and both worked fine. Then I replaced the DVD ROM by a DVD RW drive from another old computer. The cables were replaced in exactly the same way, even the jumper setting was the same. I did not touch the CD drive.

Now the DVD RW drive works fine, but the computer does not recognise that the CD drive is there. However the CD drive opens when I press the door button, and during computer start-up its light blinks for a while.

After replacing the DVD drive I mistakenly reconnected the monitor to the wrong plug on the back of the computer, which gave a blank screen. Due to the blank screen I turned the computer off three or four times during start-up, until I realised what the problem was.

How can I get my computer to recognize that it has a CD drive as well as the DVD drive? Thanks 92.29.117.124 (talk) 00:57, 20 February 2011 (UTC)[reply]

When you restart your computer, open the BIOS to see it recognizes the drive. If it does, it's most likely a software problem. If it doesn't, it's almost certainly a hardware problem.
If it doesn't recognize the drive, you probably have the master/slave settings set incorrectly on the drives. Depending on the vendor, year of creation, etc. there are different ways to set a drive as master/slave - usually they are written right on the CD drive documentation, but you may need to look online. On my old CD drives, there were little pins in the back next to the power socket and the I/O cord. Magog the Ogre (talk) 01:17, 20 February 2011 (UTC)[reply]
Even though you didn't touch the CD drive, you could have easily disturbed the cabeling to it. Check the flat IDE cable is definitely seated correctly both at the CD drive end of things and the other end where it connects to the motherboard. The power cable is unlikely to be unseated because you say the draw still opens when you press eject, and because in my experience the power cable is usually a very tight fit. Astronaut (talk) 14:40, 20 February 2011 (UTC)[reply]

Verifying that copied files are identical with their source

[edit]

I have copied many binary files from a pendrive to my harddisk. Two or three of them were said to be uncopyable due to being corrupted. What's the easiest way of checking that the remainder are exactly identical to the original files? I'm using WinXP SP3. Thanks 92.29.117.124 (talk) 01:09, 20 February 2011 (UTC)[reply]

You'll want to run a checksum on the drive data. There are several methods (and programs) listed in the linked article. Magog the Ogre (talk) 01:25, 20 February 2011 (UTC)[reply]
From a command prompt, use fc to compare the files. fc/? will show the syntax. You'll need to use the /b switch. If you're not comfortable with the command line interface, there are many graphic/windows-based file comparison programs available, at least some of which will be freely available. Mitch Ames (talk) 02:37, 20 February 2011 (UTC)[reply]
Using something like MD5 or SHA-1 would be the most reliable. Microsoft has a free program called File Checksum Integrity Verifier. Here's a link [1]. There are of course other programs that will do the same. Shadowjams (talk) 10:44, 20 February 2011 (UTC)[reply]
If you want to compare two files - eg after a file copy, when you have both instances - an actual file comparison program (fc or any other) is more reliable than a program that only compares a hash. A binary compare of the files is 100% reliable. A comparison of hashes is 99.many_nines%, but not 100%. Hashes do have their uses (eg checking for changes later when you don't want to keep a second copy), but they are not "most reliable" when you have two copies. Mitch Ames (talk) 11:57, 21 February 2011 (UTC)[reply]

Thanks. Is there any file manager that can compare/verify binary files? Thanks 92.15.31.249 (talk) 11:26, 20 February 2011 (UTC)[reply]

As Mitch Ames said, the windows shell does this out of the box. Just type
fc /b "path and name of first file" "path and name of second file"
If the files are identical, you'll get a message that the files are, indeed, identical. If they're different, you'll get a listing of the differences. --NorwegianBlue talk 22:28, 20 February 2011 (UTC)[reply]

I've been using the freeware Duplicate Cleaner to see if the files are identical duplicates - not quite what it was intended for, but it seems to be the easiest way to do it. 92.15.9.175 (talk) 15:07, 20 February 2011 (UTC)[reply]

Power issues, pt. 2

[edit]

About three weeks ago, I posted a question regarding some power problems I've had, and got good response, though not complete. We figured out that the plug on my power cord isn't making clean contact with the socket in my laptop (I've since been able to verify this, as putting the plug in my laptop always causes it to get really hot, when the power does make a connection).

My question continues: is it possible to replace a power socket in a laptop? I have a Dell Latitude d620, IIRC (all the stickers have fallen off the bottom, so I'm not sure). Magog the Ogre (talk) 01:12, 20 February 2011 (UTC)[reply]

The mains plug in the power supply (and inline socket in the cord) are normally standard IEC connectors, probably C5 clover leaf or C13 (standard computer). If you know how to use a soldering iron, then you may be able to open the power supply and resolder a new connector in. However, it is easier to buy a universal laptop power supply. Look at the existing power supply for the voltage and wattage; you'll need a replacement with the same voltage (1V out probably won't make much difference), and at least the same wattage (too little and you risk overheating the power supply; too much and you're just wasting your money). They come with several tips to suit most laptops; you may want to take your laptop to the shop to check, but I'd be surprised if it didn't have one to fit. CS Miller (talk) 08:18, 20 February 2011 (UTC)[reply]
CSMiller's answer concentrates on one side of the problem (replacing your power supply to get a plug that "fits better" into your laptop, which by the way can just as easily be done by only replacing the tip instead of the whole power supply) so let me tackle the other side: your laptop's socket. The problem could either be that the socket is worn and the plug is not making good contact, or the socket is fine but is coming loose from the motherboard itself. Either way a repair involves taking your laptop apart (which is a pain and a half as almost everything has to come out to remove a motherboard), then either re-soldering your socket to the motherboard or replacing it entirely with a new one. To answer your question: yes, it certainly is possible to replace the power socket. I don't know what the typical call-out fee and labour would be (if it's not under warranty or you don't want to do it yourself), but it will be much higher than the cost of the actual replacement part. Good luck! Zunaid 10:35, 20 February 2011 (UTC)[reply]
From memory, it is the mains inlet on the laptop's PSU is damaged, and it does not make a tight connection to the mains cord. The main connection then overheats, and damages the mains cord. However, the low-voltage connectors are fine. CS Miller (talk) 12:22, 20 February 2011 (UTC)[reply]

Well I know how to use a solder; I am a computer science major after all. But I don't actually have a solder, which is a problem obviously. It would be nice if I had a voltmeter to check where the connection dies; but I'm pretty sure it's right near where I plug in the cord, because a little jiggliing and it will work. Magog the Ogre (talk) 02:42, 21 February 2011 (UTC)[reply]

If the contact pin doesn't feel mechanically loose, use a bright light and a magnifier to inspect it for oxidation. If it's not nice and shiny, try cleaning it with De-oxit (wonderful stuff that you can get at Radio Shack or online). That fixes a lot of these problems. 71.141.88.54 (talk) 04:55, 21 February 2011 (UTC)[reply]
I had a similar problem, which turned out to be the connection to the motherboard. I was able to solder it back on, but unfortunately opening the laptop also severed the useless paper cable they use for the track ball. So now it has power, but I must use an external mouse. It was a royal pain, and I think I'd take it to a shop rather than try it again, myself. StuRat (talk) 06:17, 21 February 2011 (UTC)[reply]
I also have a hint for after you repair it. There's nothing to stop it from breaking off the motherboard again, so I'd plug/unplug it as few times as possible. For example, you could unplug the other end from the wall and wrap the cord around the laptop to transport it. This might damage the cord, but that's far easier to replace. StuRat (talk) 06:25, 21 February 2011 (UTC)[reply]

Apple's Darwin License

[edit]

Is possible to get Apple's Darwin operating system under a permissive license? --Melab±1 06:06, 20 February 2011 (UTC)[reply]

I suppose Darwin (operating system) comes under the license that it comes under. See its web site for details. What different do you need? E.g. the article on it mentions "with proprietary drivers" - if that is a problem, are you prepared to pay for the programming work needed to rewrite those? What do you consider permissive? 88.112.59.31 (talk) 19:17, 20 February 2011 (UTC)[reply]
It states on [2] that XNU is licensed under the BSD and APSL licenses. I prefer a license where I don't have to redistribute modifications under the same license (APSL). Do you think that Apple might make a move to releasing newer versions Darwin under a non-copyleft license? --Melab±1 01:19, 21 February 2011 (UTC)[reply]
If XNU is dual licenced under the BSD and APSL licences then a non-copyleft licence is already available so I'm not sure what you're asking for. If you want other components, you should specify what although I somewhat doubt anyone here has any insider knowledge or Apple's future licencing plans and of course what we think is largely irrelevant here. Nil Einne (talk) 08:10, 21 February 2011 (UTC)[reply]
But I'm unsure about whether or not all files in its directory are dual-licensed or each component has a different license. --Melab±1 22:15, 21 February 2011 (UTC)[reply]

Javascript and regex

[edit]

I've currently got a piece of javascript code which outputs something similar to "2011-02-20T05:59:20Z". I am trying to pull the 05:59:20 out of this using a regular expression.

[0-9]{2}:[0-9]{2}:[0-9]{2}

This is the regex I've made, which works to pull it from that string. Unfortunately when I add that to this line of code using .exec(string), it makes it stop working.

original
result.innerHTML += '<li>(<a href="/w/index.php?diff=prev&oldid=' + edit.revid + '">diff</a>) <b>' + (edit.minor == undefined ? '' : 'm') + (edit.bot == undefined ? '' : 'b') + '</b> <a href="/wiki/' + escape(edit.title) + '">' + edit.title + '</a> ' + edit.timestamp + ' <a href="/wiki/User:' + escape(edit.user) + '">' + edit.user + '</a> (' + edit.parsedcomment + ')</li>';
Modified code
result.innerHTML += '<li>(<a href="/w/index.php?diff=prev&oldid=' + edit.revid + '">diff</a>) <b>' + (edit.minor == undefined ? '' : 'm') + (edit.bot == undefined ? '' : 'b') + '</b> <a href="/wiki/' + escape(edit.title) + '">' + edit.title + '</a> ' + [0-9]{2}:[0-9]{2}:[0-9]{2}.exec(edit.timestamp) + ' <a href="/wiki/User:' + escape(edit.user) + '">' + edit.user + '</a> (' + edit.parsedcomment + ')</li>'; 

What am I doing wrong here?

(and as a sidenote, how much of a nightmare would it be to subtract 05 from the first two digits (and add 24 if the result is negative) to adjust UTC to my timezone?) -- ʄɭoʏɗiaɲ τ ¢ 06:17, 20 February 2011 (UTC)[reply]

1. You have to surround regexps with slashes. 2. To subtract 5 from the timezone, use something like (parseInt(nn)+24-5)%24 where nn is the 2-digit string. The +24 makes sure the stuff in the parens is positive, and the %24 gets rid of the extra 24 if the result is too large. This is a standard and useful idiom for dealing with modulo calculations when you want to make sure the result is not negative. 71.141.88.54 (talk) 09:59, 20 February 2011 (UTC)[reply]
Alright, first step definitely worked... For the second, where would I put that in the code? I'd assume I can't do
+ (parseInt(/[0-9]{2}/.exec(edit.timestamp))+24-5)%24 + /:[0-9]{2}:[0-9]{2}/.exec(edit.timestamp) +

-- ʄɭoʏɗiaɲ τ ¢ 15:13, 20 February 2011 (UTC)[reply]

I think the first /[0-9]{2}/ in that example will match digits from the year, so you want something like /T([0-9]{2})/.exec()[1] to match the T05 and select the 05. The rest of it looks like it might work (since javascript automatically converts ints to strings when you try to add an int to a string). I'd say give it a try. Note that I haven't written any javascript in a long while, so my instincts about it aren't so good these days. Semi-related advice: Firebug is amazing and is near-indispensible for debugging complicated javascript, so you might want to start using it if you're not already. Also: irc freenode #javascript is probably a quicker place to get this type of help. 71.141.88.54 (talk) 02:25, 21 February 2011 (UTC)[reply]
Awesome, I'll definitely check that out next time I have problems. Your solution resulted in NaN:59:20, but it set me in the right direction. What I ended up doing was pulling the UTC time out of the original string, then when I added to result.innerHTML, I pulled the first two numbers, did the math, and displayed the remaining numbers.
        edit.timestamp = /[0-9]{2}:[0-9]{2}:[0-9]{2}/.exec(edit.timestamp);

        result.innerHTML += '<tr><td><b>¤</b></td><td width="25%">(<a href="/w/index.php?diff=prev&oldid=' + edit.revid + '">diff</a>...<a href="/w/index.php?title=' + edit.title + '&action=history">hist</a>) <b>' + (edit.minor == undefined ? '' : 'm') + (edit.bot == undefined ? '' : 'b') + '</b> <a href="/wiki/' + escape(edit.title) + '">' + edit.title + '</a></td><td>' +  (parseInt(/[0-9]{2}/.exec(edit.timestamp))+24-5)%24 + /:[0-9]{2}:[0-9]{2}/.exec(edit.timestamp)  + '</td><td><a href="/wiki/User:' + escape(edit.user) + '">' + edit.user + '</a> (' + edit.parsedcomment + ')</td></tr>';

And it works! Thank you :) - ʄɭoʏɗiaɲ τ ¢ 03:50, 21 February 2011 (UTC)[reply]

Cool! It's worth figuring out how to use groups in regexps (that's using parens in the expression to pull out pieces of the match), and also as a matter of style I'd probably say edit.timestamp.substring(0,2) to get the first 2 chars once you've already got the timestamp, rather than doing a second regexp match, but either way works. 71.141.88.54 (talk) 04:18, 21 February 2011 (UTC)[reply]
Note, there is another issue, which is if the timezone correction does go over the 24-hr boundary, then adjusting it means you also have to adjust the date. There are probably some built-in functions that can help with this but I don't remember them well enough. Check a reference guide. 71.141.88.54 (talk) 04:24, 21 February 2011 (UTC)[reply]
This code has been my intro to both javascript and regex, so I'm learning as I go quite honestly. I only needed the time and not the date; I'm using this to make a mini-watchlist call that shows the title, time, user and comment. Thank you for all the help. - ʄɭoʏɗiaɲ τ ¢ 04:45, 21 February 2011 (UTC)[reply]
It occurs to me that there's another problem with that code, which is that the timestamp after you do the arithmetic could come out as "3:45" instead of "03:45". If it's just for your own use, you might not care, but if you're planning to release the code to other people, it's best to make it as free as possible of subtle little gotchas like that. There are some sprintf-like functions you can search for and download, so you can do "%02d", or you could just code a little adjustment for the n<10 case. Javascript is quite powerful but it can be a bit "loose" (it's easy to make unnoticed errors) and difficult to debug in a browser environment, so be persistent ;-). 71.141.88.54 (talk) 20:02, 21 February 2011 (UTC)[reply]
And one more gotcha to be aware of if you're dealing with leading zeroes: parseInt("03") is 3, parseInt("05") is 5, parseInt("09") is 0. I could tell you why if anyone cares... :) Marnanel (talk) 22:47, 22 February 2011 (UTC)[reply]

Asus and Toshiba

[edit]

Which brand is the more reliable of the two? 24.189.87.160 (talk) 10:15, 20 February 2011 (UTC)[reply]

Personally, I prefer Asus. Although Toshiba is a more established company. Asus makes some high end gaming computers and because it's not technically a name-brand, they sell pretty cheap compared to their peers.--v/r - TP 18:57, 20 February 2011 (UTC)[reply]
In my limited experience with laptops I found Toshibas to be better built and overall more thought-through than Asus laptops. This, however, comes from a person who does not like laptops. --Ouro (blah blah) 08:51, 21 February 2011 (UTC)[reply]
Asus are considered to be robust. Toshiba look better, and are more expensive. You can buy any one with peace of mind. The cheapest Asus is cheaper than the cheapest Toshiba. —Preceding unsigned comment added by 212.169.187.5 (talk) 13:52, 21 February 2011 (UTC)[reply]

international email

[edit]

How do I send an email to another country. Do i need to do something extra? Thanks Tom —Preceding unsigned comment added by 99.66.171.155 (talk) 11:58, 20 February 2011 (UTC)[reply]

As a general rule, all you need is their email address and the Internet will do the rest. --Phil Holmes (talk) 12:09, 20 February 2011 (UTC)[reply]
In fact, there's no general way to tell what country the person you're emailing is located in. None of the Internet protocols are designed to be aware of national borders. Paul (Stansifer) 13:04, 20 February 2011 (UTC)[reply]
You might want to be aware of security monitoring and censorship. In the US, emails crossing the borders with certain "terrorist keywords" will get extra attention, while some nations might block emails on topics they object to, like any mention of democracy. StuRat (talk) 06:09, 21 February 2011 (UTC)[reply]

haha, no, just make sure you get the address exactly right - pay especial attention to the end, maybe sojeone is using a different extention, not .com like you're used to... —Preceding unsigned comment added by 109.128.213.73 (talk) 15:14, 21 February 2011 (UTC)[reply]

Two things I should mention here: 1) ".com" does not imply any country, and even for top-level domains that do imply countries, there's not necessarily any direct connection. (I live in the US, but I lived in the UK when I got my domain, so my email address still ends in ".uk".) 2) When you dial an international phone number, you have to add the country code onto the start. I have met people who believed there was some equivalent in email (so if your email address was foo@example.com and you lived in the US, then I would have to email foo@example.com.us if emailing you from abroad). This is not so, at least not nowadays. The same email addresses are used everywhere. Marnanel (talk) 15:34, 21 February 2011 (UTC)[reply]

compress

[edit]

I have lets say 100,000,000 one million small files mostly html, totaling no more than 500MB in all. I want to compress them with 7zip, but due to the limitations discussed at 7zip#Limitations it is not possible to create an archive with so many small files on my limited ram computer. What alternative methods could I use to overcome this? I was thinking about putting the files into several .tar archives, and then running 7zip on the .tars. However, I've never used .tar so I don't know if this is a good idea. Will 7zip compress the files as effectively if they are in .tar archives? Or would it be pointless like trying to compress .zip files? 82.43.92.41 (talk) 14:00, 20 February 2011 (UTC)[reply]

Why not just put them into several 7zip files, and add those to the archive. Although 7zip (probably) won't be able to compress them further (though who knows, maybe its header information compresses quite easily, so it could compress the total individual archive sizes further) , it should include them without a complaint. If it doesn't include them without a complaint, just rename the files from .7zip to .xyz. I doubt 7zip will say "I see what you did there! You're trying to get me to think that this is just some random format I don't know about, that happens not to compress very well. But I looked at these files - they're 7zip files, just with a different extension! You think you can get around my arbitrary limits? Well, you got another think coming, bud. I am NOT including these files. Go use winzip or something, maybe they'll let you commit these acts against nature." 109.128.201.187 (talk) 17:07, 20 February 2011 (UTC)[reply]
7-zip doesn't prevent the archiving of files with names ending in .7z; that would be ridiculous. The metadata is compressed by default, so running ordinary 7z files through 7-zip is unlikely to reduce their size. -- BenRG (talk) 03:49, 22 February 2011 (UTC)[reply]
Because of the 7zip limitations discussed in the article I linked to. Using several 7zip files, I'd have to divide into 1,000 separate 7zip archives which is not feasible. 82.43.92.41 (talk) 18:47, 20 February 2011 (UTC)[reply]
If only there were such a thing as a "scripting" language, where you could write a small program to give 7zip "commands" - then doing it into 1,000 or a million times would be easy. But that's crazy Unix talk. 109.128.201.187 (talk) 19:26, 20 February 2011 (UTC)[reply]
If you can write a .bat script which would compress 100,000 files at a time with 7zip, then compress the next 100,000 files etc until the whole folder is processed, I'd be very grateful 82.43.92.41 (talk) 19:34, 20 February 2011 (UTC)[reply]
Try it! The tar file should have many recurring byte sequences in it, giving recurring-sequence-based compression algorithms a "happy case" to work with. 88.112.59.31 (talk) 19:12, 20 February 2011 (UTC)[reply]

How can it be possible to have a hundred million small files which total no more than 500 megabytes? That would put the average file size at 5 bytes! I would hazard a guess that even the file's header would be more than 5 bytes in length. Did you actually mean totaling no more than 500GB, not MB? Rocketshiporion 23:35, 20 February 2011 (UTC)[reply]

I made a huge mistake with the zeros, I meant "one million" files, not a hundred million. Sorry! 82.43.92.41 (talk) 23:47, 20 February 2011 (UTC)[reply]

Taring files before compressing them should work - in fact, it'll probably give you better compression than if you compressed them separately (assuming the files have similar type content). Most data compression schemes based off of Lempel-Ziv-type algorithms require sequential reading of the file during decoding - in order to get the random access in .zip files, each of the files are compressed separately, which means you don't get to take advantage of the redundancy between the different files. You can get around this somewhat by using solid compression (which is not supported by the .zip archive type, but is supported by the .7z type), although many implementations of this are effectively tar->compress. By the way, compressing already compressed files, as suggested above, is probably the worst way of handling it - you don't get to take advantage of the redundancy between files, and you bloat the archive with the compressed files' header information. -- 174.21.250.120 (talk) 07:38, 21 February 2011 (UTC)[reply]

First of all, I tried creating a directory of 485,340 small files (at which point my ramdisk ran out of space) and then archiving them, uncompressed, with 7-Zip command-line version 9.20 (32-bit, Windows). The memory usage increased to 137,076K while it was "scanning" the files, then grew linearly to 305,900K while it was archiving them. So, while there does seem to be a memory-usage problem, it's not quite as bad as the article makes out, and you can probably use it on a million files without a problem.
If it doesn't work, though, you can archive the files uncompressed in any archive format you like (they all support uncompressed archiving, not just tar) and then run the result through 7-Zip. If you use an archiver that can output to stdout instead of a file (tar does, I think Info-ZIP's zip does), you can pipe the output directly to 7z -si, avoiding the intermediate file. You could also use xz instead of 7-Zip for the second stage. It uses the same algorithm typically used in 7z archives (LZMA) and it's understood by recent versions of GNU tar; you can write tar cJ instead of tar c to run the output through xz automatically. However xz doesn't support huge LZMA dictionaries like 7-Zip does, and it doesn't support the PPMd algorithm which compresses text better (but slower) than LZMA. -- BenRG (talk) 03:49, 22 February 2011 (UTC)[reply]

Is there a safe alternative place to download the latest version of Flash Player for Firefox on Windows? I've been trying to download it from the official website (http://get.adobe.com/flashplayer/completion/?installer=Flash_Player_10.2_for_Windows_-_Other_Browsers) for ages, and it downloads reeeeeeally slowly. This is free software: I'm not trying to pirate anything. I'd just like to be able to finish downloading it before bed! 86.161.110.118 (talk) 17:55, 20 February 2011 (UTC)[reply]

Oh, I should have said, Adobe Reader downloaded very quickly, so I know there's no problem with my download speed in general. 86.161.110.118 (talk) 17:56, 20 February 2011 (UTC)[reply]

http://www.wikifortio.com/735750/install_flash_player.exe 82.43.92.41 (talk) 18:20, 20 February 2011 (UTC)[reply]
Oh wow, that was really quick! Thank you so much. 86.161.110.118 (talk) 18:44, 20 February 2011 (UTC)[reply]
Adobe.com offers direct HTTP downloads of the installer from the site, though they don't go out of their way to advertise it. The relevant page is [3] and the actual download link is http://fpdownload.adobe.com/get/flashplayer/current/install_flash_player.exe. It's probably a better idea to get the latest version there than an unidentified version from a potentially dodgy open file sharing site recommended by an anonymous user. However, I downloaded the wikifortio.com file and it is byte-identical with the current adobe.com file, so you're okay in this case. -- BenRG (talk) 04:44, 22 February 2011 (UTC)[reply]

GIMP plugin to read Canon EOS raw files?

[edit]

I installed the GIMP on my mother's Windows computer, and she would like to use it to read raw image files from her Canon EOS 5D Mark II DSLR camera. Is there a GIMP plugin for Windows available for that? JIP | Talk 20:27, 20 February 2011 (UTC)[reply]

UFRaw is compatible with GIMP. It has apps that read Canon Raw and I recommend reading though the site so that you can pick out what you (or Mom) needs.--Aspro (talk) 20:54, 20 February 2011 (UTC)[reply]