Wikipedia:Reference desk/Archives/Computing/2010 February 6

Computing desk
< February 5 << Jan | February | Mar >> February 7 >
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 6 edit

Help with Python edit

I'm trying to create a program that writes the numbers 1-10000 to a text file in python. Here's the code I have so far.

 
file = open("L:\mudkipz.txt", "r")
filedata = file.read()
file.close()
import math
b = 0
while b < 10000:
   b = b+1
   num = b
   f = open('L:\mudkipz.txt', 'w')
   f.write(num()/n)
   f.close() 

The problem is, whenever I run the file, I get this error:

Traceback (most recent call last):
File "c:\Users\Mitch\Documents\filewriter.py", line 10, in <module>
f.write(num()/n)
TypeError: 'int' object is not callable 

What am I doing wrong? MMS2013 00:49, 6 February 2010 (UTC)[reply]

Sounds like "f.write(num()/n)" is line 10, and the computer things you are trying to divide by n when I imagine you want to write the escape code for a new line - put the /n in quotes.87.102.67.84 (talk) 01:06, 6 February 2010 (UTC)[reply]
The error message seems to say that because num is an int, you can't call the function num() --70.129.128.154 (talk) 01:09, 6 February 2010 (UTC)[reply]
Thanks for your help, but I made both of the changes you recommended, and I still get the same error. MMS2013 01:21, 6 February 2010 (UTC)[reply]
Possibly you will also need to convert the number to a string - I think write needs a a string.
The code would be f.write(str(num)+"/n")
str(x) is a function that converts x to a string [1] via [2] does this work - what di you write?87.102.67.84 (talk) 01:25, 6 February 2010 (UTC)[reply]
Why on Earth would you open and close the file 10,000 times? Even if it worked, the performance would be horrible.
On to the problem... Think about what the value of n is (if n is a variable) at each stage in your loop? In what way is functiuon num() linked to value num? Why even bother copying the value of b to num in the first place?Astronaut (talk) 01:36, 6 February 2010 (UTC)[reply]
It worked, thank you all :) MMS2013 01:53, 6 February 2010 (UTC)[reply]

Python Equivalent edit

What would the equivalent of the TI Basic command fpart() be in Python? MMS2013 01:56, 6 February 2010 (UTC)[reply]

modf. I'd post this link but Wikipedia has decided it is spam, despite it being the most useful page I could find on the subject: www tutorialspoint com/python/number_modf.htm --Mr.98 (talk) 02:12, 6 February 2010 (UTC)[reply]

Power adapter cables edit

I would like to purchase another hard disk. I have an extra power adapter cable. However, it is too short to reach the location that I would place a new hard disk. What are my options to handle this? Are there extension cables that can be plugged into the end of one cable? And if so, are there any concerns that I should be aware of? The existing cable runs back into the power supply, which is fairly tightly sealed up and a little difficult to access. If it is easier or recommended to just replace the cable with a longer one, though, I suppose I could remove that inner casing to access it. Thank you. 124.214.131.55 (talk) —Preceding undated comment added 02:24, 6 February 2010 (UTC).[reply]

The power cables in PC are pretty much standard throughout. Can you swap the spare with one that is in use on another drive? Astronaut (talk) 02:29, 6 February 2010 (UTC)[reply]
Yes, I can and just did. I now have enough length for an extra drive. Silly me for not trying the obvious first. Thank you. 124.214.131.55 (talk) 02:43, 6 February 2010 (UTC)[reply]
Although you've already resolved this, I just wanted to let you know you can get extension cables for both IDE drives (with a molex connectors) and SATA drives (with the SATA connectors). Assuming your PSU is actually capable of powering the extra device, the tiny amount of additional cabling that you're adding won't have any impact. You can also get "Y cables" that will split one cable into two new connectors (and giving a slight lead extension at the same time). These also don't don't really cause any problems assuming that your PSU can handle it, but they can make it more difficult to balance the load across the rails, assuming your PSU prefers/requires this. ZX81 talk 03:01, 6 February 2010 (UTC)[reply]
  Resolved

Computational complexity of applying numbered permutation edit

What is the computational complexity of the algorithms given at Permutation#Algorithms_to_generate_permutations, if an arbitrary precision integer type is needed to store k? NeonMerlin 05:17, 6 February 2010 (UTC)[reply]

