« first day (293 days earlier)      last day (4022 days later) » 
00:00 - 22:0022:00 - 00:00

00:03
0
Q: SQLite Helper Class in C#

NetInfoHere is a SQLite Helper Class I created. Any input appreciated, including security and simplification. using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Data.SQLite; using System.Linq; using System.Text; using System.Threading.Tasks; usin...

00:21
FYI, reload has occured.
00:33
0
Q: Condorcet voting method in OOP Python

JivanI'm currently learning Python and having a great time so far (coming from PHP, I have a feeling of suddenly seeing the light). At the same time, I'm studying voting algorithms. So, for training purposes, I made this little class which determines the Condorcet winner of a rank voting election (ba...

@codesparkle: thanks for the comment!
@palacsint no worries, deleted as you already fixed it
Hey, codesparkle!
@codesparkle: I hope I've fixed it
I am at work so just sneaking a quick look into the chat room for a minute
Hello @codesparkle!
Oh, okay.
Hi @syb0rg and everyone else as well :)
You should visit us more often, we never see you in here!
2
Note: Bounty expires in 23 hours.
00:39
agreed — it has been a rather busy year for me but I can assure you I've been keeping an eye on the community and I'm very pleased with all the great improvements: having an active chat room, the code-challenge, and how active meta has become
4
25
Q: Possibility to add a feed of all recent answers to chat rooms

Simon André ForsbergMany beta-sites suffer with a problem of voting. Code Review is one of them. We at Code Review have realized that it is hard to vote for answers that you're not aware of, therefore some of us (no monkeys named) posts a link to a recent answer every now and then in the chat. Instead of us posting...

0
A: Eliminate [design], [software-design], and [architecture] tags

JamalConsidering that these three tag can represent off-topic questions, I'll hold off on the prospective burnination until any remaining off-topic questions are found and closed. I'll update this as well, along with applying status-completed or status-declined.

@jamal yes I've taken a look at it and in my opinion none of the three tags in question have significant value for the site
I'm all for getting rid of them
@codesparkle: Thanks for checking on things? I still have most of the flag-handling covered; I'm not as busy.
Then one of us can put in the request after locating any remaining off-topic questions.
@codesparkle Please repeat that comment on the Meta post for the record?
00:55
Hey @Saposhiente
01:06
Hey @Jamal, I'm a bit confused. How was that question you just put on hold off topic? It seems like he was asking for suggestions on how to improve?
It appears he was just mentioning the design and not the code itself.
I'll check it out again...
In our help I quote, "Best practices and design pattern usage". What's the difference between this and just "design"?
Oh! The code he posted is something he wants to model! But isn't actually code to review?
What question are we talking about?
2
Q: How to design a robust class for Packet Capturing tool?

srainaI need to design a class for packet capture tool. Class should provide service to start and stop a dumpcap packet capture. Class should be capable of accepting all sorts of inputs which includes interface type, various filters, autostop condition and destination directory to save captured file. H...

I think i get it now, due to "using tcpdump instead of dumpcap without much changes"
Thanks Santa?
01:18
@Jamal I combined into one answer. Sorry for the pollution. I'm insufficiently slept today; I thought at the time it was a funny thing to do once, now see that it wasn't.
No hard done. I think some assumed you were taking that one Meta answer too seriously.
@Jamal Is this a canidate for burnination: codereview.stackexchange.com/questions/tagged/…
I'm not sure. That can still be posted as a separate Meta question.
01:35
I may have edited a few tag wikis.
So for all of you that can review suggested edits, now is your time to raise your review count in that category.
01:58
0
Q: How can I layout this class to make it easier to use for API developers?

Rich CI have an application that allows the user to place a string of text into a PDF document. I have three different ways that they can do this: Use a Form Field. Then they have four properties to define: Provide field name provide instance of the field provide an X-axis Offset provide a Y-axis O...

Advice on the length of github.com/Saposhiente/EvalJS/blob/master/src/com/github/… for getting it reviewed? It's 425 lines, but 100-150 of those lines can be easily omitted in the question for brevity.
@Saposhiente If you would focus on a snippet of the code, that would be preferable. But posting the refined down code wouldn't be terrible.
Though if you do post all of the code, I wouldn't expect reviews to happen very quickly.
@syb0rg I focused on a snippet of the code, and it got closed :P
@Saposhiente Ahh, but you didn't. You eliminated all of the code and asked a question on design, which is considered off-topic.
This would be an example of a snippet of code:
8
Q: More efficient way to retrieve data from JSON

