If you can read this, either the style sheet didn't load or you have an older browser that doesn't support style sheets. Try clearing your browser cache and refreshing the page.

(Fark)   Fark Geek Forum   (fark.com) divider line 7048
    More: Misc  
•       •       •

13099 clicks; posted to Geek » on 06 Feb 2007 at 5:32 PM (7 years ago)   |  Favorite   |  Watch    |   share:  Share on Twitter share via Email Share on Facebook   more»



7048 Comments   (+0 »)
   

First | « | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | » | Last
 
  2008-09-25 09:10:20 PM
Mike: don't make me stop this car, kids!

they started it!
 
  2008-09-26 11:21:16 AM
Got an SQL question for you folks.

I have two tables, Student and Scores

Student
+----+------+-------+
| id | name | grade |
+----+------+-------+
| 1 | Bob | 11 |
| 2 | Mary | 11 |
| 3 | Tim | 12 |
| 4 | Lisa | 12 |
| 5 | Gary | 10 |
| 6 | Leah | 10 |
| 7 | Dean | 11 |
| 8 | Lori | 10 |
| 9 | Don | 12 |
...

Score
+----+------------+-------+
| id | student_id | score |
+----+------------+-------+
| 1 | 4 | 100 |
| 2 | 3 | 98 |
| 3 | 3 | 97 |
| 4 | 3 | 86 |
| 5 | 4 | 92 |
...

I want to list ONLY the top 3 scores for EACH student in grade 12 like so:
+------+-------+
| name | score |
+------+-------+
| Tim | 98 |
| Tim | 97 |
| Tim | 86 |
| Lisa | 100 |
| Lisa | 92 |
...

What would my SQL statement be?

I'm sure it's simple but I've never had to use SQL since I'm an RPG programmer. In RPG I'd just READ a logical file over the Student table that only contained grade 12 students and then do a READE on a logical file over the Score table where the records were sorted by student_id, score desc.
 
  2008-09-26 07:51:27 PM
Benny_Hill: Got an SQL question for you folks.

I have two tables, Student and Scores

Student
+----+------+-------+
| id | name | grade |
+----+------+-------+
| 1 | Bob | 11 |
| 2 | Mary | 11 |
| 3 | Tim | 12 |
| 4 | Lisa | 12 |
| 5 | Gary | 10 |
| 6 | Leah | 10 |
| 7 | Dean | 11 |
| 8 | Lori | 10 |
| 9 | Don | 12 |
...

Score
+----+------------+-------+
| id | student_id | score |
+----+------------+-------+
| 1 | 4 | 100 |
| 2 | 3 | 98 |
| 3 | 3 | 97 |
| 4 | 3 | 86 |
| 5 | 4 | 92 |
...

I want to list ONLY the top 3 scores for EACH student in grade 12 like so:
+------+-------+
| name | score |
+------+-------+
| Tim | 98 |
| Tim | 97 |
| Tim | 86 |
| Lisa | 100 |
| Lisa | 92 |
...

What would my SQL statement be?

I'm sure it's simple but I've never had to use SQL since I'm an RPG programmer. In RPG I'd just READ a logical file over the Student table that only contained grade 12 students and then do a READE on a logical file over the Score table where the records were sorted by student_id, score desc.


SELECT name, grade.score FROM students INNER JOIN grade ON students.id=grade.student_id ORDER BY name, score DESC;


Will get you the information you want. Not sure how to limit it to three each by name yet.
 
  2008-09-26 09:17:31 PM
It sounds like something out of one of Joe Celko's books... but my copies aren't here and my brain is dropping bytes.
 
  2008-09-26 11:28:34 PM
MusicMakeMyHeadPound: SELECT name, grade.score FROM students INNER JOIN grade ON students.id=grade.student_id ORDER BY name, score DESC;


Will get you the information you want. Not sure how to limit it to three each by name yet.


A friend of mine gave me this (which is I believe is MSSQL specific):
SELECT DISTINCT st.name, sc.score
FROM student st INNER JOIN Score sc ON st.id = sc.id
WHERE st.grade = 12 AND sc.score IN (SELECT top 3 score FROM score WHERE score.ID = sc.id ORDER BY score desc)
ORDER BY st.name

I turned it into something like this for MySQL:
SELECT DISTINCT st.name, sc.score
FROM student AS st INNER JOIN Score AS sc ON st.id = sc.id
WHERE st.grade = 12 AND sc.score IN (SELECT sc.score FROM score WHERE score.id = sc.id ORDER BY score desc LIMIT 0,3)
ORDER BY st.name

Unfortunately MySQL didn't like the LIMIT clause in the subquery. I noodled it around for a while and was able to figure out a different way to solve the problem - I convinced my pointy-haired boss it would be better to see all the scores rather than just the top 3 :-)

