Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
6
Posts with Upvotes
6
Upvoting Members
4
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
~25.3K People Reached
Member Avatar for khakilang

I heard of Linux many years ago but did pay any attention to it. Only 2 years ago when I was a photographer for an event call MYGOSCON (Malaysian Government Open Source Conference) where I get to know about Open Source and Linux. From than on I was eager to …

Member Avatar for peaceman
0
253
Member Avatar for txwooley

I've been going through a couple of tutorials on SDL and having moderate success. But this one has me stumped. The tutorial from LazyFoo.com has me creating a dot that emits sparks. I followed along and wrote my code which returns my .bmp as NULL. Hmmm, I must have done …

Member Avatar for jaskij
0
906
Member Avatar for txwooley

In the book "How to Think Like A Computer Scientist" on the website openbookproject.net the tutorial leads you to draw a house with a pre-written script. It then instructs you to: # Wrap the house code in a function named draw_house(). # Run the script now. Do you see a …

Member Avatar for shasta90
0
584
Member Avatar for jintujacob

Hey friends lets checkout a small, simple and cute python program for taking photos with with your webcam without the help of any third party application programs. [CODE] import os import datetime import opencv.adaptors from opencv import highgui import Image def get_image(camera): im = highgui.cvQueryFrame(camera) # Add the line below …

Member Avatar for jintujacob
0
401
Member Avatar for buster2209

I"m trying to determine if the user is root or not then prompt to become root user; [CODE]if os.geteuid() != 0: # If not root user... os.system("gksudo crack.py") # Open root password window else: # Do Nothing if os.geteuid() == 0: # If you are root user... os.system("You are now …

Member Avatar for buster2209
0
3K
Member Avatar for TwistedVelocity

The program I was attempting to make was going to be 1.open notepad 2.fill 1 - 2 pages with text 3.save the file (named "1") 4.loop with a different saved name each time (IE named 1, then named 2, then 3, etc etc) I can open notepad, and loop that, …

Member Avatar for richieking
0
140
Member Avatar for fiberoptik147

I am VERY novice and working on a school project in C++. I'm not sure where I've gone wrong here in this code. Any advice on why this is not working would be appreciated. Please, pretend like you are talking to someone who knows very little about programming so far. …

Member Avatar for sergent
0
203
Member Avatar for schrope

I need help i am not sure if i am on the right track. i have to write a program to calculate the night of nights someone has to stay and what size bed they want. than i have to give a total of cost plus 6% sales tax. her …

Member Avatar for txwooley
0
307
Member Avatar for flyboy567

Hi, Ive written a program which is capable of sorting an array of ints e.g. array[6] = {4,6,-1,0,6,4} however i want to expand this so it will be able to order chars as well. With my code as it is, it will order chars correctly i.e. sort the numbers out …

Member Avatar for mike_2000_17
0
151
Member Avatar for vass1

Hello, I have just started to learn C++, and so I got my self a copy of "TEACH YOURSELF C++ IN 21 DAYS". 1/ Could someone pls say if this book is suitable for a new a newbie. 2/ And what about it's counterpart, " TEACH YOURSELF C++ IN 24 …

Member Avatar for txwooley
0
123
Member Avatar for GregPeters

Hi all I was wondering how to pass a multidimensional array to a function: Here is my code: [CODE] #include <cstdlib> #include <iostream> using namespace std; void PrintArray (int* array, int n); int main(){ int SIZE; cout << "Enter how many records: "; cin >> SIZE; int array[SIZE][2]; for (int …

Member Avatar for txwooley
0
226
Member Avatar for txwooley

I found an old post (2002) on another website where someone asked how to colorize text in Linux. The reply was: [CODE]printf ("\033[31ma\033[32mb\n");[/CODE] Where the format is "\033[XXm" followed by the text to be colored. I tried this on my Ubunutu machine and it works. It even works with "cout …

Member Avatar for txwooley
0
118
Member Avatar for txwooley

I am completely new to C++. I have a function that deals cards for a blackjack game. To do this, I need to call this function 10 times (two cards each for 4 players and a dealer). But it just deals the same card to everyone. I think it might …

Member Avatar for WaltP
0
150
Member Avatar for txwooley

I am trying to learn C++ through on-line tutorials and such. In almost all tutorials, the author tells you which headers to include for that particular exercise, but never tells you how he knows that. I understand that if you are advanced enough to be writing tutorials, you know off …

Member Avatar for mike_2000_17
0
116
Member Avatar for txwooley

My daughter plays FaceBook games and is always asking me to solve anagrams. So I thought I would make a script for her to enter a scrambled word and it would compare it to the built-in spell check dictionary. But this code returns words such as quip and quiz when …

Member Avatar for txwooley
0
364
Member Avatar for txwooley

