Wikipedia:Reference desk/Archives/Computing/2009 November 23

Computing desk
< November 22 << Oct | November | Dec >> November 24 >
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.


November 23 edit

Regarding Sortware testing standards... edit

Is there any standard for software testing? If yes what are they? Can any software testing professional suggest?

Well, there are professional standards (so standards for testers, rather than testing), administered in the UK by the British Computer Society/Information Systems Examination Board - details here. I'd imagine similar bodies in other countries will have comparable qualifications. -- Finlay McWalterTalk 14:10, 23 November 2009 (UTC)[reply]
This is going to be very domain-specific. It depends on your software purpose, market/audience, language/implementation details, and budget. If you have some more specifics, we can point you toward particular methodologies or tools. You can also read software testing. Nimur (talk) 17:02, 23 November 2009 (UTC)[reply]

Bot for adding category to Settlements listed in Domesday. edit

There are 13,418 English places listed in the Domesday Book of 1086.

Not all of these are still settlements today, but a very large number of them have Wikipedia articles, which highlight the fact of their inclusion in the Domesday Book, and have a link back to the Domesday Book article.

The category Places listed in the Domesday Book is an attempt to link and organise these pages - but the task of manually adding this category to every appropriate article is daunting.

My question is, is there an existing bot which could be adapted to automate this task?

Josephus (talk) 10:52, 23 November 2009 (UTC)[reply]

user:Rambot created a vast number of US articles from US Census information (and added basic info for them, again from the census). But really lots of the bots that use the pywikibot framework should be able to do this; they all require a bit of reprogramming for each task, but your task doesn't sound like it'd be hard. I'd ask at Wikipedia:Bot requests. -- Finlay McWalterTalk 14:14, 23 November 2009 (UTC)[reply]

String vs. Pattern for Scanner Delimiter in Java edit

I can't figure why I'd use one over the other for setting the delimiter. Is there any advantage to using a pattern instead of a string? As far as I can see they'd come out the same. I want my delimiter to be a string "TOSS-UP" so I can't figure that using a pattern would help in my case. Thanks! 76.95.117.123 (talk) 12:38, 23 November 2009 (UTC)[reply]

The documentation for the String one says, "an invocation of this method of the form useDelimiter(pattern) behaves in exactly the same way as the invocation useDelimiter(Pattern.compile(pattern))". In other words, it's just a convenience method for you to be able to pass in a String when you don't need the Pattern for anything else. If you have to create the Pattern yourself (for example, to use its two-argument constructor), then they let you pass that Pattern in, too. Short answer: String when you can, Pattern when you must. --Sean 14:40, 23 November 2009 (UTC)[reply]
If you have a complicated reg-exp, then Pattern.compile may take a long time to execute. So, you would want to store the resulting Pattern object for re-use, instead of recomputing the pattern each time. If this is inside a loop with many iterations, consider benchmarking the two methods against each other, to see which has a faster run-time. Nimur (talk) 17:01, 23 November 2009 (UTC)[reply]

Perl Projects edit

Hello, I am relatively new to the programming world but I've written some simple VBA programs and would like to start learning Perl. However I'm not really sure where to start. When I learned VBA I found books to be rather useless except as a reference. Project based learning, however, was very effective.


Therefore, I was wondering if anyone could suggest some simple programming projects or tasks which would be useful in learning Perl? TheFutureAwaits (talk) 15:34, 23 November 2009 (UTC)[reply]

