« first day (312 days earlier)      last day (3707 days later) » 

9:04 PM
And I'm off, see you all later
 
Bye @BenVlodgi
 
Bye!
 
@BenVlodgi later
I am out of here too
 
Bye!
Hello @PatoSáinz and @nhgrif
 
9:17 PM
Hi
 
Anonymous
@syb0rg sup
 
Upcoming question for you, @syb0rg.
 
syb0rg, the more I think about the idea of implementing a RationalNumber (or ComplexNumber) class as a good means for practicing both OOP and Objective-C, the more I think it's a good idea. ;)
 
@nhgrif Is this a suggestion for me to try out in ObjC?
 
Anonymous
I wonder if imaginary numbers are implementable in C
 
Anonymous
9:20 PM
maybe in haskell, lisp, they are
 
syb0rg, yes. We were discussing something the other day, and you said you weren't 100% comfortable with OOP, I think. I told you that OOP didn't completely click for me until I wrote a rational number class as a Java assignment.
 
@nhgrif Sounds like I should implement it then :)
 
0
Q: Can this recursive binary search in C be made more concise?

AndyCan someone please let me know if they see glaring issues with this code? I tested a handful of cases and it seems to work but in other threads. I often see much more concisely written versions of this. I just want to know if anything I have done is superfluous or just stylistically poor form. ...

 
And then post it as a CR question.
 
@PatoSáinz I don't see any reason for why they wouldn't be...
Well, this just can't be right...
And so it's time to sleep again, at least I got some progress on some serialization code I'm working with... (yes yes, it will be reviewed later on)
Night folks.
 
9:31 PM
Goodnight!
@Corbin: Any thoughts on this one? I went ahead and closed it as unclear for now. I still can't quite tell if this really is how the OP intended it to be.
6
Q: Any tips for making this C++ vector class faster?

user3058865I've been working on a 3D-vector class which should be as streamlined as possible for use in numerical simulations. It will be used to model 3D-physical vectors. I hoped to design it in a modern and fast way - but one is never perfect. So, I would be interested in some input from your side. //t...

 
Considering it's technically working code, I don't think it should be closed. It is a bit unclear what his intention is, but I think he meant a mathematical vector (which when in unit-vector form is just a 3d point) whereas you were thinking a dynamic array. If you look at his operators, it's definitely a mathematical vector.
I think he's asking for the wrong thing ("performance" reviews irk me), but people can focus on whatever aspects they want so that doesn't matter.
 
Yes, Jerry Coffin did first agree that it looks more like a 3D point in space. I'm still a bit unclear on it, but I suppose I can reopen if you or someone else can still figure out a review.
 
I definitely have some things to point out on it. I won't be able to until a bit later from now, but there are certainly some things.
 
Me too, but I don't feel like doing so now. This last assembly (also part C++) zombie must've tired me out.
 
0
A: Can this recursive binary search in C be made more concise?

syb0rgThings you did well Declaring your parameters as void when you don't take in any arguments. Keeping your dependencies to a minimum. Things you could improve Bugs: You have a bad test conditional. if(value < 0) int first = 0; I think you mean to return a value there instead, but forgo...

 
9:46 PM
7200 rep even! :D
And one vote left...
 
0
Q: Time optimization of finding separators

