collapse collapse

* Who's Online

  • Dot Guests: 82
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Board Stats

  • stats Total Members: 88
  • stats Total Posts: 11163
  • stats Total Topics: 1699
  • stats Total Categories: 4
  • stats Total Boards: 76
  • stats Most Online: 248

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - isaro

Pages: [1] 2
Alright, for one of my studies I am beginning to work with databases (We have no prior knowledge to programming with them, it is a learn as you go.) At my disposal I have web space and a multitude of programs to program SQL and transfer the files between the server and my computer.

Following are the database schemas, and the database instance with the existing tuples. All the primary keys are underlined. Other candidate keys (CK), and foreign keys (FK) are specified. Any attribute that is nullable is specified otherwise the attribute can not be null (not null).

RecCenterMember (id, f_name, l_name, dob, family_id)
FK: family_id references id in Family_Package
Family_id nullable

Class (id, title, type, instructor, season, year)
Attribute season may be “Spring” or “Summer” or “Fall” or “Winter”
FK: type references type in Type
FK: instructor references id in Instructor

Instructor (id, f_name, l_name, member_id)
FK: member_id references id in RecCenterMember
Member_id nullable

Type (type, description)

FamilyPackage (id, address, phone)
CK: phone

Enrollment (class_id, member_id, cost)
FK: class_id references id in Class
FK: member_id references id in RecCenterMember


a) Create all the tables with the specified attribute names, as listed above, with appropriate constraints such as primary keys, foreign keys, unique attributes, value check, and defining nullability. Put all the DDL statements in a file create.sql and create the tables and constraints running the batch of SQL statements from this file. You may also put in any comments you have on the creation of your tables.
b) Insert the data into the tables, using a batch of insert statements from insert.sql.
2. What is the phone number of the O’Shea’s family?
3. Give the name of the instructors who taught in both the Spring and Fall of 2009 and the description of the classes that they taught in the two semesters.
4. Give the name of the instructor who has taught the most total classes since data have been kept.
5. Give the average ages of the recreation center members who are younger than 50 years old and those who are older than 50 years old.
6. Give the distinct types of classes that were offered in 2008 and 2009 along with their descriptions.

What I have accomplished in my 'create.sql' file:

Code: [Select]
Create table RecCenterMember(id int identity(1,1) primary key,f_name varchar(50),l_name varchar(50), dob varchar(50),family_id int)
Edit 1:
Code: [Select]
Create table RecCenterMember(id int,f_name varchar(50),l_name varchar(50), dob varchar(50),family_id int, primary key(id))