Computational complexity is not an exact measure of time. It is a measure of how much more time is required (or more resources) as the problem grows in size. If using arbitrary precision numbers, the slow math will be slow for small values of n and large values of n. You are going to perform the math approximately n times to produce the kth permutation. So, it is O(n). The key thing to understand is that the time it takes to perform n computations will be much longer for arbitrary precision math as opposed to just using standard integer types. How much longer depends on your implementation of arbitrary precision math. -- kainaw 05:31, 6 February 2010 (UTC)[reply]
For arbitrary precision maths the time taken depends on the encoding - ;(ignoring unary) the average length of a set of numbers encoded to base b is (n-1/(b-1))(b-1) = L, where n is the number range of numbers numerals, the time to add it proportional to L, to multiply L^2 and to divide to an integer b*L^2 (i think) doing sums in software - basic algorhtyhms, proofs on request, to complicate things each iteration of the loop shortens (reduces) the number - in a way not totally related to the base representation - if you can work out how the length of the representation of the number changes after each iteration of the loop it should be possible to calculate a formula (or at least the formula as a summation) for the time taken.87.102.67.84 (talk) 07:35, 6 February 2010 (UTC)[reply]
I assume you didn't mean the lexicographic method - which doesn't need numbers (except to store a value up to k - but not up to k! - much easier) - it can work with strings (or arrays of chars/numerals)...87.102.67.84 (talk) 07:40, 6 February 2010 (UTC)[reply]
And note that the range, since each swap narrows it, is i! for all 2 ≤ in. At Computational complexity of mathematical operations, it says the fastest multiplication algorithm for n-bit integers is O(n log n 2log* n) and that division is the same complexity as multiplication. Barring any other optimizations, this implies the permutation's complexity is
 
whatever that works out to be. NeonMerlin 21:02, 6 February 2010 (UTC)[reply]
What about the complexity of the memory unit inside the computer? What about the complexity of the pipeline (or lack of a pipeline) inside the CPU? In computational complexity, you focus on a single algorithm. If the algorithm requires multiplication, you don't add in the complexity of multiplication to the algorithm. You assume that multiplication can be accomplished. Similarly, you don't concern yourself with the complexity of memory management when working on a multiplication algorithm. You assume that memory management can be accomplished. Your goal should be to improve each algorithm separately, not in a big confusing mess of summing up a bunch of complexities into something that makes no sense. -- kainaw 22:37, 6 February 2010 (UTC)[reply]

Orkut edit

What is Orkut Buykkokten's religion?? —Preceding unsigned comment added by 59.164.73.59 (talk) 11:21, 6 February 2010 (UTC)[reply]

Please don't post the same question on multiple reference desks. --ColinFine (talk) 16:02, 7 February 2010 (UTC)[reply]
Then what should I do?? Paste it on my shirt?? —Preceding unsigned comment added by 59.164.73.39 (talk) 12:58, 8 February 2010 (UTC)[reply]

List of BASIC dialects than can run under both Windows or Ubuntu? edit

Is there a list anywhere please? For example the GPL version of SmallBasic (not the Microsoft language of the same name) can run the same code under Windows or Ubuntu. I'd like to find out what other dialects can do this. Thanks 78.146.77.179 (talk) 13:42, 6 February 2010 (UTC)[reply]

List of BASIC dialects lists several that run under several platforms. It's not shown as a platform comparison, but if you search that page for "linux" you mostly find that those that run on linux will also run on windows and very often on mac. -- Finlay McWalterTalk 14:15, 6 February 2010 (UTC)[reply]

From List of BASIC dialects by platform:

The free basics that can run under both Windows and Linux are Basic-256/KidsBasic, Basic4SDL/Basic4GL, Chipmunk Basic, FreeBASIC, OpenOffice Basic (?), RapidQ, ScriptBasic, SmallBASIC (also PalmOS), Vintage Basic, wxBasic, XBasic, Yabasic.

The commercial ones are BBx, BlitzMax, GLBasic, KBasic, Hotbasic, KoolB, ProvideX, PureBasic, REALbasic, TrueBasic

Not known if free or commercial: BluntAxeBasic. 78.146.77.179 (talk) 17:11, 6 February 2010 (UTC)[reply]

Languages most similar to BASIC edit

I have been using one or two versions of BASIC for decades. I seldom do any programming, just ocassionaly is it useful. For someone familiar with using BASIC, what other languages would be most similar? And easiest to learn for someone habituated to basic? Thanks 78.146.77.179 (talk) 13:46, 6 February 2010 (UTC)[reply]