My rand() isn't very random. As a matter of fact, it's not random at all! I am running Ubuntu 10.04 on both home comp and laptop. When I execute the code: [CODE]#include <iostream> #include <cstdlib> using namespace std; int main() { int x; x = rand(); cout << x; return …

Member Avatar for Fbody
0
95
Member Avatar for txwooley

I thought I could organize my movie files by writing a quick and dirty HTML script for them. I read a few tutorials on HTML (not CSS) and it seemed simple enough. So I made this: [CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" id="DocumentRoot"> <head> <title>Media</title> <meta …

Member Avatar for txwooley
0
127
Member Avatar for albertkao

I want to walk a directory and ignore all the files or directories which names begin in '.' (e.g. '.svn'). Then I will process all the files. My test program walknodot.py does not do the job yet. Please help. [CODE]#!c:/Python31/python.exe -u import os path = "C:\\test\\com.comp.hw.prod.proj.war\\bin" for dirpath, dirs, files …

Member Avatar for jice
0
3K
Member Avatar for bbman

Hey everyone, I need some help on some simple Python programming, below is my problem: Identify numbers or words in any .txt file that aren't listed in a provided .txt file and to output those numbers or words that aren't in the text file one per line, in alphabetical or …

Member Avatar for Ene Uran
-1
111
Member Avatar for txwooley

I have an old computer that doesn't have internet access. It does have Python 2.6 which supposedly has Tkinter. The problem is, it returns an error that Tkinter module is not installed. I searched the net, and saw that I may have to manually install tcl/tk. Done. I tried [CODE]import …

Member Avatar for woooee
0
155
Member Avatar for Cyproz

Ok so i need to make a program that you put in an email address and it checks for the @ symbol and then makes sure its not the first digit or the last digit. Now i know that there is " like s.islower( for lowercase) and s.isupper but i …

Member Avatar for vegaseat
0
115
Member Avatar for Fridericus

Hello everyone, I have a problem with TkMessageBox on Windows: My program receives a message from a server and then it should show a MessageBox, but instead of doing so, the program freezes. Elsewhere in the program, a MessageBox is called after the user having pressed a button, and this …

Member Avatar for Fridericus
0
373
Member Avatar for persianprez

When running my code, I get a "substring not found" not entirely sure what that means..here is my code:\ [CODE]filename = open('code.txt','r').read() string = filename def decode(string): abc='ABCDEFGHIJKLMNOPQRSTUVWXYZ' n=1 result='' for rotate in string: result+=abc[(abc.index(rotate)-n)%26] n+=1 print result def main(): decode(string) main() [/CODE]

Member Avatar for persianprez
0
122
Member Avatar for soUPERMan

Hello, im trying to use a function inside another function and getting an error: The function: [CODE]# Function that recieves number of characters and calculate cost of advertising def costAd(numChar): if numChar >= 15: cost = 35.00 else: cost = 35.00 + ((numChar - 15) * 3.55) return cost costAd()[/CODE] …

Member Avatar for soUPERMan
0
175
Member Avatar for txwooley

I am trying to put a terminal into my tk gui program as a widget. I figured out how to have the output of a command sent to a text widget: [CODE] root = Tkinter.Tk() tfield = Tkinter.Text(root) tfield.pack() for line in os.popen("run_command", 'r'): tfield.insert("end", line) root.mainloop() [/CODE] But how …

Member Avatar for txwooley
0
11K
Member Avatar for txwooley

So I have figured out how to receive output from an application using [CODE]process = subprocess.Popen("my_app", shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE) info = process.communicate() [/CODE] But how do I SEND info TO an app? I have an application that asks for a yes(y) or no(n) confirmation …

Member Avatar for txwooley
0
81
Member Avatar for txwooley

How would I execute a command and have it's output returned as a list or string? For example (in Linux): [CODE]os.system("iwconfig")[/CODE] prints a list of wireless devices to stdout. How can I make Python see those results as a list or string so I can search for certain devices (like …

Member Avatar for txwooley
0
103
Member Avatar for kfancy

We're making blackjack and when we ask hit or stay, how do we make sure that the player gives us a valid response by typing either 'hit' or 'stay'? Thanks!

Member Avatar for jcao219
-1
98
Member Avatar for sniperx99

Hello all, I am completely new to python, but unfortunately a professor I am working for needs some code done in it. Basically, I need to look through a file for the word "DATA" and then perform some manipulations (simple algebra) do a long list of numbers (3900 to be …

Member Avatar for sniperx99
0
81
Member Avatar for txwooley

I wrote a script (kind of a learning thing) to open .rar archived files using unrar (non-free) in Linux. Now I want to add a section where my script will check to see if unrar is installed. To complicate matters, Linux also has a package 'unrar-free', and both use the …

Member Avatar for txwooley
0
121