Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Say Something...

This thread is locked; no one can reply to it. rss feed Print
 1   2   3   4 
Say Something...
AMCerasoli
Member #11,955
May 2010
avatar

Yhea... Where's everybody? I'm bored and the forum is dead...

Arthur Kalliokoski
Second in Command
February 2005
avatar

get back to work, jetson!

They all watch too much MSNBC... they get ideas.

Thomas Fjellstrom
Member #476
June 2000
avatar

It's the middle of a work day here. :P

They don't pay me to chat on the internet :P

But since I'm taking a break, I can spend a couple moments to spam random forums!

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

AMCerasoli
Member #11,955
May 2010
avatar

hahahaha 9:30 here... I want to see something new and funny on allegro.cc and what do I find? nothing... NOTHING! C'mon.

Dennis
Member #1,090
July 2003
avatar

If you are bored, play WoW. Yes, it is boring as well but occasionally some other player runs through your view, ignoring you on their quest to collect/kill/bring n of x from a to b, which makes it feel like you are part of an active world. :P

Thomas Fjellstrom
Member #476
June 2000
avatar

On some down time I've been messing with my LuaGlue project, along with my minecraft tools (I'll eventually get it all released...). I started writing a perl script to process C and C++ files, including doing manual preprocessing... It didn't turn out so well, and SiegeLord reminded me of clang, and the fact that libclang exists, so I'll probably use that instead. Eventually LuaGlue will come with a little tool called "Hoof" (geddit?) that will automatically generate bindings using clang, and maybe some templates... Haven't fully planned it out. There's a chance that it may use lua itself to customize binding generation :D

It helps that I've wanted to play with llvm and clang for a while, and this is a very good excuse to become familiar with it.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Bruce Perry
Member #270
April 2000

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

SonShadowCat
Member #1,548
September 2001
avatar

I just left the office and am about to spend the evening/night with my lady. So its a good day.

Fishcake
Member #8,704
June 2007
avatar

It's morning, and I'm working right now. I regularly visit Allegro.cc while waiting for my program to compile, though I don't have much to say, so I just read some threads in the off-topic section and move on. :P

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

I stop by several times a day, but there was nothing interesting going on. Must be some kind of negative feedback loop. :/

Right now, I am working on a Java program that inserts data into a database and reads it back into a JTable. Anybody know how to auto increment part of a composite primary key based on the other unique components of the key? I have a 3 part composite key composed of a student name , a course name, and an attempt number. (It's a made up Exam table). I need to auto increment the attempt number based on the unique set of student name and course name.

Karadoc ~~
Member #2,749
September 2002
avatar

I don't have much to say, because I haven't been doing any programming recently.

I bought a Surface Pro 2 yesterday. I'm still learning how to drive it, with the touch screen, and the digipen thing, and the new OS - but I'm pretty happy so far. I didn't realise that the computer can detect the presence and position of the digitiser pen without it touching the screen. I'm pretty impressed by that. (It means you can point at the screen with the pen to get "mouse-over" text and stuff like that without touching the computer.)

-----------

Kris Asick
Member #1,424
July 2001

"Something"

...

...what? ::)

--- Kris Asick (Gemini)
--- http://www.pixelships.com

l j
Member #10,584
January 2009
avatar

Something.

a b c d e f g h i j k l m n o p q r s t u v w x y z.
I wins thread?

AMCerasoli
Member #11,955
May 2010
avatar

Dennis said:

If you are bored, play WoW.

I don't know, never liked that game. I have never played it, though. I have been playing the alpha of RimWorld, really like it.

Anybody know how to auto increment part of a composite primary key based on the other unique components of the key?

Why do you use composite primary keys? I always try to avoid them.

GullRaDriel
Member #3,861
September 2003
avatar

Something ? I practice trumpet everyday !

>:(

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Dizzy Egg
Member #10,824
March 2009
avatar

Is the search for God meaningless if we all die alone?

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

Gideon Weems
Member #3,925
October 2003

It's good to confirm every once in a while that one doesn't have epilepsy.

... Also, I'd almost forgotten about those ads.

Slartibartfast
Member #8,789
June 2007
avatar

bamccaig
Member #7,536
July 2006
avatar

Anybody know how to auto increment part of a composite primary key based on the other unique components of the key? I have a 3 part composite key composed of a student name , a course name, and an attempt number. (It's a made up Exam table). I need to auto increment the attempt number based on the unique set of student name and course name.

This just sounds like a poorly designed data model. :-/ There should be a student table for student information (including their names), a course table for course information (including their names), and perhaps an intersection between them that would effectively capture your "attempts" in a dynamic way (i.e., count the number of records grouped by student and course). You may want a table to hold course information distinctly and a separate table to associate courses with specific "runs" (e.g., "Computer Programming 101" beginning September 4th, 2014 and ending January 31st, 2015 taught by Mr. Hackz Leetsauce in room M2051). Grouping and counting might not be ideal for the "attempts" (if that even practically matters), but you could always cache the answer in an intersection table between student and course.

In any case, it seems to me that you could use more tables. >:( I am inclined to agree with AMCerasoli that having a "composite" key in this case probably isn't very useful either. You could always add a unique index if you wanted to enforce uniqueness amongst those fields, but having a single integer primary key is otherwise useful to reference specific records without having to carry around several pieces of information in code. Just because those fields make the record unique doesn't necessarily mean that they should compose the primary key (it doesn't mean that they shouldn't either, but at least in my example above your key would consist of several integer keys instead of strings). :-/

That's not how you database. >:(

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

bamccaig said:

That's not how you database. >:(

Pull the corncob out of your butt bc. It's a contrived database just so we can work with JDBC and database connections. I know its not normalized and I know it's not a good design. It was just a made up example of an Exam table for a lab in Java II. :-*

bamccaig
Member #7,536
July 2006
avatar

A corncob, you say. Intriguing. :-* It was a poorly made up Exam table for a lab in Java II. >:(

This sounds a bit like homework. >:( I still think that my previous post contains the best answer you'll get, however subtle it may be.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Yes please, let's split up a totally made up database table into 3 tables so I have to join them together to get my results. :/ The teacher was satisfied that I met the requirements for the lab, so that's really all there is to say. It wasn't about proper database design, but about using JDBC to retrieve and set data in a database. :/

Edit - I already came up with a solution that works. I made the composite key hold only the student and course name, and then SELECT'ed unique combinations and counted the number of occurences so I could get the proper attempt number into the database.

bamccaig
Member #7,536
July 2006
avatar

{"name":"h14E2A55A","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/6\/f69804312463aa134dfe22aa33a2c888.jpg","w":500,"h":375,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/6\/f69804312463aa134dfe22aa33a2c888"}h14E2A55A

William Labbett
Member #4,486
March 2004
avatar

something

np

Derezo
Member #1,666
April 2001
avatar

Turned 29 on Wednesday.

Today is last day of class. Start again on May 5th, teaching the same material, but have more hours next semester.

"He who controls the stuffing controls the Universe"

 1   2   3   4 


Go to: