« first day (802 days earlier)      last day (1469 days later) » 

9:04 AM
0
Q: Dijkstra Algorithm

karma_geekI have implemented Dijkstra's Algorithm in C, using arrays instead of any structs. Here is my implementation: #include <stdio.h> #include <stdlib.h> int G[20][20] , distance[20] , inSet[20] , q[20] , parent[20] ; void print( int V ) { int i ; for ( i = 0 ; i < V ; i++ ) printf("i = %d pare...

 
I'm voting to close this question as off-topic because it looks like a better fit for codereview.stackexchange.com. — deceze 57 secs ago
 
This question looks like very much — Vogel612 31 secs ago
@Vogel612 ... example code? ^^
 
@SimonAndréForsberg Almost written like a recurrent neural network
 
@SimonAndréForsberg yep, already written
 
This code seems to stay on SO, but feel free anyone to help the OP out and get some SO rep:
0
Q: Scapy python script consuming too much cpu while sniffing

KarlovalentinI have coded a wireless probe sniffer using python + scapy. I'm want to use this script in openwrt routers. Everytime it captures a probe request from nearby devices, the information is send to a webservice. (mac, power and probe). My problem is the high consumption of CPU. The script runs quit...

 
9:09 AM
also... why does duga not catch "codereview.se"?
 
@SimonAndréForsberg
 
@Vogel612 She does, but she probably caught your comment before you edited. Then she doesn't notice the edit.
 
that makes sense
 
wait, we have a .se review?
 
?? wat ??
 
9:17 AM
@Torxed: stop trying to shoehorn questions into CR. If this question is off-topic here, then vote to close it for proper, listed reasons. You can advise that a question might be a good CR fit, but the first rule of voting to close a post is that it has to actually be off-topic here. — Martijn Pieters ♦ 41 secs ago
upvotes until foaming at the mouth
 
CodeReview is more about superficial changes such as code structure, patterns and naming, rather than technical changes like CPU and optimization. Whilst we do sometimes point out optimization issues on CR, someone who is looking for optimization tips alone is going to be sorely disappointed on CR. — Dan Pantry 48 secs ago
 
@Vogel612 this. What do you mean with codereview.se?
 
.se expands to stackexchange
[codereview.se]
 
TIL
 
@Duga That comment is not correct and restricting CR to "superficial changes" is a disservice... @DanPantry
 
9:18 AM
CodeReview is more about superficial changes such as code structure, patterns and naming, rather than technical changes like CPU and optimization. Whilst we do sometimes point out optimization issues on CR, someone who is looking for optimization tips alone is going to be sorely disappointed on CR. — Dan Pantry 2 mins ago
@DanPantry ^^^ You had better retract that statement immediately.
 
Retracted, although I don't see how it's completely incorrect
I'm sorry if I caused offense
 
Code Review is not superficial.
 
> Whilst we do sometimes point out optimization issues on CR, someone who is looking for optimization tips alone is going to be sorely disappointed on CR. <--- agreed
 
We do very important optimization work, among many other things.
 
We've got a really nice migration here.
4
Q: Console Project to Find Cost of Tile to Cover W x H Floor

H OzdogusI am new to C++ and programming in general. After reading through my first book, I decided to take on some programming exercises and test what I learned. The exercise is phrased as follows: "Find Cost of Tile to Cover W x H Floor - Calculate the total cost of tile it would take to cover a floor...

 
9:20 AM
Superficial: existing or occurring at or on the surface.
 
A ebtter wording would be this:
 
Perhaps a better word is cosmetic.
 
No!
 
@DanPantry the problem is... code-structure changes are not superficial
2
 
No, you're right, they aren't, they are cosmetic
 
9:21 AM
that's also bananas
 
No!
 
We do not change the meaning of the code, technically
 
We do not review the code execution, but the written code
 
We do not change how the code functions
That is what I mean by cosmetic
 
that's like .. calling some human that gets grown working wings a "cosmetic operation"
 
9:21 AM
Do not misunderstand
Code review is important, I agree
But rarely are reviews about changing the meaning of code, except in the case of optimization algorithms
 
@IsmaelMiguel where is the difference?
@DanPantry define "meaning of code"
 
@DanPantry I'd rather say that we change the how but not the what
4
 
When I say meaning of code, I mean how the code actually functions.
 
@Vogel612 Everywhere.
 
@Simon that's basically what I tried to say
 
9:22 AM
@IsmaelMiguel why?
 
We don't change what the code does, we change how it looks and how it is structured
 
@Vogel612 It states that 1- we only touch on the written aspect and 2- we do not fix bug or other performance issues.
 
@DanPantry meh...
 
Whilst, yes, this is important, this is one of the definitions of superficial or cosmetic - only changing the appearance
 
the structure is part of what the code does
 
9:24 AM
No, not really. The fact I encapsulate a calculator behind 3 methods or a class doesn't change the fact that it is a calculator.
 
calling a method instead of using the "inlined" instruction is two different things
it compiles differently, it works differently, it executes differently...
 
but the code still functions the same after the code review.
 
@IsmaelMiguel bug != performance issue...
@DanPantry that's a misunderstanding
because it doesn't
 
Except we just told someone off for recommending a question to come to CR because they were asking for only performance improvements.
No, at a low level, it doesn't
You have different assembly instructions
But the function of the code itself is the same.
 
I have an answer from the Heap! Good, well-formulated questions about schema reviews are on topic there! :P
 
9:25 AM
what it actually achieves is teh same :P
 
@DanPantry that's a self-contradiction
 
If I want my calculator to add 2 and 2
And I change the way it does it through CR
 
@Vogel612 I know...
 
It still adds 2 and 2.
It is still, functionally, the same thing.
It is just organized differently.
 
no...
 
9:26 AM
...yes?
 
if someone recommends a different enough approach you will still get four out of it
but maybe you just add 1 and 1 and 1 and 1 instead
 
But isn't the user interface the "surface"?
 
In my opinion, the way the code presents itself is the surface
 
So it's rather the other way around
 
And I have to reemphasize that does not downplay my opinion of CR
but we do not give out only performance optimizations, we throw the whole kitchen sink in, we have repeatedly had questions asking only for optimizations only to be disappointed when they get more of a, well, review
 
9:29 AM
@DanPantry but that's two different things
 
I'd say that Code Review answers are unpredictable: you might get a faster or better way to obtain 4, or you might even get an answer telling you why you don't actually want 4 in the first place. So, if obtaining 4 is a specific concern, then it's better on SO. If it's open-ended, then CR.
2
 
@200_success That, I agree with.
 
and you mustn't reduce CR to the linting we sadly still have to do so often
 
I don't reduce it to the linting we do.
But I think it is a mistake to say that we perform optimizations
 
> superficial changes such as code structure, patterns and naming
 
9:30 AM
in the same way that saying we only performing linting is what we do
such as - but not limited to.
I'm not going to list every single thing that we do, I only have limited characters.
Code structure, patterns and naming are the things I see most.
 
I'll grant that you were right about possible disappointment if you ask on CR with a very specific question in mind.
But please avoid "superficial", "cosmetic", or any similar adjectives.
 
And optimizations just muddies the water because thats exactly why the commenter was suggesting migration anyway.
I shall.
You have to bear in mind I do reviews here as well, and I have also performed optimizations on some of the reviews I've done
So this is not just some outsiders opinion on a SE they have no idea about
 
@DanPantry the problem here is actually not really us, the problem is what kind of idea it transports to "the others"
we're insiders, we know how this works
they don't
and that's why such adjectives are dangerous
 
Point taken
I apologize for the foolish wording. No offense was intended :)
 
I think your intention with that comment might have been in the right place, but it's too easy to misinterpret it or take it out of context, and thus spread misinformation about our work.
 
9:36 AM
BTW.Work
 
btw?
 
@Gemtastic You got a link to a relevant chat message? This could get important for a later meta.
 
6
A: What's a Zombie? And what are the many other memes of Code Review?

Vogel612Meme: BTW Originator: [attributed to] Malachi, Mat's Mug and Others Cultural Height: The 2nd Monitor Background: The many ways of backronymizing btw led to the introduction of the BTW enum: public enum BTW{ Bananas, Bring, Normal, Waffles, Wall, Web, Win, Woods, Wo...

@Mast Heap ftw.
 
back to work? @Vogel612
 