Python (programming language) and Javascript are fairly similar, at least to a modern structured basic (one with while loops and blocks and stuff, rather than older stuff like ONGOTO and NEXT). -- Finlay McWalterTalk 14:11, 6 February 2010 (UTC)[reply]
People still use BASIC today. For example, you can compile GW-BASIC programs inside Windows and they will still run. You can use the old MS-DOS GW-BASIC program, too. Here is a list of BASIC dialects, if you'd rather try something else: [3].--Drknkn (talk) 14:18, 6 February 2010 (UTC)[reply]
Fortran I think is the nearest, Pascal (programming language) is quite similar to the more featured versions of basic (ie the ones with proceedures) and shouldn't be too much of a shock to the system (though not a great improvement either) , both tend to require more structure than the average basic. However I agree that python (which has a lot more concepts and features not in Basic - unlike pascal and fortan) would be a lot easier to learn. And more suitable to occasional programming - but a bit slow in comparison to the others (including compiled basic). I believe that freeBasic is still well supported if you want a feature package basic.87.102.67.84 (talk) 14:42, 6 February 2010 (UTC)[reply]
Are you looking for another language like basic, or another basic dialect(List of BASIC dialects)? There are still a number of working and decent Basic compilers...Smallman12q (talk) 19:38, 6 February 2010 (UTC)[reply]
I may be prepared to start using another language if it was quick to learn after using Basic for a long time, and it could do things that basic couldnt. I've been using GWBasic in a DOS window quite happily, but as I'm planning to get an old computer running Ubuntu as a spare, then as my question above indicates I'm interested in finding a Basic dialect that will work with Windows or Ubuntu. I was already aware there are many basic dialects available. 78.146.77.179 (talk) 20:00, 6 February 2010 (UTC)[reply]
FreeBASIC can be compiled to run on Windows, DOS, and Linux. --Phydaux (talk) 22:55, 7 February 2010 (UTC)[reply]

Confused by fancy variable names edit

In the old days variable names were just one word or even just one letter. Now looking at examples of code I see very long variable names with lots of "."s in them, or even "::"s in them. 1) Is there some cross-language convention for variable names that I could study? 2) Do the "."s or ":"s mean anything to the compiler or interpreter, or are they simply of significance to the programmer only? 78.146.77.179 (talk) 13:51, 6 February 2010 (UTC)[reply]

In C and C++ foo.bar can mean that bar is a member of the struct foo. In C++ and Java (and a bunch of other languages) it can also mean that bar is a member of an object called foo (you need to know if foo is an object or a struct). In C++ foo::bar means that bar is a class variable (or are we calling them "class member") of the class foo. Class members in Java use a . rather than ::   , so there's another reason you need to know what foo is before you can understand what foo.bar means. Other languages kinda follow these "conventions" sometimes, and sometimes not. Note that in most of these (C++,java and their ilk) bar can be variable (called a member) or a function (called a member function) so you can call foo.bar() just like you'd call printf(). These all mean something to the compiler and the language runtime; they're reserved syntax, so you can't just make a variable like int foo.bar=3; -- Finlay McWalterTalk 14:05, 6 February 2010 (UTC)[reply]
They are for the compiler. In the old days, there were no such things as classes and objects. Nowadays, dots have special meaning in object-oriented languages. Here's an example:
Dog.color = brown
Dog is a class. Color is a property of a dog. Here's a method:
Dog.bark()
The two colons are specific to C++, but are similar in meaning to the dot. They are used with classes, whereas a dot is used for objects. An object is an example of a class. For example, in Visual Basic, you could type this:
Dim fido As Dog
Now, fido is an object (instance) belonging to the Dog class.--Drknkn (talk) 14:08, 6 February 2010 (UTC)[reply]
So Dog.color is class.property, Dog.bark() is class.method. How would you refer to an actual dog, not just the dog class please? 78.146.77.179 (talk) 16:10, 6 February 2010 (UTC)[reply]
Typically you'd make an instance (as in 'instantiate') of the class - something like (disclaimer: my use of instance doesn't seem to match everyone elses - probably better to think of it as a variable declaration)
fido = new Dog
in the same way you might write:
name = new String (for a string variable named 'name' )
(syntax varies between languages)
Then the object (fido the dog) is the 'variable' (of type or class dog), and is refered to by fido.bark() , fido.ageof , fido.favouritetoy , fido.age etc.87.102.67.84 (talk) 16:18, 6 February 2010 (UTC)[reply]
So the interpreter would automatically understand that the method dog.bark() would apply to fido as in fido.bark()? 78.146.77.179 (talk) 17:09, 6 February 2010 (UTC)[reply]
Yes.87.102.67.84 (talk) 17:19, 6 February 2010 (UTC)[reply]
Note: one way to do this (if you have a lot of dogs) would be:
Doglist[] = new Array[101] of Dog
(Assuming you have 101 dogs). Then to find dogs called "fido" (and make them bark) you would loop over the dog array like this:
For x =1 to 100
if Doglist[x].name == "fido" then do something.. such as Doglist[x].bark()
Next x
(again actual sytax varies) Obviously bark() would be just a proceedure with something simple like print "woof" in it.87.102.67.84 (talk) 16:46, 6 February 2010 (UTC)[reply]
the dots are very much like path separators in file listings - defining sub variables in the same way that "C:/User name/my_files/my_images/holiday_in_tenerife/images_of_the beach/" defines a nested folder on the hardisk - compare with ""C::User name.my_files.my_images.holiday_in_tenerife.images_of_the beach" - as noted above the final "file" (by analogy) can be either a variable (x,y etc) or also a function or proceedure.87.102.67.84 (talk) 14:53, 6 February 2010 (UTC)[reply]
Double colons are also used for class separation in Perl. Marnanel (talk)
Fortran uses a class%member property system, so everything depends on the language as well. Titoxd(?!? - cool stuff) 19:20, 6 February 2010 (UTC)[reply]
Another important use of the "::" in C++ is in specifying a namespace, which is kinda like a class, only completely different. -- 174.21.224.109 (talk) 19:29, 7 February 2010 (UTC)[reply]