syb0rgI am using the jsmn JSON parser (source code) to get some text from a JSON. jsmn stores the data in tokens, but the tokens do not hold any data, they just point to the token boundaries in JSON string instead. For example, jsmn will create tokens like: Object [0..31] String [3..7], String [12.....

Just a single method, or loop.
Or something similar.
Hello @rolfl
I swamped the review queue for you ;)
02:20
I've trimmed it down to 250 lines, 120 of which are from multi-line methods
Ahh, that seems like it would be all right, as long as it works.
In case anyone hasn't seen this. Almost to Necromancer.
3
A: 10x10 bitmapped square with bits

JamalThat global array is indeed not good. You'll need to pass around an array, but you shouldn't do it with a C-style array. Doing that will cause it to decay to a pointer, which you should avoid in C++. If you have C++11, you could use std::array, which will be set at an initial size. But if you...

BTDT.
0
Q: How and why does Braintree setup their API code this way?

Rich CHow and why does Braintree setup their API code this way? They are somehow allowing method calls that get chained and then populated into a variable that finally gets sent in through the Search() method. I've never seen APIs work this way before. How do they set this kind of thing up behind th...

Hi Syb0rg
02:34
^^^ Any idea where this would be on-topic?
SO?
Aaaand it's gone.
Meanwhile, I now need to choose a title.
02:55
1
Q: Using bukkit conversations for a coding console: Proper structure?

