182 Solved Topics

Remove Filter
Member Avatar for lewashby

I'M reading a linux book and I've come to a chapter on setting up a DHCP server. The thing is I don't understand why I would ever need to set one up. All the computers in our house are already using DHCP and I've never set up a server, why …

Member Avatar for lewashby
0
191
Member Avatar for lewashby

I'M trying to move an 11 gig .tar.gz file that is pretty much one of my home usernames from my ubuntu laptop to my fedora desktop, here's what I'M getting. developer@garrett-laptop:~$ scp developer@192.168.1.9:/home/develope/fromlaptopsaveDeveloper.tar.gz garrett@192.168.1.5:/home/developer/Desktop developer@192.168.1.9's password: Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). lost …

Member Avatar for mike_2000_17
0
279
Member Avatar for lewashby

#include <Stdafx.h> #include <iostream> #include <math.h> #include <stdlib.h> #include <time.h> using namespace std; int rand_0toN1(int n); int main() { int n, i; int r; srand(time(NULL)); // set a seed for random-number generation. cout<< "Enter number of dice to roll: "; cin>> n; for(i = 1; i <= n; i++) { …

Member Avatar for ravenous
0
153
Member Avatar for lewashby

I'M trying to compile a very small cout<< console application in MSC C++ but the program flashes up and goes away so quick that I can't see anything that's going on. Below are my headings, what's missing? Thanks. #include <Stdafx.h> #include <iostream> using namespace std;

Member Avatar for Nick Evan
0
248
Member Avatar for lewashby

I just downloaded netbeans and when I went to start a C++ project I was told that Netbeans couldn't find a C++ compiler. When I use to play around witt MS Visual C++ I never ran into a problem like this, Can anyone tell me what's up and what I …

Member Avatar for lewashby
0
153
Member Avatar for lewashby

My dad got a new Dell lap-top with Windows Vista less than a year ago. Yesterday all the sudden it's wireless network adapters quit working. I went to investigation and found that it wasn't finding any networks, further investigation found that it was turned off. Now on this computer there …

Member Avatar for rickw57
0
164
Member Avatar for lewashby

I've just upgraded from Ubuntu 9.10 to 10.04 and now firefox will not play videos on youtube. Please help, thanks.

Member Avatar for Stefano Mtangoo
0
65
Member Avatar for lewashby

[CODE]import wx # create window app = wx.App() win = wx.Frame(None, title = "Simple Editor", size = (410, 335)) win.Show() # create buttons loadButton = wx.Button(win, label = 'Open', pos = (225, 5), size = (80, 25)) saveButton = wx.Button(win, label = 'Save', pos = (315, 5), size = (80, …

Member Avatar for vegaseat
0
113
Member Avatar for lewashby

I'M new to SQL and I'M reading the book "Simply SQL". I'M running Ubuntu Linux and I downloaded MySQL Workbench. I also downloaded the source .sql files for the book. I need some help getting started. How do I get the files into Workbench so I can follow along with …

Member Avatar for tesuji
0
306
Member Avatar for lewashby

[CODE]background_image_filename = "sushiplate.jpg" sprite_image_filename = 'fugu.png' import pygame from pygame.locals import * from sys import exit pygame.init() screen = pygame.display.set_mode((640, 480), 0, 32) background = pygame.image.load(background_image_filename).convert() sprite = pygame.image.load(sprite_image_filename) # The x coordinate of our sprite x = 0. while True: for event in pygame.event.get(): if event.type == QUIT: exit() …

Member Avatar for lewashby
0
837
Member Avatar for lewashby

[CODE]import pygame from pygame.locals import * from sys import exit from random import randint pygame.init() screen = pygame.display.set_mode((640, 480), 0, 32) while True: for event in pygame.event.get(): if event.type == QUIT: exit() rand_col = (randint(0, 255), randint(0, 255), randint(0, 255)) for _ in xrange(100): rand_pos = (randint(0, 630), randint(0, 479)) …

