SV650.org - SV650 & Gladius 650 Forum



Idle Banter For non SV and non bike related chat (and the odd bit of humour - but if any post isn't suitable it'll get deleted real quick).
There's also a "U" rating so please respect this. Newbies can also say "hello" here too.

Reply
 
Thread Tools
Old 13-08-08, 03:39 PM   #11
SoulKiss
Member
Mega Poster
 
SoulKiss's Avatar
 
Join Date: Jul 2006
Location: Sunny Croydonia
Posts: 6,124
Default Re: Hashes of Arrays, who'd have 'em

Quote:
Originally Posted by Baph View Post
It's a reference to the 4 letter word...
Of course, silly me - you want sweet, salt, natural or cheese popcorn ?
__________________
Sent from my PC NOT using any Tapatalk type rubbish!!

█╬╬╬╬()i¯i▀▀▀▀▀█Ξ███████████████████████████████)
SoulKiss is offline   Reply With Quote
Old 13-08-08, 03:45 PM   #12
Baph
Guest
 
Posts: n/a
Default Re: Hashes of Arrays, who'd have 'em

Quote:
Originally Posted by SoulKiss View Post
Of course, silly me - you want sweet, salt, natural or cheese popcorn ?
for (i=0; i<boxes.length; i++) if (boxes[i] == sweet) System.out.println("I'll take that one...");


Sorry 2mths, couldn't resist.
  Reply With Quote
Old 13-08-08, 04:20 PM   #13
2mths
Guest
 
Posts: n/a
Default Re: Hashes of Arrays, who'd have 'em

Hmm not entirely sure I understand what you're getting with that last Baph

For me it'd have been something like...

perl -e while (@boxes ) { if ($_ =~ /sw/) { print "$_ for me please!" } }

Or some such (there being a _lot_ of different ways you could approach that)

As for too many asterisk, I didn't but asterisks there and there were just enough to disguise something similar to bar stewards.

The 'thing' (graphing module) I'm trying to use requires that the plot data be fed to it as an array of arrays (I think). Said data is coming from a db query. So I'm trying to populate the different arrays on the fly. That took me long enough to work out. Then I realised that I needed another array containing my x-axis values. In trying that a) I broke what I had got working and b) my brain fell over so I swore at you lot and went home.

I could do what I need to do by writing a very namby pampy script which runs several queries and processes the output of each to prepare my data. But I'm trying to develop my scripting and write something a little more mature that does it in one go (trivial to some I'm sure).

Anyway I'm home now and about to kill some sprites in CoD4 till I feel better.

Last edited by 2mths; 13-08-08 at 04:32 PM.
  Reply With Quote
Old 13-08-08, 04:23 PM   #14
Baph
Guest
 
Posts: n/a
Default Re: Hashes of Arrays, who'd have 'em

Quote:
Originally Posted by 2mths View Post
Hmm not entirely sure I understand what you're getting with that last Baph

For me it'd have been something like...

for ($i=0, $i<$totalSweets, $i++) {
Linguistic difference.

However, why bother looping around totalSweets? If you've named the variable properly, surely that's an array containing all boxes of sweet popcorn? Why not just treat it as a FIFO structure instead of looping?

Last edited by Baph; 13-08-08 at 04:23 PM. Reason: spelling
  Reply With Quote
Old 13-08-08, 04:26 PM   #15
Grinch
Guest
 
Posts: n/a
Default Re: Hashes of Arrays, who'd have 'em

Pardon?
  Reply With Quote
Old 13-08-08, 04:29 PM   #16
Filipe M.
Guest
 
Posts: n/a
Default Re: Hashes of Arrays, who'd have 'em

Quote:
Originally Posted by Grinch View Post
Pardon?
Nothing to do with cake, don't worry.
  Reply With Quote
Old 13-08-08, 04:35 PM   #17
2mths
Guest
 
Posts: n/a
Default Re: Hashes of Arrays, who'd have 'em

Quote:
Originally Posted by Baph View Post
Linguistic difference.

However, why bother looping around totalSweets? If you've named the variable properly, surely that's an array containing all boxes of sweet popcorn? Why not just treat it as a FIFO structure instead of looping?
I didn't mean to post what you saw - that was my first error. The second was misunderstanding what you were getting at, I subsequently worked out more of what you'd done by reading the quote of SK for some context.

No idea what about FIFO structures (I can work out what it stands for but that's not helping) so looping is all I've got.

Last edited by 2mths; 13-08-08 at 04:38 PM.
  Reply With Quote
Old 13-08-08, 04:38 PM   #18
timwilky
Member
Mega Poster
 
timwilky's Avatar
 
Join Date: Mar 2004
Location: Not in Yorkshire. (Thank God)
Posts: 4,116
Default Re: Hashes of Arrays, who'd have 'em

What is the problem, I cut my teeth coding assembly language on VAX computers many years ago. so multiple levels of indirection with offset etc. piece of ****.

You then get to c type pointer arrays, so effectively create multi dimensional arrays and multi size etc.

You them move into things like java collections and arrays etc. But now you no longer have those nice pointers that allowed you to do fancy tricks, like stepping through arrays etc using pointer arithmetic.

So explain what is doing your head in, and we will try to help.

but first read the manual young man, then read it again. there is nothing worse than getting somebody to show you how, because you will just not remember.
__________________
Not Grumpy, opinionated.
timwilky is offline   Reply With Quote
Old 13-08-08, 04:40 PM   #19
timwilky
Member
Mega Poster
 
timwilky's Avatar
 
Join Date: Mar 2004
Location: Not in Yorkshire. (Thank God)
Posts: 4,116
Default Re: Hashes of Arrays, who'd have 'em

BTW FIFO = first in first out, as opposed to last in first out etc.
__________________
Not Grumpy, opinionated.
timwilky is offline   Reply With Quote
Old 13-08-08, 04:42 PM   #20
Luckypants
Moderator
Mega Poster
 
Luckypants's Avatar
 
Join Date: Jul 2003
Location: Nr Ruthin
Posts: 7,079
Default Re: Hashes of Arrays, who'd have 'em

Quote:
Originally Posted by timwilky View Post
BTW FIFO = first in first out, as opposed to last in first out etc.
AKA a queue to us oldies.
__________________
"Your Viffer sounds like it is raising hell! Spot on." - Witchery 17/4/08
Snow Plough Appreciation Society - Member #3

Luckypants is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Friends, Who'd have 'em? Stu Idle Banter 22 10-12-08 11:12 PM
Who'd have thought? licoricepizza Idle Banter 0 22-11-07 03:51 PM
Who'd be up for.......? independentphoto SV Ecosse 51 02-09-07 07:52 AM
Who'd be in sales! Mogs Idle Banter 3 12-02-07 04:01 PM
Who'd like one of these.. kciN Idle Banter 7 02-08-06 08:52 PM


All times are GMT. The time now is 08:06 PM.


Powered by vBulletin® - Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.