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. |
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? MMS 2013 00:49, 6 February 2010 (UTC)
What would the equivalent of the TI Basic command fpart() be in Python? MMS 2013 01:56, 6 February 2010 (UTC)
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).
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? Neon Merlin 05:17, 6 February 2010 (UTC)
What is Orkut Buykkokten's religion?? —Preceding unsigned comment added by 59.164.73.59 ( talk) 11:21, 6 February 2010 (UTC)
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)
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)
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)
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)
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)
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 ( talk • contribs) 14:50, 6 February 2010 (UTC)
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 (
talk •
contribs) 15:22, 6 February 2010 (UTC)
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 (
talk •
contribs) 16:00, 6 February 2010 (UTC)
thank u v much. i'll buy a splitter and test it... —Preceding unsigned comment added by JephyVarapuzha ( talk • contribs) 16:22, 6 February 2010 (UTC)
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)
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)
“ | The installer has insufficient privileges to access this directory: C:\Program files\QuickTime\QTSystem. The installation cannot continue. Log on as administrator, or contact your system administrator. | ” |
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)
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)
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)
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)
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)
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)
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)
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)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)
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)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)
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)
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)
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. |
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? MMS 2013 00:49, 6 February 2010 (UTC)
What would the equivalent of the TI Basic command fpart() be in Python? MMS 2013 01:56, 6 February 2010 (UTC)
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).
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? Neon Merlin 05:17, 6 February 2010 (UTC)
What is Orkut Buykkokten's religion?? —Preceding unsigned comment added by 59.164.73.59 ( talk) 11:21, 6 February 2010 (UTC)
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)
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)
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)
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)
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)
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 ( talk • contribs) 14:50, 6 February 2010 (UTC)
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 (
talk •
contribs) 15:22, 6 February 2010 (UTC)
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 (
talk •
contribs) 16:00, 6 February 2010 (UTC)
thank u v much. i'll buy a splitter and test it... —Preceding unsigned comment added by JephyVarapuzha ( talk • contribs) 16:22, 6 February 2010 (UTC)
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)
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)
“ | The installer has insufficient privileges to access this directory: C:\Program files\QuickTime\QTSystem. The installation cannot continue. Log on as administrator, or contact your system administrator. | ” |
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)
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)
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)
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)
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)
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)
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)
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)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)
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)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)
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)
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)