Selling financial software edit

What steps should a programmer take to avoid the possibility of legal trouble in the event that the financial software they develop and sell unexpectedly turns out to give wrong results which lead people to take wrong financial decisions? 78.146.77.179 (talk) 14:06, 6 February 2010 (UTC)[reply]

The most common strategy is to use the prevailing jurisdiction's limited liability provisions, typically by establishing a limited liability corporation, partnership, or whatever. As this programmer is worried about "the possibility of legal trouble" then they need to talk to a lawyer. -- Finlay McWalterTalk 14:24, 6 February 2010 (UTC)[reply]
Indeed, you should talk with a lawyer about your individual case. Common steps that are often taken are that the programmer forms a corporation or a limited liability company and makes sure all business is conducted in the name of the company. If the Exxon Corporation loses a billion dollars because of an error in the software, the programmer himself is not supposed to be liable; the company is, so it can declare bankruptcy in the face of the staggering losses, and supposedly the owner(s) of the company have no further liability. Another step you're probably familiar with is the lengthy legal disclaimer in the software's EULA. And also there is a type of insurance called Errors and omissions insurance that is supposed to cover this — though the policies are lengthy and complicated and always have lots of exclusions. E&O is expensive. I don't have any data on how effective each of these 3 steps is. Comet Tuttle (talk) 18:14, 6 February 2010 (UTC)[reply]

Record 2 speeches simultaneously on a single pc edit

I'm doing some experiments on speech separation.

My situation is: consider a conference with n number of speakers. There are n microphones to record the speech. But each of the microphone will get a weighted speech of all the users. I want separate each speakers using the outputs from all the microphones. For this first I've to record at least two speeches simultaneously on a same pc. I want to know if its possible. —Preceding unsigned comment added by JephyVarapuzha (talkcontribs) 14:50, 6 February 2010 (UTC)[reply]

Yes I think so, if I've understood correctly - assuming each microphone has the same characteristics - then the amplitude recorded on a given microphone will be = k1s1+k2s2+k3s3+etc where s1,s2 etc are the separate speech amplitudes of each speaker, and k1,k2,k3 etc are constants (assuming each speaker roughly stays in the same position to each microphone) - since you have multiple microphones (assuming 1 per speaker or more), and multiple samples of sound amplitude as well - you can treat the formula as linear equations and solve for s1,s2 etc - the key thing here seems to be to assume that the constants k(n) on microphone m and k(m) on microphone n are the same.. - since they are the same distance from the opposite speaker. Also assume that each speaker is the same distance from their own microphone - making k(n) for speaker n = k(m) for speaker n. This would give you a first approximation for the individual speaker amplitudes - multiple samples give you an average.
The next step would be to find a method of varying by small amounts the parameters of k until the channel separation of the S(n)'s are maximum - this might be done either statistically, or using a computer to iterate values.
Was that the sort of thing you were thinking of? If so and you need more info it you might get more answers on the maths desk - provided you can make it clear to them what the type of algorhtym you want to implement is. 87.102.67.84 (talk) 15:03, 6 February 2010 (UTC)[reply]


