Jump to content

proggR

Members
  • Posts

    431
  • Joined

  • Last visited

    Never

Posts posted by proggR

  1. I thought I knew MySQL until I started this assignment and now I know I just plain don't. I have 10 questions and have managed to figure out 6 of them but now I can't figure out the rest.

    I normally don't ask for homework help but if anyone could help me out I'd appreciate it. We're given output and have to figure out the input that would make it. Its a fun idea but I'm so confused now I just can't seem to figure out the remaining questions.

     

    #5 list a customer name ( last name and first name) with another
       customer name provided both customers live in the same city. 
       Do not show customers paired to themselves, or reversed pairs. (2 marks)
    
    +-------------+-------------+-------------+-------------+
    | CustSurname | CustGivname | CustSurname | CustGivname |
    +-------------+-------------+-------------+-------------+
    | Adams       | Amy         | Baker       | Bill        |
    | Adams       | Amy         | Evans       | Ellen       |
    | Baker       | Bill        | Evans       | Ellen       |
    | Dove        | Dennis      | Grant       | Gail        |
    +-------------+-------------+-------------+-------------+
    4 rows in set (0.04 sec)
    
    #6 List all Reservation IDs, the room fee (property rate times number of guests times length of stay), a 15% hospitality fee, the total fees due, the reservation amount paid, and the balance owing for each show.  Order the list
    to have the largest balance owing first.  (2 marks)
    
    
    +--------+---------+---------+-----------+-------------+----------+
    | ResvID | RoomFee | HospFee | TotalFees | ResvAmtPaid | BalOwing |
    +--------+---------+---------+-----------+-------------+----------+
    | R10    | 1520.00 |  228.00 |   1748.00 |      760.00 |   988.00 |
    | R12    | 1200.00 |  180.00 |   1380.00 |      560.00 |   820.00 |
    | R13    |  900.00 |  135.00 |   1035.00 |      420.00 |   615.00 |
    | R6     | 1040.00 |  156.00 |   1196.00 |      900.00 |   296.00 |
    | R4     | 1500.00 |  225.00 |   1725.00 |     1500.00 |   225.00 |
    | R3     |  600.00 |   90.00 |    690.00 |      520.00 |   170.00 |
    | R7     |  720.00 |  108.00 |    828.00 |      720.00 |   108.00 |
    | R8     |  576.00 |   86.40 |    662.40 |      576.00 |    86.40 |
    | R9     |  520.00 |   78.00 |    598.00 |      520.00 |    78.00 |
    | R5     |  420.00 |   63.00 |    483.00 |      420.00 |    63.00 |
    | R1     |  420.00 |   63.00 |    483.00 |      420.00 |    63.00 |
    | R11    |  384.00 |   57.60 |    441.60 |      384.00 |    57.60 |
    | R2     |  180.00 |   27.00 |    207.00 |      360.00 |  -153.00 |
    +--------+---------+---------+-----------+-------------+----------+
    13 rows in set (0.04 sec)
    
    #9 List customer names ( last name and first name) for customers who have
       more than two reservations or has a reservation at the Green Farm.
       (2 marks)
    
    +-------------+-------------+
    | CustSurname | CustGivname |
    +-------------+-------------+
    | Adams       | Amy         |
    | Baker       | Bill        |
    | Franks      | Fern        |
    +-------------+-------------+
    3 rows in set (0.17 sec)
    
    
    #10 To help planning, create the SQL statement that will print the number 
        of reservations that end ( start date plus length ) on a weekday, and
        print the number that end on a weekend. (2 marks)
    
    
    +---------+---------+
    | Weekend | Weekday |
    +---------+---------+
    |       1 |      12 |
    +---------+---------+
    1 row in set (0.05 sec)
    

     

    The tables we're working with are:

     

    Reservation
    +--------+------------+------------+-------------+------------+----------+----------+
    | ResvID | ResvStart  | ResvLength | ResvAmtPaid | ResvGuests | FKPropID | FKCustID |
    +--------+------------+------------+-------------+------------+----------+----------+
    | R2     | 2008-07-11 |          2 |      360.00 |          2 | P2       | C4       |
    | R3     | 2008-07-14 |          2 |      520.00 |          4 | P5       | C5       |
    | R4     | 2008-07-19 |          5 |     1500.00 |          4 | P8       | C2       |
    | R5     | 2008-07-10 |          6 |      420.00 |          2 | P1       | C3       |
    | R6     | 2008-07-05 |          4 |      900.00 |          4 | P3       | C6       |
    | R7     | 2008-07-17 |          4 |      720.00 |          4 | P2       | C1       |
    | R8     | 2008-07-05 |          6 |      576.00 |          2 | P4       | C4       |
    | R9     | 2008-07-21 |          2 |      520.00 |          4 | P3       | C1       |
    | R10    | 2008-07-05 |          4 |      760.00 |          4 | P6       | C2       |
    | R11    | 2008-07-16 |          2 |      384.00 |          4 | P4       | C5       |
    | R1     | 2008-07-14 |          3 |      420.00 |          4 | P1       | C1       |
    | R12    | 2008-07-10 |          4 |      560.00 |          4 | P5       | C6       |
    | R13    | 2008-07-14 |          3 |      420.00 |          4 | P5       | C2       |
    +--------+------------+------------+-------------+------------+----------+----------+
    13 rows in set (0.00 sec)
    
    Customer
    +--------+-------------+-------------+----------+------------+
    | CustID | CustSurname | CustGivname | CustCity | CustPhone  |
    +--------+-------------+-------------+----------+------------+
    | C1     | Adams       | Amy         | Toronto  | 4165551212 |
    | C2     | Baker       | Bill        | Toronto  | 9057771212 |
    | C3     | Cook        | Chuck       | Westport | 6133219876 |
    | C4     | Dove        | Dennis      | Ottawa   | 6137893322 |
    | C5     | Evans       | Ellen       | Toronto  | 4167774432 |
    | C6     | Franks      | Fern        | Kiosk    | 7059876543 |
    | C7     | Grant       | Gail        | Ottawa   | 6139873254 |
    +--------+-------------+-------------+----------+------------+
    7 rows in set (0.00 sec)
    
    Property
    +--------+--------------+-----------+----------+----------+----------+
    | PropID | PropName     | PropCity  | PropRate | PropBeds | PropType |
    +--------+--------------+-----------+----------+----------+----------+
    | P1     | Echo Lake    | Timmins   |    35.00 |        4 | Cottage  |
    | P2     | Fish Heaven  | Upsala    |    45.00 |       12 | Resort   |
    | P3     | Green Farm   | Tweed     |    65.00 |        4 | BB       |
    | P4     | Rustic Retrt | Schutt    |    48.00 |        4 | Cabin    |
    | P5     | Toms Place   | North Bay |    75.00 |       16 | Cottage  |
    | P6     | Maries House | Stratford |    95.00 |        4 | BB       |
    | P7     | Mitchel Ldng | Westport  |    35.00 |        6 | Cabin    |
    | P8     | Pine Lodge   | Kiosk     |    75.00 |       22 | Resort   |
    | P9     | SL Salon     | Kingston  |    10.00 |        6 | BB       |
    +--------+--------------+-----------+----------+----------+----------+
    9 rows in set (0.00 sec)
    

     

    Thanks again for any help/answers. I'm going to keep working away at these and I'll check back later.

    Thanks in advance.

  2. I've never uploaded files via PHP before and it doesn't seem to be working.

    I have the file input on the form and in the form tags have added enctype="multipart/form-data" but when I print the $_FILES array on the handler script it just outputs 'Array()' so nothing is being passed or uploaded at all.

    I'm not really sure where I'm going wrong at this point. I'm sure there is much I could mess up later on, but this part should be simple. Here's my form and the part of the handler that deals with the $_FILES array:

     

    //form in the first file
    
    <form id = 'form'action='thread_update.php' method='post' enctype='multipart/form-data' align='center'>
    	<label for="name">Name: </label> <input type="text" id="name" name="name" /></br>
        <label for="subject">Subject: </label>  <input type="text" id="suject" name="subject"/></br>
        <label for="message">Comment:</label> <textarea name ="message" rows=5 cols=50 id="message"> </textarea> </br>
    <label for="filename">File:</label> <input type = "file" name ="filename" id ="filename"> <br/>
    </br>
    <input type="submit" value="Submit"><br/>
    </form>
    
    
    //file related portion of the handler, not really much there yet
    print_r($_FILES);
    if (isset($_FILES['filename']))
    $file = $_FILES['filename'];
    else
    die ('No image selected. Threads must contain an image.');
    

     

    It outputs the error message which is why I added the print_r to check if it contained anything and it doesn't.

    Any help would be appreciated. Thanks in advance.

     

  3. How do I change the order though? Would I change the order in the tables or write a script to figure out the order to display everything? I think that'd be slower because I'd have to query the reply table, figure out the x most recent threads that were replied to, then query the thread table for those threads, and repeat for each page of posts. I'm sure I'm just thinking about it the wrong way. I would probably need to join the two or something in one query.

  4. I'm working on scripts for an imageboard/forum and just realized I don't know how to reorganize the table based on the most recent update. I have a thread table and a reply table and I want to write the script so when a reply is made the coresponding thread gets moved to the bottom of the thread table. And it also doesn't change the Id which is the primary key and autoincremented. I was thinking about making another table that would keep track of the order and just reference the thread list and constantly delete/insert columns to make them in order. That seems inefficient to me, especially if you look at popular forums and imageboards that have replies and new threads flying in by the hundreds per minute.

    If anyone knows anything that could help I'd really appreciate it. Thanks in advance.

  5. My girlfriend's laptop took a huge crap the other week and I've been just letting her use mine for now. Today I went and picked up a SATA>USB adapter to backup her files before trying to install Windows on it again (I tried running the repair from the Windows disc since its a Vista BCD issue but it wouldn't read the disc, so installing Windows will be a pain in itself). The drive shows up in My Computer but whenever I try to open/explore it My Computer and explorer.exe freezes and I have to restart the process. I tried accessing it in the command prompt and get "The request could not be performed because of an I/O device error."

    Could there be something so incredibly wrong with the drive that its been causing all the problems? If so why can't I even boot from CD on the laptop? Is there any software anyone knows about that may make the process a little easier? Even if I could do bit copy from this drive to my external to make sure I have all the data I could go buy a new HD if that were the case.

    Anyway. I'm going to keep toying with this. If anyone has any suggestions that'd be helpful. Thanks in advance.

  6. A friend and I wanted to toy with some imageboard software. The most common software is perl based so i've installed XAMPP and edited the imageboard's config file but when I go to the script in my browser I get:

     

    Error message:
    Can't locate config.pl in @INC (@INC contains: . C:/xampp/perl/site/lib/ C:/xampp/perl/lib C:/xampp/perl/site/lib C:/xampp/apache) at C:/xampp/htdocs/wakaba/wakaba.pl line 16. BEGIN failed--compilation aborted at C:/xampp/htdocs/wakaba/wakaba.pl line 16. ,

     

    What I don't get about it is line 16 of wakaba.pl is right after it says use lib '.'; so I can't see why it can't find the config file since its in the same directory. Here's that couple lines of code:

    use lib ".";
    BEGIN { require "config.pl"; }
    

     

    Like I said, its the first time I've used perl so I don't know where to go from here. Google hasn't really helped. I found something about adding the directory to the PERL5LIB variable but I don't even know how to do that.

     

    If anyone can help that'd be awesome. Thanks in advance.

  7. What it was meant to be by Jesus is irrelevant. You said yourself that it has become a religion, so anyone who identifies themselves as Christians are needlessly also identifying themselves as being religious. What an author of one book thinks cannot redefine that Christianity is universally considered a religion throughout the entire world.

    I'm not saying I or this book are "redefining" Christianity. And how are the beliefs of the principal figure of Christianity irrelevant? That would be like saying the teachings of Guatama Buddha are irrelevant to Buddhism just because people didn't follow it the way it was meant to be followed. Jesus himself said that's not the way. Have you read the Bible or at least the New Testament or are your conjectures based solely on dictionary definitions which I can assure you don't always give the best definition.

  8. You cannot be a Christian without being religious. Christianity is a religion, so if you're Christian you are per definition religious.

    Wrong. If you're up for a read, read The End of Religion by Bruxy Cavey. Christianity has become a religion, yes. But it was never meant to be religious. It was meant to be a worldview.

    It makes more sense to have such an incredibly complicated system come from something intelligent than something random.

     

     

    I never got this argument, it's flawed. The more complex something is, the harder it is for "something intelligent" to create it. So how does that make more sense (not that I ever expect religion and "sense" to play nice)?

    Because the more complex something is the more impossible it is for mere chance

    to create it. It may be harder for a human to create more complex things but a human didn't create the universe.

  9. I'm on my phone so I haven't got to read the whole thread yet. I will tonight.

    For me it goes like this:

     

    I'm a Christian. I grew up Catholic and around the age of 14 decided it's all a bunch of fairy tales and stories and stopped going to church or believing in anything. Then around 17 or 18 I started thinking more about it more and after a lot of thinking and reasoning and reading I realized that (to me) God creating everything makes more sense. I started thinking of life as a written program. You see code in DNA, you live in the real life physics engine, you learn by building up an internal knowledge/belief database. When was the last time you randomly smashed the keyboard and made a program? It makes more sense to have such an incredibly complicated system come from something intelligent than something random.

    With that said. No I'm not religious. I think religion is and always has been about rules. Being a Christian I believe that Jesus was a real person and was God incarnate. While he was on the earth he constantly reprimanded religious leaders for being religious and crooked. Rules are not supposed to be what makes you do or not do something. Is there things God doesn't want done? Yes. Does he give us the choice to do it or not? Obviously. I do dumb stuff all the time and I know I 'sin' on a daily basis. But I know that thats not what's important. Faith is what's important. Religion makes you do things because you think following the rules gets you to heaven. Faith makes you want to do what's right because you know it's right and you WANT to do it.

    Anyway. That's my two cents. It's probably not even what I was trying to say. It's too hard to write long thoughtful things on my phone. 

  10. Proliants are weird with that. I have a 3000. Does it have an OS on it? I had to format before it would see the disc at all. Unless it's the smart start cd it came with it wouldn't boot to the disc with an os already installed. I switched mine from windows server to netbsd and never touched it again lol.

  11. Thanks. I've stumbled across sugar but opencrx is new so that's good. I'm looking for something for a hosting company to manage all the accounts and associate virtual servers. I was thinking about scripting it myself and then I could licence the scripts to other new hosting startups. It was a thought. It'll be a while before I do it either way.

  12. I think that's what they're called. Customer Management System? Anyway. Is there any good free ones I could give a try? I was going to script one but what I want it for was confusing me when I was trying to normalize my database. I suppose that a CRM may not be the best idea though because it wouldn't be tailored to what I need.

    Anyway. If anyone knows any good services that'd be really helpful. I'll keep planning my database in the mean time. Maybe I'll think of an efficient way to handle everything.

    Thanks in advance for any help.

  13. If its virtualized from the flashdrive, can I still have it mount network drives? Also, since a lot of the programs I use are Windows programs it may not work. I'd really like to though. I found U3 and it looked ok but I may just try customizing Portable Apps better and organizing the flash drive more like a computer would be. I'm not sure. I was just hoping a windows manager could be started like a program and used to navigate the computer/flash drive. Similar to how adobe bridge is essentially a windows explorer replacement.

  14. I don't really know how to explain what I'm thinking but I'll try.

    I just bought a 16 GB flash drive because my netbook only has a 16GB SSD and after the OS is installed (XP) it doesn't leave a lot of room for programs I'd like to have on it for school (I don't need them on it, its mainly for notes, but it is nice to be able to code during class). I'm installing the programs and IDEs etc onto the flash drive so I can use them from the netbook as well as running them on the lab computers so I can use the same programs all the time (I use Dev C++ whereas the school uses Borland).

    Anyway, what I'm looking for is a desktop environment or window manager that can be loaded from the flash drive to create the same environment everywhere I go. I don't know if that makes sense. It can't just be an OS unless I virtualize it because I'd like it to run at the school, and I'd also like it to be able to access files on the schools network drive and see the computer's C: drive in its file manager.

    I don't know if I'm making any sense to anyone else. My apologies if I'm not.

    If anyone understands what I'm babbling about and can recommend any software I'd be pretty happy.

    Thanks in advance for any help.

     

    Pee ess, I know about and use Portable Apps. That's kind of the idea I'm looking for but different.

  15. It's not that great of an idea to show off to a prospective employer/client that you'll disregard confidentiality agreements if you think you can get away with it.

    I was going to say the same thing.

    If you got written permission from your employer to discuss projects you've worked on it would show the new company you follow NDA and also verify the projects. I'd definitely ask the employer's permission and try to get something in writing if possible. It may not be depending on the situation.

  16. I bought a PS3 when the Slims came out. I play a lot of World at War but also some random sports games that my housemates have like Tiger Woods and NHL. Nazi Zombies is a good time waster within World at War.

    My ID is proggR. Add me. I don't have many games for it yet but I'll probably start buying more soon enough.

  17. Are you required to use all that software? My school uses a lot of .net software too but I try to

    avoid it.

    I'd do pretty much what Hamza said. Plan your db with each entity you'll need. Then plan what attributes about the entities are relevant to include in your database. Then plan the relationships between them all and remove any repeating data if there is any.

    Then I'd make a mock front end in paint or Photoshop. Something to let you visualize what it's going to look like. Then code it to look like that. Once you have all the pages coded you

    can work on your script to create the database and your handler scripts that access it. Then it's lots of testing and rewriting scripts until you've covered every possible error.

    As far as the .net software though, I couldn't help you much with that. 

     

  18. Lol I like the look of jeans and a tshirt with a nice jacket. It does look good. But not only am I required to be a little more formal with the interviews (theyre for placement and a good paying summer job through my program at school) but I also like suits. Plus, I'd still have to buy a new jacket for the jeans and a tshirt style :P

    Moores has designer suits on buy one get one free and some as cheap as $300 so I'm

    going to try some on today. I think I'll bring along my jacket and ask them what I could do

    though.

  19. I didn't know very much about suits and even though it was the smallest suit the store had it was still too big in the shoulders. It fits fairly nice in the waist and arms because it was tailored when I bought it but they can't tailor shoulders and it looks a little strange to be honest.

    I need a suit for some interviews I have coming up and I'm wondering if anyone knows how I may be able to salvage the suit I have. If not Ive been looking around and have found some decent deals at stores but obviously not spending $300 and more for a suit when I have an almost perfect suit in my closet.

    Thanks in advance for any help anyone can give. Hopefully there's some suit wearers on phpfreaks! 

  20. Two things:

    1 - I like the site a lot. The navigation is consistent and the design is interesting and clean.

    2 - Good to see some Audi's/VWs on there :). If I'm ever near Montreal I'll stop in. I'll show my friend this site too. I think he'd like it and goes to Quebec more than me.

  21. Answer

     

    1. You rub your hands together till they are really sore

    2. You take the saw and cut the table in half

    3. Two halves make a whole

    4. You climb through the hole and escape

     

    simple

    What saw?

    I've heard this with a mirror and that part is "look in the mirror and see what you saw".

    Clever play on words :P

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.