Edit 2 Some progress has been made, still unsure if it is entirely right.
Code: [Select]
Create table RecCenterMember(id int, f_name varchar(50),l_name varchar(50),dob varchar(50),family_id int,primary key(id),foreign key(family_id) references FamilyPackadge
Create table Class(id int, title varchar(50),type varchar(50),instructor varchar(50),season varchar(50),year int,primary key(id),foreign key(type) references Type,foreign key(id) references instructor)
Create table instructor(id int, f_name varchar(50),l_name varchar(50),member_id int,primary key(id),foreign key(member_id) references RecCenterMember)
Create table Type(type varchar(50), description varchar(100),primary key(type))
Create table FamilyPackadge(id int, address varchar(50),phone varchar(50),primary key(id),unique(phone))
Create table Enrollment(class_id int, member_id int, cost numeric(12,2),primary key(class_id),foreign key(class_id) references Class,foreign key(member_id) references RecCenterMember)

Edit 4: Much progress has been made (still doing this solo)
Code: [Select]
Create table FamilyPackage(
id int,
address varchar(50),
phone varchar(20),
primary key(id),
Create table RecCenterMember(
 id int,
 f_name varchar(20),
 l_name varchar(20),
 dob date,
 family_id int,
 primary key(id),
 foreign key(family_id) references FamilyPackage)
Create table Instructor(
 id int,
 f_name varchar(20),
 l_name varchar(20),
 member_id int,
 primary key(id),
 foreign key(member_id) references RecCenterMember)
Create table Type(
 type varchar(20),
 description varchar(40),
 primary key(type))
Create table Class(
id int,
title varchar(20),
type varchar(20),
instructor varchar(20),
season varchar(20) constraint chk_season CHECK(season IN('Spring',
year int,primary key(id),
foreign key(type) references Type,
foreign key(id) references Instructor)
Create table Enrollment(
 class_id int,
 member_id int,
 cost numeric(12,2),
 primary key(class_id,member_id),
 foreign key(class_id) references Class,
 foreign key(member_id) references RecCenterMember)

I am currently putting random data into the tables.

Do I know if I am doing it right? no, but I understand that this created a table and I can store into it with Insert. I am in need of some help in understanding a way to tackle this (I assume if you know SQL this is a rather simple task as i don't see anything too complex being asked, could be wrong though.)

General Talk / Here is a deal :P
« on: November 21, 2010, 12:48:14 pm »

So yeah, Microsoft is deciding to sell age of empires III for 10 cents.

Javascript / Javascript help.
« on: August 18, 2010, 10:41:51 pm »
Working on a script to run through grease monkey, and I was wondering if anyone knew how to make it as if a mouse was clicking at pre-determined locations.

I put in a coordinate location in the script in a loop, and it will click that location every time it goes through the loop.

Humor / Few days ago
« on: June 09, 2010, 12:27:16 pm »
Alright, I have a little story while I was at my friends house a few days ago ( Computer Related )

So we were on his two computers playing G mod LAN, and I can hear weird noises from his computer (sounded like popcorn)

It gets louder, and then the computer shuts off.

I ask him "I think it over heated, how  long has it been on?"

Him: "9 days or so"

Me: "-.-"

So we open it up, and sure enough, the GPU is melted basically ( the fan looked like a melted candle ) and most of the capacitors are charred and shot liquid everywhere.

To those who don't have great cooling, turn your computer off at night...

Upside to the story?

I built him a new computer ^.^

Software support / Computer sleep.
« on: March 08, 2010, 03:56:58 pm »
Alright, so there I have been trying for awhile now to run some small programs to keep going while my computer is in sleep mode, the programs are required to connect to the internet and I want to be able to leave them on while my computer is asleep.

My problem is my computer disconnects the internet whenever I go into sleep mode.

I'm wondering if there is any software or fixes I might have not tried to allow me to do so.

My network adapter is a linksys USB connection.

General Talk / Pokemon Online
« on: February 14, 2010, 07:45:49 am »'s extremely well made, and still in Beta, check this out >.>

General Talk / Took apart one of my comps today to clean.
« on: February 13, 2010, 11:56:36 am »
Took apart one of my computers.
I posted the inside on the EVGA forums as they like viewing that stuff.

here's a link to the images

And yes, I built this one.

General Talk / Dragon Age Toolset
« on: January 18, 2010, 12:14:02 am »
Just wondering if anyone has played the "Dragon Age Origins" game yet.

But yea, I've been looking around on the tool set, and I'm going to be planning on creating some DLC for it.

Bioware makes the greatest toolsets for their games.  ;D

Request A Program or Tutorial / Creating a picture.
« on: January 07, 2010, 04:32:33 pm »
Anyone have a good example of Java code where it is simply putting an uploaded picture into an applet. ( or application )

I just want to see how they uploaded the picture.

Java / (Referance) Java Source Dump.
« on: September 29, 2009, 04:38:57 pm »
Making this thread for all Java source codes for small programs people make, this can be used for reference if someone forgets how to do a certain function or something.

Java / Raw input (Scanner class) -Isaro
« on: September 26, 2009, 08:35:01 am »
Taking raw input from the user in Java has been done multiple ways, generally if you learn from a book, they will teach you a class they made themselves, here is how to use the scanner class to take in raw input.

Code: Java
  1. /* Raw input tutorial: By Isaro */
  3. import java.util.Scanner;
  6. public class Tutorial
  7. {
  8.         public static void main(String[] args)
  9.         {
  10.                 String name;
  12.                 Scanner scan = new Scanner(;   // Creates a new object of scanner class, this will take in Raw input from the user.
  15.                 System.out.println("What is your name? ");
  16.                 name = scan.nextLine();    // the String variable 'name' takes whatever typed as a string due to 'nextString' method of the scanner class
  19.                 System.out.println("Hello " + name + ", that is a great name."); // concatenates the string with the variable.
  20.         }
  21. }

Also, if you feel like declaring the variable differently.

Code: Java
  1. /* Raw input tutorial: By Isaro */
  3. import java.util.Scanner;
  6. public class Tutorial
  7. {
  8.         public static void main(String[] args)
  9.         {
  11.                 Scanner scan = new Scanner(;   // Creates a new object of scanner class, this will take in Raw input from the user.
  14.                 System.out.println("What is your name? ");
  15.                 String name = scan.nextLine();    // the String variable 'name' takes whatever typed as a string due to 'nextString' method of the scanner class
  18.                 System.out.println("Hello " + name + ", that is a great name."); // concatenates the string with the variable.
  19.         }
  20. }

Scanner uses 'nextLine()' to take strings.
and uses 'nextInt()' to take integers.
also uses 'nextDouble()' to take floating point values.

[edited name=Nathan Adams date=1255216723][/edited]

Java / More Java source
« on: September 22, 2009, 08:24:54 pm »
This is a program that calculates the amount of paint it requires to cover a cylinder.

some random Java source, can be used for reference, also someone tell me if the equation for surface area is correct.

Code: [Select]
import java.util.Scanner;
 import java.text.DecimalFormat;

 public class PaintCylinder
public static void main(String [] args)
final int COVERAGE = 350;
double radius,height,surfaceArea,gallonsNeeded;

Scanner scan = new Scanner(;

System.out.println("Enter the radius of your Cylinder (feet): ");
radius = scan.nextDouble();

System.out.println("\nEnter the height of your Cylinder (feet): ");
height = scan.nextDouble();

surfaceArea = (2*Math.PI*Math.pow(radius,2)) + (2*Math.PI*radius*height);

gallonsNeeded = surfaceArea / COVERAGE;

DecimalFormat fmt = new DecimalFormat ("0.##");

System.out.println("A Cylinder with " + radius + " radius and "+ height+ " height, requires" + fmt.format(gallonsNeeded) + " of paint");

Edited the equation
[edited name=isaro date=1253674540][/edited]
[edited name=isaro date=1253745833][/edited]

Java / Java Source
« on: September 15, 2009, 07:40:28 pm »
Ok, I feel like the output numbers I'm getting are wrong, observe and tell me if the calculations and such are correct.

Code: [Select]
/* File:
 * Author:
 * Assignments: Project 2.9
 * Description: Calculates the volume, and surface area of a sphere from it's radius.

  import java.util.Scanner;

  public class SphereCalc
  public static void main(String[] args)
double radius,volume,surfaceArea;

Scanner scan = new Scanner(;

// Takes the input of seconds from the user.

System.out.println("Enter the radius of your sphere: ");
radius = scan.nextInt();

volume = Math.pow((4/3)*(Math.PI*radius),3);

surfaceArea = Math.pow(4 * (Math.PI * radius),2);

System.out.println("The volume of your sphere is " + volume);
System.out.println("The surface area of your sphere is " + surfaceArea);

C++ / profile source
« on: August 16, 2009, 02:35:49 pm »
Was brushing up on some C++, and code blocks wouldn't compile/build my program for debugging, here is my source, see if any of you can compile it.

Note: There are probably errors, I did this quick.

Code: [Select]
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main(){
    ifstream profile;
    string strWord= "";
    string Name = "";
    int age = 0;"profile.txt");
        cout<< "Error, File not found.";
        return 1;



        cout<<strLine<< endl;



    profile.seekg(NULL, ios::beg)

    profile >> strWord >> Name;
    profile >> strWord >> age;

    cout << "Name: " << Name;
    cout << "Age: " << age


    return 0;


Beta Releases / isaro's Space defense game.
« on: August 08, 2009, 08:34:52 pm »
Here is the space defense game created by myself.

You will need to have Python 2.5.4 downloaded

download pygame at http:  //    download the pygame-1.9.1.win32-py2.5.msi

Also I include the download for livewires with the game which you will need as well.

Somone please test this so I know the upload works and I included everything.

Suggestions / C++ Celestialcoding book?
« on: July 14, 2009, 11:39:38 am »
I think once the numbered C++ tutorials are finished, I will compile them into one  .PDF

All the tutorials in one big compilation step by step seems like it would help quite a bit.

C++ / Bit shifting
« on: July 12, 2009, 03:56:50 pm »
If anyone has troulbe understanding bitshifting with ASM or C++ try this.

General Talk / Story of a hacker.
« on: July 08, 2009, 01:34:56 pm »

There is no question who the most famous hacker is. One of the first computer hackers prosecuted, Kevin Mitnick was labeled a "computer terrorist" after leading the FBI on a three-year manhunt for breaking into computer networks and stealing software at Sun, Novell and Motorola.

Known more for social engineering his way into networks than actually hacking them, Mitnick frustrated law enforcement not only by staying one step ahead of them but also with pranks like leaving doughnuts for them to find when they raided his home.

Finally arrested in 1995, Mitnick pleaded guilty to wire- and computer-fraud charges and was released from prison in 2002. His notoriety has helped him get lucrative speaking engagements and launch a security consultancy, where he gets paid for doing some of the very actions that landed him in prison.

In the first in a three-part Q&A series with hackers, CNET News talked to Mitnick, now 45, about what got him interested in computers in the first place, the differences between hacking today and three decades ago, and whether it's wise to hire a former black-hat hacker to do security work.

Q: When did you start hacking?
Mitnick: When I was 16 or 17 years old, when I was in high school -- 1979 time frame; before it was even illegal.

How did you get into it?
I became very interested in phones. I was a ham operator, an amateur radio operator, for about three years and in high school I met this other student whose dad was a ham radio operator and this other student had a hobby of phone freaking and he introduced me to this. He was able to do amazing things with the telephone system. He was able to get unlisted numbers. If he had my number, he could get the name and address … He could do all these magic tricks with the phone system. I also had an interest in telephony over ham radio. He introduced me to phone phreaking and when the phone companies started converting over to electronic systems from electromechanical systems they used front-end computers to control it. So the phone company was in the process of automating their processes. To further my phone phreaking, I needed to become familiar with the phone systems' computers. So that was my foray into hacking.

So you went from phone phreaking into hacking?
Yes. The phone company had this computer system called Cosmos, which stood for "computer system for mainframe operations." Well, my first hacking occurred as a student at Monroe High School in Sepulveda, Calif., in the San Fernando Valley. I met another student who was very heavy into computers and at this time it was the Commodore VIC-20. They offered a computer training course for seniors but I wasn't a senior, so he introduced me to the professor. He wasn't going to let me into the class. So I did all these electronic tricks with the phone system and the teacher was amazed and he waived the prerequisites and let me in the class. I think he regrets that decision today.

What could you do with the phones then?
I think I demonstrated calling into comp systems. You could interact with them with your voice and control them by touch-tone. He gave me his name and the city he lived in and I was able to get his telephone number. I was able to interface my ham radio with the telephone system and dial into computers and access them through the touch-tone pad. At that time it was pretty advanced because you didn't have voice response systems then like you do today.

What's the hacking activity you are most proud of?
Ethical or unethical (laughing)? You probably want to hear about when I was a hacker. I guess my intrusion into Motorola. I was able to call an employee at Motorola and convince her to send me the code for the MicroTAC Ultra Lite cell phone … Motorola had their whole campus protected by SecurID and I was able to use an elaborate social-engineering scheme by also manipulating the telephone network and set up call-back numbers within Motorola's campus. So I convinced a manager in operations to tell one of the employees to read off his RSA SecurID code any time I needed it so I could access the network remotely. That's how I was able to access their internal network and then I was able to use technical means to hack into their development servers for cell phones … I was able to find the source code to all the different cell phones.

I was interested in the MicroTAC series because it looked like a "Star Trek" communicator. I wanted to understand how these phones worked, how the codes controlled the processor. I wasn't interested in selling the source code or doing anything with it. It was more about the challenge of getting it. I had to breach like four layers of security to get in. I'm not really proud of it because it was obviously wrong … I made a stupid and regrettable decision and decided to go after the source code.

When you say it was about the challenge of getting it, can you elaborate?
At the time I was actually a fugitive in Denver, Colo., and one of my colleagues handed me a brochure of this phone and I thought it was ultracool, like the iPhone of today. I really wanted to understand what are the protocols used, how does the phone talk to the communications network, how does the whole thing operate? And I thought maybe I could modify the firmware for the code in my phone and make it more difficult for the government to track me. For example, there are certain methodologies the government uses, like any time your phone is on, it is communicating with the mobile telephone company. I wanted to be able to toggle that off and on, so basically take my phone offline and do extra things to it. At the time I had that idea, but I never went through with it because I was so busy hacking ... It was pretty much the trophy. Once I got the source code, that Motorola phone intrigued me. I looked at it, read through it, and tried to understand what I could understand.

After that I went after other different cell phone companies and it really was about the trophy. It was the challenge of getting in and getting the code, storing it at USC in Los Angeles and moving on to the next one. That's how I got caught. The USC administrators noticed that a lot of their disk space was being used and that their systems were breached and they called the FBI. The companies themselves didn't realize they were hacked. It was USC that discovered it … I didn't spend any time trying to hide it (source code). That was my downfall.

Did you know what you were doing was illegal?
I started hacking back in the '70s and there were basically no laws against it, against phreaking or hacking. In school, my parents and other people actually encouraged it. There were no ethics taught. If you could hack into the school's computer you were considered a whiz kid. Today if you do it you get expelled or they call the cops. It was like a reward of intellect back when I got started. Then they criminalized it later. I was so hooked into the adventure of the hacking game, doing it for a number of years even though it became illegal. It was thrilling, adventurous. It was all about solving the puzzle, using intellect to get around obstacles. It was like a huge game.

What would you do differently if you could go back in time?
In hindsight, I wouldn't do what I did because now I'm much smarter and wiser, and I caused a lot of network and systems administrators a lot of headaches undeservedly. It was the wrong thing to do. But at the time there was no such thing as penetration testing and no school curriculum on security. You had to be self-taught. That's how I learned about security and systems -- through hacking. I took the wrong road in doing it. I wouldn't repeat it. Today there are degrees, pen testing, books on the subject. At the time, a lot of companies and universities didn't give much thought to security.

When I was 17 years old, the phone company was so livid with me for hacking their systems -- and not hacking through a computer but through social engineering and calling and controlling touch phones or calling employees. There were no laws against it. They actually yanked out the phones in our house, and I was living with my mom at the time. I was in high school. They wouldn't let us have a phone and cited California Public Utilities Commission rules that if there's fraud or abuse, the phone company can yank the phone.

Rather than stop my activities I figured I would one-up them. We were living in a condo. The condo had unit numbers and we were unit 13. I went to the hardware store and got the numbers 1, 2, and a B for unit 12B. I called the phone company and told them the builder had built another unit in the condo complex. Then the phone company came out and installed a phone for a new subscriber in 12B under my name or my mother's. Then we had a phone for two weeks and one day it just went dead. The phone company was livid because I had done this elaborate thing to trick them. After about six months we got the phone service back but we could only make outgoing calls.

Let me ask about your time in jail. How much time did you serve and what was that like?
I served five years, and I ended up in solitary confinement for a year because a federal prosecutor told the judge that if I got to a phone I could connect to NORAD (North American Aerospace Defense Command) and somehow launch an ICBM (intercontinental ballistic missile). So the judge, reflecting on the movie "War Games," put me in solitary confinement. I think it was a strategy they used to get me to plead out or cooperate. I was held for four and a half years without a trial. I spent a lot of time focused on the defense and reading cases and serving as assistant to my attorney. At the end of the day, I realized justice is economic; unless you have enough money to properly mount an effective defense, you always lose.

I wanted to admit that I was hacking, but the intention and the purpose of it wasn't fraud, because to commit a fraud you have to convert property to your own use and benefit, to profit. In my case, that was lacking. I was doing it for the trophy. I was cloning my cell phone to random subscribers and dialing into computers from the cell phone. The purpose wasn't to make free calls; it was to make it more difficult for the government to track me. They claimed all my hacking into those companies was a huge elaborate fraud and that I caused $300 million of damage. They said the value of property I copied, the R&D development cost, was $300 million. The government tried to use the old (definition of) loss for tangible property. If I copied that code and they no longer had use of it, it would be a $300 million loss or whatever.

They told my attorney that if I didn't cooperate and plead out, not only would they take me to trial in Los Angeles, but they would put me in a revolving door of trials and put me on a bus and take me from federal jurisdiction to federal jurisdiction. So I signed the deal and admitted causing between a $5 million and $10 million loss. I signed it not believing it. I signed it to get out. I really don't believe to this day that my actions caused that amount of loss, because none of the victim companies lost use of their code, they never claimed any losses due to my activities. Sure there were losses, maybe in the thousands of dollars, for their time to investigate who hacked into their systems and to secure them. Those are the real losses. But I was the example for the federal government, so they needed to put me away for a long time. That's why I was very angry and bitter against the government at the time, because I wasn't being punished for what I did. I was being punished for what I represented at the time. I have no qualms about being punished for what I did. The punishment should fit the crime.

So, if someone were to ask you what lessons you've learned, what would you say?
Don't break the law. Don't intrude on other people's property. It's just the wrong thing to do. It's unethical and immoral. And now of course it's illegal. It's trespassing. You're violating somebody's property rights. And they have the right to control and keep their property confidential. What I attribute my change of heart to is growing up. Back then I was young and immature, and never damaged anything intentionally.

Do you think your hacking has led to positive change in some way?
Yes. It led to my career. Today I speak around world, I do pen testing all the time -- and deep penetration testing, where I go after the most sensitive credentials at a company to see if I can get to the crown jewels. I see what I can do as an ethical hacker. I really enjoy this work because when is it that you can take a criminal activity, legitimize it and get paid for it? Ethical hacking. It's not like you can be a drug dealer and go work for Walgreens … A lot of pen testers today have done unethical things in their past during their learning process, especially the older ones, because there was no opportunity to learn about security. Back in the '70s and '80s, it was all self-taught. So a lot of the old-school hackers really learned on other people's systems. And at the time, I couldn't even afford my own computer. A dumb terminal was like $2,000. A 1,200-baud modem was like $1,200. The cost of this technology was out of my range as a high school student, so I used to go to local universities and use their system, albeit without their knowledge, to learn.

Any advice for young hackers?
Yeah, don't follow in my footsteps. There are definitely other roads or other opportunities and ways that people can learn and educate themselves about hacking, security and pen testing. Today it's a huge market. It's become a huge issue within the federal government with critical infrastructure.

Some people say companies shouldn't hire former black-hat hackers. What are your thoughts on that?
I'm hired all the time. So far it has not really been an impediment. You have to evaluate the person's skill set, their maturity and what they did before as a hacker. Were they getting credit card numbers and buying merchandise on the Internet? Or were they hacking systems for their own intellectual curiosity? You can't just lump black-hat hackers into one category. You have to look at what they did in the past, what they've done since then and what credentials they have to get the job done. People who have operated on the other side of the law, like Frank Abagnale, he is a prime example. He reformed himself and now is the leading authority on counterfeit money and checks. Look at Steve Wozniak. He even started out as a phone phreak (and sold blue boxes on UC Berkeley campus). But he took a whole different direction. He's done a lot of good for the community. That's another factor -- what good has that person done for the community and industry since the transgression?

What are you doing now?
Consulting, author, public speaker. I go around the world speaking. That's my primary activity -- ethical hacking, pen testing, system hardening, training, education. And I'm working on my autobiography. It's due out in spring 2010.

Request A Program or Tutorial / E-mail
« on: June 09, 2009, 08:11:22 pm »
I need to make a request for help to recover an old yahoo E-mail password -.-

It's my brothers and he needs it to recover n account for a game.

Anyone feel like helping with a brute forcer or something?

-Preferably Celestial.

General Talk / Birthday
« on: May 26, 2009, 10:13:39 pm »
My birthday today  :)

Turning 17

Python / [4]Loops.(2.5)
« on: May 23, 2009, 11:16:33 am »
Here we will use variables and a while loop.

Code: [Select]
x = raw_input("Pick a number ")

while x != 0:
      x -= 1
      print x

This bit of code takes in the number you gave it, and takes off one, then prints the new number, and keeps doing it until your number equals 0, if you pass in a negative number you are going to get some weird results.

!=    is does not equal, so as long as x does not equal 0 it runs the loop.
>     greater than
<     less than
==   equal too, (comparative) you can't use single equal signs to start a loop.
>=   greater then or equal too.
<=   less then or equal too.

Now here is a for loop.

Code: [Select]
y = 10
for z in range(y):
print z
This one I use any random variable ( z )   and run it through the range of y, which is 10 numbers, so z runs through and prints 10 numbers.

Request A Program or Tutorial / Idea request
« on: April 26, 2009, 09:42:33 pm »
My final project for Python programming is coming up.

I need some ideas, so just throw stuff out there, can be GUI or not.

Challenges / Complex "Hello World"
« on: April 26, 2009, 04:34:21 pm »
I have a little  challenge to throw out there, in any language it can be done.

Lets see everyone submit the most complex program of equations and parsings, but the output is always hello world.


Run for loops through other words put in lists that takes out letters and combines them to print "Hello World"

Most complex method wins.

Here is my try at it.

Code: [Select]
# Hello World

import random

c = random.randrange(2)

listtup = [("H","W"),("e","o"),("l","r"),("l","l"),("o","d")]
h = ""
w = ""
if c == 0:
    for i in listtup:
        h += i[0]
    for i in listtup:
        w += i[1]
    print h + " " + w
if c == 1:
    for i in listtup:
        h += i[0]
        w += i[1]
    q = h + " " + w
    print q

That is in Python 2.5, tested it and it works fine.

Software support / Debug
« on: April 21, 2009, 09:59:03 pm »
Code: [Select]

/*Problem: Price returns zero
Problem source possibilities: MySQL query execution, use of HTTP_RAW_POST_DATA. Use of 
HTTP_RAW_POST_DATA requires encoding type to be set to text/xml. 

if (!isset(
$HTTP_RAW_POST_DATA file_get_contents("php://input");

$doc = new DOMDocument();
$CharId $_COOKIE["charid"];
$Op $doc->getElementsByTagName('intOption');
$Option mysql_real_escape_string(stripslashes($Op->item(0)->nodeValue));
$St $doc->getElementsByTagName('strStat');
$Stat md5(mysql_real_escape_string(stripslashes($St->item(0)->nodeValue)));

$character mysql_query("SELECT * FROM aq_characters WHERE id='{$CharId}'");
$charquery mysql_fetch_array($character);

/*Set stat being trained, store into State variable (Used later to query player stat(s) from database).*/
if ($Stat "intSTR") {
$State "strength";
   if (
$Stat "intDEX") {
$State "dexterity";
   if (
$Stat "intINT") {
$State "intelligence";
   if (
$Stat "intEND") {
$State "endurance";
   if (
$Stat "intCHA") {
$State "charm";
   if (
$Stat "intLUK") {
$State "luck";
/*If player selects to pay in Gold(Option 0), determine price and check that character gold - price is not negative. */
if ($Option == 0) {
$Price = (($charquery["{$State}"]^2)*0.8);
if($charquery["gold"] - $Price 0){
$error 1;
$message "You do not have enough gold to train this stat.";

//Same as option 0, but Tokens.
if ($Option == 1) {
$Price = ((($charquery["{$State}"]^2)*0.8)/20);
if($charquery["tokens"] - $Price 0){
$error 1;
$message "You do not have enough tokens to train this stat.";

header("Content-type: text/xml");
$error != 1){
   if (
$Option == 0) {
$update mysql_query("UPDATE aq_characters SET $State='{$State}'+5, gold=gold-'{$Price}' WHERE id='$CharId'");
   if (
$Option == 1) {
$update mysql_query("UPDATE aq_characters SET $State='{$State}'+5, tokens=tokens-'{$Price}' WHERE id='$CharId'");
$message "You have trained " $State " up 5 points.";

Working on an online private server, this code is not working right, read the comments for some clues. need a bit of help trying to debug it....any ideas?

If you need more information ask.

Python / [3]Taking input into equations.(2.5)
« on: April 16, 2009, 08:35:46 pm »
Now we will combine raw_input(    and variables into a small math program.

Code: [Select]
print "Welcome to the mini math program.\n"

print """
Please pick two numbers
and we will add them together.

num1 = int(raw_input("What is your first number? "))

num2 = int(raw_input("What is your second number? "))

num3 = num1 + num2

print "Your sum is",num3

raw_input("Press Enter to Exit")

I use the int() in front of the raw input, to mark it as I'm inputting an integer only, integers are whole numbers.

In the end print statement, you need the    ,    to separate the string and variable.

also,the triple quotes print statement (""")

triple quote print statements print exactly what is inside the quits, even if you do \n or anything, good way to do ASCII art if you feel like it.

Python / [2]The magic of Variables (2.5)
« on: April 16, 2009, 08:15:09 pm »
Alright, now time to move on.

In this tutorial we will store data into variables.

We will accomplish the 'Hello World' program again, but by storing it inside a variable, then printing the variable.

Code: [Select]
# Sets variable to equal the string "Hello World"
variable =  "Hello World"

print variable

raw_input("Press Enter to Exit")

The variable I used, I named variable, but you can name it anything

Code: [Select]
# Sets variable to equal the string "Hello World"
stuff =  "Hello World"

print stuff

raw_input("Press Enter to Exit")

That works exactly the same.

Now, to store some numbers in variables.

Code: [Select]
x = 10

y = 5

z = x + y

print z

raw_input("Press Enter to Exit")

This gives x and y both a number variable, and z variable is set to equal x + y,  and if you print z, it will print the sum of x and y.

You will be using variables all the time throughout programming.

Python / [1]The Very Basics of Python (2.5)
« on: April 16, 2009, 08:05:20 pm »
Python is an extremely easy to learn language great for beginners.

To begin first you will need to download version 2.5 from this link, click  for x86 processors  download after you get to the site.

And now, once you are all done downloading, open IDLE, then click file, new window.  This is where we will create your program.

Here is the code to a simple 'Hello World' program.

Code: [Select]
# Prints the phrase 'Hello World' in command window.
print "Hello World\n"

raw_input("Press Enter to Exit")

Now, all that does is print the words inside the "_".

To explain it all step by step now.

#, symbol means comments, these will not show up in the program, just used in your code so you can remember things you made by putting notes in these, or letting other people understand your code.

print,    print is a function in python that prints whatever is inside the "_" next to it.

the '\n' you see in the program stands for new line, you won't see the program print it, it treats it as a mini function inside your string of words that the print statement prints out.

I used \n so the raw input part appears one line further down.

raw_input("_")   this function takes raw input from a user, this is very commonly used function. can be used to store Strings,Integers, or Floats inside variables

I used raw_input("Press Enter to Exit") to make the output remain on the screen until the user presses enter.

!!!! Remember to save files with a .py at the end when you name them.
      saving a file named 'game', you would name it '' and click save.

General Talk / Computer Specs!
« on: April 13, 2009, 09:46:03 pm »
Post your computer specs, just for fun.

Intel Core 2 duo 2.8ghz
4 gigs RAM OCZ gold 1066
9800GT Nvidia graphics

nice and solid, planning to up everything. I certainly have the power supply for new stuff and my mother board can handle another 2 sticks of ram.

Beta Releases / Graphic Arrow
« on: April 08, 2009, 04:01:58 pm »
This is a very very simple program, that tests your graphics card somwhat.

The arrow moves corner to corner very fast, if your graphics are good, it will not blur, if you have a slower graphics card you will see the arrow blur into an unrecognizable shape.

This program was mostly meant to test canvas in Python. nothing special, yet, I did place some commented code that doesn't do anything, but it reveals that I can bind functions to buttons easily, and that would leave room to make some simple games ( Pac-Man would be an easy one )

To run you need Python 2.5  downloaded.

Humor / Sheep lights, amazing...
« on: March 22, 2009, 08:22:53 pm »


Pages: [1] 2


* Search

* Recent Posts

Image Comparison by Shishka
[May 15, 2017, 01:18:02 pm]

Re: srchub - free source code hosting by Nathan
[December 14, 2015, 11:37:02 pm]

Re: srchub - free source code hosting by Celestialkey
[November 27, 2015, 08:51:42 am]

Updates by Nathan
[October 30, 2015, 08:27:36 pm]

Re: Client-Server Messaging by Nathan
[October 25, 2015, 05:48:57 pm]