Project euler if you are obsessed with primes, otherwise you could just search "programming contest" and do some of the tasks. Picking a tutorial for some library eg this gtk tutorial and working through it is a choice. http://perldoc.perl.org/ and perldoc are off-topic but relevant. -194.197.235.240 (talk) 15:58, 23 November 2009 (UTC)[reply]
The best task to learn on is by writing a program you need (that way it's not an academic exercise and you get something valuable at the end). However, since one major use of Perl is in web programming (Common Gateway Interface), producing a web page or web site might be a good project, perhaps integrating with a database (assuming you have some way of hosting a web page - otherwise it might be less interesting as a project). Since Perl is also commonly used for text processing, there might be something in that area you could look at - do you need any files converted to different formats, or text analysed or formatted, or maybe even an interpreter or compiler? --Maltelauridsbrigge (talk) 13:05, 25 November 2009 (UTC)[reply]
I should also note that "Learning Perl" is possibly the only language tutorial textbook I've ever used that was actually helpful. It introduces techniques in a logical order, with useful exercises. Since it doesn't go into the object oriented elements in great detail (which are largely horrible additions in any event) older editions remain surprisingly useful. I'd recommend finding a used copy of 3rd edition and trying it out. I think I learned off a copy of 2nd edition (which covered up through something like Perl 5.01), and 99% of what I learned was directly transferable. —ShadowRanger (talk|stalk) 15:07, 25 November 2009 (UTC)[reply]
I don't recommend you learn Perl. Please take a look at python and ruby, which are superior in my mind. Cheers, ContinueWithCaution (talk) 14:48, 27 November 2009 (UTC).[reply]
I do recommend you learn Perl. I had lots of people tell me to learn python (what's with the tabs) over perl at one point, and knowing a little of both, you'll do just fine to learn perl. In any case, we're not here to answer your question by telling you to ask a different question (although I'm sure I've violated this rule too).
I found this series very helpful, and so is O'Reily (although the Learning Perl book is a little too beginner; opt for one of the other ones if you know a little bit). I would also recommend doing some basic text processing style apps before jumping into the CGI things, which are going to involve a lot of OO and module stuff. Shadowjams (talk) 09:19, 28 November 2009 (UTC)[reply]

Replacing grub edit

I can't fix this over the phone. Anyone know of an idiot-safe method to completely replace grub? Situation: User wanted to install Windows 7 to VMWare. He was in Fedora 11, ran VMWare, popped in the Windows 7 disk, and started the install. It said it wanted to the root drive. He said no, took out the disk, and decided to try the next day. Turned on his computer and it just said "GRUB_". I walked him through making a USB live disk (because his computer doesn't have a CD/DVD drive or floppy). He can boot into Fedora 12 live. If he runs Anaconda (to try and upgrade), he gets two choices: Replace existing Linux install or Install to free space. I got him to rescue mode where the local media is under /mnt/sysimage, but /mnt/sysimage/boot is completely empty. From there, I can't help anymore. -- kainaw 16:03, 23 November 2009 (UTC)[reply]

testdisk is worth a try, though I'm not %100 sure it can fix your specific problem. --194.197.235.240 (talk) 16:24, 23 November 2009 (UTC)[reply]
By booting into a Ubuntu LiveCD, it is possible to access a GUI grub configuration - StartUp-Manager. This is not "idiot-safe" - I don't think anything that mucks with the bootloader could be. But, it may be easier than other alternatives. Be sure to instruct the user to boot Ubuntu as a "try-without-modifying-your-computer" mode (or else it will begin installing over the other partitions). Once booted into the live-CD mode, you can actually modify the grub configuration file (either conventionally with a text-editor, or with the Startup Manager GUI). Nimur (talk) 16:52, 23 November 2009 (UTC)[reply]

You want to reinstall grub, right, not replace it with something else? Is so, here's what I have done a couple of times (using knoppix, but it should be the same when booting from a usb stick):

1. Create a mount point for the linux partition which countains the grub directory

(Assuming /dev/hda1 is the "lost" linux partition, replace if necessary)

  • Boot knoppix
  • open Konsole
# su
# cd /mnt
# mkdir root

2. Mount it

# mount -t ext3 /dev/hda1  /mnt/root

3. Make /proc and /dev accessible

# mount -t proc none /mnt/root/proc
# mount -o bind /dev /mnt/root/dev

4. Do chroot

# chroot /mnt/root /bin/bash

5. Reinstall grub

# cd /boot/grub

You might want to examine menu.lst at this point:

# vi ./menu.lst
# grub-install /dev/hda

WARNING: please observe that there is no number after hda!

If you get the error message "/dev/hda does not have any corresponding BIOS drive", try

# grub-install --recheck /dev/hda
  • Sorry if I've misunderstood and am answering a different question than the one you've asked. I don't understand every step of the process, I found this howto somewhere on the net a long time ago, and I've used it a couple of times, successfully.
  • Possibly the super grub disk has an easier way of dealing with this (it has a usb version, apparently). Hope this helps.
edit: Thinking a bit more about the super grub disk: it should allow you to boot into the os you've lost touch with. Then you can skip all the chroot stuff, and go straight to step 5. --NorwegianBlue talk 22:55, 24 November 2009 (UTC)[reply]
Thanks all. It isn't an issue anymore. I finally asked why he didn't just burn the install disk to a CD and do an "upgrade system" from there. He didn't have a DVD burner and (in the past) the Fedora team had the attitude that if you didn't have a DVD burner, you were a loser that didn't deserve Fedora. In version 12, they finally pulled their heads out of their asses and realized that not everyone has a DVD burner. So, they have the CD install iso as well. He downloaded and created the install CDs and did an upgrade. However, anaconda apparently pulled a trick. He selected upgrade. It said that the boot sector was messed up (no kidding - that's the problem) and asked if it should be fixed. I don't know the exact message since I wasn't there. But, apparently, selecting "yes" meant "please erase my entire hard drive". So, all files have been lost and he just installed Fedora 12 from scratch. -- kainaw 04:45, 26 November 2009 (UTC)[reply]

