419 Archived Topics
Remove Filter 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 … | |
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 <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>> … | |
#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; // … | |
#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 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 … | |
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 … | |
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 … ![]() | |
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 … | |
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 … | |
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 … | |
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. | |
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, & … | |
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] | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 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 … | |
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, … | |
[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 … | |
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): … | |
[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 /= … | |
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 … | |
[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 … | |
[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 = … | |
[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. | |
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. | |
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 … | |
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 | |
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 … | |
[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 * 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, … | |
[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, … | |
[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)) … | |
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 … | |
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. | |
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() … | |
[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): … | |
[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 … | |
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 … | |
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]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 … | |
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 … | |
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 … |
The End.