Member Avatar for vegaseat
0
260
Member Avatar for lewashby

file = hfmix2.py error is on line 3 [CODE]# imports from Tkinter import * from sound_panel2 import * import pygame.mixer # create gui app = Tk() app.title("Head First Mix") # create mixder mixer = pygame.mixer mixer.init() # call functions panel1 = SoundPanel(app, mixer, "50459_M_RED_Nephlimizer.wav") panel1.pack() panel1 = SoundPanel(app, mixer, "49119_M_RED_HardBouncer.wav") …

Member Avatar for vegaseat
0
190
Member Avatar for lewashby

In the following program I don't understand why 'mixer' is given as an argument to the function 'create_gui'. Please explain. File 1 [CODE]# imports from Tkinter import * from sound_panel import * import pygame.mixer # create gui app = Tk() app.title("Head First Mix") # create mixder mixer = pygame.mixer mixer.init() …

Member Avatar for vegaseat
0
134
Member Avatar for lewashby

I am reading the book "Python Programming 2nd Ed. for the absolute beginner" and I am having some trouble with a very simple program. I was instructed to download and install pygame and the livewires package as I have done. This program is meant to display a grahical window, that's …

Member Avatar for albo1125
0
293
Member Avatar for lewashby

[CODE]import sqlite3 def find_details(id2find): db = sqlite3.connect("surfersDB.sdb") # grap surfer data from database db.row_factory = sqlite3.Row cursor = db.cursor() cursor.execute("select * from surfers") rows = cursor.fetchall()[/CODE] In the code snippet above from "Head First Programming", the syntax for the database code is poorly explained. Is row_factory a call, method, or …

Member Avatar for lewashby
0
138
Member Avatar for lewashby