Actually i've some algorithms in hand. What i need to do is to record two speeches simultaneously in a single pc. My PC have two mic-in s (one in front and one in back). I want to know if I could record with these two simultaneously. The sound recorder on windows seem to record from one only. —Preceding unsigned comment added by JephyVarapuzha (talkcontribs) 15:22, 6 February 2010 (UTC)[reply]

ok I'd guess the sound in is stereo (it is on most) - and the microphones monoaural - so you just need a splitter - probably a 3.5mm stero male to 2 mono splitter ? http://www.google.co.uk/search?rlz=1C1CHNG_en-GBGB363GB363&aq=0&oq=3.5mm+stereo+to&sourceid=chrome&ie=UTF-8&q=3.5mm+stereo+to+2+mono+splitter ? :) I would guess the two mic ins are the same port - but to be certain you'd need to give us the soundcard model (or motherboard model if it's on there) - you can get this info via the sound drivers info panel probably.87.102.67.84 (talk) 15:26, 6 February 2010 (UTC)[reply]


My motherboard model is Gigabyte M61PME-S2P. By using a splitter we get only one sound file right? I need two separate wav files for both the mics. —Preceding unsigned comment added by JephyVarapuzha (talkcontribs) 16:00, 6 February 2010 (UTC)[reply]

The audio chip is http://www.realtek.com.tw/products/productsView.aspx?Langid=1&PFid=28&Level=5&Conn=4&ProdID=44 "2 stereo ADCs support 16/20/24-bit PCM format, one for stereo microphone, the other for legacy mixer recording" - so it's possible that you do have 2 stereo channels. Splitting a stereo wav into two monos is simple http://www.google.co.uk/search?rlz=1C1CHNG_en-GBGB363GB363&sourceid=chrome&ie=UTF-8&q=split+stereo+wav - you might need some extra audio software to do it. Similarily to get both stereo channels to record you'd need something with more features than windows sound recorder - I don't know what to recommend - maybe someone else can.87.102.67.84 (talk) 16:12, 6 February 2010 (UTC)[reply]

thank u v much. i'll buy a splitter and test it... —Preceding unsigned comment added by JephyVarapuzha (talkcontribs) 16:22, 6 February 2010 (UTC)[reply]

Consider also getting some USB sound cards. Like This one : [4].
Those should be selectable as seperate sound devices in whatever software you're using to do the recording. APL (talk) 04:39, 7 February 2010 (UTC)[reply]

Graphics tablet trainer edit

I recently purchased a graphics tablet and am using it for the first time. Obviously like any new device, it takes some time to coordinate one's muscle memory to the device—in particular I am finding it tough to gauge the pressure settings and making precise movements with it. I am not bad with pen on paper drawing (in the sense that my hands and brain are well in sync), but I am finding this rather fumbling at first.

Is there some sort of trainer/game/etc. that would help me with this? I imagine that one could fairly easily have something that forced one to basically "practice" using it under very precise conditions, helping the hand and brain learn how to do it "just right" each time. (Similar to the exercises one does in learning a musical instrument, where you are basically "programming" your brain and hands and etc. to work together in a new way.) Does anyone know of such a thing? I'm not sure what I ought to be searching for, really. Is there such a thing? (Don't make me program one myself.) Obviously practice makes perfect, but I'm not really capable of using the tablet for my "real" work yet, and so I guess I'm looking for some kind of program that would structure my "practice" a bit. --Mr.98 (talk) 16:04, 6 February 2010 (UTC)[reply]

I suggest a game where you win or lose based on how well and quickly you draw things. Yahoo Games used to have a version of Pictionary, but I can't find it any more. I did find "The Sketcher", which might also work, there: [5]. StuRat (talk) 00:19, 7 February 2010 (UTC)[reply]
I use a tablet instead of a mouse at home almost all the time (this may or may not be practical depending on how your computer is set up; picking up and dropping the stylus take time, so I do a lot of stuff from the keyboard). It is possible to do pretty much everything with a tablet, though there will always be more wiggle than using a mouse (I accidentally drag things I'm meaning to click on all the time). My tablet is medium-sized (I think it's 4x6 inches), but I prefer to use it with the screen mapped to a smaller rectangle; I like not having to move my wrist as much.
If you like logic puzzles, Simon Tatham's Portable Puzzle Collection are very good, and involve plenty of pointing; pick a puzzle with lots of clicking, choose an easy setting, and resize the window to something small if you want to practice precision. (These puzzles tire my wrists out, though, so don't go overboard.) Paul Stansifer 02:22, 7 February 2010 (UTC)[reply]
I enjoy playing iSketch. It's a fun web-based Pictionary clone. Wacom owners are at a natural advantage. APL (talk) 04:42, 7 February 2010 (UTC)[reply]
Crayon Physics and World of Goo are both good indie games (well worth the money) that are good for use with tablets. --125.239.49.44 (talk) 23:58, 7 February 2010 (UTC)[reply]