6
A: What's a Zombie? And what are the many other memes of Code Review?

Vogel612Meme: BTW Originator: [attributed to] Malachi, Mat's Mug and Others Cultural Height: The 2nd Monitor Background: The many ways of backronymizing btw led to the introduction of the BTW enum: public enum BTW{ Bananas, Bring, Normal, Waffles, Wall, Web, Win, Woods, Wo...

 
9:38 AM
@DanPantry You can use Memer for that.
 
i read it as by the way
 
well that's BTW.Normal
 
Ah now I get it.
@IsmaelMiguel is memer available for us or still in dev? I looked at it briefly yesterday
use
 
@DanPantry Still in dev, but you can use anyway. As long as you check the github. I'll ping you if I change anything
 
9:39 AM
Use that one
It also works on other chatrooms
Security.stackexchange.com is one of them
 
awesome stuff @IsmaelMiguel
starred
var meme_database what a time to be alive
 
0
Q: Cleaning old XML log files automatically

SeraphimI have a piece of code that searches for XMLs in given folders, delete the ones older than X, zip the ones older than Y and delete zips older than X. It works perfectly but I have a terrible feeling that this is very inefficient code. I am a temp at a networking company and this is one of the fir...

 
Everything is in my repository.
If you go to a website and the json file doesn't exist, you get a warning
 
"warning: no memes here"
 
?
Where?
 
9:42 AM
... never mind
 
Oh
If you find a misspelling or a missing meme, feel free to ping me
 
i can always fork/pr :-)
 
That too
 
Or create an issue
 
Whatever is easier for you
I'll manage it
 
9:46 AM
so many options!
 
There are really tons of options.
Just use the one you like
 
@IsmaelMiguel have you considered using developer.mozilla.org/en-US/docs/Web/API/MutationObserver and falling back to interval polling/
 
@DanPantry Yes, I have. But, for now, I wanted something that works well. That would be for something that works great. And specialized as well. In that case, for Firefox
 
@IsmaelMiguel its supported in IE11+ and Chrome 18 with flag / Chrome 26+ without
Not criticizing you, just making you aware to the option :)
 
I know. But what you are pointing out is too soon to be implemented
 
9:57 AM
@Vogel612 Thank you!
That's clear enough.
Ofcourse we could always change our scope to include it anyway ^^
 
currently we do include them, given they're written as SQL and not a picture of an UML / E-R Diagram
 
11:12 AM
@Mat'sMug 2 Simons on the wall ;-)
 
Where?
 
In the reputation-race between me and Mug
 
What race?
 
There is an MVC sample project here but its for using Google Calendar it may still give you some inspiration codereview.appspot.com/194980043DaImTo 30 secs ago
 
Hello
 
11:15 AM
@Timo Hello
 
Hello
 
hello
 
Hello
 
1
Q: Javascript 'class' use of prototypes

gudthingI am currently learning javascript and I attempted to make a Person class (note - this was part of a practice exercise, so some of the design decisions may have been due to the requirements). Specifically, I am looking for feedback on: -Usage of prototypes (i.e. from my understanding, prototy...

 
11:33 AM
Congrats on our new moderators ! @SimonAndréForsberg, @Jamal, @Mat'sMug and @200_success. Btw @200_success you will need to update your about me :D
 
@Marc-Andre Maybe they already updated?
 
@IsmaelMiguel no they aren't...
 
@Vogel612 *Haven't *Didn't
 
@IsmaelMiguel The about me of 200_succes still say that he is a pro-term moderator, which is not true anymore ;)
 
What's the difference?
 
11:38 AM
pro-tem: appointed, not pro-tem: elected
 
^^ that
 
That is, indeed, old info
Maybe they're busy on their business?
 
It was just a friendly reminder ;)
 
And a very welcome one. If it sounded disrespectful, I'm extremely sorry. That wasn't what I meant.
 
Oh no at all! I just don't know the agenda (not sure of this word) of everyone, so I can't say if they're busy or not.
 
11:42 AM
Schedule
That's the word you are looking for.
But I get what agenda means.
They most likely are busy.
There's only one thing that concerns me in the new moderator list
 
11:54 AM
This question should be posted over at codereview.stackexchange.comfeeela 14 secs ago
 
1
Q: Data reduction program