Strange codes in text, e.g. +ADs- or +ACoAKg- edit

i got a dataset that uses a strange encoding for non-printables / diacritics. i'm getting hte impression that it's an artifact of some mail system. or maybe it's excel or something? anyway, the stuff i get looks like this:

+ADs-, +AGA-, or +ACoAKg- and +ACEAIQ-

there's more.... any idea what that this and where it comes from? google shows me stuff from mailing lists etc - but theys just look like mangeled mail, nothing discussing the codes themselve.

Interestingly, Excel seems to know what to do with them. Might be something like quoted printable... just different :) any idea? -- Duesentrieb-formerly-Gearloose (?!) 16:46, 23 November 2009 (UTC)[reply]

It could be a Base64 encoding; it could be a lot of things. If it is Base64, we can decode it into binary values (with a tool like this one), but interpreting those numeric values will be context-specific. If it is attached to mails, is it part of a GNU Privacy Guard key? If it's only the special-characters, your process flow will be a bit complicated - you will need to get the binary-value and then determine which character encoding it belongs to, and then put that into a text editor or application which can use that character-coding. Nimur (talk) 16:53, 23 November 2009 (UTC)[reply]
No, it's not Base64. Bryan found it for me: it's UTF-7. Thanks all :) -- Duesentrieb-formerly-Gearloose (?!) 17:03, 23 November 2009 (UTC)[reply]
Strictly speaking, UTF-7 is a particular markup and interpretation of Base64 data. Our article explains this. Nimur (talk) 18:31, 23 November 2009 (UTC)[reply]

Detecting photoshopping/cloning in images edit

Hi all,

I've heard of programs that can detect photoshopping, most typically programs that detect the use of the clone tool, but I can't seem to find any online. I also heard that Adobe might be developing plugins for this, but that news was back for CS3 and I've got CS4 and see no plugin.

Anyone know of any such programs?

Thanks! — Sam 63.138.152.155 (talk) 19:36, 23 November 2009 (UTC)[reply]

Well, JPEG snoop is out there - it mostly talks about examining the 'exif' data (basically file headers and such) - which isn't really a good indication that the image has really be falsified - maybe someone just tweaked the brightness or cropped it or something. Detecting use of the clone tool is something that seems simple enough to do - but surprisingly, the blurb for JPEG snoop doesn't really push that aspect of it's supposed capabilities. SteveBaker (talk) 03:42, 24 November 2009 (UTC)[reply]
Detecting Photoshopped pics is the type of thing computers wouldn't do particularly well. Consider some of the techniques used:
1) Check for missing body parts. In one pic of a row of Russian leaders, one head was deleted, but the feet still showed where he had been.
2) Look for disproportional body part sizes. If the head is too big or small for the body, for instance.
3) Look for shadows pointing in different directions.
4) Look for different light source reflections on shiny objects, like people's eyes.
Most of these tasks would be difficult for a program to do alone. Some, though, like the last one, might work once a person identified the locations to check. StuRat (talk) 04:37, 26 November 2009 (UTC)[reply]