Administrative rights in Windows XP Media Center Edition edit

  Resolved

Hi. I'm running Windows XP, and I was installing the latest version of iTunes when I ran into an error message, indicating that I didn't have permission to perform some task unless I log in as an administrator. That seems fine, except there's only the one account on this machine, and it has administrative rights. I'm kind of stumped. Does anyone have any ideas? -GTBacchus(talk) 18:30, 6 February 2010 (UTC)[reply]

Now I've found the secret "Administrator" login, and when I'm logged in that way, I get the same error message. It says:
Still stumped. -GTBacchus(talk) 18:56, 6 February 2010 (UTC)[reply]
Try right clicking the directory, click Properties then the security tab and check Administrator has Full Privileges. You could also experiment with the Advanced button, and take ownership of the directory. --205.168.109.130 (talk) 19:19, 6 February 2010 (UTC)[reply]
I kept searching after posting, and found an uninstallation program that does deep registry cleaning. Therefore, I'm now listening to music again. Regardless, the tip you suggest is something I didn't know about, and which may come in handy later. Thanks for that. -GTBacchus(talk) 20:28, 6 February 2010 (UTC)[reply]

Google redirect virus -- how does it work? edit

I've given up on trying to clean this infuriating bug off my system, but I would like to understand how it's operating exactly. Why, for instance, Google themselves can't deal with it. And why it affects every browser I have. Thanks. Vranak (talk) 19:01, 6 February 2010 (UTC)[reply]

If there's a computer virus on your system, it can do whatever wondrous imaginings the programmer thought up, including altering what URLs are accessed whenever any application on your computer attempts to resolve any URL. There's nothing Google can do about it. May I recommend, after you reformat your system, creating one account with administrator rights that is only used when installing software, and another account with no administrator rights, which you use on a daily basis for all your computing tasks? This makes it a lot harder for malware to infect your system files. Comet Tuttle (talk) 20:49, 6 February 2010 (UTC)[reply]
My HP Mini 311 failed, within two weeks of purchase, to even revert to its original state. Every HP I've used has failed catastrophically within three years. Best choice I have is just to live with it. Vranak (talk) 21:05, 6 February 2010 (UTC)[reply]
That strikes me as probably not the best choice you have. --Mr.98 (talk) 22:53, 6 February 2010 (UTC)[reply]
I've tried everything and nothing works. Vranak (talk) 23:44, 6 February 2010 (UTC)[reply]
It may be simply that the virus has modified your hosts file or is pointing to a different DNS. Have you tried visiting Google by IP? If HP provided you with installation media and you have nothing you care about on the disk, the obvious solution would be to completely wipe the harddisk/s and reinstall from scratch. I believe some computers have a recovery partition however in that case there's a risk the recovery partition has been infected (I don't know how common this is but it's clearly a possibility if the content is writable to the malware which it would be if it's on a disk connected to the computer when the malware is running and would even be possible if the partition isn't mounted since the malware can mount it or interpreted it itself.) If that really doesn't work, it sounds like you have more serious problems of some sort. You may of course want to do this offline particularly if you don't have a good firewall and are using an old version of Windows (getting online without getting infected may become a problem, worst case scenario you could download the necessary updates from another computer) Nil Einne (talk) 10:18, 7 February 2010 (UTC)[reply]
Hear me on this: I have tried everything. There's something that I just don't understand about the infection though, for all my efforts to be in vain. Why is it that all the antivirus and antispyware software I try is oblivious to the issue? How can that be? Vranak (talk) 13:20, 7 February 2010 (UTC)[reply]


It's pretty obvious some program has modified the way your requests to google are processed on your computer. Google has no way to helping you. As for why antivirus software can't detected, well maybe it's a new virus or undocumented. I suggest you try combofix —Preceding unsigned comment added by 82.43.89.14 (talk) 13:39, 7 February 2010 (UTC)[reply]