lynxThis is my first program in Python and first time I'm writing in dynamically typed language. I have substituted real detectPeaks function with a simple placeholer. I'm aware of several problems with this program. I still don't quite know how to 'live with' python scoping. Hence qFix function. I ...

 
Hey @Rick - the opening sentence of your most recent answer is .... broken?
 
@IsmaelMiguel In American-English, both are used.
 
@Mast The 'standard' is the British-English.
And excuse the delay in answering, I was busy for a while
 
That's what you're taught. Reality is different (somewhat unfortunately).
 
12:05 PM
It really is somewhat different, therefore the quotes.
 
So, now that the circus is moved out of town, when are we getting a new design?
 
I recommend you all to listen to this:
@nhgrif What do you mean?
 
@nhgrif good question...
for starters I'd like to have the damn beta-label taken down..
 
I think it will take a while. :/
A LONG while
(A pessimist view, I know, but that's me)
 
It already has taken "a LONG while"
 
12:11 PM
also Simon has shown willingness to take over the post of pun-torer
 
@IsmaelMiguel It already took a long while, let's hope it's done now.
 
Well, another while waits.
 
@Vogel612 SE mods will love CR.
 
Also, I'm kind of interested to see who they're giving swag to.
 
Let's hope it isn't a while(true);
 
12:12 PM
@nhgrif me too. AFAIK election candidates will get some swag...
the question is how it works out for graduation...
 
@nhgrif We could always distribute our own swag. I think there are enough people interested.
 
Well, that's been done before. But they've also given first page of rep swag.
@Mast I'm interested in some official Stack Exchange stuff... stuff you can't just buy...
 
Wait...
 
We could always put CR 4 LIFE on a t-shirt and send the schematics around.
 
Wasn't the website supposed to graduate last year?
*in 2013
 
12:13 PM
@IsmaelMiguel ... that's kinda the point...
 
What the hell happened then?
 
this and that..
there's a meta post by Pops...
/too lazy to search...
 
There was a contest to make banners
 
I want to be able to wear a shirt in to work that's clearly an officially licensed Stack Exchange shirt for a site that people are starting to become aware of... but that can't be purchased... or a mug to set at my desk.
4
 
why not both?
 
12:15 PM
@nhgrif Who's mug?
 
sure
 
@IsmaelMiguel the announcement was made in september 2014.
 
@SimonAndréForsberg Then the website has been eating dirt?
 
I'd also like some Stack Overflow gear too...
 
Who wouldn't?
But I can't pay for it
 
12:16 PM
I don't want stuff you buy.
I could buy it, but I don't want stuff you buy.
 
You want to make it yourself?
 
No.
I want them to give it to me.
That's how it works.
 
OH!
That would be cool
But impossible
 
...no... it's not.
That's how it works.
 
Stack Exchange gives the middle finger to Portugal. And Portugal gives the middle finger to where I live.
 
12:17 PM
Stack Exchange swag can not be purchased (to my knowledge). It can only be received as a gift from Stack Exchange.
 
So, yeah, it is impossible to me.
 
@nhgrif there used to be a time when you could buy swag
but they stopped, because it was too expensive.
 
@IsmaelMiguel I don't know what this means, but okay.
It was too expensive for them to sell merchandise?
 
@nhgrif There's PT.StackOverflow.com
Which is actually BR since they don't care about Portugal
 
Okay, and?
 
12:19 PM
to maintain the shop and the people running the shop and purchasing the swag at a loss over and over...
 
It's...
 
And Portugal doesn't give a damn about the southern parts
 
It's a Portuguese language site
 
Thus, It is impossible to me
Yes
 
but I really can't understand how geography matters.
 
12:19 PM
99% Brazillian
 
So what?
 
So what?
There are no events in Portugal
Only Brazil
 
It's not about events.
It's about reputation.
They occasionally give out swag to people who hit milestones like 100k/200k/300k
or if you were a significant part of a beta site graduation
 
Like a painting ;-)
 
oh that was a one-time thing
 
12:21 PM
124
Q: Where is my box of Stack Overflow swag?

Andy EThat question title isn't intended to sound demanding, I'm just unsure how to word it better. So a while ago, I received an email from Robert Cartaino titled Stack Overflow — You're killing it: It's not often I get to reach out and thank someone individually for their contribution to a site,...

