« first day (1161 days earlier)      last day (2857 days later) » 

12:00 AM
RELOAD! There are 2526 unanswered questions (92.9035% answered)
 
0
Q: calculate sum of path of a binary tree

Lin MaWant to calculate all sum of all possible paths from root to leaf, each node has value of a integer number (decimal). In the following example, 1 / \ 2 4 / /\ 3 5 6 possible paths are (123, 145, and 146, which sum is 414). In this example, 12 is not a valid path since 2 is not a leaf node....

 
Might be a question appropriate for Code Review. — unor 21 secs ago
 
12:22 AM
@CaptainObvious That's a pretty nice PHP question, for a change
 
12:46 AM
This question should be asked on codereview.stackexchange.comfabianegli 5 secs ago
 
1:18 AM
0
Q: Custom Input split for unstructured data

atul guptai am planning to parse below file with spark, so i have written a custom input split , i want the values from hadoop to Spark as `commitId:committerName:file1,file2.... Format. As i am new to distributed paradigm so want to know if below code can work with spark or not to get the desired outp...

 
jrh
1:32 AM
You guys use some acronyms I'm not familiar with, I looked up TTQW and I found this meaningfor.com/what-does-stand-for/ttqw ... well... "The acronym TTQW has a life path number 8. Individuals that have the life path number eight are full of energy with an extraordinary ability for focus. Their confidence can fill a room."
it only gets more bizarre as you get farther down the page, I have no idea what's up with this page, it's like an astrology bot generated it or something
 
23
A: What's a Zombie? And what are the many other memes of Code Review?

Mat's MugMeme: [TTQW | TTGH] | TTGTB Originator: [attributed to] Simon André Forsberg (first TTQW here) Cultural Height: The 2nd Monitor Background: leaving the chatroom and/or going AFK isn't something we do often. These funky acronyms efficiently communicate that it's either time to quit work (or tim...

 
jrh
ah, okay. thanks
 
1:57 AM
TIL what :godmode: was made for!
this @Comintern guy is like Neo... he is The Matrix
 
2:09 AM
this WM_RUBBERDUCK_CHILD_FOCUS is a... custom Windows message he's injecting into the message pump so that we can raise an event when a docked toolwindow loses focus. way to work around an underfeatured API: talk to its mom instead.
 
2:23 AM
0
Q: A function that calls a function with variable number of parameters passed to both

TomOnTimeI have javascript code that repeats this pattern many times (though the values of INSTRUCTIONS and "a" are different each time). The number of elements in "INSTRUCTIONS" varies. var INSTRUCTIONS = [ 'LEFT', '90', 'FORWARD', '10', 'LEFT', '90']; var a = [ 'red', 'blue', 'newjersey', ]; fo...

0
Q: How can I make my code for Project Euler #5 more efficient and cleaner?

Ethan Watson2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? public class SmallestMultiple { public static void main(String[] args) { int ...

 
3:07 AM
0
Q: Raspberry Pi headless server using bash and USB automounting

dbmitchRevised from: Bash scripts and udev rules to handle USB auto mounting / unmounting Tested: Uses USB insert/remove to control a headless Raspberry Pi 3 with Raspian Jessie Lite Changes: Implement more functions Improve comments Modify if-fi exit handling Add optional flag for auto proces...

0
Q: On-the-fly destructors

JustinDue to my needing to use C libraries inside C++, I kept finding myself wanting to be able to ensure that the free function got called, even if an exception got thrown. UTILS_SCOPE_EXIT ensures that the function will be called at the end of scope. External documentation shows how to use it, and al...

 
3:33 AM
0
Q: Code in patched Cygwin for calculating path to command interpreter

KazI'm working on a fork of Cygwin for native Windows development. In this commit, I'm trying to improve the security of code that spawns cmd.exe, used by functions like system, popen. What I would like to focus on is this: static const char *cmd_exe_path = NULL; static void init_cmd_exe_path(vo...

 
4:11 AM
 
4:36 AM
0
Q: Count character replacements needed to make string a palindrome

Jae BradleyProblem Count the number of character replacements necessary to convert an input String to a palindrome. Each character replacement must replace the given character with the character directly before it in the alphabet (sorted A-Z). In other words, D can only be replaced with C. For simplicit...

 
4:55 AM
@user2296177 They can be any distance apart. Anywhere from 1 2 3 5 8 9 to 1 15 89 153 23514
In my particular scenario, the likelihood of them being sequential is very high at the beginning, and very low at the end. I.e.: 1 2 3 4 5 6 7 8 9 10 11 12 12853 1585832
 
5:30 AM
I'm voting to close this question as off-topic because it belongs on code review. — 2501 57 secs ago
 
5:45 AM
Monking !
Quote of the day: “Dynamic typing: The belief that you can’t explain to a computer why your code works, but you can keep track of it all in your head.” hehe ^_^
 
I'm just throwing in this link to codereview.stackexchange.com where these kind of questions belong to. — muXXmit2X 18 secs ago
 
0
Q: Check if a Sudoku board is filled out correctly

Stewie GriffinThe code below takes a filled out Sudoku board of size NxN, with sub-blocks of nxn, and checks if the solution is correct. main_function takes a board as input. This function calls check_rows and check_blocks. The first of the two is used to check both the rows and columns of the board. The seco...

 
@DanPantry the creator of Redux has 1k rep on CR! codereview.stackexchange.com/users/2634/dan
 
6:08 AM
So, your code works but you'd like to improve it? If this is the case, maybe codereview.stackexchange.com would be a better place for it. — zezollo 24 secs ago
 
6:18 AM
I'm voting to close this question as off-topic because this is a "code refactor" question which belongs on https://codereview.stackexchange.comOhgodwhy 26 secs ago
 
0
Q: Dynamic Programming: Optimal Solution for Number of Ways to get n

codeFreakA cricketer can score 1, 2, 4 or 6 in a ball. Find in how many ways the player can score a total of "n" runs without hitting 3 consecutive boundaries. Note: Scoring 4 or 6 is considered as a boundary. My solution is: int *arr; //global array to save calculated ways int waysUtil(int n, int boun...

 
6:31 AM
--Small question: Can I say this, or is this the wrong terminology? "...use native Python or use numpy". If I use Python without any modules, can I call it "native Python", or should I say something else?
or maybe "plain Python", "pure Python", just "Python"?
 
plain Python works
 
I also ran into "pure Python" formulation
pure / plain - Both of these work
 
ok :)
"Why is he calling it native Python"? Similarly, I think I call lists for vectors, since I'm used to Matlab.
 
@StewieGriffin you also have a module called array if you need it. But basically Python lists are very flexible and can hold completely heterogeneous, arbitrary data, and they can be appended to very efficiently, in amortized constant time
If you need to allocate an array that you KNOW will not change, then arrays can be faster and use less memory than lists. That's the only use-case where I'd use arrays instead of lists
 
@Dex'ter didn't know. I'll check it out =) Bu
 
6:45 AM
possible answer invalidation by christo8989 on question by christo8989: codereview.stackexchange.com/posts/134030/revisions
 
check it out here
 
But in the case where I need to do "strange" indexing, isn't numpy arrays better? If I have a list/array like this: x = [[1,2],[3,4]], and I want the elements [1,3], and [2,4], do you think it's best to use lists?
 
yes, that's not hard to do with lists. In general, numpy is used for large data handling
let's give you an example
 
The reason why I have used numpy in this question is due to these comments chat.stackexchange.com/transcript/message/30769715#30769715
 
it's not bad practice. I personally didn't use numpy so much
 
6:58 AM
@Dex'ter If you don't mind, a few comments/suggestions/improvements in an answer to the question I linked to would be very much appreciated. It seems like you know quite a lot more than I do =)
 
Sure, I'll just take a look and answer a lil' bit later ^^
 
Sure =) No rush!
It's not like I'm working on a project with a fast approaching deadline :P
 
:P oh I forgot about the example. You could achieve that with:
lst = [[1, 2], [3, 4]]
lst2 = [[y[0] for y in lst], [y[1] for y in lst]]
print(lst2)  # output: [[1, 3], [2, 4]]
 
possible answer invalidation by christo8989 on question by christo8989: codereview.stackexchange.com/posts/134030/revisions
 
Hmm, I wonder why N3buchadnezzar said it was a horrible idea then... Is it just a matter of personal preferences, or?
cc: @N3buchadnezzar
 
7:08 AM
well, no, it's actually not. He said that because numpy was actually made for this purpose. If you have to play around with arrays numpy is a good fit. They are really optimized when it comes to this purpose
 
But got to go. I'll be back =)
 
Read this when you come back. It'll make things clearer
 
Just a final quick yes/no question: For selecting sub-blocks in an array (or list of lists), e.g. the 3x3 blocks in Sudoku, would you still consider lists a good option?
 
yes, I'd also use list operations. But that's a matter of preference. Numpy might be a better choice
I'll make some tests these days because you made me curious
^^
 
@Dex'ter :)
 
I might even do some list comprehension when it comes to sublists
they are really fast :P
but again, numpy might be a faster option here
 
XKCD needs to post more what-ifs =/
 
7:35 AM
Monking
 
monking @JoeWallis
 
@StewieGriffin I dunno why people are saying to use list comprehensions, just use zip... list(zip(*[[1, 2], [3, 4]]))
 
0
Q: Why does string.split with a regular expression return an array that ends with an empty string?

PimgdI'd like to split an input string on the first colon that still has characters after it on the same line. For this, I am using the regular expression /:.+/ So given the string aaa: bbb:ccc I'd expect an output of ["aaa:\nbbb", "ccc"] And given the string aaa:bbb:ccc I'd expect an outpu...

javascript ez question
that my coworker asked me and I went "that's easy, it's because... ... ... wait, I don't know"
 
@Pimgd I think it makes sense, but I can't explain why, so +1
@Quill and he stole my name @_@ There can be only ONE Dan of CR! :p
 
@Pimgd Cause the ':bbb:ccc' is what you're splitting, so the first part is 'aaa' and the latter part of the split is ''
Oh JS works differently to Python it seems I get a : where you don't...
 
7:49 AM
@JoeWallis I made a transcription error, using regex /:(.+)/
because I'm interested in left and right side
 
Yeah I see what you mean now. that is weird behaviour.
I assume it's going to have something to do with your regex though because you don't get that with just a standard ':' or something
It's also weirder because /:(.+)/.exec('aaa:bbb:ccc') will correctly return the two matching groups without an empty string
btw, this doesn't sound like something you should be using regex for anyway ^^
 
If it's a bug that'd be funny
 
bug in js? nawwww :^)
 
@DanPantry I know, I told my coworker that he ought to use indexOf and just go from there
but now I've gotten curious and want to know =D
 
Errrr
is it because .+ may be matching some kind of "invisible" character?
. matches 1 or more of any character
a long shot, I know
 
7:57 AM
@Pimgd got the book for Christmas... I didn't talk to anyone until I finished reading it. Regret I didn't do one at a time...
 
@DanPantry battle him to the death for the title
 
IMO it's better than Thing Explainer. I think it got a bit humdrum...
 
@Pimgd to get it working properly, though, you could just tell your colleague to use string.split(':'), then reduce the array into two elements - array[0] will be 'aaa', array[1...N] will be the remainng matches, which is exactly what you would have had with the regex anyway
 
Tumbleweed candidate; zero score, no answers, no comments, and low views: Route Cipher implementation
 
woo, my first clueless answerer
suggests a regex that doesn't even give the correct output when tested against cases in my question
but nice try anyway
 
8:00 AM
wut
 
@Pimgd There is a vein of truth in it though which I've just realised
It's split into 3 elements because there are 3 colons, they are empty strings because you don't capture the colon
(maybe?)
NVM there are 2.
 
"aaa:bbbccc".split(/:(.+)/) gives ["aaa", "bbbccc", ""]
 
> "aaa:bbb:ccc".split(/:(\w+)/)
[ 'aaa', 'bbb', '', 'ccc', '' ]
You can see that with this, which only captures word characters
 
@Pimgd I wonder what would happen if the entire world's population dropped what they were doing and started reading the What-if book from start to finish at the same time.
 
@JoeWallis hit the nail on the head i think
 
8:02 AM
Hopefully
 
well it seems to make sense
I'mma accept it because that seems far more likely than "bug"
 
It happens in Python, so I don't think it's a bug, ;P
 
Zak
Monking @all
 
=)
 
8:07 AM
@RoboSanta My 100th question on Stack Exchange gave me my first Tumbleweed bagde here two days ago... Wohoo! Badges...
 
Zak
It's FRIDAY!
 
and I haev a mandatory all day outing with football and crap in 2 hours
:\
 
Zak
As such, here's my contribution to today's inanity:
 
because I don't have enough to do..
 
Wow, that answer gave me more rep then I've ever gained on SO, :O
3
 
8:09 AM
@JoeWallis that's because the CR people came by and voted
 
PSA: then indicates a relative time. than is measuring amounts or comparisons.
eye twitch
 
PHPOOP :D
 
also I managed to score pretty nice rep as well, I'm ever so close to the 2k I need to fix random typos whenever I'm browsing SO
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Shell Sort Comparisons/Exchanges Counter
 
8:24 AM
@JoeWallis what answer ? :P
 
Without specifying which errors you get, we have a hard time to help you. Please post error codes and other things you tried (the for loop approach). If you want your code to be improved you should post to Code Review Stack Exchange instead. — mwormser 15 secs ago
 
8:46 AM
@RoboSanta no tumbleweed for youuu
 
Monking
 
Monking
 
@Mast near starwall, but... offensive, maybe?
 
9:03 AM
> You've earned the "edit questions and answers" privilege! Learn more about it in the help center.
4
woo 2k rep on SO
 
@JoeWallis nice
you've also got my +1
 
Zak
Woo! New (potential) Acquisition I need to model. That's my day spoken for ^^
 
@Zak yay, more work...?
 
9:19 AM
Monking!
@Pimgd How cute :p
0
Q: Finds the position of words in a sentence [python]

bubblez go popMy program is made to tell the positions of each word in a sentence. However it simply doesn't work sometimes and I cannot tell why. counter = 0 mainLoop = True print ("this program takes a sentence and a word and puts outputs the positions of the words in the sentence") sentence = str(input("i...

This should be closed until the code works right?
 
@N3buchadnezzar right
 
@Dex'ter Too late :p I already posted a comment =)
 
1 second late, hehe
:P
 
@Dex'ter Thanks, :) It's gone hot now, ):
 
@JoeWallis ? =(
 
9:26 AM
@N3buchadnezzar Huh? (I don't like being in HNQ, ;P)
 
yep, #49th atm
 
@JoeWallis Why not? :p
 
at some point in the future they'll roll up the CR voting ring on SO
 
@N3buchadnezzar More scrutiny, I'm probably just paranoid
 
@JoeWallis I'd rather not have my code working via "it seems to work", so more eyes are always welcome for things like this
 
9:30 AM
-1
Q: How to pass data on html page with wget?

monchuI want to send "6294" data on this web html page : "http://www.banquept.fr/2016_res_admiss/resultats_concours.php" for example. I try to do it with this unix command : wget ‐‐post-data ‘submit=6294’ http://www.banquept.fr/2016_res_admiss/resultats_concours.php but it didn't work...

 
@CaptainObvious Let's close this
 
@Pimgd It's definitely good for you, :)
 
Zak
@Pimgd Yes, but work I really enjoy.
 
People need to vote more =(
5
 
@CaptainObvious How on earth had this question got an upvote?
 
I'm always voting when I see a good, nice review. Especially when it's clear there's a lot of effort and research / knowledge
^^
 
Monking
 
@Vogel612 Monking
 
monking @Vogel612 !
 
@N3buchadnezzar ?
also, SO review queues so LARGE
2
 
9:45 AM
how can I do the tag ? ^^
 
@Dex'ter [tag: tagname]
without the space
 
but I have plenty of CR reviewing experience so I can just slam that skip button
 
awesome. Thanks @DanPantry
 
reviewing on SO is like
 
monking
 
9:55 AM
skip skip skip skip skip skip yep looks good skip skip skip skip no, use comments for that skip skip skip
 
that's me when I'm thinking what I have to eat
hehe =)
 
@Pimgd reviewing on Arqade be like close close close comment-close close close close close close leave-open close skip close close
 
@arda suggested edits queue
 
@Pimgd oh that is less crazy on arqade too
there are sometimes extreme vandalism tho
 
because when I'm faced with suggestions like this
then I really can't say
 
10:00 AM
@Pimgd sounds like me in the mod queue
 
@Pimgd reject as reply or conflict with author's intent
because it should be a separate answer
 
> Pimgd has approved 7 edit suggestions and rejected 2 edit suggestions and improved 2 edit suggestions
what its showing: the 44 skipped reviews
*not
also; co-workers are surprised you can get fast answers on SO
there's a whole "whoa, so this is the internet, such mystical powers" vibe going on
 
> so this is the internet
is it their first time on the internet? <_<
 
not literally, but the same surprise as showing up with video calls to some bush village
 
also I checked my review history. It apparently is similar with what I posted above
 
10:16 AM
So what's wrong with what you've got? If it's working then note that SO is for fixing broken code: if you want a code review, try codereview.stackexchange.com but see the question guide first. — stuartd 10 secs ago
 
10:38 AM
Yay, another Enlightened badge on meta :-)
> Mast has approved 71 edit suggestions and rejected 143 edit suggestions and improved 12 edit suggestions
 
@Mast where do you see that
 
review stats
> Vogel612 has approved 168 edit suggestions and rejected 123 edit suggestions and improved 51 edit suggestions
check your latest handled suggested edit and expand the info-card with (more)
> Vogel612 has approved 53 edit suggestions and rejected 27 edit suggestions and improved 8 edit suggestions
Community has approved 810 edit suggestions and rejected 229 edit suggestions and improved 2 edit suggestions
^^ that's CR the other one is SO
 
> ardaozkal has approved 260 edit suggestions and rejected 177 edit suggestions and improved 13 edit suggestions
 
I only have like 180 total on CR ;-;
 
> Pimgd has approved 56 edit suggestions and rejected 31 edit suggestions and improved 20 edit suggestions
CR
 
10:46 AM
I don't review on SO, not enough rep. Only do Triage there, and an edit every once in a while.
> Mast had 103 edit suggestions approved, and 12 edit suggestions rejected
SO.
 
This belongs in Code Review. — mwormser 26 secs ago
 
11:11 AM
Also, should I delete my question once I find a satisfying answer? I don't want to spoil it for others. — Ethan Watson 9 hours ago
 
11:37 AM
Did anyone use vSphere client
?
 
11:53 AM
0
Q: Implemetation of a queue for digicode-like system

BusyAntWhat it is about I created an application where you need to push invisible buttons in a certain order to unlock the advanced mode. To handle this, I wanted to use a queue (FIFO) of my own, adapted to my problem. Every time I click a button, its ID is added to the queue with addItem, and the pas...

 
monking
 
Monking @janos
 
@StewieGriffin well "congrats", I guess. I don't expect to see this badge anytime soon =)
 
@Dex'ter yea kinda. can I help you with something?
 
Monking @janos
 
12:04 PM
yea, just wanted to know if there's any way of going full-screen when working in console
I know about ctrl + alt + enter but it doesn't work as expected
 
@Pimgd nicely done!
 
@Dex'ter that seems to be the only thing there ...
 
@Vogel612 that's sad. I'll go blind eventually
 
> If you see public static final char COLON = ':' in Java code, find whomever wrote that and break their keyboards. If the representation for COLON ever changes from : you will have a maintenance nightmare.
lol ^^
 
> You've earned the "Nice Question" badge (Question score of 10 or more) for "Why does string.split with a regular expression that contains a capturing group return an array that ends with an empty string?".
 
12:12 PM
Little long winded...
 
Gotta hit the google keywords
 
Small burn
I would make several arguments that EMPTY_STRING is beneficial. (1) I can much more easily find all uses of EMPTY_STRING in a file than I can find all uses of "". (2) when I see EMPTY_STRING I know for darn sure that the developer intended that string to be empty, and that it is not a mis-edit or a placeholder for a string to be supplied later. Now, you claim that by me making this argument that you may qualify my knowledge, and safely ignore me forever. So, how do you qualify my knowledge? And are you planning on ignoring my advice forever? I have no issue either way. — Eric Lippert yesterday
 
@Pimgd pretty sure that hits every keyword, you could search something completely unrelated and it might come up XD
 
@skiwi s/small/severe
 
@throck95 ... feel free to supply a better title...?
also, naming is hard and I think this is a pretty good try
 
12:14 PM
monking!!
 
@Pimgd yea I have no idea, but usually you don't want your name longer than about 6 words or so, at a certain point people actually don't read something because the name deters them
 
why empty string in split array
such a good title
maybe...
empty string in array split regex
I'd pass over that title so hard
 
monking
 
RegEx Split Returns Empty String Array
?
 
no because that one is easy
empty string input
 
12:18 PM
idk then, was just brainstorming
 
Monking
 
Monkey-greetings.
 
can someone take a look at this answer and try to explain it to me in a different way? i'm not completely following his logic for some reason -- codereview.stackexchange.com/questions/134208/…
 
> The idea here was to implement suggestions made by @hd/@Pimgd
ooh, mentions
here, have some upvotes
 
@Pimgd A good answer deserving a pimp
Who are we tossing upvotes at?
@Pimgd Ah, already had upvoted it
Why has the answer on that question not been upvoted?
 
12:30 PM
@PeterLai It is certainly something I have used but not convinced it is great design, see this code review postJames Elderfield 24 secs ago
 
6
Q: Casting base to derived class according to a type flag

TheArtistI have been writing an event class for my game engine and I came across to the following problem: Is casting a base class object to a derived class object given a type flag a good programming design? Let me give you the following simple example. I have this enum holding the categories of the e...

Hi! Welcome to CR! Please note that example code is off topic here. I think your question is ok, but it is flirting with it. — RubberDuck Jul 7 '14 at 18:02
 
@Pimgd It is something cyb0rg started. It means great answers
 
can we move this to not nth
I dunno separate chatroom
 
sure just link me which one you want to go to
 
tell me a name,open a new room
"specific-post discussion" or sth..
hang on.
 
12:44 PM
i mean this is an ongoing project that is not as indepth as rubberduck but might have a bunch of topics like this - not sure what to call it tho
 
DBManager is what it's all 'bout
 
there we go :)
 
0
Q: auto_increment composite primary key with MySQL InnoDB

user1032531The intent is to have an auto_increment composite primary key on a InnoDB table which mimics the behavior as on a MyISAM table. The following assumes (3) InnoDB tables all with an auto_increment composite primary key (id incrementing and a_id not incrementing). Please comment positively or nega...

 
:30893816
 
@N3buchadnezzar what about the move?
 
12:48 PM
@syb0rg Oh, hai
 
@N3buchadnezzar Herro friend
 
@Vogel612 Just wondering what was moved
@syb0rg Im just being a pimp.
 
@N3buchadnezzar big convo about my project :)
 
@throck95 =)
 
@N3buchadnezzar just follow the link :)
 
12:50 PM
@Vogel612 Rooms are cheap.
 
possible answer invalidation by throck95 on question by throck95: codereview.stackexchange.com/posts/134208/revisions
 
@Mast true that..
@Duga probably okay
 
I started voting two days ago, and now I am top 8 this month. Weird.
 
@Vogel612 yea only added it in because the answer asked for it
 
@N3buchadnezzar The month is not that old and people are unfortunately not voting that much
 
12:51 PM
@Mast talk first?
 
@N3buchadnezzar Better late than never
We appreciate voters like you
 
I have rolled back the last edit. Please see What to do when someone answers. You inadvertently invalidated section 2) of the existing answer. Feel free to post a follow-up question. — Mast 11 secs ago
 
Good answers and questions deserves more recognition.
3
 
@Pimgd A nice dinner.
 
eh well, battery running out and university disabled all outlets
BBIAB
 
12:52 PM
Not being too known with C++ and Java, it is the least I could do =)
 
Why does your university disable outlets?
 
@Vogel612 How did your exam go?
 
> Without seeing code for the new Exception classes to understand if there really is some value being added by these (rather than simply more complexity for calling code to deal with), the value certainly is not clear here for having these.
@Mast not sure if it needed rolled back, he said he couldn't be certain without it so it's kinda asking for the code
 
It does create a temporary state of invalidation
 
@Pimgd yea which I was going to try to address by commenting on his post telling him that I've given him the code requested
it's like a double edge sword, yes it invalidates but it was also asked for
it just doesn't make sense to make a whole new question for the exception that does almost nothing other than have a name, just my thought
 
1:00 PM
@throck95 No, it's asking for you to include it in the next revision.
So keep it as is, and include it in the follow-up.
No invalidation, points for everyone and a sane question.
3
 
I disagree but what do I know. That's why you're where you are and I'm not :)
 
@Mast Is it best to append to a list, and then make it into a set. Or is it best to create a set and then add elements to the set?
 
@N3buchadnezzar Performance-wise, memory-wise or complexity-wise?
 
@N3buchadnezzar nice answer ^^. I really like it
 
@Dex'ter Thanks ^^
@Mast I was thinking performance wise.
The list solution might be easier if we have a smaller list
 
1:10 PM
@N3buchadnezzar Sets are significantly faster when it comes to determining if an object is present in the set (as in x in s), but are slower than lists when it comes to iterating over their contents.
wwhen you want to store some values which you'll be iterating over, Python's list constructs are slightly faster. However, if you'll be storing (unique) values in order to check for their existence, then sets are significantly faster.
 
gotta do actual work
 
0
Q: Project Euler, problem 21

Đorđe MilanovićI'm solving problem 21, from Project Euler site. I can't see any mistakes in code, but it gives me wrong answer. Correct solution is 31626, but I get 18320. #include <iostream> using namespace std; unsigned long sumOfDivisors(unsigned int a){ unsigned long sum = 0; for(unsigned int i=1; i

 
@Dex'ter And you can backup your claim with facts:
>>> min(timeit.Timer('for e in elements:pass', setup='elements=set(range(10000))').repeat(7, 10000))
0.8969283030019142
>>> min(timeit.Timer('for e in elements:pass', setup='elements=list(range(10000))').repeat(7, 10000))
0.6928142239994486
 
yea', here's the proof
^^
 
@N3buchadnezzar acceptable
 
1:16 PM
 
That's so me when my code actually work at the first run
hehe
 
@Dex'ter personally I'd change acceptable to insane but...
 
Jokes on you, code never works in the first run, you just happen to observe acceptable behavior
 
if my code runs successfully, that probably means the error is being swallowed
 
@Quill or it does do what you want it to do
 
1:18 PM
@skiwi truth to be told ! You're right
 
@Dex'ter Somewhat surprised how well my simple miller implementation performed.
 
@Quill Swallowing is quite common in Javascript indeed
 
@skiwi It's more that I'm working with promises, and when you're stacking like 15 if you forget to reject even one with an error, it will get lost in the stack
 
how do you link rooms in comments
 
''.join(link,room)
:D
python joke
 
1:22 PM
@Vogel612 i can just forsee it getting long and @Vogel612 already made a room for it so be easier to get him in it
 
@Dex'ter ''.join(map(str, room))'
 
@throck95 Meh...
 
lol was just linking it to the right message above
 
@N3buchadnezzar ): ... it's almost weekend and I'm still at the office
 
@Dex'ter =(
Is broken code acceptable on SO?
 
1:26 PM
yes
On SO it is. Here is not
 
@N3buchadnezzar it's saturday in new zealand, so to answer your question maybe
 
@throck95 My condolences
 
@N3buchadnezzar Friday for me! I just like playing Devil's Advocate :)
 
1:37 PM
@N3buchadnezzar I see what you did there...
 
Its friday I can not help it :p
 
@N3buchadnezzar so I gotta ask. What kind of satanist are you if you get Rebecca Black stuck in someone's head?
 
Anyone here fluent in French? Do you know what 'gestion' is in English?
 
@N3buchadnezzar one boxed the video for comfort/excitement/anger.
 
@zʏᴀʙiɴ101 I'm going with anger >_<
 
can we just retire that meme already??ß
3
 
@Vogel612 We can retire it until next friday.
2
 
1:57 PM
> ß
 
as long as "next" friday is when im not here
 
That might be grounds for a meme... or not? ;)
 
I've already got an ear infection, I don't want it to turn into cancer -- if you can't tell im adamantly against that song. played way to much and it makes my blood boil
 

« first day (1161 days earlier)      last day (2857 days later) »