SaposhienteI have a class that serves to carry data between my Javascript evaluation class and the player, via the Bukkit Conversations API, available in full on github (you will need Bukkit and Rhino as libraries (you can just comment out the JNBT code, it's not important), and a Craftbukkit server to run ...

0
Q: Vote To Close to have headers like in close dialog options

Joseph the DreamerI come across posts that are irrelevant to the CodeReview site, and closing them would be the best choice, obviously. The close dialog has these options, where these texts are the headers: duplicate of... off-topic because... unclear what you're asking too broad primarily opinion-based Now if...

@Saposhiente This code compiles and works?
@syb0rg No main class because that's not how Bukkit works
@Saposhiente But the code works when the Bukkit library is supplied?
@syb0rg No, because there's no plugin class. Right, I'll provide a main(...) method to just send stuff through System.in/out
03:02
@Saposhiente Say all of the dependencies were available. Would the code work.
@syb0rg Only in tandem with the EvalJS class on github
Or is it fine for people to have to get the other classes from github for it to work?
People don't have to compile the code to review it. It just needs to be working code.
Okay
Also, in a funny story, my edit messages are backwards.
@Jamal Should this be re-opened now? It appears as if it should work:
1
Q: Using Bukkit conversations for a coding console: Proper structure?

SaposhienteI have a class that serves to carry data between my JavaScript evaluation class and the player, via the Bukkit Conversations API, available in full on GitHub (you will need Bukkit and Rhino as libraries (you can just comment out the JNBT code, it's not important), and a Craftbukkit server to run ...

My initial edit was the big one, message "completely reworked to fit content standards". Then I fixed a capital B, and wrote message "just a capital B". This overwrote my previous message, making the big edit have message "just a capital B". Then, when I edited it again to change the message back, it registered as a new edit, with no changes: "completely reworked to fit content standards".
03:20
Reopened!
</momentarily-afk> Thanks guys.
0
Q: tax return program need help

user3255517The overall program I have to do is a simple tax return. Add wages, interest, dividends, and other income. Deduct $2,800 for each dependent. income = wages + interest + dividends + other income - (number of dependents * 2800) I have that and that part is good. Now after I get that, I ask ...

@StackExchange We've seen this before....
Already closed as dupe. Hopefully we won't see a third one.
Does that instigate moderator action on the user account?
03:36
Possibly. But it's good you've left a comment.
I'm trying to help him understand what to do. I'm not sure he's getting the concept, I've pointed him to the help center.
I have posted as well.
0
Q: How to optimize my code to make it faster?

HansI am currently working on a problem of an online judge (not a contest). However, my code keeps exceeding the TimeLimit, which is only 1 second. I have used the Scanner and System.out.print() however I have been told that such methods will make my code slower and will consume more memory, that is ...

He deleted them both.
@Malachi self-learner ... ;-)
03:40
I hope we were able to help him, and he didn't delete them out of frustration.
The first revision was pretty awkward, too. He didn't have to delete it, but that's his choice. Perhaps he'll post a fully-working solution soon.
@syb0rg Hey, I've looked through your 26 tag edits. Can I make a suggestion?
Too bad I am anyway. Please actually read things you copy from SO. If it was always a one-to-one for our tags we would have imported them all. On the C tag you left links and description that isn't relevant here.
@JamesKhoury I saw you declined that edit. I revised it to edit out the non-related stuff.
I do read them, and at first glance I thought it would be okay to include it.
@syb0rg You must have been in the rendered view rather than the markdown view.
I don't think i can change my review on it. Sorry.
@JamesKhoury It's fine. I made the edit after I saw the rejection of it.
03:46
It is helpful to see tags with real content though. Keep up the good work.
@syb0rg: Another question from that OP has now been posted.
I saw, I'm trying to see if it's on-topic still.
0
Q: Total income program

user3255517I have my program working. I just need to redo this function a little bit. I got different % rates depending on what the income is and what the status is. float get_total_income(float wage, float div, float intre, float other, int dep) { char status[10]; float income = 0, sum = 0, adj...

@Jamal It looks like he is wanting a review, but the reviewed code has to eventually be some for-each loop he is talking about.
Which I don't even think exists in C, BTW.
I've added a comment. If it doesn't help, I'll close as unclear.
No, there's no for each in C nor C++. This is also not C++, regardless of the for each.
04:01
Apparently it's a function in C++: cplusplus.com/reference/algorithm/for_each
Ah, that. I thought he meant a keyword. I may need to add the tag back then, but I'll wait. The code still barely looks like C++.
I can't get it to compile, though that could be due to global variables he isn't including.
The real challenge is getting rid of all of those magic numbers...
@Jamal Heh, he answered your question with a question.
I'm just guessing his English isn't too good. But I do still want to work with him here.
There are so many things wrong with this code... I'm not even sure where to start reviewing it...
at the bottom
04:10
It's so strange, he is using functions that were introduced in C11 (the most recent standard that not many people are using quite yet), and yet his code is so... un-standard.
Well, feel free to review it once it's on-topic.
Ahh, he added all of the code.
Umm: #include <cstdio>
C++
But he already includes it earlier...
ARRGH!
And the rest is C. That should be mentioned in a review, then.
Okay, it's ready for review.
Slightly comedic first line in this answer:
0
A: Monadic Immutable Linked List in the Least Functional Language Evar

amonThis is pretty decent code. A few things seem noteworthy: The spacing is inconsistent. This could have happened if size was a boolean isEmpty in a previous incarnation… There are a lot more opportunities to declare variables to be final than were used. The documentation inside the methods is a ...

It's even funnier considering it's a selfie. :-)
04:23
@Jamal @All ... ( @Sim In case anyone is interested in the helping people, or yourself, to badges, I have put together this 'little' SEDE query... One Vote Short
Nice!
What's the proper style for putting algebra in your answer?
Are there no overlap with answers? I have 4 almost at Nice Answer, but it lists two for me.
Still improving:
0
A: Total income program

syb0rgThere is a lot that could be improved in this code. I doubt I will be able to mention it all. Things you could improve: You include both <stdio.h> and <cstdio>. #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <cstdio> I couldn't get the code to compile as C code with t...

@Jamal - it is based off the data that was current when SEDE was populated
So, from last Sunday ;-)
04:28
Oh, okay.
@syb0rg: +1 - that's a pretty good start. Probably the most important thing here would be all the if statements.
@Jamal Still working on it. A switch statement wouldn't be the right approach here, so I may have to look to loops.
@rolfl: Have you already posted that on Meta?
Under what? Wonderland?
(Well, no, I have not posted it anywhere)
I also think that "un-votable" posts (such as locked posts) should be excluded. In this case, Jesse's answer cannot receive Guru as the question is locked.
Yes, Wonderland would be best.
04:49
Updated:
2
A: Total income program

syb0rgThere is a lot that could be improved in this code, so I doubt I will be able to mention them all. Things you could improve: Preprocessor You include both <stdio.h> and <cstdio>. #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <cstdio> User-experience You ask the us...

@Jamal Now I show the OP how he can refine his test conditionals.
Also, I organized all of the mini-reviews.
As a new answer, you mean?
Nah, I just put "headers" above all the different topics I cover.
Okay.
2
A: Stack Exchange Data Explorer is up. What now, Wonderland?

rolflIt is very exciting to get badges on Stack Exchange, but, how many badges are you one vote away from? Badges can be somewhat complicated to understand, but, sometimes you are just one vote away from that Enlightened.... but, were you the first answer? Are there badges you missed? Is there a vot...

05:03
@Saposhiente Algebra? I don't think CodeReview has anything special for Maths. Just write it as you would in code?
@JamesKhoury Yeah, that's what I'm going to do. Asker's code is perfectly fine; they've just got a bad algorithm.
Well, mostly fine.
just put it in a code block or blockquote block?
@Jamal that is awesome!
And it was written by the monkey @rolfl
I know! :D This must be Santa's (nice) list.
What do you mean self learner? @rolfl
@Malachi: The badge? That's for having a score of 3 or more on a self-answer.
05:52
@200_success I fixed the assertion
0
Q: convert-number-to-word-in-php-not-working

jhonPlease note, the following PHP code converts amount in number to amount in words. This works fine for integer like (ex. 5250) and when it with decimal it gives wrong results. Ex: for 450 = four hundred fifty only. Ex: for 450.5 = four thousand five hundred five (which is wrong) and it should be ...

0
Q: Optimizing Filtering Function

ruler501#include <iostream> #include <fstream> #include <algorithm> #include <thread> #include <cmath> #include <sstream> #include <cstdlib> using namespace std; ostream* outfile = &cout; bool testCantor(unsigned long long p, unsigned long long q){ while(q % 3 == 0){ q /= 3; if (p/...

FYI, this question is rising on the hot network questions list:
3
Q: Total income program

user3255517I have my program working. I just need to redo it a little bit, and it could use some improvements. I got different % rates depending on what the income and status is. #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <cstdio> //functions called float wages_loop(); float othe...

I think I'm off for the night. That answer exhausted me.
Very good work. :-) I'm glad I didn't have to take moderator action here. Everyone won.
Goodnight!
0
Q: Get array of pressed buttons using extension method

davidkennedy85In my game, I need to detect whether any buttons/keys are pressed at all before I try to process any input. This is easy enough for keys since the XNA library provides a GetPressedKeys method on the KeyboardState class: private void ProcessKeyboard() { keyboardState = Keyboard.GetState( Play...

What question??? I will see it tomorrow I guess. Goodnight everyone
06:06
Alrighty! I've got a new question!
06:49
0
Q: Path from source to destination, with increasing values

JavaDeveloper Given a source and destination, in an integer matrix, find path, such that the next position in the path has a greater than or equal to value than the previous position. In other words monotonically increasing. In event of multiple paths, a non-optimal solution may be returned. I'm l...

07:37
@Jamal Night!
Studying for quiz tomorrow. :-/
Python people: is this ready for reopening?
-1
Q: Copy a directory structure to another, but only copying specific files

Patrickscript.py: #!/usr/bin/python import os srcDir = os.getcwd() dirName = 'target_directory' dstDir = os.path.abspath(dirName) def ignore_list(path, files): filesToIgnore = [] for fileName in files: fullFileName = os.path.join(os.path.normpath(path), fileName) if not...

08:00
Good morning everyone. :)
Morning!
08:27
wimp.com/pbsremixes <-- Bob Ross at his very best
@rolfl I love that query, remind me about it again when I am home!
Hello, @user13500!
Hello :)
Do you require assistance or are you ?
I have looked at the code in this question: codereview.stackexchange.com/questions/42387/… my question is what is OK to write in an answer. Is it OK to rewrite a lot of the code? As in refactoring and explaining why and how?
If I'm continuing as I have started I'll end up rewriting a lot of the code and "delivering" a complete, rewrite ...
Yes, that is an option, if you have a different approach in mind and can explain how it works.
08:34
OK. I'll look at it some more and see if I post. Received an urgent e-mail about another matter ...
However, this is a homework question (details from the previous revisions), so it may not help the OP entirely. Of course, these answers are still for the benefit of everyone, so feel free to give it a shot.
08:59
@200_success: Is this ready to be reopened?
Waiting for four days now to have the camera I ordered. They didn't even send it. Logging into my account and what do I read there: cancelled
09:22
0
Q: Usage of __ while declaring any variables or class member in python

Bhupesh PantIs this is good practice to use __ convention while declaring the member variable? This also imparts private kind of feature of that data member. There have been cases when I found that its good to have hidden members of a class. This is certainly exposes only that feature that will help the th...

09:58
@Jamal It's very close to working code, missing just an import shutil. I wouldn't normally close a question due to such a minor fault. This poster seems to double-space everything for some reason. When he double-spaced his other question, it was clearly unintentional.
I've nominated it for reopening.
10:28
0
Q: How am I doing? My first ongoing PHP project — Minecraft query tools

WinnyHow am I doing? This is my first major PHP project and I haven't gotten much feedback and any feedback is appreciated! The quick rundown of the project is I wanted to learn how to use PHP and I wanted to learn about Minecraft's status protocol, so I did what was obvious at the time. File listin...

0
Q: Which Java string value is preferred to return: blank or null

Truong HaI come across this snippet and wondering I should remove the first line String result = ""? Which is more practical: return blank or null public String getInfo() { String result = ""; String uri = clientConfiguration.getUri(); String regex = "http://(.*)/consolidate"; Pa...

0
Q: JavaScript Sandbox Pattern

4485670Based on this Stackoverflow question I came up with the following code. I'd like your general thoughts about it. Code style, functional, logical, disadvantages, just anything you can come up based on the code that should be mentioned about it and springs into your eyes. Thanks! This is the sandb...

10:46
0
Q: recursive tree traversal, LCA, o(n) ? JAVA

NimChimpsky public TreeSet<Node> find(Node node, TreeSet<Node> nodeSet) { nodeSet.add(node); if (node.getLeft() != null) { find(node.getLeft(), nodeSet); } if (node.getRight() != null) { find(node.getRight(), nodeSet); }...

11:19
Why is it, that this page says I only have 19 answers in the html tag, whereas my profile tells me I have 25?

http://codereview.stackexchange.com/tags/html/topusers

http://codereview.stackexchange.com/users/35408/kleinfreund?tab=tags
@Malachi Make sense now?
11:41
@kleinfreund answers + questions = posts
Alright, thank you.
0
Q: Preventing Email Injection (Updated)

LoaiA day ago I have asked a question on here about Preventing email injection. I had some feedback and worked on it, below is the latest update - please would anyone share their opinion? is it secure enough? is there a way to short-cut the code? <?php session_start(); if ($_SERVER['REQUES...

 
1 hour later…
12:52
0
Q: Am I using Lazy initialization properly?

James SouthThe following code is intended to implement a LinFu DynamicProxy interceptor to lazy load given virtual properties from an Umbraco datastore. My concerns: Thread safety, Have I covered all the bases, Am I storing variables correctly? Duplication - Getting the child type, am I safe to store a v...

13:03
@200_success - just saw your icon pop up.... can you check... am I being stupid here?
You use the words "finds the lowest common ancestor in tree of nodes" but the picture you draw is not a tree, and nowhere in your code do you have a 'root'... your 'find' method just builds a set of children, not ancestors. Does your code work? — rolfl 27 mins ago
13:40
0
Q: Ruby Array Variable Loses Reference While Looping

user3335369I have two questions. 1) Is their a way to streamline this code from an object perspective? and 2) I am writing a parsing routine in Ruby 2.1 for a spreadsheet. The code works properly through the first array of pricing data. Unfortunately, on the fifth loop through datatable, while processing th...

Hi @StackExchange
Banana?
3
14:08
ring ring ring ring ring ring ring
#Bananna Phone
Love that song
@rolfl yes it makes sense now.
I love the tablet application but at the same time it doesn't compare well to the full desktop site
since chat is such a big part of the SE experience I find it frustrating that the apps are not chat friendly
I agree
-1
A: Generic Task Blocking Queue

Roni DoverJust as a clarification, this is an interview question that the writer of this post attempted to solve during a job interview at an Israeli company for an R&D position. I know that since I work at that company and am familiar with the question. Personally, I think its quite objectionable to post ...

▲▲▲▲▲not an answer
@Malachi I don't find it even close. I've nerver been ble to really use it
14:21
has anyone worked up a nice query to show how much new user retention we have? and if it is on the rise?
@Marc-Andre are you talking about the application now?
@Malachi Yes sorry
@Marc-Andre I totally agree with you. I like it for watching for new answers and new questions, but you really can't do much on the application.
@user13500 Whoa, I didn't even invite you here and you came! This is great!
I like how active you are for a new user!
Sometimes finding a good name for a method or a variable is so hard... I can't find something nice that will fit what the method is doing.
@user13500 I like your blank about me section
go @syb0rg go
BTW (Back to Work)
14:35
0
Q: How to declutter dependencies

mboldtI'm running into a problem with my code in a asp.net mvc application. Maybe it's not a problem and I'm being just paranoid but it seems like a problem to me (might be because I just read the Clean Code book...) I am using the repository-pattern with the unit of work-pattern to abstract the data ...

14:46
@rolfl I was checking how you named the gridbaglayout, so it was "easy" to spot!
0
Q: Sieve of Eratosthenes - Python

IgglybooSo I've been doing a lot of Project Euler lately and just wanted to make sure my implementation was as good as it could be. Does anyone have any suggestions to speed this up? def sieve(upperlimit): # mark off all multiples of 2 so we can use 2*p as the step for the inner loop l = [2] + [...

@Malachi ???
FYE (E->Entertainment):
@syb0rg I voted on one of your answers or something and it brought the positive score to 10
@Jamal you could have waited for this Comment to get some more votes....lol JK codereview.stackexchange.com/questions/26497/…
15:14
There is no syntax coloration in the question.
@Malachi Ahh, thank you!
15:39
REVIVAL (and Self-Learner)
0
Q: Bidirectional map based on memory manipulation (C++11)

Vittorio RomeoThis is a bidirectional map implementation that stores the values as pairs on the heap, and uses pointer arithmetic for efficient lookup. codepad link, may be easier to read #include <iostream> #include <set> #include <utility> #include <SSVUtils/SSVUtils.hpp> namespace Internal { template<...

16:05
0
Q: UITableView 'hidden' section causing more memory allocations every time on pull to refresh

troop231I'd like to see how to improve this code. I have a UITableView that I'm 'hiding' a section when the user taps on that section's header. I thought this was a pretty cool implementation, but it turns out when this section is hidden and the user pulls to refresh, about 1-2MB is added into memory eve...

16:23
0
Q: Java Ghost4J PDF to Image Conversion

DanThe primary goal of this code is to convert a PDF file to images. I also create a directory under C:/Media based on a combination of the PDF name and current date and insert the uploaded PDF to the same directory as the images for safe keeping. I am primarily concerned that I am over-complicati...

I actually have more Rep than @CodeSparkle right now!!! lol
0
Q: Bash script - automate an upload image + description process on a server

David JordanI was tasked at work to improve a system where through a web interface a client, which eventually became us, uploads a bunch of images with descriptions (latter coming from csv files), the images are then automatically resized yada yada for the site. Nowt wrong with the latter, but the upload a...

You've earned the "Revival" badge for Multiple repository calls or LINQ query. See your profile.
LOL ▼▼▼▼
2
A: Multiple repository calls or LINQ query

MalachiI personally like the Second option, like you said it is cleaner, easier to read, and looks fairly simple and straight to the point. I don't see any obvious mistakes in your code. I can only suggest that you test it vigorously and perhaps check out the option given by @Jignesh Thakker in the c...

0
Q: Ruby programmer wants to help a C novice to refactor his small C app

Joshua MuheimA friend of mine needs to learn programming C in school, but unfortunately he has troubles with it and his teacher seems to be pretty incapable, for example, they are using Eclipse IDE and the teacher never showed how to do a Refactor => Rename, for example (so all pupils search and replace stuff...

I was supposed to remind you of something... what was it...?
9 hours ago, by Simon André Forsberg
@rolfl I love that query, remind me about it again when I am home!
Zombie!
0
A: Scala TDD and function injection

Uri AgassiI'm no Scala Pro, but I'll try to give my two cents anyway: Your decision to "inject the functions" (pass them as parameters) in order to be able to test them resulted in awkward code, and complicated an otherwise simple method. As for the tests you chose to make of the resulting method, they s...

double-tap!
I should check how many '11 there are remaining. It'd be nice to at least get those gone.
@rolfl Hit the cap, losing rep :/
Side note: I can now protect questions!
17:21
Microsoft Spell check recognizes "AutoMagically" but Google Chrome doesn't/
@rolfl I was totally confused by the question and the code, until I finally figured out what he was thinking.
0
A: Lowest common ancestor in recursive tree traversal

200_successYou seem to be have a few misconceptions, as @rolfl points out. First, the data structure you have described and illustrated does not fit the definition of a tree. Rather, I would characterize your data structure as a graph of maximum in-degree 2. Second, you seem to be under the impression th...

I am currently cleaning up those three tags. I'll contact Trogdor as soon as I finish.
@rolfl Some positive reaction from our friend.
You get my +1 ... ;-)
@Jamal You mentioned The Workplace graduating. I stopped by and gave an answer. Now my status bar is hyperactive from the subsequent comments.
12
A: How can I professionally offer to accept a previous wage after they rejected my proposed counter-offer?

200_successAn employer that wants to fill a position normally wouldn't rescind an offer. My guess is either: They had already another candidate to fill it, and have extended an offer to someone else instead. Your counteroffer was so unreasonable that they would rather continue interviewing more candidate...

17:36
Nice design! I am so jealous...
0
Q: C# Internal Class with Public Methods / Internal Methods

Pathachiever11Suppose I have this Internal Class in C#: internal static class DataProxy { internal static Data GetData() {..} public static Data GetData2() {..} } It doesn't make a difference if I use internal or public, right? I always use public mostly because of consistency, but browsing throu...

Yep, that design is streight forward.
^ example code - off-topic.
But I can go ahead and migrate it to Programmers on request.
0
Q: Inheritance and setting up for an API request

user3338117I am setting up a class to be used for an API request (with JavaScriptSerializer) I am using it to send a complaint to their ticketing systems. So for example I send Title, Description, Custom_Fields In my code I have public class Report: BaseRequest { public string Title {get; set;} p...

17:58
@kleinfreund: I think this suggested edit should have been approved: codereview.stackexchange.com/review/suggested-edits/17426 (check the markdown)
@palacsint syntax highlighting works fine without the <!-- language: lang-foo --> comment as long as the question is tagged appropriately – rejection was therefore correct.
@amon - thanks for the perl answer... lots of food for thought.
@amon: Good point. Anyway, the rejection message should contain that too.
@amon some languages don't render correctly unless you add that lang comment. some are not linked to the tags
@amon - in this case, the highlighting is different between <!-- language: lang-lua --> and nothing.
18:08
or I should say they don't have a language highlighting associated with the tag on Code Review, yet
Actually, I am wrong ....
lang is doing funny things in my preview.
@rolfl Well, the red background in the diff is hiding the existing highlighting, but the history (and present state) shows clearly that it works
on HTML/CSS questions it is almost Mandatory to have them at the beginning of the code blocks
@Malachi indeed, Prettify can guess some things, but has it's difficulty with XML/HTML and CSS. It works for boring stuff like Java, though
It's especially entertaining to see its failure modes when highlighting Perl, with its custom quote operators. qq(it's a string) ← lone ' will derail the parser
perl's chameleon opeartors are nightmares for parsers..... s{this}(that) ... ;-)
s/this/that/
s!this!that!
18:17
@rolfl s gthisgthatgg ← global substitution
Even, if I am not mistaken.... s"this"that"
s'this'that' will work as well, but disallow variable interpolation.
0
Q: Many member variables, my options for read only access?

user1062874I have a MouseInputHandler class that registers itself to an InputManager. When the InputManager class receives events they are forwarded to MouseInputHandler which changes it's state to reflect the state of the mouse. A mouse as an input device provides a large number of different properties tha...

0
Q: Is my implementation of shunting yard algorithm correct?

Abhyudaya SrinetI am trying to implement an expression parser and below is my code of the implementation via shunting yard algorithm about which i learnt here Equation (expression) parser with precedence? I am able to get the correct results for the cases im testing but I think it would be better if someone ex...

1
Q: Any bad habits or good habits that I have

user3117051I started learning Java through an internet course I'm 17 and want to get a head start before college. I have written this simple program that is a basically a maths test. I would like to know is there any areas I can improve on and if I have any bad habits that would be useful to break now. I re...

0
Q: recursive calculator in C

rikonorThis is a calculator I wrote for a student's project, It still has a problem (one that I know of), where it can't handle inputs of the form '2*2*2...' (more then one '*' or '/' sign). The case '2*2' was solved in hackish ways. I'd appreciate any remarks or advice on the code and possibly how to...

Busy Friday!
18:42
@StackExchange Off-topic, doesn't work.
11 hours ago, by kleinfreund
user image
▲▲▲I like
19:08
@Jamal I figured it was really, really quiet in here.
Hey all, I have a new question
Perfect timing, too! I've just finished cleaning those three tags, so now I can get the tags burninated.
Say, a person asks a question, receives feedback, and then alters their code. Should they create a new question (asking the same thing, just new code), or update their original post and wait until they can give a Correct answer?
16
Q: Can I edit my own question to include suggested changes from answers?

ChrisWI posted a question with code, which one or more people answered with a code review. Should I edit my question, to include the changes which were suggested in the code reviews? To show the finished code? To avoid getting more of the same answers on the old code? To get new reviews of the new c...

@syb0rg Ah! Well thanks!
19:24
As a community member, I'd encourage you to take action if you believe that someone has invalidated answers to their question in such a way. With insufficient rep, all you can do now is to flag a moderator. Signs include
1.) the OP telling an answerer that they're updated the code (if there's only original code)
2.) a major update on the original code was done after receiving an answer (and no separate updated code)
4
19:37
0
Q: Write a C program using multiple functions that will calculate the gross pay for a set of employees

user37288I am relatively new to C Programming and really trying to gain a better understanding. I already wrote a program that will calculate the gross pay for a set of employees. I want modify the code by adding multiple functions. Can anyone help me? I want to create a separate function whenever poss...

@StackExchange Off-topic, OP is asking for code to be written.
@Jamal PIN IT
19:55
@rolfl Thanks, now favorited your query!
@Jamal When closing questions, original posters aren't notified that their post is closed. Therefore, it's good to leave a comment
I believe there's a MSO request somewhere asking for that functionality to be added, so you will know when your question gets closed.
Excellent... someone upvoted an answer.... I now have positive reputation for today ;-)
@rolfl Santa says hi
Hi Santa!
You've earned the "discussion" badge. See your profile. yay, how could I have survived without it?
20:10
@SimonAndréForsberg: Discussion badge? Have I missed something? :)
@palacsint It's not that interesting, it's just a bronze tag badge on Code Review meta :(
@SimonAndréForsberg: Oh, I see, a tag badge :)
@SimonAndréForsberg: Yes, I have left a comment for nearly all of my closures. Only a few of them were opinion-based.
The final phase of the SO election has begun!
@Jamal Good, I just noticed that you missed commenting on one but I did it for you :)
Yup, and I'm reading up on them, deciding to who to vote for
@Jamal I already voted.
20:20
Me too
Me, too.
just got my cool silver badge
20:33
Are there only 10 candidates left to vote on now?
Yes
Damnit, I read Madara's answers to the questions and now Madara is not in the list!
I would like to have 1000 more reputations points. I would have 1337!
@syb0rg: I can't find any C++ code in here, just C. But it probably doesn't matter as it would be best for SO.
0
Q: recursive calculator in C