Of course I'm not actually working with students and scores but you know what I mean.

Thanks for taking the time to think about it MMMHP!
 
  2008-09-27 02:46:27 AM
Service pack three is raping my xp box right now. It's wonder I can even post on the internets from the goddamned thing before it locks everything up. FARK THIS.

I figured I'd let automatic updates tell me when I could get it instead of trying to get it early, but apparently they didn't bother to make it work correctly, ever. If I ever stop gaming, I'll never set e-foot inside a windows box again. *sigh*
 
  2008-09-27 03:11:43 AM
If you boot to safe mode, assuming the machine stays stable enough, you can remove sp3 there.
Then I'd suggest virus/spyware/etc scanning the machine, and updating all your drivers before trying to install again.
You maybe even want to run a repair install from your original XP media.

SP3 has worked correctly on most of the machines I've put it on, and 100% of the clean installs I've put it on.
 
  2008-09-27 03:41:08 AM
No_47: Then I'd suggest virus/spyware/etc scanning the machine, and updating all your drivers before trying to install again.

That's what I'm doing now. Should have known.
 
  2008-09-27 11:35:55 AM
what version of mysql?
 
  2008-09-27 12:21:31 PM
Mike: what version of mysql?

5.0.51a

I found some documentation (pops) on the mysql website that mentioned my problem specifically but it didn't say anything about when they might have it fixed.

There IS a workaround apparently. A fellow posted his method of getting around it at the bottom of the page.
 
  2008-09-27 08:46:59 PM
gayb: Service pack three is raping my xp box right now. It's wonder I can even post on the internets from the goddamned thing before it locks everything up. FARK THIS.

I figured I'd let automatic updates tell me when I could get it instead of trying to get it early, but apparently they didn't bother to make it work correctly, ever. If I ever stop gaming, I'll never set e-foot inside a windows box again. *sigh*


Cedega and Wine.
 
  2008-09-27 08:49:01 PM
Man On Fire: Cedega and Wine.

Never works properly.
And why would anyone, anyone, pay a monthly subscription for a program to sort-of run games on Linux when they already have a Windows OS?
and have I mentioned directx 10? Because DirectX 10.
 
  2008-09-28 01:57:10 AM
Man On Fire: Cedega and Wine.

I'm trying. My natural stupidity is dragging the learning process out a bit. Did get photoshop to work the other day, that was awesome. That's like an hour a day less spent in windows.

To me windows isn't the devil or anything, but all linux all the time is still the goal.
 
  2008-10-01 09:11:15 PM
Dumb question: any (simple) way to use a grease monkey script to make a set page (the fark homepage is what I intend) meta refresh? I don't know all that much html/ect

Also, if I did this would it spaz out and lose my page if I was disconnected from the internet? If it like tried to refresh without internet

/:D boondocks has rickroll music
 
  2008-10-02 04:51:19 PM
I'm not sure if this has been added by an extension I'm using or if it's part of Firefox, but try
Right Click anywhere on page -> Reload Every -> (choose time)
Right Click anywhere on page -> Reload Every -> Enable

and yeha I think it 404s when you go offline
 
  2008-10-02 05:31:35 PM
Wow. I suck.

If any of you remember I've been trying to fix this guys computer. I went ahead and made the hard drive one big partition, (it was a small 33 mb partition and then one 55 gb partition) reformatted, and installed XP Home using the disks Dell provided. I figured that it would not do any harm to delete the utility partition, as I figured the malware he had installed had probably found it's way into everything.

Now, when I turn on the computer, I am asked to choose between operation systems Windows XP Home or Windows XP Home. I've booted into both and they seem to be the very same. When I go into either it shows that there is 55 gb of remaining space.

I pretty much want to make it so that he doesn't have to "choose."

What uh, what should I do?
 
  2008-10-02 05:54:28 PM
TehNacho: Wow. I suck.

If any of you remember I've been trying to fix this guys computer. I went ahead and made the hard drive one big partition, (it was a small 33 mb partition and then one 55 gb partition) reformatted, and installed XP Home using the disks Dell provided. I figured that it would not do any harm to delete the utility partition, as I figured the malware he had installed had probably found it's way into everything.

Now, when I turn on the computer, I am asked to choose between operation systems Windows XP Home or Windows XP Home. I've booted into both and they seem to be the very same. When I go into either it shows that there is 55 gb of remaining space.

I pretty much want to make it so that he doesn't have to "choose."

What uh, what should I do?


Right click My Computer, Properties, Advanced tab, Startup and Recovery, then set the Default Operating System to one of the WinXP Home installs, then set the display OS list to 1 or 0.
Done.
 
  2008-10-02 05:58:01 PM
Fenis-Wolf:
Right click My Computer, Properties, Advanced tab, Startup and Recovery, then set the Default Operating System to one of the WinXP Home installs, then set the display OS list to 1 or 0.
Done.