[CODE]def find_details(id2find): surfers_f = open("surfing_data.csv") for eash_line in surfers_f: s = {} (s["id"], s["country"], s["average"], s["board"], s["age"]) = eash_line.split(";") if id2find == int(s["id"]): surfers_f.close() return(s) return({}) lookup_id = int(input("Enter the id of the surfer: ")) surfer = find_details(lookup_id) if surfer: print("ID: " + surfer["id"]) print("Name: " + surfer["name"]) print("Country: " …

Member Avatar for TrustyTony
1
250
Member Avatar for lewashby

In the following program I have a few questions. [B]results.txt[/B] Johnny 8.65 Juan 9.12 Joseph 8.45 Stacey 7.81 Aideen 8.05 Zack 7.21 Aaron 8.31 [CODE]scores = {} result_f = open("results.txt") for line in result_f: (name, score) = line.split() scores[score] = name result_f.close() print("The toop scores were:") for each_score in sorted(scores.keys(), …

Member Avatar for vegaseat
0
98
Member Avatar for lewashby

[CODE]line = "101;johnny 'wave-boy' Jones;USA;8.32;Fish;21" s = {} (s['id'], s['name'], s['country'], s['average'], s['board'], s['age']) = line.split(";") # above, why is "s" and the end of the key list surrounded by parenthesis? print("ID: " + s['id']) print("Name: " + s['name']) print("Country " + s['country']) print("Average " + s['average']) print("Board type: " …

Member Avatar for snippsat
0
159
Member Avatar for lewashby

I recently uninstalled python 2.6 from my Ubuntu, unbeknown to me at the time, the gnome desktop is reliant on python 2.6. Ubuntu then crashed and now will only load up in Kubuntu KDE. Kubuntu will not let me switch back to Ubuntu gnome, it's not an option. So from …

Member Avatar for JasonHippy
0
132
Member Avatar for lewashby

In the following code, could someone please explain these if statements? elif 5 <= unhappiness <= 10:, & elif 11 <= unhappiness <15:, they have two arguments, one on each side which is something I haven't seen before. Also, what the one to the far right for anyway? Also, this …

Member Avatar for masterofpuppets
0
154
Member Avatar for lewashby

I have to prgrams and thus, two question to ask. In the following program how does the line [COLOR="Red"]status = staticmethod(status)[/COLOR] do anything? My python programming book somehow connects it to the line [COLOR="Red"]Critter.total +=[/COLOR] 1 but I don't see how? Please explain. [CODE]# Classy Critter # Demonstrates class attributes …

Member Avatar for vegaseat
0
194
Member Avatar for lewashby

In the following program, I'M getting the following error message when I try to run it. [COLOR="Red"]TypeError: object.__new__() takes no parameters[/COLOR] [CODE] # Classy Critter # Demonstrates class attributes and static methods class Critter(object): """A virtual pet""" total = 0 def status(): print "\nThe total number of critters is", Critter.total …

Member Avatar for pythopian
0
551
Member Avatar for lewashby

In the following program, at what point does my program call the _str__ method/constructor? I don't see it specifically being called at any point. I know it happens with this line print [CODE]"Printing crit1:" print crit1[/CODE] but I still don't see how or when this happens. Thanks for any and …

Member Avatar for mn_kthompson
0
203
Member Avatar for lewashby

I'M reading the book "Python Programing second edition for the absolute beginner". While explaining the object paramater whithin a class, this how it reads. Base your class on [I]object[/I] , a fundamental, built-in type. Can someone please tell me what that means? Thanks.

Member Avatar for mn_kthompson
0
131
Member Avatar for lewashby

Does anyone know where I can find a goo pdf python reference for the following? pre built constructors, functions/methods for the follwoing tuples, lists, dicts...etc I hate reading a book with nothing but quick explanation, I want to see them for myself. And I already know how to find them …

Member Avatar for python user
0
187
Member Avatar for lewashby

These three things are holding me back. 1. The new style class object parameter - [CODE]class MyClass(object)[/CODE] [INDENT]Note that I'M also also not familir with the old style[/INDENT] 2. The [CODE]_init_([/CODE] - constructor, or any constructs for that matter. 3. The [CODE](self)[/CODE] parameter. How is it different from the normal …

Member Avatar for vegaseat
0
89
Member Avatar for lewashby

First of all, I'M reading the book "Microsoft XNA Game Studio 2.0". I understand the error I'M getting but I don't know what to do about it. The error says I can't use backgroundColor before it has been declared. I'M following along with the book so I don't see why …

Member Avatar for jbennet
0
140
Member Avatar for lewashby

How do you know when to use a function by wraping the content between parentheses "function(x) or through dot notation x.function() ? thanks.

Member Avatar for masterofpuppets
0
161
Member Avatar for lewashby

I the following program, can someone please explain these two lines. "def __init__(self, master):, & Frame.__init__(self, master)" One other thing. Shouldn't the method "update_count" use a return to return the new count? thanks. [CODE]# Click Counter # Demonstrates binding an event with an event handler from Tkinter import * class …

Member Avatar for vegaseat
0
199
Member Avatar for lewashby

I more than half way through the book "Python programming for the absolute beginner" 2nd Ed. and things are really starting to get hairy. The book has me to write some code just before or after explaining each part. But I have to really concentrate on the paragraph I'M reading …

Member Avatar for vegaseat
0
120
Member Avatar for lewashby

I'M reading a book on Python and my very first object/constructor program isn't show the output that the book is showing. I lacks the two lines "A new critter has been born!" [CODE]# Constructor Critter # Demonstrates constructors class Critter(object): """A virtual pet""" def _init_(self): print "A new critter has …

Member Avatar for lllllIllIlllI
0
121
Member Avatar for lewashby

In the program be below, I'M having trouble with these few lines, remember, I'M new. What's going on here? I'M just a little confused because there is (word) wraped in len(). [CODE]position = random.randrange(len(word))[/CODE] And what's going on with these two lines? Thanks. [CODE] jumble += word[position] word = word[:position] …

Member Avatar for snippsat
-1
169

The End.