« first day (407 days earlier)      last day (3602 days later) » 
00:00 - 18:0018:00 - 00:00

12:59 AM
@Jamal In case you're still around: IMO, it's not really worth anything like a line-by-line critique of the code. I've seen something like the basic technique he's using, but only in really ancient books. I've posted something much closer to current practice:
0
A: Simple C++ calculator which follows BOMBDAS rules

Jerry CoffinI suppose I may be somewhat biased, but if I were going to carry out this general task, I'd probably use a recursive descent parser. A simple version to handle +, -, * and / with the correct precedence can look something like this: #include <iostream> #include <string> #include <cctype> int exp...

Since this is a fairly common type of question, it would probably be nice if somebody added a shunting-yard implementation though.
 
@JerryCoffin I still thought there'd be some benefit to it, at least so that such things won't be repeated. I know that such a review wouldn't be enough to really flesh this out.
 
@Jamal Maybe. I guess my basic problem is that this looks to me like it should really be thrown out and replaced--and writing replacement code is less work than going through this in any kind of detail and explaining all the reasons it should be tossed.
 
I would've probably taken that approach, if I knew how. I did think that first that it's way too much code for such a problem.
 
is @Mat'sMug around?
anyone else install KDE and KTurtle on their windows machines?
 
1:20 AM
I am installing KDE right now
 
wait..... you can install KDE on windows? what the hell? does it like replace the windows environment???
 
Ah, ok. So it's just the KDE environemnt in terms of applications being able to run
I thought it was KDE in the sense of true, desktop manager KDE
Still pretty cool though
 
1:42 AM
and now I try KTurtle
I am going to love having this on my Windows machine. I actually have dual monitors over here...lol
@Mat'sMug congratulations!!!!
 
@syb0rg hi , just wondered what the details were for the offboard processing
 
2:12 AM
Hey
Has anyone seen this post...
0
Q: Converting any PHP function toString() like in JS

GRIGORE-TURBODISELIn JavaScript, any function is basically an object on which you can call (function(){}).toString() to get it's underlying code as a string. I'm working on a function aimed to do the job in PHP. It looks like this so far: function fn_to_string($fn, $strip_comments = true) { static $content...

 
yes ._.
and now i can't un-see it
 
yes... (too)
 
Is it fit for CR?
 
my daughter is going to say "you didn't tell me you had KTurtle on this computer!" when she sees me programming on the Turtle on my Windows Machine
 
> Are there any reasons for which using this approach may not be a good idea?

When *is* it a good idea? What in the world is the usecase of that? x.x
 
2:17 AM
@AlexL - I don't know PHP, but the question looks good... well researched, functioning, etc. The limitations are clear, and they are problems, but the claim is that they are corner cases which likely are not significant. The questions at the end are in line with standard code revies.
 
@AlexL "it's the question CR deserves, but not the one it needs"
 
Yeah, it's a great question. It's just an interesting concept to jam into PHP :/
 
I cannot see any reason to clsoe it, and I can see a lot of potential for a review (from someone who knows PHP)
 
I don't think anyone was suggesting closure?
 
3 mins ago, by Alex L
Is it fit for CR?
 
2:19 AM
Not closure, maybe an edit to take out the points where things aren't working. That's more SO
 
Ah.. not sure how I missed that :)
 
I agree it is a good question with good code though
 
@AlexL I'm going to disagree with you on this one, but only a little bit.
 
@AlexL eh, I think it's fine. Might be good to point out the limitations so people don't waste their time explaining them to him when he already knows them.
 
I often write real code with known issues.
It's the unknown ones that are the bigger problem.
 
2:20 AM
@rolfl Alright! Well hey, that's why I asked here before making a move :D
 
> We like to help as many people at a time as we can. Make it clear how your question is relevant to more people than just you, and more of us will be interested in your question and willing to look into it.
 
It sure as heck is an interesting script
 
i'm not seeing the usefulness of it
maybe i'm just not imaginative enough
 
if I don't get on the computer tomorrow, I just want to say....
Happy Father's Day to all the fathers on CR
been watching American Ninja Warrior so I had to get out my pull up bar again...lol
2
 
@Malachi Thank you. Happy Father's day to you too (in case I'm not around tomorrow).
2
 
