182 Solved Topics
Remove Filter 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 … | |
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 … | |
#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++) { … | |
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; | |
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 … | |
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 … | |
I've just upgraded from Ubuntu 9.10 to 10.04 and now firefox will not play videos on youtube. Please help, thanks. | |
[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, … | |
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 … | |
[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() … | |
[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)) … | |
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") … | |
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() … | |
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 … ![]() | |
[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 … | |
[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: " … | |
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(), … | |
[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: " … | |
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 … | |
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 … ![]() | |
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 … | |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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 … | |
How do you know when to use a function by wraping the content between parentheses "function(x) or through dot notation x.function() ? thanks. ![]() | |
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 … | |
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 … | |
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 … | |
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] … |
The End.