135
Q: Is it true that if someone reaches 200k reputation he/she gets a painting with a unicorn on it?

Adam AroldI've seen a blog post with Jon Skeet on it holding a painting of a unicorn with the title "What happens if you reach 200k reputation?"

 
0
Q: Optimizing a html parsing php script

LukaszThe script is intended to return an array with texts containing specific words in English and the equivalent texts in Polish from EUR-Lex - a website with EU documents. The script downloads the page which address is specified by the passed variable. Then the page http://eur-lex.europa.eu/search...

 
Probably they don't even know where Portugal is, since PT.StackOverflow is actually in Brazil.
 
The PT stands for Portuguese. English-language based Internet companies are extraordinarily frequently based in the United States. Does that mean they don't know where England is?
 
@IsmaelMiguel I really don't want this to get to you the wrong way, but... Why the heck is that relevant?
 
@nhgrif Don't overestimate the U.S.A knowledge.
 
12:25 PM
@IsmaelMiguel if you feel Portugal is systematically left out, why not ask on their meta?
3
 
@Vogel612 I was explain why it is impossible for me to get SE.swag
 
It's not impossible for you to get SE Swag because SE swag isn't geography-based.
 
^^
 
If I spoke Portuguese, I would feel perfectly capable of eventually earning PT.StackOverflow swag.
 
Fine, I'll eat my words on my way back home, while getting a pizza on the supermarket
 
12:27 PM
And I live in the middle of the United States.
 
@nhgrif that's.... still in the US
2
 
I honestly don't feel capable of
But anyway, time to go home
 
@Mat'sMug Yeah. I can't just move to the middle of nowhere to prove my point better.
But if I were living in the middle of sub-Saharan Africa, if I still had an Internet connection, I'd still consider myself equally capable of earning Swag.
The only question would be whether or not UPS would be able to deliver it to the jungle.
2
 
@IsmaelMiguel That's because the majority of Portuguese speakers comes from there.
@nhgrif Given enough time and money, all bugs are shallow.
 
I take my laptop to work in a backpack (that work gave me). One of my cats is intensely curious about the contents of the backpack (laptop isn't in it right now). One of these days, the cat will make it to work with me in the backpack.
 
12:44 PM
@nhgrif Hopefully you'll notice the weight difference before it's too late
 
Or the incessant meowing?
In my first week, someone had a dog there. Pets are totally cool in the office... as long as the pets are cool.
Neither of my cats would be cool in the office.
 
Cats just live to cause trouble
I would know, I have seven of them ;-)
 
@IsmaelMiguel Brazilians speak Brazilian Portuguese, I believe PT stands for Portuguese and not Portugal. It's a language specification, not geography specification.
 
Say, is Jamal's hat SE swag?
 
@Quill moderators get specific swag
 
12:53 PM
@SimonAndréForsberg Site specific?
 
If there exists site-specific swag, yes.
I don't know if there is CR-specific swag yet.
 
Well, it's a hat with a diamond (that moderator indicator), and the segmented colour changing (blue tinged), so I figured
 
@Quill pro-tem swag, I'd fare
oh no wait.. no that's from one of these contests.
 
Contests?
 
can't find one right now, but the SE power outage about a year ago had one
 
1:01 PM
AFAIK, you don't get a diamond hat from the contests.
 
Maybe we could try pinging him
@Jamal, where did you get that swag-filled hat?
 
@SimonAndréForsberg Yes, PT stands for Portuguese. But it's quite sad that it is more Brazillian-related than Portuguese-related
But don't worry
 
@IsmaelMiguel I am not surprised. I think Portuguese users know better English than Brazilians, and are thus more likely to visit the English version of SO.
 
-1
A: Rating tennis players in a database, taking days to run

Olof MagnussonMaybe its a smaller point, but i think logging things slows down performance (ie the "print i").

 
Is the SO main-site United States-based?
 
1:06 PM
@SimonAndréForsberg Finally someone who gets most of it! Thank you.
 
I don't think of geography when I think of hte main site...
 
@nhgrif It is
 
Brazil's population is 200mil to Portugal's 10mil...
 