If you're ever in Phoenix, Phil owes you a beer.
 
  2008-10-02 06:34:53 PM
Crap. Now I'm trying to get all the devices reinstalled.

Jackasses at Dell sent a random driver disk, and I've tried all of the audio drivers on it, and not one of them work.
 
  2008-10-02 06:38:04 PM
Oh wow! The networking device works just fine!

Off to Dell.com to get shiat downloaded.
 
  2008-10-02 07:20:13 PM
I'd just open boot.ini and delete the second Windows entry

also
this guy's retailer told him to take his two month old computer to a tech because it's a software fault.
i34.tinypic.com
(the RAM also faults at 514MB but that's not onscreen)
Fridays are always bad.
 
  2008-10-02 10:59:32 PM
yeah, that ain't software :)

If you're very very lucky you can just reseat the dimms. Unlikely though given that you've got 8 bad bits, probably a whole chip on the dimm blew out.
 
  2008-10-04 08:04:57 AM
No_47: I'm not sure if this has been added by an extension I'm using or if it's part of Firefox, but try
Right Click anywhere on page -> Reload Every -> (choose time)
Right Click anywhere on page -> Reload Every -> Enable

and yeha I think it 404s when you go offline


Sounds like what I need, but not a default part of firefox-any idea what extension that might be?
 
  2008-10-04 08:06:38 AM
Shiat-my farky's acting up too, speaking of FF extentions, any idea why farky 1.11 would be hiding random threads? I have no filters set up...
 
  2008-10-04 08:49:12 AM
Barakku: Shiat-my farky's acting up too, speaking of FF extentions, any idea why farky 1.11 would be hiding random threads? I have no filters set up...

You might email 920 about it. I think he's got a working, up-to-date version. He usually hooks up LPers, but I haven't used it in a while, so am not really paying attention. Looks like getfarky.com is still up too, but you appear to have the latest version.
 
  2008-10-04 12:39:59 PM
Barakku: No_47: I'm not sure if this has been added by an extension I'm using or if it's part of Firefox, but try
Right Click anywhere on page -> Reload Every -> (choose time)
Right Click anywhere on page -> Reload Every -> Enable

and yeha I think it 404s when you go offline

Sounds like what I need, but not a default part of firefox-any idea what extension that might be?


the Reload Every Firefox plugin.
 
  2008-10-04 11:19:07 PM
My desktop went pop, a capacitor gave way from what I can see (one is bulged with liquid coming out). Does anyone know if I can just build a new PC and plug my old HD in and have it boot up? Or will the NTSF file system have a cow if it sees a new MB and CPU?
 
  2008-10-04 11:31:36 PM
It won't care, except:

- It'll bluescreen on boot if it sees a different ATA/SATA chipset than the one the old board had, but, that can be worked around by booting in safe mode and changing the driver.

- If you go from a single-core CPU to a multi-core CPU you'll need to switch the HAL that Windows is using to get the second CPU going; that's not super simply to do, but it can be done...

- Obviously you'll need to reinstall drivers for anything onboard that's different, like the audio hardware, ethernet, video etc... that's easy though, provided you don't get stuck in a chicken-n-egg problem like having no ethernet and being unable to download ethernet drivers :)
 
  2008-10-04 11:42:28 PM
Thanks for the reply.
 
  2008-10-05 12:20:14 AM
You can also install an OS on a new HD, and slave the old HD to get your copious amounts of prawn off it.

That's not an answer to your question though.
 
  2008-10-05 01:05:10 AM
Befuddled: My desktop went pop, a capacitor gave way from what I can see (one is bulged with liquid coming out). Does anyone know if I can just build a new PC and plug my old HD in and have it boot up? Or will the NTSF file system have a cow if it sees a new MB and CPU?

If you have a Microsoft product, it might flip out over the hardware change. I hope you have your original activation key.
 
  2008-10-05 03:35:46 AM
AesopRock_00:
the Reload Every Firefox plugin.


I think it might be part of Tab Mix Plus (which I use to modify the appearance of tabs and placement of buttons - it's actually quite cool)


Also, referring to another question, I've found that NT-based windows rarely boots with a new motherboard. Even if a machine is running and you uninstall all the drivers first. It just bluescreens and there's no way to fix it.
 
  2008-10-05 05:07:00 AM
I'd also like to state, for the record, that there's no way in hell Kubuntu Intrepid is going to be ready by the 30th, and I suspect they'll drop back to KDE 3.5 sometime in the next couple of weeks.

This sh*t is buggy.
 
  2008-10-05 09:27:21 AM
No_47: Also, referring to another question, I've found that NT-based windows rarely boots with a new motherboard. Even if a machine is running and you uninstall all the drivers first. It just bluescreens and there's no way to fix it.

That's the ATA driver issue I was talking about; change it to "generic IDE" before swapping boards (or in Safe Mode) and it tends to go a lot better. Otherwise you can get an INACCESSIBLE_BOOT_DEVICE bluescreen...
 
  2008-10-05 02:17:40 PM
That not the usual bluescreen I get. I think it's 0x0000007B and/or 7E. Most of the time it doesn't even boot to safe mode.
 
  2008-10-05 06:03:05 PM
0x0000007B = INACCESSIBLE_BOOT_DEVICE :)
 
  2008-10-05 08:12:47 PM