2:27 AM
@JerryCoffin thanks Jerry
KTurtle doesn't support objects or arrays it looks like....or maybe it isn't listed in my little KTurtle handbook I printed a while back
 
Can't expect too much from an educational language aimed at children :p
 
I know right...lol
 
Thanks @Malachi, you too
 
You would think it would support arrays though... That's kind of a fundamental aspects of computers, not just specific programming languages lol.
I'm slowly coming to the realization that I'm one of like 2 people in here who don't have children... lol.
 
@Corbin If I'm not in that 2, then make it 3
 
2:33 AM
Woooo, we're up to 3! :p
 
@Corbin I thought so too, but I haven't found any syntax for it...maybe I am looking at it the wrong way and need to "Create" that functionality
 
Hrmm, there's a post on google groups from 6 years ago saying that arrays were recently added. Can't find anything more than "they're in version 4" though :/ lol
 
@Corbin It's not even saying that much--it's just saying that [ and ] are no longer used for grouping statements, so as of V4, they're at least theoretically available for array subscripting.
 
Ahhh... you're right. That's what I get for scanning :p
So it really does seem kturtle doesn't have arrays. That's.... odd.
 
I will see what I can figure out when I come to something that I think might need an array or where an array would be helpful.
going to be hard to program the turtle to play Tic-Tac-Toe without arrays and objects though...
 
2:41 AM
If you want turtle programming with more features, you might consider a full logo implementation instead. E.g., FMSLogo.
 
@JerryCoffin that is for a robot turtle.
like hardware
the first couple of implementations of this were using to control an actual robot that would draw on a large canvas.
 
@Malachi It can control that too (probably), but (unless I'm badly mistaken) should be able to display turtles on screen just fine.
 
@JerryCoffin no you are right.
I am debating on staying with the easier one for now, and just doing what I can with this and then when I teach her Ruby or Python or Javascript or whatever I can explain to her how nice it is to have the objects and arrays and stuff...
 
Well, gotta go. TTYL.
 
cheers
 
2:53 AM
latter
I need to learn how to add some things to that chat bot
in the code.
the Browser finally crashed so now all the learned commands were lost...
 
0
Q: python beginner, flickr api

user46421I'm totally new to python and am hoping some of you clever guys can assist. I am trying to write a simple python script that will obtain a list of all my images from flickr. So far all I've managed to do is generate a set of albums but can't get much further. import flickrapi api_key = 'xxx' a...

 
Doge!!!!
 
such post. very off topic. wow.
 
@twobob Sorry I missed you, I've been quite busy lately. Anything you would like to know specifically?
 
3:57 AM
@DaggNabbit You said that shell script comments (#) are deprecated. Do you have a link to that?
I avoid them in PHP, just curious to see where you got that
 
@AlexL hmm, they might only be deprecated in .ini files
i think they were only ever intended for use in shebang lines though, i don't consider them to be good style
i'll remove that part
 
@DaggNabbit Maybe don't remove it, perhaps a reword to "non-industry standard in PHP scripts" would work
 
@AlexL, changed "deprecated" to "unusual"
 
Nice!
 
hmm, a shebang line would have to come before <?php
so it's not even a comment up there
so who knows why that's in the language =/
 
4:08 AM
Ooooo, @DaggNabbit, I had not. That's rather interesting
 
4:21 AM
Zombie down
 
@AlexL that one looks OT to me =p
example code
+1 anyway
but i think example code is OT for a good reason... who knows which pattern makes more sense without meaningful code?
 
I actually hadn't even thought of it being off topic!! Now that you mention it, it is kind of hypothetical code
 
 
1 hour later…
5:55 AM
0
Q: async method with multiple task

rcadaoasHi I'm trying to make my ASP.net Web API methods asynchronous, this method is in the Business Logic layer of my N-tier. I'm waiting for the result from my 1st task and use it on the 2nd task. but I think I'm doing it in a wrong way. can you please give me advice or feedback regarding my code. pu...

 
6:06 AM
hi all
 
Hi
Sorry all, I've flooded the front page a bit by introducing a tag.
English Language & Usage is more interesting. They've just flooded their front page with [pejorative-language].
 
just put a thx to the meta post of me :)
It improved the situation here no?
I don't see soe flooding at the front page (maybe looking bad page)
 
6:26 AM
@200_success No problem. :-) Hope you didn't mind me "edit-stalking" as well.
You do help out tremendously with tag-related stuff, and I commend you for that. I'll try to get used to this new tag.
 