@Quill How is that not a Code Review?
@IsmaelMiguel I have had an online game for 7 years, 80-90% of the players are Brazilians. I am talking from experience.
 
@nhgrif I know.
But it's still sad
@SimonAndréForsberg What game, if it is ok to ask
 
I already saw that one
It's a cool game
 
That's a very popular game in Brazil. They organize tournaments and all kinds of stuff.
They even have a Facebook group dedicated for it.
 
o.O
WTH?
 
I agree, @SimonAndréForsberg. I think Quill's comment is unnecessary (the downvote is okay though)
 
It is a small answer, but it is an answer.
 
1:12 PM
@SimonAndréForsberg Maybe a comment, instead?
@nhgrif Yeah, I removed that one
 
@Quill It does not need to be a comment when it is an answer.
1 min ago, by Simon André Forsberg
It is a small answer, but it is an answer.
Additionally, the answer can be edited to be improved further. Pointing out the specific line, for example.
 
@Quill - all moderators are offered moderator swag, which includes the diamond hat, and other stuff that's site-specfic, or, if you're a pro-tem mod, or a site without swag, you get general stack exchange swag.
 
@rolfl Thanks for the info, did you get a hat?
 
Yes.... ;-)
 
monking
 
how do I update my branch on github? hopefully not too off-topic
 
@Malachi with changes you've done locally? git push ?
 
I haven't made any changes to my branch, but they have made changes that I want. do I fork it again?
 
pull it.
 
I am just doing online right now.
 
1:24 PM
git pull
 
okay, thank you.
 
or create a pull request using the GitHub UI (this will do a pull for you)
 
urk. that smells fishy..
 
0
Q: Check if words in two different strings are matching without considering their order

GibboKI need to compare two strings containing words separated by a dash. If words are present in both string the script consider the strings as the same, this works with any order ex: WORLD-FRANCE-PARIS same FRANCE-PARIS-WORLD same or WORLD-FRANCE-PARIS same PARIS-WORLD-FRANCE same or WORLD-...

 
git fetch blessed
git pull blessed master
git push origin master
 
1:28 PM
@Vogel612 are you making fun of me....?
 
no that's how I work with forked repos..
blessed is the original repo, origin is the fork
I pull from blessed (usually after fetching and checking whether I need to prevent merge-commits)
and then push to my fork
then again I often have my branches set up as tracking origin and can just say git push instead of git push remote branchname
 
1:42 PM
in Javascript Libraries, 11 secs ago, by Malachi
I can do it all by myself
 
@rolfl welcome to the normal users ;) (and thx for all what you have done)
12
 
I have stars again!
 
Monking!
 
@chillworld Monking!
 
monking @Phrancis
 
1:43 PM
@rolfl How does it feel to be normal a normal user again?
 
and monking @rolfl
 
@Simon - I am a little lost - been consciously trying to stay away for a bit. I have a lot of things to catch up on - but, actively ignoring CR is hard to do other things is hard.
 
Hey, I posted my first answer to a code review post, so I'm looking for feedback on my answer:
0
A: Find common elements in a list of arrays

MrTiIf we break the problem down, it makes the problem easier. Lets start by simply finding the intersection of two arrays. The fastest way to find an intersection is using sets, but since we are talking about Javascript here, we are going to use objects. Hence, our steps become: Create a curren...

in chat, or on the post is fine
 
@SimonAndréForsberg definitely - trying to go from "full addict" to "social addict".
2
 
1:48 PM
@Malachi not for long
2
 
Mhh maybe we can make AnswerReview site now ^^
 
@NathanMerrill That's an OK answer. let me explain that.....
 
@rolfl Good Luck
 
but lol no I'll take a look at it
 
@Quill How can that code be so slow? First iteration should be clean-up, next iteration fixing the problem.
 
1:50 PM
your answer is not so much a review, as a "this is a completely different way". Now, that's not a bad thing, but more detail on why it is a better way would be good - so that the OP can link your answer to key aspects of their code.
 
what rolfl said.
 
Explaining what your answer does is good, byt explaining why you do things differently - i.e. what problems you are resolving in the OP's code... is good.
 
@rolfl s/byt/but/ , s/... is good/... is better/
 
ok, updated
 

« first day (802 days earlier)      last day (1469 days later) »