SimonIn one of my assignments I faced a problem: There are unknown number of pairs of words. A line consists of: 1. a word, max 10000 chars 2. a space 3. another word containing letters which are separators 4. a new line sign (btw I mustn't use strings) I have to write the first word with spaces inst...

 
0
A: Created a BST for Objective-C, Looking for some feedback

nhgrifFirst, it should be noted that an NSDictionary can use any object as it's key, as such, your setValue:forKey: methods should probably be rewritten to take id as the key argument type, rather than NSString*. Second, while the structure of your binary search tree is important for somethings, the...

 
@nhgrif Tagged for reload
 
@Jamal Nice!
 
1 fewer unanswered ObjC questions
 
@StackExchange Non-working code in a question, likely to result in a mess of answers.
1
Q: Can this recursive binary search in C be made more concise?

AndyCan someone please let me know if they see glaring issues with this code? I tested a handful of cases and it seems to work but in other threads. I often see much more concisely written versions of this. I just want to know if anything I have done is superfluous or just stylistically poor form. ...

 
10:11 PM
@PatoSáinz The C99 standard includes support for complex numbers.
 
Revised:
3
A: Can this recursive binary search in C be made more concise?

syb0rgThings you did well Declaring your parameters as void when you don't take in any arguments. Keeping your dependencies to a minimum. Things you could improve Bugs: You have a bad test conditional. if(value < 0) int first = 0; I think you mean to return a value there instead, but forgo...

Now includes some revised code.
Hello @JamesKhoury
 
0
A: C# class to encapsulate and manage multiple background web crawlers

Jeff VanzellaGenerally, very well written code. I just have a few suggestions. In the Start method, I understand why, but I don't like that there are two calls to check if the service is running. It feel kind of redundant, and I don't think you'll get a speed increase by short circuiting the lock. I would...

another Zombie dead
 
Edit-stalked.
@Corbin: Yet another assignment that combines both C and C++, but is tagged as C++...
0
Q: Time optimization of finding separators

SimonIn one of my assignments I faced a problem: there are an unknown number of pairs of words. A line consists of: a word, max 10000 chars a space another word containing letters which are separators a new line sign (btw I mustn't use strings) I have to write the first word with spaces instead ...

 
@jamal Yeah, I hate how the line between C and C++ is very, very blurred. This is about as C as it gets if not for new and cout. But unfortunately, I don't think retagging it would be appropriate.
 
I just left a comment.
 
10:21 PM
And, I'm not sure if the asker will understand what you're truly getting at with your comment. Hopefully whoever reviews it will explain a bit of why this is very C and not C++.
Wait.. Wtf... is this even valid C++? new char[]? What the hell? I thought operator new[] required an argument?
 
I'd review it, but I'm not sure if I should gear it towards C or C++. The only C++ aspects are <iostream> and cout.
 
I think he intends to write C++, so I would review it that way. Might also be worth a C review though.
Then again, I usually have a bias to push people towards C++. It's just such a more useful language for almost all uses. Not to say C isn't great at what it does, but C++ is just much more practical for most things.
 
@Corbin Even I have to agree with this.
 
A C review would seem a bit easier (get rid of new, <iostream>, and cout). A C++ review would mention even more.
 
Yeah. I share your love of C, @syb0rg, but I just can't recommend to it people with good conscious. It's a wonderful language, and it really helps one understand how computers operate, and it exposes programmers to a lot of clever patters and idioms. Unfortunately it's pretty terrible from a productivity point of view though :/
 
10:25 PM
@Corbin Unless you use a ton of libraries.
 
Oh my god. I just realized he's using !cin.eof() (which is wrong to begin with) and its synchronization to stdin. That's nasty.
Imma review the shit out of this when I get a chance.
5
 
And I'll have my votes ready (hopefully). :-)
 
@syb0rg Yeah. Luckily there's a ton of really good C libraries. They're still not particularly pleasant to use though. RAII is the best thing to ever happen from a C perspective.
 
@Corbin Another reason to not use C: string manipulation sucks.
 
Yeah. Which really in a way goes back to shitty library ease-of-use. There's tons of string libraries that handle memory and provide basic operations. Unfortunately there's still a lot of overhead to using them compared to something like std::string.
Although really, string libraries aren't too bad.
Things just get nasty very quickly when generic libraries become involved. Oh, want to have a balanced tree? Prepare to provide 19 function pointers :p. Oh, want to have a simple dynamic array? How would you like to deallocate elements?
Of course, that stuff is all embedded in C++ too, but in a much more pleasant and reusable way.
 
10:42 PM
@syb0rg morning
morning all
 
True unsung hero
give the man some love:
Oops I take it back...
???
 
I blame the editors at the time for not telling the OP to stop with those damn tags in the title. There are still so many of them.
I've edited just that title. Perhaps someone will contribute something.
 
11:01 PM
Apparently I'm a masochist. I had to take a stab at it:
0
A: Time optimization of finding separators

CorbinI plan to revisit the more C++ side of this later, but I've noticed a few things in general that are wrong with this or that could be improved. Since you're not allowed to use std::string, this review biases towards C. You have two major bugs in this. 1) new[] requires a size. I'm surprised ...

 
One more hour until reload. :/
 
stupid time change, me too
 
I have 5 votes left if you have good stuff to vote on
 
vote for Pedro
2
0
A: Class to encapsulate and manage multiple background web crawlers

Jeff VanzellaGenerally, very well written code. I just have a few suggestions. In the Start method, I understand why, but I don't like that there are two calls to check if the service is running. It feel kind of redundant, and I don't think you'll get a speed increase by short circuiting the lock. I would...

 
@konijn You know you want to vote for this...
And this:
1
A: Custom linked list class

nhgrifFirst, it should be noted that an NSDictionary can use any object as it's key (as long as it conforms to NSCopying protocol), as such, your setValue:forKey: methods should probably be rewritten to take id as the key argument type, rather than NSString*. Second, while the structure of your bina...

 
11:07 PM
@JeffVanzella You have a formatting issue in that. I tried to fix it, but I can't figure out why the hell it's parsing the way it is.
 
They see me pimpin', they votin'...
7
A: x64 assembly clearmem / zeromem

Jamal The comments in the clearmem procedure for the Linux block look a bit confusing. You could just have a summary of the procedure commented above, and have the individual comments for each line specify the meaning of the assembly instructions. Specifically, the lines that describe the C++ code d...

 
@Corbin Because the code was inside a bullet point, it has to be indented 8 spaces to be formatted as code.
 
1 more ?
 
@syb0rg Ah, good to know. I feel like the Control+K shortcut should know to take that into account :(
 
@Corbin MSO?
 
11:11 PM
MSO???
 
@konijn Maybe this?
@Corbin Meta Stack Overflow
 
Ah... Oooo, an excuse to make my first MSO post?! I'm on it! lol
 
MSO!!!
 
@Corbin Research for duplicates first!
 
Yeah, I probably won't actually post it. Feel free if you want to.
My guess is that they don't want to embed a markdown parser in JavaScript
 
11:12 PM
I'm too scared :P
 
and that would be the only way to do it
without making a gross AJAX call just to have the keyboard shortcut
 
Someday, I'll put an image into one of my answers. Someday!
 
what's the formatting issue?
 
@JeffVanzella You need 8 spaces for Markdown to format code when it is inside a bullet point.
 
ahhh :)
 
11:13 PM
I fixed your formatting in your answer.
 
wondered why that never worked for me lol
 
Yeah, I have a lot of experience doing that with my type of answers.
 
I'll know for the future :)
 
Hello @Yuushi
 
hey @syb0rg
 
11:22 PM
Only 50 rep from the max... good day.
 
user77406
@syb0rg: I've never seen the function given in a subscript for Big-O notation. Is that how you usually do it, or was there a specific reason for doing it in that answer?
 
@Corbin: You were right; the OP of the vectors question wasn't talking about the container. Boy do I feel dumb with that first comment of mine. :-P
 
Eh, just blame it on C++ for using a confusing name :). Haha
 
