|
all good things come to an end
|
# ? May 18, 2012 15:45 |
|
|
# ? May 9, 2024 09:05 |
|
rotor posted:finding the end of an array is an exceptional condition so what you're saying is that it works best if the enumeration loop knows what it's enumerating over, so you can have one version for arrays and other bounded collections and one for IO that reads until exhausted, but both present the same API to higher-level code so you don't have to care?
|
# ? May 18, 2012 15:47 |
|
but then you get the movies and janeway is an admiral!?!?!? makes no sense
|
# ? May 18, 2012 15:47 |
|
man I can't wait to find out what happens when this thread discovers the semipredicate problem
|
# ? May 18, 2012 15:57 |
|
tef posted:man I can't wait to find out what happens when this thread discovers the semipredicate problem that's pretty much php_library.txt
|
# ? May 18, 2012 15:58 |
|
Panic! At The cisco posted:that's pretty much php_library.txt i assume you say this because that is a completely solved problem in php? (also mega lol @ exceptions when you hit the end of a loop. python is such a bad language)
|
# ? May 18, 2012 16:03 |
|
BonzoESC posted:so what you're saying is that it works best if the enumeration loop knows what it's enumerating over, so you can have one version for arrays and other bounded collections and one for IO that reads until exhausted, but both present the same API to higher-level code so you don't have to care? I think his point is traversing a finite collection and finding the end isn't exceptional behaviour, it's expected behaviour use the same API for I/O if you like but obviously reaching the end of a stream could be expected (web request) or exceptional (market data stream) depending on the application tef posted:man I can't wait to find out what happens when this thread discovers the semipredicate problem I think capn crunch showed in-band signaling is a bad idea skeevy achievements fucked around with this message at 16:27 on May 18, 2012 |
# ? May 18, 2012 16:23 |
|
Tiny Bug Child posted:i assume you say this because that is a completely solved problem in php? yeah
|
# ? May 18, 2012 16:31 |
|
BonzoESC posted:so what you're saying is that it works best if the enumeration loop knows what it's enumerating over, so you can have one version for arrays and other bounded collections and one for IO that reads until exhausted, but both present the same API to higher-level code so you don't have to care? the api they're complaining about is the one for IO
|
# ? May 18, 2012 16:49 |
|
python does it wrong always
|
# ? May 18, 2012 16:51 |
|
Janin posted:this is how python works, fyi nah they're at a lower level if they have to worry about exceptions from the array ending or does python have some kind of __~^each^~__(array, lambda{but only one expression}) function with a terrible name and tenuous object-orientedness?
|
# ? May 18, 2012 17:09 |
|
Shaggar posted:python does it wrong always this is getting pretty old, this isn't even shaggaring anymore. put some effort into it
|
# ? May 18, 2012 17:11 |
|
actually what gets old is people suggesting that python isnt total trash for idiots
|
# ? May 18, 2012 17:11 |
|
tef posted:man I can't wait to find out what happens when this thread discovers the semipredicate problem semipredicate yourself back to gbs
|
# ? May 18, 2012 17:55 |
|
Shaggar posted:actually what gets old is people suggesting that python isnt total trash for idiots GIT-R-DONE!!
|
# ? May 18, 2012 17:57 |
|
BonzoESC posted:nah they're at a lower level if they have to worry about exceptions from the array ending Iterators are for when you're looping over a value which doesn't have a fixed size, and might need to perform arbitrary IO to calculate the next element. And why would you ever want a lambda with more than one expression? If you really need to use statements in a loop for some horrible reason, just define a local procedure.
|
# ? May 18, 2012 18:29 |
|
Janin posted:And why would you ever want a lambda with more than one expression? If you really need to use statements in a loop for some horrible reason, just define a local procedure. Because using lambdas/blocks/anonymous functions as a building block for control structures is convenient code:
|
# ? May 18, 2012 18:38 |
|
In Python, it's more idiomatic to use existing control structures like 'if' or 'with', rather than inventing your own ad-hoc.code:
|
# ? May 18, 2012 19:09 |
|
Janin posted:In Python, it's more idiomatic to use existing control structures like 'if' or 'with', rather than inventing your own ad-hoc. Would kill for a 'where' construct though, so I could restrict the scope of the defined statements. That and real lexical scope.
|
# ? May 18, 2012 19:31 |
|
Janin posted:In Python, it's more idiomatic to use existing control structures like 'if' or 'with', rather than inventing your own ad-hoc. Oh yeah, Ruby doesn't have "with" built-in; implementing it is an exercise for the reader https://github.com/meh/ruby-with/blob/master/lib/with.rb
|
# ? May 18, 2012 19:39 |
|
Werthog posted:this is getting pretty old, this isn't even shaggaring anymore. put some effort into it
|
# ? May 18, 2012 20:06 |
|
BonzoESC posted:Oh yeah, Ruby doesn't have "with" built-in; implementing it is an exercise for the reader https://github.com/meh/ruby-with/blob/master/lib/with.rb What book/resource would you recommend for learning the details of ruby? It seems like a really cool language and I only know the basics atm
|
# ? May 18, 2012 20:06 |
|
BonzoESC posted:Oh yeah, Ruby doesn't have "with" built-in; implementing it is an exercise for the reader https://github.com/meh/ruby-with/blob/master/lib/with.rb clojure owns for this, I decided the language needed a switch statement based on regexes and so I added it, took about 15 lines of code tef how on a scale of 1-10 how much do you sneer at domain specific languages implemented in lisp dialects
|
# ? May 18, 2012 20:10 |
|
Sweeper posted:What book/resource would you recommend for learning the details of ruby? It seems like a really cool language and I only know the basics atm i never really used a book or a blog post about "metaprogramming" work with some libraries that use ruby cleverly and read their source if in doubt read the C source or the rubinius (ruby in ruby) source if still in doubt ask someone
|
# ? May 18, 2012 20:48 |
|
gently caress ruby, i'm using objectivist-c for my new bitcoin miner
|
# ? May 18, 2012 21:00 |
|
|
# ? May 18, 2012 22:33 |
|
looooool crosspost that in the pic thread man
|
# ? May 18, 2012 22:34 |
|
Toady posted:goddamnit... we actually get a handful of women in our clojure meet ups and it's very cool to see them not shunned and degraded. no one has been a tool bag to any of them (at least not in front of me or to their face), thank the baby jesus
|
# ? May 18, 2012 22:36 |
|
Otto Skorzeny posted:i like this nomenclature of just directly calling them quantitative and qualitative btw. the common custom of calling one h&p and the other p&h is annoying finally found my copy of quant to confirm this, but im old and used quant 3rd edition when they were still listed as "H&P" and i assume there's been some big academic because hennessy went into "management" while patterson stayed technical but idk if thats true
|
# ? May 18, 2012 22:40 |
|
seriouspostin: I haven't programmed in Java for a while and have a data structures related question. I have a ton of lines of the following types: [date, double] I want stored in some sort of list. This list I will never access randomly, I will only add to the end of it and access the list from beginning to end, one at a time. In addition, I will have 100s of these types of lists I want to access programatically. What data structure is best optimized for this type of usage? tia salted hash browns fucked around with this message at 23:25 on May 18, 2012 |
# ? May 18, 2012 23:17 |
|
Java List datatype picking flowchart: Do you want a List? y -> Use ArrayList
|
# ? May 18, 2012 23:18 |
|
Shaggar posted:Java List datatype picking flowchart: Shaggar was right This is like the only uses case for LinkedList, but frankly I don't think it will matter which of the two you choose.
|
# ? May 18, 2012 23:21 |
|
Toady posted:
|
# ? May 18, 2012 23:22 |
|
MEAT TREAT posted:Shaggar was right wait am I missing something, how do I do myArrayList.add(myDate, myDouble); ? salted hash browns fucked around with this message at 23:32 on May 18, 2012 |
# ? May 18, 2012 23:30 |
|
iamthexander posted:wait am I missing something, how do I do myArrayList.add(myDate, myDouble); ? lol you need to make a container object to put into the list or add them two at a time and traverse the list in double increments whatever
|
# ? May 18, 2012 23:33 |
|
Sweeper posted:lol you need to make a container object to put into the list eff i thought there was some magic i could do also what do you mean traverse the list in double increments
|
# ? May 18, 2012 23:35 |
|
ya, you've got to spend like 6 lines of code just to make some dumb class to hold 2 values and then 8 more lines for getters + setters if you don't want to piss off the java oop sperg gods. basically what im saying is that java is terrible.
|
# ? May 18, 2012 23:37 |
|
iamthexander posted:seriouspostin: arraylist might not be the best unless you know the sizes up front, do you know how big your lists need to be? can also use a generic Pair<U,T> class: http://code.google.com/p/totallylazy/source/browse/src/com/googlecode/totallylazy/Pair.java?r=ddc97667f03784cbf4db4906d2d09777926d0a17
|
# ? May 18, 2012 23:39 |
|
trex eaterofcadrs posted:arraylist might not be the best unless you know the sizes up front, do you know how big your lists need to be? I do, ~23500 items. Thinking LinkedArray might actually be the best here since I never need random access and only need to iterate through the whole thing. Any benefits to using a Pair class over creating my own shell class? Also new step: now lets say I have the following objects: code:
salted hash browns fucked around with this message at 00:06 on May 19, 2012 |
# ? May 18, 2012 23:54 |
|
|
# ? May 9, 2024 09:05 |
|
reallyprettymad posted:kill every white male computer professional
|
# ? May 18, 2012 23:55 |