Personally I don't trust antivirus software to eradicate 100% of every virus anyway. At this point you should get an external USB drive, copy all the contents of your hard disk to it, then disconnect it, format your internal hard disk, set up 2 separate accounts as I mentioned above, and reinstall Windows and all your applications from scratch. Make sure antivirus software is installed, then connect the USB drive again and scan it. (Some viruses interfere with antivirus software.) Then be very careful about moving your documents from the external USB drive to your internal drive — some of them are infected. Comet Tuttle (talk) 15:11, 7 February 2010 (UTC)[reply]
Try going to C:\Windows\System32\drivers\etc, right-clicking the file "hosts" and opening it in Notepad. Scroll down to the bottom -- do you see "google.com" listed there? (This is the hosts file.) If a program has modified this file, it would behave exactly the way you describe: redirecting all requests for google.com, and not be picked up by any malware detector. It's also very simple to fix: delete the line that mentions Google, and save (you may have to run Notepad as an administrator to do this.) Friggums (talk) 10:19, 9 February 2010 (UTC)[reply]

Have you used Hijack This yet, and shown the results to a suitable forum? I take your word for it that you have already done a series of scans with things like Malwarebytes, Superantispyware, Spybot, and others, using Ccleaner before each scan. 89.242.159.40 (talk) 21:31, 10 February 2010 (UTC)[reply]

Simple computer vision for linux to crop sheets of paper out of a photograph edit

I would like to take a picture of several sheets of paper. I would like for the computer to recognize the sheets, crop them out resize as necessary and then stick them in a PDF . Is anyone aware of a program (free and open source) that does this?

I am thinking about writing a quick little script using the example programs in opencv and some imagemagick but I would like to avoid reinvetning the wheel if possible. This seems like a problem someone might have already tackled, thanks. -- Diletante (talk) 19:24, 6 February 2010 (UTC)[reply]

Object and Instance edit

I've been reading Object-oriented programming after being inspired and enlightened by the very good and clear descriptions by 87.102.67.84 and Drknkn in the "Confused by fancy variable names" question above. But there is something I'm not clear about.

There is a class called Dog. The object Lassie is one particular Dog. But Lassie is also an instance of the Dog class. So what is the difference between an object and an instance please? 78.146.77.179 (talk) 19:47, 6 February 2010 (UTC)[reply]

In the inconsistent world of OO nomenclature, "object" and "instance" mean the same thing. -- Finlay McWalterTalk 20:33, 6 February 2010 (UTC)[reply]

Why are they given seperate paragraphs and headings in the Object-oriented programming article? 78.146.77.179 (talk) 20:35, 6 February 2010 (UTC)[reply]

an object is an instance of a class. --99.52.85.117 (talk) 20:39, 6 February 2010 (UTC)[reply]

The article says "One can have an instance of a class or a particular object." I'm confused. 78.146.77.179 (talk) 20:53, 6 February 2010 (UTC)[reply]