I need some design help if anyone can right now -

I'm trying to use a font my client wants on her website, but it's not recognized when it goes online. What can I do?
 
  2008-10-05 08:25:55 PM
Mike: 0x0000007B = INACCESSIBLE_BOOT_DEVICE :)

ooooooooooooooh
can't say i've seen the text
 
  2008-10-05 08:29:33 PM
breatheophelia
I'm trying to use a font my client wants on her website, but it's not recognized when it goes online. What can I do?

Explain how the web works and that no visitor of the site will see it in the cool font if the visitor doesn't happen to have that cool font installed on their computer by coincidence?

That's why there are fall-back fonts in CSS.
 
  2008-10-06 01:07:13 AM
>:(

Font issues are my nemesis (I work in a small print shop).

Problems usually start when people use a medium for other than its intended purpose (i.e. using Excel or Visio to design a raffle ticket or postcard).

Admittedly, the web is more flexible and does evolve to meet unintended consequences...
 
  2008-10-06 09:55:07 AM
No_47: I'd also like to state, for the record, that there's no way in hell Kubuntu Intrepid is going to be ready by the 30th, and I suspect they'll drop back to KDE 3.5 sometime in the next couple of weeks.

This sh*t is buggy.


Would you care to elaborate? I haven't looked at Intrepid yet nor have I used KDE 4 with Hardy Heron. Are the bugs easily reproducible? Is it particular applications that are buggy or all of them?

Was/is Intrepid going to be a LTS release? I was just curious about that because Ubuntu Hardy Heron was an LTS but we Kubuntu users got a standard release.
 
  2008-10-06 01:46:06 PM
Would an acceptable solution be to use the font to make an image or something that preserves its visual integrity?
 
  2008-10-06 04:23:39 PM
Depends on how slow they want the page to load, and if they reeeeeally wanna use Photoshop to edit all their text vs using a text editor like everyone else...
 
  2008-10-06 08:52:14 PM
Late thanks for help with the firefox thing, not exactly what I wanted, but seems to not fark anything up.
 
  2008-10-07 12:27:57 AM
Mike: Depends on how slow they want the page to load, and if they reeeeeally wanna use Photoshop to edit all their text vs using a text editor like everyone else...

If they want it to load even slower, they could make every web page as a pdf.

Hey, that would solve the font issue.
 
  2008-10-07 03:37:53 PM
I've got a pc here that memtest failed on after 8 hours and 7 passes... with a "unexpected interrupt" "type: divide"

I don't really have any choice but to swap out hardware and run it for another 8 hours, do i?
 
  2008-10-07 11:36:08 PM
No_47: I've got a pc here that memtest failed on after 8 hours and 7 passes... with a "unexpected interrupt" "type: divide"

I don't really have any choice but to swap out hardware and run it for another 8 hours, do i?


Nope. Have fun with your dead RAM stick.
 
  2008-10-08 12:49:28 AM
Playing with a new laptop tonight, having some fun, have a question.

First, the fun Ive been having. :-) It came with a webcam built into the frame above the screen. I put real vnc on it, set it in my garage, and am now sitting in my computer room watching a cricket wander around the garage. Fun! Tomorrow Im going to set it by the lizard cage. They always scurry and hide when I walk by... I know theyre up to something...

Anyway, the question : How are these people finding their stolen laptops over the internet? Unless you set up something that did something like automatically emailed yourself once a day, how would you get it back?
 
  2008-10-08 03:52:11 AM
nosajghoul:
Anyway, the question : How are these people finding their stolen laptops over the internet? Unless you set up something that did something like automatically emailed yourself once a day, how would you get it back?


I think they were using Back to My Mac
 
  2008-10-08 10:57:23 AM
nosajghoul: How are these people finding their stolen laptops over the internet?

Undercover, if it's a Mac. (orbicule.com doesn't allow me to hotlink it here)
 
Displayed 50 of 3013 comments

First | « | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | » | Last


 
   Forgot password? Create an account to make comments
  Use HTML Buttons
If you can see this, something's wrong with your browser's CSS support.
 
Before posting, please take a minute to review our posting rules and our legal/privacy policy.
By posting, you agree to these terms.
Got questions about Fark? See our FAQ.

Continue Farking
Submit a Link »






Report