This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Returns a random Date in the range [start, end) | |
| */ | |
| public static Date randomDate(Date start, Date end, boolean endInclusive) { | |
| long d1 = start.getTime(); | |
| long d2 = end.getTime(); | |
| // How can I change the range from [start, end) to [start, end] (inclusive) | |
| // depending on whether endInclusive is set? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NODELIST new; | |
| new = malloc(nodeList.size * sizeof(NODE)); // I could be wrong here | |
| int i; | |
| for (i = 0; i < nodeList.size; i++) { | |
| NODE *n = pop(nodeList); | |
| push(new, n, n->data); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| booking_in_seats ==> I | |
| ================ | |
| tname | |
| section | |
| booking_num | |
| booking_for_schedule ==> S | |
| ==================== | |
| tname | |
| date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CLUB -> Defines a CLUB | |
| ---- | |
| club (varchar) | |
| MEMBER -> Holds member information for CLUBs | |
| ------ | |
| club (varchar refs CLUB) | |
| id (customer id number, refs another table, I don't think this is neccesary to solve the problem) | |
| PURCHASE -> Holds all purchases |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WITH #members AS ( | |
| SELECT DISTINCT count(*) as num | |
| FROM yrb_club C, yrb_member M | |
| WHERE C.club = M.club | |
| ) | |
| SELECT | |
| C.club, | |
| count(M.num) | |
| FROM | |
| yrb_club C, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Returns CID's of customers that have never purchased a book in French | |
| -- I need something like | |
| -- SELECT C3.city FROM yrb_customer C WHERE c3.cid = c2.cid | |
| -- (this doesn't work though) | |
| SELECT DISTINCT C2.cid | |
| FROM | |
| yrb_customer C2, | |
| yrb_purchase P, | |
| yrb_book B |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| purchase | |
| ======= | |
| club | |
| title | |
| year | |
| book | |
| ==== | |
| title | |
| year |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package name.marcocirillo; | |
| import java.awt.BorderLayout; | |
| import java.awt.GridLayout; | |
| import java.awt.HeadlessException; | |
| import java.awt.event.ActionEvent; | |
| import java.awt.event.ActionListener; | |
| import java.io.IOException; | |
| import java.io.InputStream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Fit Facebook Like Feature with page | |
| $().ready(function(){ | |
| try { | |
| $('.uiGrid').css("color", "white"); | |
| } catch (err) { alert(err); } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| typedef struct Node Node; | |
| typedef struct FIFOQ FIFOQ; | |
| struct Node { | |
| char data; // the data for this Node | |
| off_t offset; // offset of data byte in the file | |
| Node *next; // next Node in the queue | |
| }; | |
| struct FIFOQ { |