419 Archived Topics

Remove Filter
Member Avatar for lewashby

I'M trying to install Ubuntu Server but I'M getting the following error. Bare in mind that I download the iso a second time believing the file was simple corrupted while downloading but got the same error again anyway. ///cdrom/pool/main/e/e2fsprogs_1.42-1ubuntu2_amd64.deb was corrupt. Download the iso two and got this error twice …

Member Avatar for mike_2000_17
0
185
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 <stdlib.h> #include <time.h> #include <math.h> using namespace std; int rand_0toN1(int n); int hits[10]; int main() { int n; int i; int r; srand( static_cast<unsigned int>(time(NULL))); // set seed for random numbers cout<< "Enter number of trials to run "; cout<< "and press ENTER: "; cin>> …

Member Avatar for WaltP
0
77
Member Avatar for lewashby

#include <Stdafx.h> #include <iostream> #include <stdlib.h> #include <time.h> #include <math.h> using namespace std; int rand_0toN1(int n); int hits[10]; int main() { int n; int i; int r; srand(time(NULL)); // set seed for random numbers cout<< "Enter number of trials to run "; cout<< "and press ENTER: "; cin>> n; // …

Member Avatar for Sky Diploma
0
238
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 working my way through the book "C++ without fear by Brian Overland" and there are two small programs with to totally different types of type casting and the book fails to explain the difference, please help me understand. Thanks. The first one is on a while loop and the …

Member Avatar for adityatandon
0
149
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

I recently purchased the book Networking for Dummies 9th Ed by Doug Lowe and now I've come to the chapter on setting up a server. The chapter specifically talks about setting up and installing Windows Server 2008. I don't really know much about servers I've never fooled around with one …

Member Avatar for LastMitch
0
139
Member Avatar for lewashby

I'M trying to learn to program and I'M also new to the Linux OS. I've just started with Ubuntu. Anyway, I was reading a long list of post from Linux users posting on Mono. I'M trying to figure out where all the negative feedback concerning Mono is coming from. Why …

Member Avatar for aabhilash.mmcet
0
268
Member Avatar for lewashby

I have my laptop split between Windows Vista and Ubuntu Linux. I recently upgraded Ubuntu and it somehow fraked up my Windows and now it will not load. I need to fix Windows so I can get back to my iTunes but I don't want to do anything that will …

Member Avatar for birellar
0
97
Member Avatar for lewashby

I'M taking a Linux/Unix admin course from the Oreilly online school. But I'M having a hard time understanding tcp/ip section, it's really making my head spin. Here is some of the lesson, could someone please help clear this up for me? thanks. Network, Broadcast, and Subnets Let's give ourselves a …

Member Avatar for lewashby
0
407
Member Avatar for lewashby

I was told that there are four python string delimiters but I can only think of three, ', ", & """. What is that last one? I searched google but with no luck.

Member Avatar for richieking
0
171
Member Avatar for lewashby