6:51 AM
@Jamal How about if you delete your own question, then compensate the reviewers who wrote the two existing answers with bounties elsewhere?
 
@200_success It was only reviewed in one answer, so perhaps I can delete that answer, remove that code from my question, and then offer a bounty.
Regarding the code removal part, I'll keep it (it's used in my original code), but I'll make a note about not reviewing it, as well as blockquoting it.
Sound good?
 
Use your judgement. Do whatever feels fair.
 
I'll go with my plan, then. Minimize the damage.
 
7:15 AM
0
Q: Is this a reasonable binary search implementation?

kmauneimport java.util.Arrays; public class BinarySearch { // this class should not be instantiated private BinarySearch() { } // searches for the integer key in the sorted array a[] // @param key the search key // @param a the array of integers, must be sorted in ascending order // @re...

 
7:29 AM
0
Q: Is this implementation of persistence OK?

GreenAsJadeI found this on the web somewhere, and have been using it for a while, in an app that has hundreds of daily users. Just occasionally someone reports a problem that I don't get right to the bottom of, and occasionally these make me wonder: did the PermaDict fail? import pickle, json, csv, os, s...

0
Q: Makefile for automatically processing image files

vwegertI have a Makefile that is used to automatically process some image files. The basic idea behind this is copy everything from col-noborder and col-rewnew to col use ImageMagick convert to copy the files from col-addborder to col and add a pre-defined border use ImageMagick convert to copy the fi...

0
Q: JS function to get the code of html script element

m93aI've got a function to get the actual executed code of a html <script> element. I need it to: be as universal as possible work even on file-to-file requests if the browser allows to This is the code I have so far: var asyncGetContents = function(node,listener){ var hasRun = false; if(node....

 
8:21 AM
Wow! My first 5xp on CR!
 
you're welcome ;)
looking at your code now
 
Thanks, santa :)
 
@m93a did you run into a case where you actually needed to override the mime type, or are you just being thorough?
 
@DaggNabbit Aye. I use this code for a custom script parser. With type="application/x-lambdascript". Firefox used to throw an error without this part.
 
ah, interesting
i don't see anything wrong with this at all other than some minor inconsistency
the one-space tabs are killing me though ;)
@m93a the only thing I'd change is making asyncGetContents a named function rather than an anonymous function assigned to a variable, and using node.src instead of getProperty/hasProperty
and that indentation
not sure if those changes are big enough to warrant a review. This looks good.
um, getAttribute/hasAttribute
sorry, it's late here
 
8:34 AM
Yeah, I understand :)
 
I think you're doing the right thing with the hasRun guard too... simplest and clearest thing to do
nice work
 
Ty.
What do you do with questions like this? :D
 
@m93a if I were you I'd make those changes I mentioned before anyone answers, that will force any answers to be interesting and not piddly little stylistic things
whichever ones you agree with anyway
 
@DaggNabbit corrected. Is it right?
 
@m93a just minors stylistic things... leaving a space between the if and the parenthetical, leaving a space after the parenthetical and before the following brace
leaving spaces here: } else {
 
8:45 AM
nooo, that's ugly! :D
 
lol xD
the thing is, once someone writes an answer, people are much less likely to answer
so if someone writes an answer that only addresses that stuff, you could be stuck with no interesting answers
honestly I don't think there's much you can do to improve it, it looks fine, but I might be missing something
 
ok. ty.
 
@200_success what are you on about
@m93a English is not your native language, correct?
 
Hi @DaggNabbit. What's the issue?
 
@200_success your comment on this guy's question
 
8:59 AM
@DaggNabbit No, I'm from Czech Republic.
 
@m93a I think the wording of your question might be misleading, I assume this code does what you want it to do?
 
I see an AJAX request maker, and nothing more. I don't see what it has to do with finding <script> elements within an HTML page.
 
@200_success I didn't see anything in the question to indicate that he was trying to find script elements
 
Title is: "JS function to get the code of HTML script element".
Question says:
> I've got a function to get the actual executed code of a HTML <script> element.
 
yeah, language barrier
 
9:03 AM
> This is the code I have so far:…
 
the function takes a node parameter which is presumably a script element
 
@DaggNabbit Right.
 
so he's already found the element, he wants to do stuff with it
namely, load the resource identified by its src attribute
 
Could either you or @m93a edit the question to clarify it then?
Thanks!
 
done
np
@m93a, feel free to change that as you see fit
 
9:12 AM
I'm ok with it.
 
cool... welcome to CR, hope to see more from you in the future :)
 