In my opinion, that's just really poor wording in that article: in a class-based language, "object" and "instance" mean exactly the same thing - basically, a particular variable whose type is some "class". "Instance" is perhaps a little less ambiguous because "object" is used so much when describing the abstract concept of object-orientation etc.
Prototype-based programming is a bit different, because there are no classes to have an "instance" of, so AFAIK the term doesn't apply. - IMSoP (talk) 21:05, 6 February 2010 (UTC)[reply]
FWIW, I've gone ahead and removed that "... or a particular object" - I really don't think it was a helpful phrase. - IMSoP (talk) 21:20, 6 February 2010 (UTC)[reply]
It is mainly just using a word that sounds nice. It doesn't sound nice to say "Lassie is an object of dog." It doesn't sound nice to say "Lassie is an instance." If you are going to follow it with the class name, you use instance. If you are going to leave it dangling, you use object. There are many areas of the English language in which one word sounds better in one situation, but is replaced with another word in a different situation. -- kainaw 21:12, 6 February 2010 (UTC)[reply]
The relationship between "instance" and "object" is just like the relationship between "son" and "man". Every man is a son and every son is a man (ignoring that "man" often implies adulthood, and sometimes doesn't imply maleness), but no one says "I am a son" in isolation. The word "instance" (like "son") is used to talk about relationships; you'd say myHat is an instance of Beret, where myHat is an object and Beret is a class. The word "object" can be a bit trickier. It's common to hear said of a language that "everything is an object", but it is not always clear what is meant by "everything". Paul Stansifer 02:14, 7 February 2010 (UTC)[reply]

Given the comments above, wouldnt it be best to combine the Objwect and Instances paragraphs in the article? 78.146.77.179 (talk) 00:29, 7 February 2010 (UTC)[reply]

(The desecription could be clearer on that page)
I think one example of the difference is that a class (ie the definition or template from which real objects are derived) is an object too, but is not an instance of anything (I go on to contradict this a few lines down!).
Sometimes people ignore or do not use the term 'object' to refer to classes.
  • Hint
    • Lassie (object) is an instance of the Dog class
    • Dog (class) is an instance of the class object (this is usually ignored since it's too abstract, and rightly so )
more correctly: Dog (class) is an extension of the prototypical class object. As you can see discussions of OO terminology rapidly descend into confusion.
Not quite true (well, the part about "confusion" is totally true). The "class object" is not worth thinking about. In some OO languages, there's a class named, confusingly, "Object". In those languages, every (lowercase) object is an instance of the class called (uppercase) "Object". It would have been less confusing (and also more accurate) if they had called that class "Thing". Furthermore, the uppercase "Object" is typically unimportant (unless you're using pre-version-1.5 Java). Summary: An object is something you can manipulate. Each object is an instance of some class. A class is a set of objects that share something in common. Paul Stansifer 19:33, 7 February 2010 (UTC)[reply]
I'd avoid worrying too much about the semantics since there will always be someone who uses the term object (broad or narrow definitions) differently.87.102.67.84 (talk) 16:36, 7 February 2010 (UTC)[reply]

Languages that have very high level commands edit

SmallBASIC has for example a chart command "which draws an automatically scaled and labeled graph of an array". Rebol has simple commands for its built-in text editor and other things. Are there any other programming languages or dialects which include simple commands for high-level things like these? 78.146.77.179 (talk) 20:50, 6 February 2010 (UTC)[reply]

See High-level language for an in-depth discussion. Marnanel (talk) 20:52, 6 February 2010 (UTC)[reply]
It does not seem to mention or list any actual languages, which is what I'm asking. 78.146.77.179 (talk) 20:55, 6 February 2010 (UTC)[reply]
Domain Specific Languages would be worth a look. See also MATLAB, R and friends. 131.111.248.99 (talk) 21:11, 6 February 2010 (UTC)[reply]
Also, I don't know, but I daresay GML will come pretty close to what you're looking for. 131.111.248.99 (talk) 21:18, 6 February 2010 (UTC)[reply]
In typical high-level languages, those features are located in libraries, rather than being a part of the language itself. For a small cost in usability (you need to track down and import the library), a language can have many, many more simple, powerful capabilities like chart. For example, in Python, you might use something like libplot or Gnuplot.py for charting. Paul Stansifer 01:57, 7 February 2010 (UTC)[reply]
Perl 187.26.127.255 (talk) 22:40, 6 February 2010 (UTC)[reply]
APL has some high level commands. It is possible to write a complex program, to calculate the inverse of a matrix for example, with just a few characters. Astronaut (talk) 19:05, 8 February 2010 (UTC)[reply]

Batch processing folder full of images? edit

Is there a simple, free, and easy way to convert an entire folder full of .bmps into another filetype like PNG or JPEG? 67.169.7.53 (talk) 23:04, 6 February 2010 (UTC)[reply]

ImageMagick --Andreas Rejbrand (talk) 01:01, 7 February 2010 (UTC)[reply]

"Open with GIMP" still shows up even after GIMP is uninstalled edit

When I right-click an image, in the menu it will show "Open with GIMP" even though I have uninstalled GIMP. How can I get rid of this? I have tried CCleaner and fixed all the registry problems it could find, but it did not fix GIMP from showing up in the menu. 67.169.7.53 (talk) 23:20, 6 February 2010 (UTC)[reply]

You may find this site helpful. --Andreas Rejbrand (talk) 00:38, 7 February 2010 (UTC)[reply]
I've tried MMM Free and Context Menu Editor, and "Open with GIMP" doesn't show up in those programs. Is it possible to manually edit the registry to remove it? 67.169.7.53 (talk) 18:45, 7 February 2010 (UTC)[reply]
If I were you I would use regedit to search the registry for "GIMP", or some part of the string displayed in the context menu. --Andreas Rejbrand (talk) 23:10, 7 February 2010 (UTC)[reply]
That worked, thanks! I backed up my registry and used find to search for GIMP keys and removed them. 67.169.7.53 (talk) 23:46, 7 February 2010 (UTC)[reply]