504 Discussion / Question Topics
Remove Filter 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'M working my way through a python book and I've just come to a section on python web programming. Here's what it's had me to do. Create a folder called "public_html" in my home directory "developer", note that this is in linux system. Inside that folder create a file called … | |
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, & … | |
Can someone please help me understand Networks, Broadcast, and Subnets? I'M taking a course at oreillyschools and I'M having a terrible time understanding the lesson. Thanks. | |
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] | |
I see that Rhythembox has been updated along with the new Ubuntu 10.x. Does anyone know if there are any plans to make Rhythembox writable to an iPod? I know about song bird but it doesn't work with my Ubuntu and I hard they were going to stop Linux support … | |
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]background_image_filename = 'sushiplate.jpg' sprite_image_filename = 'fugu.png' # imports 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(background_image_filename).convert() sprite = pygame.image.load(sprite_image_filename).convert_alpha() clock = pygame.time.Clock() position = Vectory2(100.0, 100.0) speed = 250. heading = Vectory2 while True: … | |
I have another post entitled 'understanding wxPython' in which my code runs but fails to build the scroll bars as shown by my python programming book. Note that the code in the book is running on Windows and mine is running on Ubuntu. | |
I figured out how to play all my iTunes music on my Windows partition through rhythembox but each time I have to pretend I'M going to reset my music directory. When I click on the computer hard drive a password prompt comes up. After tying my password all my songs … | |
[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 = … | |
I'M reading the book "Simply SQL" and I need to use the files for the book. It was suggested to be to use postgreSQL and now I've got it up and running on my Ubuntu machine. But I'M having a little bit of trouble getting started. When I first start … | |
[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 … | |
According to the book I'M reading clock = pygame.time.Clock() creates a new clock object. But when I took a look at the time module, I didn't find a class by the name of Clock so I could I have an object? All I found was a function and it was … | |
[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() … | |
In the following program can someone help me figure out why the close button [X] at the top right corner isn't working? [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 … | |
[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") … | |
I'M currently tacking Database Administration at [url]http://www.oreillyschool.com/certificates/[/url] I want to get into the IT community and out of this factory work. Could some more experienced people please take a look at that site and tell me if my certificate or any of them are worth taking, both in terms of … | |
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 options menu options = read_depots("depots.txt") OptionMenu(app, depot, *options).pack()[/CODE] In the above code I'M getting the error that __inti__ takes 4 arguments and that it's only given 3. I'M writing the code just how the book gives it to me. | |
[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 … |
The End.