thanks :)
 
@m93a whoa, any idea why the constructor definition is faster than the prototype in that question you just answered?
just because it doesn't have to look through the prototype chain to resolve that property I guess?
 
@DaggNabbit seems to be the reason...
But now it's TTGL (=time to go to lunch). See you :)
 
later :)
@m93a jsperf.com/construct-proto/2 <- prototype wins here
 
9:56 AM
0
Q: BINARY TREE implementation

Shruti**My code is not giving correct output.Can anyone suggest error.******* ***Program implements binary tree .Insert data in tree from text file . Search function search a item in tree. Inorder() traverse tree in inorder manner Input : 3 1 5 7 4 8 0 9 Output:1 9 7 1 4 8 5 0 3 9 ...

 
10:43 AM
Monking @all
 
Monking @Nobody
 
11:06 AM
@200_success Excellent tag! I think it was about time! Now if we just had a [tag:linked-li...oh wait]
 
11:25 AM
Monking
 
Monking @skiwi
 
And damn, Firefox now literally instaloads 20 tabs... As opposed to 500 tabs (even though it didn't load them) taking a few seconds
How are you today?
 
Monking @skiwi
 
Doing fine over here, how are you?
 
Monking @Nobody
Fine as well, and up late again ;)
 
11:29 AM
That's usually my job :P
 
Gotta do some assignment today... or tomorrow
 
@SimonAndréForsberg I would have created the tag earlier, but my concern was that it would get overused for trivial "calculator" programs. I hope that the long explicit name, as well as the tag wiki, make the intended purpose clear.
Let me know if it isn't clear what is/isn't covered by .
 
@SimonAndréForsberg I'm trying to find user experiences of javafxports, in combination with JavaFX 8 and also with Java 8
Trying to find the user experience, without being the user experience myself.
 
I'm also curious if it is possible to get the iconic android menu there, the tabbed thing on the left (or right), the SE android app uses it
@SimonAndréForsberg slideshare.net/steveonjava/java-8-for-tablets-pis-and-legos next interesting thing found
Finding out whether it really introduces anything new though
 
11:38 AM
@skiwi I believe that's made using Android Fragments, provided by the Android API.
 
I've got no clue what the javafxports actually does though... I had the impression that it 1:1 converted an existing JavaFX application to an android app
 
Biased? A bit, perhaps...
2
 
@SimonAndréForsberg Very much biased, yes ^^
 
What I love when people compare programming languages is that the criteria are always biased in favour of their favorite language :3
 
@Morwenn: Even with the given criteria I would not agree on some of the points they make about (the new) C++
 
11:50 AM
performance: optimized vs varied
what...?
 
@Nobody You're probably thinking about multi-threading?
 
for example
also platform independence
sure you have to recompile, but you can write platformindependent code in C++
 
And you can even run it on platform that do not have a JVM :D
 
In Java, it's hard to not write platformindependent code.
 
@Yuushi Varied as in varied programmers?
 
11:53 AM
I agree with the Java points in the picture, but I don't think C++ is as bad as they make it look like
 
@skiwi and that doesn't apply for every language in existence...?
 
@Yuushi In Java you really need to know what you are doing to get bad memory management... That's probably his point. Though I think overall it's still moot.
 
it's not as hard as people think to leak resources in java
 
In Java average memory management may be easy, but sometimes you need every little bit, which is very hard to get with objects and garbage collection.
 
resources isn't just memory
 
11:58 AM
In the end it comes down to the question what you want to do. C/++ has always been the domain of close to the metal programming and memory errors ^^
with a policy of "better sorry than slow"
 
12:30 PM
0
Q: Segment tree variable ranges

