|
uncurable mlady posted:array.sort()
|
# ? Dec 24, 2014 05:32 |
|
|
# ? May 13, 2024 08:12 |
|
Bloody posted:Didn't they ask you to email them the answer when you got home? What the gently caress is that. Maybe they don't know and are looking for help.
|
# ? Dec 24, 2014 05:34 |
|
i think it was more just a casual joke like 'whatever obv we dont care hecan email the answer lol' and they dont really expect you to do it. but you probably should anyhow maybe
|
# ? Dec 24, 2014 05:39 |
|
Find the answer on stack sex change and email them the link
|
# ? Dec 24, 2014 05:42 |
|
a terrible programmer question, why does the regex, code:
"-test -test1 -test2 test-3"
|
# ? Dec 24, 2014 05:46 |
|
Valeyard posted:a terrible programmer question, why does the regex, pretty sure that regex over the given input matches the "-test -test1 -test2 " part. the capturing group inside the regex, of course, will be filled in with whatever the value was the last time it matched - i.e. "test2". what you actually want to be doing is
|
# ? Dec 24, 2014 05:55 |
|
i'm trying to play around with redmine plugins and wtc plugins are github repositories with no branches everything is version 0.1 when you have incompatible dependencies using rake, are you really supposed to 'just comment some of them out' if somebody knows something that is more jenkins speed (still fragile, but i install plugins by clicking on things) that would be super
|
# ? Dec 24, 2014 05:55 |
|
Brave GNU World posted:[0, 1, 10, ..., 19, 2, 20, ...] we'll fix it in the point release
|
# ? Dec 24, 2014 05:56 |
|
Brain Candy posted:i'm trying to play around with redmine plugins and wtc this is why I always wonder why people like ruby on rails
|
# ? Dec 24, 2014 06:05 |
|
Jabor posted:pretty sure that regex over the given input matches the "-test -test1 -test2 " part. the capturing group inside the regex, of course, will be filled in with whatever the value was the last time it matched - i.e. "test2". ah, yes. for some reason i was expecting the group to be matched several times, but that makes sense Jabor posted:what you actually want to be doing is i guess i could just split up the string at whitespace, check each token to see if it matches , and then join the non matches, cheers
|
# ? Dec 24, 2014 06:08 |
|
hobbesmaster posted:this is why I always wonder why people like ruby on rails It's really been falling out of favor and will probably end up becoming the legacy poo poo no one wants to deal with when companies/clients are still somehow on rails 2/3
|
# ? Dec 24, 2014 06:12 |
|
i work at a place that has code dating back to rails 1.0. no one here is like, gently caress ruby, but every new major undertaking is a service of some kind and every one of those services is not in ruby or rails.
|
# ? Dec 24, 2014 06:30 |
|
MALE SHOEGAZE posted:i work at a place that has code dating back to rails 1.0. no one here is like, gently caress ruby, but every new major undertaking is a service of some kind and every one of those services is not in ruby or rails. uhh yeah so that is a total "gently caress ruby" situation they are so deep in "gently caress ruby" it doesn't even have to be spoken aloud. an infinite echo of "gently caress ruby" is the background radiation from the creation of the firm. "gently caress ruby" is the medium in which all other thoughts are expressed in other words, you may be working with grownups.
|
# ? Dec 24, 2014 06:37 |
|
so ok say I have a really loving long array of things. now I want to print these things out once and only once, but I want to do it "randomly" , by which I mean I don't care if it's actually random but I want them to print out sort of evenly, not all in a row or clustered or whatever. my current idea is to take a number relatively prime to the length and around 20% of the length and loop through the array using the prime index to increment the loop counter, wrapping on overflow of the array length. this works fine in my simulations but I don't know how to prove it will eventually print every element exactly once. any ideas? this may be more of a bad mathematican thread idk. I am also open to other solutions.
|
# ? Dec 24, 2014 06:42 |
|
MALE SHOEGAZE posted:i think it was more just a casual joke like 'whatever obv we dont care hecan email the answer lol' and they dont really expect you to do it. but you probably should anyhow maybe i thought it was, until they said "email us the answer and we'll let you know what we decide", so I did, and they got back to me 10 minutes later
|
# ? Dec 24, 2014 06:44 |
|
Valeyard posted:ah, yes. for some reason i was expecting the group to be matched several times, but that makes sense you really should just use a library you're hurting your future self working on the same problem by saying you can do this because you've done it before
|
# ? Dec 24, 2014 06:48 |
|
rotor posted:so ok say I have a really loving long array of things. now I want to print these things out once and only once, but I want to do it "randomly" , by which I mean I don't care if it's actually random but I want them to print out sort of evenly, not all in a row or clustered or whatever. shuffle things use poisson distribution number of things for lines until you run out of things
|
# ? Dec 24, 2014 06:52 |
|
the array is so long that sorting it will incur a significant performance penalty that I would rather not pay
|
# ? Dec 24, 2014 06:55 |
|
rotor posted:the array is so long that sorting it will incur a significant performance penalty that I would rather not pay or shuffling it
|
# ? Dec 24, 2014 06:56 |
|
Are we talking "won't fit in memory" long, or billions of elements long or smaller?
|
# ? Dec 24, 2014 07:01 |
|
rotor posted:so ok say I have a really loving long array of things. now I want to print these things out once and only once, but I want to do it "randomly" , by which I mean I don't care if it's actually random but I want them to print out sort of evenly, not all in a row or clustered or whatever.
|
# ? Dec 24, 2014 07:04 |
|
rotor posted:my current idea is to take a number relatively prime to the length and around 20% of the length and loop through the array using the prime index to increment the loop counter, wrapping on overflow of the array length. it's fine. if you have p coprime n then i*p mod n for i in [0,n) will generate every value in [0,n) exactly once. this is because the finite groups <Z mod n, +> are cyclic with any integer p coprime n as a generator of that group, which should give you enough to google on if you want to see the actual proof
|
# ? Dec 24, 2014 07:04 |
|
rotor posted:or shuffling it Fisher-Yates is O(n) so if you mean you want print while the thing is running, it has a bit where it exchanges stuff but instead you could print to whatever and increment a newline counter
|
# ? Dec 24, 2014 07:08 |
|
not sure yet, so assume the former I guess definitely some billions
|
# ? Dec 24, 2014 07:09 |
|
Menacer posted:i may be wrong, but I believe this is a simple form of a linear congruential generator. With a==1, c=={your co-prime number}, and m=={your large array}. in this case, you meet the guarantee to have a maximum period (meaning you will generate all numbers between 0 through m-1 before repeating) so long as c is co-prime with m. ShoulderDaemon posted:it's fine. if you have p coprime n then i*p mod n for i in [0,n) will generate every value in [0,n) exactly once. this is because the finite groups <Z mod n, +> are cyclic with any integer p coprime n as a generator of that group, which should give you enough to google on if you want to see the actual proof woot thx guys, my intuition said it was right but I couldn't find the way to a proof
|
# ? Dec 24, 2014 07:11 |
|
also: menacer spotted
|
# ? Dec 24, 2014 07:12 |
|
yeah i was thinking just fisher yates. otherwise i think you need to know something about the ordering of the array.
|
# ? Dec 24, 2014 07:14 |
|
rotor posted:so ok say I have a really loving long array of things. now I want to print these things out once and only once, but I want to do it "randomly" , by which I mean I don't care if it's actually random but I want them to print out sort of evenly, not all in a row or clustered or whatever. it will work, look up finite cyclic groups
|
# ? Dec 24, 2014 07:15 |
|
Valeyard posted:ah, yes. for some reason i was expecting the group to be matched several times, but that makes sense Are you still using Haskell? For the love of god, don't use non-trivial regexes.
|
# ? Dec 24, 2014 10:13 |
|
Joe Law posted:my favorite dumb coding question that ive been asked is: this is more of a coding trick question than a coding question
|
# ? Dec 24, 2014 11:07 |
|
is git only popular because it was written by ace programmer Linus torvalds
|
# ? Dec 24, 2014 11:26 |
|
I think it's because of github
|
# ? Dec 24, 2014 11:36 |
|
gonadic io posted:Are you still using Haskell? For the love of god, don't use non-trivial regexes. wait if you're using haskell and you want to roll your own thing like this why the heck aren't you using parsec instead of regexes
|
# ? Dec 24, 2014 14:38 |
|
lmbo I got let go for being sick near christmas, so yay! Apparently doing 2x my assigned tickets but not asking for more work fast enough looks bad. Also making someone with zero dev or management experience a PM and letting her make calls on effort is not a bad idea, nope. I've never left a bad job so soon but I think they did me a favor at this point. Edit: Yeah, after the initial shock and insult wore off, this is probably going to be worth it in the end. My god what a disaster. Space Whale fucked around with this message at 15:31 on Dec 24, 2014 |
# ? Dec 24, 2014 15:14 |
|
Joe Law posted:my favorite dumb coding question that ive been asked is: for each datInt in array { array[datInt] = datInt; /// I'm lazy and running a fever so this might not work but just make a second array for 2n space complexity! }
|
# ? Dec 24, 2014 15:17 |
|
Space Whale posted:lmbo I got let go for being sick near christmas, so yay! source your quotes
|
# ? Dec 24, 2014 15:32 |
|
Bloody posted:Find the answer on stack sex change and email them the link One of my greatest failures as an Experts Exchange employee was when Stack Overflow came up with Stack Exchange and I was unable to convince the bosses to call a new product Expert Overflow to get revenge on them.
|
# ? Dec 24, 2014 16:25 |
|
I don't know the difference between snack overflow and stack sex change
|
# ? Dec 24, 2014 20:12 |
|
gonadic io posted:Are you still using Haskell? For the love of god, don't use non-trivial regexes. no no not haskell, this is a django web project so python. what i was trying to do is extend the command shortcuts used in search engines, its nothing critical
|
# ? Dec 24, 2014 20:19 |
|
|
# ? May 13, 2024 08:12 |
|
Bloody posted:I don't know the difference between snack overflow and stack sex change stack sex change is a collection of question-answer websites on a variety of subjects. snack overflow is the programming specific site.
|
# ? Dec 24, 2014 21:16 |