Is upgrading a CPU easy? edit

My motherboard is an ASRock P4VM8, socket 478. It currently has only a 1.8GHZ CPU, but according to the ASRRock website, it can take a 3.4GHz Pentium 4 with a 1MB cache.

  1. Is changing a CPU difficult?
  2. Would it make a noticible difference in performance?
  3. Is the 1MB cache built in to the CPU?
  4. Is a change like this going to cause any problems with the WinXP verification?

Thanks 84.13.162.136 (talk) 21:43, 23 November 2009 (UTC)[reply]

I've refactored your question to number the individual parts of it; I hope you won't mind Finlay McWalterTalk 22:06, 23 November 2009 (UTC)[reply]
  1. Changing a CPU generally isn't difficult. Sometimes unhooking the heatsink from the motherboard can be a pain, and you'll need to clean off and reapply fresh thermal paste between the CPU and the heatsink
  2. Noticeable: probably, but I wonder if it'd be cost effective. Generally I recommend people wait and then upgrade the whole of the core system (CPU/motherboard/RAM, and for gamers the graphics adapter too) in one go, which means you can use the old system for a backup PC, a gift, or a media server. Changing components incrementally tends to leave you permanently with one component faster than the others, which means it doesn't get utilised to its full potential.
  3. Yes
  4. If you're just changing the CPU (and not lots of other things at the same time) then you'll should be fine.
-- Finlay McWalterTalk 22:06, 23 November 2009 (UTC)[reply]
It's not too difficult to change the CPU - but you do need to take care. Make sure you're not going to zap the chip with a static discharge - grab the frame of the PC so you're at the same voltage as the case - and sit the plastic box that the CPU comes in on top of the PC case as you open it - so it too is at the same voltage. Try not to touch the pins on the chip. You'll need to take care with re-inserting it - apply some silver paste to get good thermal conductivity between the chip and the heat-sink/fan. It's not that hard...but you do need to take care and pay attention.
Will you see a marked performance improvement? Well, it depends on what kinds of applications you run. You aren't going to see much difference in things that are bottle-necked by disk speed - or heavily memory performance limited. You'll probably see significant improvement in graphics/games - but it's not going to be double the performance because the graphics system isn't going any faster. But if you're doing things that are heavily CPU-dependent - then you'll see a stunning improvement. It all depends what you're doing - and how much spare horsepower there is elsewhere in the system that's just stuck waiting around for the 1.8 GHz CPU.
You may find that your power consumption goes up a bit - if your power supply is near the limit - that might be a problem - but I really doubt it. It's also possible that whatever cooling solution you have with the existing CPU won't be enough - again, it's hard to predict. Modern CPU's often throttle their speed down if they start to overheat - that would mean that your fancy new CPU would simply be throttling itself back down to the speed of the old one! There are software tools out there that let you see if that's happening - and it's definitely worth checking what the deal is when the CPU is working hard. So make sure you don't have stuff like cables draped over the CPU's fan - if there are expansion boards that you can relocate down the far end of the rack from the CPU - so much the better. Sadly, the one card that would help would be the graphics card - but you probably can't relocate that. But generally - if you can keep cables away from the fans and electronics - that'll help the most.
SteveBaker (talk) 02:49, 24 November 2009 (UTC)[reply]

I was adding changes to the website for a Client and now my page has been deleted. edit

As this question is about a specific Wikipedia article, I've moved it to the appropriate place, Wikipedia:Help_desk#I was adding changes to the website for a Client and now my page has been deleted. -- Finlay McWalterTalk 22:15, 23 November 2009 (UTC)'[reply]

my e-mail had to be changed -after the change my page has been deleted. I received it on Thursday but it does not come. My new e-mail is *(cmont1234@gmail.com) my old mail was (montg1234@hotmail.com)Can this be corrected?

Charles Montgomery

5413Pebble Court McKinney, TX cmont1234@gmail.com