@RickyDemer That is how I usually notate it. To me it makes it clearer that it is a Big-O notation that way.
Do you think otherwise?
 
@Corbin It's reopened now. :-)
 
11:25 PM
:)
 
user77406
@syb0rg: I think it can make the notation harder to read. (although admittedly not in that case)
 
@RickyDemer So you would think it was better if is wasn't in a subscript?
 
user77406
yes
 
@RickyDemer Alrighty. I'll change how I format those in the future, and in that answer. Thanks for the input.
Welcome to the 2nd Monitor by the way.
 
@syb0rg, thanks again for the insights on that recursive search problem. Learned a lot
 
11:31 PM
Hrmm, I wish this weren't a homework assignment. I really want to post code of how I would have done it, but... I'm afraid that's giving him the answer. lol
 
@Andy Anytime. I would upvote the question, but I am out of upvotes :P
@Andy And welcome to The 2nd Monitor, and Code Review for that matter.
 
^^ What Syb0rg says .... but with a monkey accent
2
 
So far you aren't like the typical newbie. You seem to know your way around Stack Exchange.
 
Just to note, there is a bsearch in the C standard library
 
Ahh, I forgot about that. Re-tagging with .
 
11:36 PM
Hrm well... Just found an excuse to use the spoiler markup
http://codereview.stackexchange.com/a/44209/7308
Did not know that SE has a spoiler syntax... Though it's quite horrible to use.
 
DVLR vvvv
 
Thanks Santa!
A lot of up-votes, I hope this isn't all from one user...
You'll set off the serial upvote reverser.
@Andy How long have you been programming in C?
 
Hm. I just got two Steam coupons for a game called Pixel Piracy: store.steampowered.com/app/264140
 
@syb0rg about three weeks :) Was trying to convert iterative version to recursive.
 
@Andy You did a pretty good job. The only problem was when you had to deal with the max size of an int. I ran into that speedbump when I was trying to benchmark your code.
 
11:46 PM
@syb0rg is that always true with recursive? I recall when I was learning Python there were performance reasons for choosing iteration. But might just depend on the function.
 
@Andy Depends on what you are trying to accomplish. Usually iteration is faster than recursion. But there are a few cases where recursion is faster.
I can show you an example in a bit.
93
Q: Is recursion ever faster than looping?

Carson MyersI know that recursion is sometimes a lot cleaner than looping, and I'm not asking anything about when I should use recursion over iteration, I know there are lots of questions about that already. What I'm asking is, is recursion ever faster than a loop? To me it seems like, you would always be a...

 
@syb0rg thanks, I will read it
 
@Andy Here is another good way to put it:
> Loops may achieve a performance gain for your program. Recursion may achieve a performance gain for your programmer. Choose which is more important in your situation!
 
Haha, excellent way to put it. In python people said using recursion was more "pythonic" yet it slowed the program down. Definitely makes program shorter and looks cooler
 
Worry about making the code clean first and foremost. Premature optimization and all that.
 
11:54 PM
@200_success The reason I put that as a "bug", is because the code should be able to handle an unsorted array.
@Andy So you have been on Stack Overflow for 3ish years, what made you decide to join Code Review today?
 
@syb0rg well historically I've asked questions on SO when I've been stumped. But as I tackle C I want to also be able to learn to make code clean and less buggy and I think Code Review works well for that.
 
Well, as long as you keep asking C questions, I'm happy :)
 
That it does.
 
@Andy How are you learning C? An online tutorial? A book?
 
Nicely done, @syb0rg - you're beating me today ;-)
 

« first day (312 days earlier)      last day (3707 days later) »