user3649942http://www.spoj.com/problems/GSS5/ http://www.spoj.com/problems/GSS1/ I am able to do GSS1 when range varies as x<=i<=j<=y but unable to narrow down the similar approach for GSS5 where x1<=i<=y1,x2<=j<=y2,x1<=x2,y1<=y2 I have used the idea that on merging we move upwards towards the root & me...

 
12:47 PM
@DaggNabbit strange O_o.
In this case: http://jsperf.com/construct-proto/5, constructor wins again.
 
 
2 hours later…
2:50 PM
It's oh, so quiet.
Is everyone coding?
 
0
Q: Personal Project for managing my Bookmarks - v2

Aseem BansalI had asked earlier for review of parts of my JS file earlier and review of the complete JS file of my project. Now I have made changes as per the suggestions. Here are the files. I would like to get a review of the structure and organization of the code. I have broken down the earlier single fil...

 
3:08 PM
Monking Simon
 
Monking @rolfl
And hey @kleinfreund
 
0
Q: Product price tracker for a ecommerce site and graph of price vs time over the time

aviI am building a small app which helps me to track a product's price change over a time. I am using Tornado and Mongodb. I will be tracking hundreds of products and monitoring the price for thrice in a day. Here is what I want: index page: which displays all the products I am tracking and give...

 
Heya @Simon
Heya everyone. :)
 
Who's up for some clean-up homework?
 
What kind of clean-up?
 
3:20 PM
Obsolete comments, maybe a badge
 
Are we talking F8 in Norton Commander? Shift + Delete in Windows Explorer? rm -rf * in Linux?
Oh, that kind of clean-up. I already got the badge.
 
Yeah, you do ... but there are still obsolete comments ;-)
 
You got a query to find them?
 
@rolfl I'm not sure if this question should be re-opened or not:
Thanks - this explanation is a bit different to the reason for "on hold" above. Here's the thing. The code already works. It passes all the tests I have for it. So my concern is about robustness. That's the type of thing that a code review is often the best means of determining: this works, but is it robust? — GreenAsJade 2 hours ago
It has 3 reopen votes at the moment. I'm a bit confused by what he's actually asking about.
 
3:27 PM
I saw that..... I think Jamal mis-selected the close reason.
 
Considering the edit, I don't think he did. codereview.stackexchange.com/posts/54291/revisions
"I found this on the web somewhere" certainly sounded suspicious.
Why can't I flag this obsolete comment?
Hi there, Sorry to say but your going off-topic with your question cause code must be real working code. We do not fix bugs or make extra functionality but we review working code in every aspects. Of course its possible you have bugs that you aren't aware of and that can we also point out, but in this case you know it's not good. — chillworld May 28 at 11:05
 
3:43 PM
0
Q: Looping through sub-folders - novice programmer

user3740620I am looking to copy/paste data from workbooks within different sub-folders within a user selected directory. I have generated some code to achieve this but have become stuck... I am simply looking for an objective perspective to check if I have missed something or for any suggestions. I have pa...

 
@SimonAndréForsberg I am not sure.... but I processed the other flags, how about now?
 
Nope, for some reason the flag icon doesn't show up
 
Monking
Happy Father's day
 
Ta. Hey Malachi
You too
@Malachi - can you flag this comment as 'obsolete'?
Hi there, Sorry to say but your going off-topic with your question cause code must be real working code. We do not fix bugs or make extra functionality but we review working code in every aspects. Of course its possible you have bugs that you aren't aware of and that can we also point out, but in this case you know it's not good. — chillworld May 28 at 11:05
 
@rolfl done
 
3:52 PM
@SimonAndréForsberg - just you ... not sure why.
 
Why can @Malachi do so but not me? Could it be related to the fact that I had upvoted the comment?
Or maybe it's just a hidden 'feature' in the SE system
 
@rolfl I really Laughed Out Loud LOL
 
@SimonAndréForsberg Yes, you cannot flag a comment you have upvoted.
 
Well that's a strange feature...
 
I'll confirm that
 
3:56 PM
so last night I was writing some new code based off of @Mat'sMug's answer (I had some good additions) and went to run it before I saved the new version, and KTurtle Crashed.......
 
163
Q: Allow flagging a comment after upvoting it