movies = [ "The Holy Grail", 1975, "Terry Jones & Terry Gilliam", 91, [INDENT]["Graham Chapman",[/INDENT] [INDENT][INDENT]["Michael Palin", "John Cleese", "Terry Gilliam", "Eric Idle", "Terry Jones"]]][/INDENT][/INDENT] print(movies[4][1][3] = Eric Idle Could Someone please explain how it counts from the outer loops through the inner loops With the number 4, 1, & …

Member Avatar for richieking
0
83
Member Avatar for lewashby

In the following two functions, why is it that the first one can see the outside variable but the second one can not? [CODE]name = 'Jack' def say_hello(): print ('Hello ' + name + '!') def change_name(new_name): name = new_name[/CODE]

Member Avatar for TrustyTony
0
124
Member Avatar for lewashby

In the following program I'M getting an error with the blit function. The error is invalid destination position. background_image_filename = 'sushiplate.jpg' sprite_image_filename = 'fugu.png' [CODE] import pygame from pygame.locals import * from sys import exit from gameobjects import Vectory2 pygame.init() screen = pygame.display.set_mode((640, 480), 0, 32) background = pygame.image.load(sprite_image_filename).convert_alpha() sprite …

0
300
Member Avatar for lewashby

I'M getting an error in the following program on line 38 to a function call. The function is in the gameobjects module and the there's an error there as well on line 21. Here's the code. Code:[CODE] background_image_filename = 'sushiplate.jpg' sprite_image_filename = 'fugu.png' import pygame from pygame.locals import * from …

Member Avatar for Gribouillis
0
192
Member Avatar for lewashby

[CODE]import pygame from pygame.locals import * from sys import exit pygame.init() screen = pygame.display.set_mode((640, 480), 0, 32) font = pygame.font.SysFont('arial', 32) font_height = font.get_linesize() while True: for event in pygame.event.get(): if event.type == QUIT: exit() screen.fill((255, 255, 255)) pressed_key_text = [] pressed_keys = pygame.key.get_pressed() y = font_height for key_constant, pressed …

Member Avatar for woooee
0
6K
Member Avatar for lewashby

Minimal Server [CODE]import socket s = socket.socket() host = socket.gethostname() port = 1234 s.bind((host, port)) s.listen(5) while True: c, addr = s.accept() print 'Got connection from', addr c.send('Thank you for connecting') c.close()[/CODE] Minimal Client [CODE]import socket s = socket.socket() host = socket.gethostname() port = 1234 s.connect((hos[/CODE]t, port)) print s.recv(1024) These …

Member Avatar for Gribouillis
0
125
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 recently upgraded my Ubuntu from 9.10 to 10.04 and now it's messed up my Windows Vista partition. When I try to load Windows it boots to a strange login menu with low resolution. It then takes me to a screen with options like Repair/Fix, Recovery, Complete Recovery... I'll click …

Member Avatar for helioptra
0
190
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

[CODE]+--------------+------+------------------------------------+-------+ | ProductCode | Qty | Title | Price | +--------------+------+------------------------------------+-------+ | relationaldb | NULL | The Relational Database Dictionary | 14.99 | | artofsql | 50 | The Art of SQL | 44.99 | | databaseid | 0 | Database in Depth | 29.95 | | mysqlspp | 5 …

Member Avatar for xandro
0
102
Member Avatar for lewashby

Program 1 [CODE]import math class Vectory2(object): def __init__(self, x = 0.0, y = 0.0): self.x = x self.y = y def __str__(self): return "(%s, %s)" % (self.x, self.y) @classmethod def from_points(cls, P1, P2): return cls( P2[0] - P1[0], P2[1] - P1[1] ) def get_magnitude(self): return math.sqrt(self.x**2 + self.y**2) def normalize(self): …

Member Avatar for snippsat
0
97
Member Avatar for lewashby

[CODE]import math class Vector2(object): def __init__(self, x = 0.0, y = 0.0): self.x = x self.y = y def __str__(self): return "(%s, %s)" % (self.x, self.y) @classmethod def from_points(P1, P2): return Vector2(P2[0] - P1[0], P2[1] - P1[1]) def get_magnitude(self): return math.sqrt(self.x**2 + self.y**2) def normalize(self): magnitude = self.get_magnitude() self.x /= …

Member Avatar for lewashby
0
114
Member Avatar for lewashby

I'M reading the book "Beginning Game Development with Python and Pygame". The book showed me how to calculate the distance between two points using vectors. It first explained that you just subtract the values in the first point from the second. But just page or two pages later it says …

Member Avatar for Beat_Slayer
0
89
Member Avatar for lewashby

[CODE]class Vector2(object): def __init__(self, x= 0.0, y = 0.0): self.x = x self.y = y def __str__(self): return "(%s, %s)" % (self.x, self.y) @classmethod def from_points(cls, P1, P2): return cls( P2[0] - P1[0], P2[1] - P1[1] ) A = (10.0, 20.0) B = (30.0, 35.0) AB = Vector2.from_points(A, B) print …

Member Avatar for Beat_Slayer
0
110
Member Avatar for lewashby

[CODE]background_image_filename = 'sushiplate.jpg' sprice_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(sprice_image_filename) # our clock object clock = pygame.time.Clock() x1 = 0. x2 = 0. # speed in pixels per second speed = …

Member Avatar for Beat_Slayer
0
211
Member Avatar for lewashby

[CODE]class FooBar: def __init__(self, value = 42): self.somevar = value[/CODE] f = FooBar('This is a constructor argument') f.somevar This is a constructor argument How can the parameter value know what kind of data it's going to be given? Int, float, string, etc? thanks.

Member Avatar for vegaseat
0
124
Member Avatar for lewashby

I just got postgresql & pgAdmin III up and running. I'M trying to start the book "Simply SQL" so how do I go about getting to .sql files for the book into pgAdmin? Thanks for any and all replies.

Member Avatar for lewashby
0
162
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

I just got a new book on sql. So what software do I need to get started to and play around with these statements and load the querys supplied by the book. Thanks. By the way I'M running Ubuntu Linux

Member Avatar for teedoff
0
100
Member Avatar for lewashby

To help increase sales, your management decides to give customers a one-time bonus. Here are the credit rules: for 1-15 credits, add 1 credit for 16-30 credits, add 2 credits for 31+ credits, add 10% and round up (10% of 35 is 3.5, rounded up to 4) Write an update …

Member Avatar for d5e5
0
104
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 * pygame.init() screen = pygame.display.set_mode((640, 480), 0, 32) while True: for event in pygame.event.get(): if event.type == QUIT: exit() random_color = (randint(0, 255), randint(0, 255), randint(0, 255)) random_pos = (randint(0, 639), randint(0, 479)) random_radius = randint(1,200) pygame.draw.circle(screen, …

Member Avatar for lewashby
0
1K
Member Avatar for lewashby

[CODE]import pygame from pygame.locals import * from sys import exit from random import * pygame.init() screen = pygame.display.set_mode((640, 480), 0, 32) while True: for event in pygame.event.get(): if event.type == QUIT: exit() screen.lock() for count in range(10): random_color = (randint(0, 255), randint(0, 255), randint(0, 255)) random_pos = (randint(0, 639), randint(0, …

Member Avatar for TrustyTony
-1
310
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

I'M learning python and I can write very small simple programs with Tkinter or play sound through pygame. I've just started the book "Beginning Game Development with Python and Pygame". I'M in the earlier part of the book and I've just been given the program below. The thing is, even …

Member Avatar for TrustyTony
0
223
Member Avatar for lewashby

Could someone please tell me why this code will not close my app when the [X] at top right corner is clicked? [CODE]def shutdown(): track.stop() app.destroy() app.protocol("WM_DELETE_WINDOW", shutdown)[/CODE] If you want to see the whole code it's on an earlier post called "Tkinter Scale". Thanks.

Member Avatar for vegaseat
0
2K
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

[CODE]from Tkinter import * import tkMessageBox import pygame.mixer # create GUI window app = Tk() app.title("Head Frist Mix") sound_file = "50459_M_RED_Nephlimizer.wav" # start the sounds system mixer = pygame.mixer mixer.init() # create function def track_toggle(): if track_playing.get() == 1: track.play(loops = -1) else: track.stop() # create function volume def change_volume(v): …

Member Avatar for vegaseat
0
276
Member Avatar for lewashby

[CODE]# create GUI app = Tk() app.title("Head-Ex Deliveries") # create a label Label(app, text = "Depot:").pack() # add to Tk app window # create a text entry depot = Entry(app) depot.pack()[/CODE] I understand and have been told that placing the instance name(app) as a parameter of Tk methods and other …

Member Avatar for TrustyTony
0
278
Member Avatar for lewashby

I'M getting error below when I run the following program code. It's with the following function. [COLOR="Red"]fileD.write("%\n" % depot.get())[/COLOR] [COLOR="Red"]Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__ return self.func(*args) File "/home/developer/Projects/Head First/Chapter 7/Head-Ex.py", line 7, in save_data fileD.write("%\n" % depot.get()) ValueError: unsupported format …

Member Avatar for TrustyTony
0
176
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]from Tkinter import * import pygame.mixer sounds = pygame.mixer sounds.init() correct_s = sounds.Sound("Correct.wav") wrong_s = sounds.Sound("Wrong.wav") number_correct = 0 number_wrong = 0 def play_correct_sound(): global number_correct number_correct = number_correct + 1 correct_s.play() def play_wrong_sound(): global number_wrong number_wrong = number_wrong + 1 wrong_s.play() app = Tk() # creat a tkinter application …

Member Avatar for SgtMe
0
354
Member Avatar for lewashby

I'M a single parent, 24, and I have a full time job in a factory. That's pretty much killed any change for me to go back to school. I love the computer field and I've been playing around with C# and Python for a little bit and I'M also a …

Member Avatar for libbylab
0
213
Member Avatar for lewashby

I've been trying to find pygame that will work with python 3 on my Ubuntu machine far a while with no luck. I can find a version that will work with Ubuntu but now for python 3, or I can find one that will work with python 3 but not …

Member Avatar for Kruptein
0
125

The End.