user2327670This is a calculator I wrote for a student's project, It still has a problem (one that I know of), where it can't handle inputs of the form '2*2*2...' (more then one '*' or '/' sign). The case '2*2' was solved in hackish ways. I'd appreciate any remarks or advice on the code and possibly how to...

Now I have voted in the SO election!
20:47
Zombie!
0
A: Can I make my render method more efficient?

Jeff GohlkeSometimes, the correct answer really is "Nope; it's all good." It makes for a boring answer, but there it is. It doesn't look like you can make this much faster, based on what you've provided. One thing you might consider is checking the variables to see if the image manipulations are actually...

Got to go! Have a nice evening all!
0
Q: algorithms for traversing unordered tree

AdRI have been doing some programming 'exercises'. Trying to come up with the most efficient algorithm for tree traversal. Consider following function signature: CNode * CNode::find(int number) const where CNode structure is not organized as binary search tree (otherwise obviously a faster a...

@amon Some bedtime reading for you: cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf
21:04
@200_success Oooh, it has charts, and code examples in Haskell, and beatiful LaTeX typesetting :) (I'm terribly sorry for that Python answer)
That's OK. I've written some stupid reviews too.
@Jamal Well there is his problem, he shouldn't be compiling C code as C++ code.
I'll take another look at it later, but right now I'm not going to reopen.
There already is a reopen vote.
I'm curious what compiler was used, and what flags were passed.
I think we should ask that.
21:15
@200_success: it compiles with g++ (Debian 4.4.5-8) 4.4.5
I mean, I wonder what compiler the OP used.
It's not clear if this is supposed to be C or C++. Could you make the language absolutely clear, and tell us your compiler setup (e.g. which compiler and what options you are using) — amon 26 secs ago
I think we're on track to get our first 20k user in about a week.
:-)
^ I'm not sure why you converted that to a comment. IMO it's a legitimate criticism of the code (i.e. an answer).
21:26
^ Agreed; that's an answer.
it's half an answer. E.g. quoting a source might make it a whole one. I'd rather have seen a comment requesting expansion than a deletion
I can undelete it, then. But I'll put a post notice on it until the OP expands on it.
Honestly, I don't know. Sorry. I intended for this to be C only, could you tell me what part is C++? Also, palacsint says he successfully compiled it using g++, so I assume that is what I'm using (Sublime Text 2). I'm sorry you can't run it for some reason, my question was mostly about the logic really. Thanks regardless. — user2327670 7 mins ago
@Jamal What is there to want from the OP?
Short answers are allowed.
Single-topic answers are allowed.
@ChrisW I could post a contesting answer “this magic number identifies PDFs”, which is obviously wrong. Which answer would be valid? The one that has some kind of argument beyond “believe me”. E.g. quoting a source would do the trick
@ChrisW: Others were wanting to know which compiler and flags the OP has used. It can continue to collect reopen votes if what the OP has is sufficient.
21:41
@amon Is google.com/search?q=base64+jpeg+header+9J%2F4 an adequate reference? This isn't Skeptics.SE
@Jamal You @ed me about the C/C++ question but I hadn't mentioned that question.
I edited the PNG/JPEG answer to include that Google link.
@ChrisW: Sorry, I got confused. I also wasn't entirely aware of the new policy referring to short answers. It's not something I'm used to, so please bear with me. With your edit, I can remove the post notice and comment.
@Jamal I think people agreed that very short answers are OK iff they're helpful, on-topic, and not link-only: meta.codereview.stackexchange.com/q/1463/34757
Also, I can change that Meta post into a FAQ, also making it current site policy.
It was an admirable answer.
I understand now. Like I said, I'm having to transition into such a change, which is okay during the beta period. I'm absolutely not disregarding community consensus.
21:50
@Jamal what? we have a consensus?
According to this Meta post, many agree that short answers are okay (under certain circumstance, as long as they're not link-only), which code-only answers can sometimes be accepted.
13
Q: Short answers and code-only answers

ChrisWWhat should we do with: Short answers (for example, "I suggest you use [hyperlink to this standard API] instead.") Code-only answers (for example, an improved version of the code in the OP) Such answers could be improved (e.g. by adding an explanation of why the suggestion is helpful). Is it...

@Jamal I believe changes can come to site policy even after graduation, just look at SO...
man are they sticklers on Superuser
@SimonAndréForsberg: Right, but most of it is usually done during beta.
FYI: Question is ready for re-opening:
1
Q: Minecraft query tools

WinnyThis is my first major PHP project and I haven't gotten much feedback and any feedback is appreciated! The quick rundown of the project is I wanted to learn how to use PHP and I wanted to learn about Minecraft's status protocol, so I did what was obvious at the time. File listing The code is al...

@Jamal Yes of course, that's one thing that the beta period is for.
00:00 - 22:0022:00 - 00:00

« first day (293 days earlier)      last day (4022 days later) »