TshepangIt's sad to upvote a comment on a post that's subsequently updated in a way that renders the comment obsolete and not be able flag it afterwards. There may well be other cases where one would want to flag an upvoted comment too. Related: From November '09: Flagging a comment which was upvot...

 
@MadaraUchiha it's a duplicate on SO,
 
@Malachi link?
Oh, no, it's not a duplicate.
And I can reopen it instantly if needed.
 
look at the question again
 
I've a PHP gold badge there
 
lol
the wars
I gotta go
 
4:16 PM
@Malachi on Windows? Mine too crashes at times, I learned to hit "Save"...
 
lol
I am going to perkins and then might go to the driving range....
catch you all later
 
@MadaraUchiha - it would be on-topic here.... but I think a meta post is in order ... we are getting to the point of having duplicate 'is my PHP/SQL code safe from SQLInjection'.
There are only so many ways to write that code....
 
@rolfl How about a canonical?
 
That's what I am thinking.....
 
Something similar to Stack Overflow's "How do you prevent SQL injection?"
 
4:19 PM
but, it woul dhave to be run past our meta, I think.
 
0
Q: PHP programming im having problems knowing what to put of ADD CODE HERE

user3742556Products <?php if(!count($data['products'])) { echo "<p>no products found</p>"; } else { // This should display text/number input fields for each ...

 
I will re-write when I get back
 
201 questions related to SQL Injection .... codereview.stackexchange.com/search?q=PHP+SQL+Injection
 
0
Q: Injections and query

George IrimiciucI made a class that connects to my DB and inserts some values. Is it secure or how can I protect this further from injections? The object declaration will come from variables with POST from a form, after being validated, ofc. Just want to know if this is secure. That, and also, should I make a m...

 
Cross-post, but that's OK.
 
4:34 PM
SO Community Ads have been reset. Should we run another one? @rolfl can you check with Grace Note if it's ok for us to do that, I feel that we have sort of a little bit abused the SO "open source project advertising" thing, I wonder....
 
I can ask...
 
0
Q: Port code from VB6 to Android

ZuzooVnI have some problems when i port my source code from VB 6 to Android. I have an encrypted file and i wanna decrypt it using my generate method. But, the generate method produces a corrupt file, i can not open it by winzip or winrar. The correct file can be opened by winzip program Please look a...

 
4:49 PM
@CaptainObvious Ouch...
One that took porting code very literal.
And is off topic as I read through it.
 
CV please.
0
Q: Looping through sub-folders - novice programmer

user3740620I am looking to copy/paste data from workbooks within different sub-folders within a user selected directory. I have generated some code to achieve this but have become stuck... I am simply looking for an objective perspective to check if I have missed something or for any suggestions. I have pa...

 
Cool pic.
 
0
Q: Is it time to start broadening the definition of duplicates?

rolflsql-injection is commonly a concern in PHP, and it is a common request to ask when presenting code for a Code Review here. There are only so many ways you can propose a question that relates to SQL Injection in PHP. This new question was posted today (cross posted from SO), which is what inspir...

 
Woah, TIL that AltGr on Windows is in fact mapped to Ctrl+Alt.
While we're at it. Win+n opens the related window in the taskbar. O__O
And I thought Win+E was the only purpose of that button.
That said I can imagine that @Simon somehow mapped Win+E to open TotalCommander, right?
 
0
Q: PowerShell script to automate the search of DLL files

Nazar554I often write different applications in C++ using different libraries, and sometimes it takes a lot of time to find where are the *.dll files to distribute. I use Dependency Walker but it still takes a lot of time to look in the GUI. I wrote a PowerShell script that will find all used libraries a...

 
5:22 PM
@kleinfreund No actually I haven't, but I should really do that... (if I only knew how)
I can create an algorithm to calculate probabilities in Minesweeper but don't know how to re-map Win+E...
StackOverflow's pepole tell me ask question here — ZuzooVn 7 mins ago
Bah...
 
5:51 PM
Why would we move our crap somewhere else? — Robert Harvey ♦ Apr 29 at 20:16
2
 
@StackExchange @rolfl Your standard no-answer is missing there.
 
00:00 - 18:0018:00 - 00:00

« first day (407 days earlier)      last day (3602 days later) »