« first day (703 days earlier)      last day (1953 days later) » 

12:00 PM
[ckuhn203/DEV204X] ckuhn203 created repository
@Duga A little slow to the game there...
But..... how'd you do that? I didn't put a hook on that repo.
There's a hook on you?
Oh should probably ping @SimonAndréForsberg
I guess so @rolfl.
I'm being watched....
@RubberDuck Yes, you are being watched ;)
@Duga checks some users for new repositories once every hour or so.
Speaking of being watched, I believe @Donald.McLean will be watched as well soon.
You making good on your answer-more-questions promise, I see, @Simon?
12:13 PM
@SimonAndréForsberg ahhhhhhh so she watches my "recent activity".. gotchya.
I'll admit it, that creeped me out a little bit. If she wasn't your bot, it would have really creeped me out.
@Duga's alive.
12:24 PM
@rolfl yeah, a little now, a little then. Trying to catch up with Loki.
in TCG Creation, 13 hours ago, by Duga
Loki Astari vs. Simon André Forsberg: 4200 diff. Year: -1566. Quarter: -267. Month: -267. Week: -165. Day: -125.
I think I need a 200/monkey wall
@rolfl Where do you want it? (which chat room), and how often?
Q: HTML code runner/tester?

YouCan'tHrefMeIs there any HTML Code runner or tester available out there online? I would like to practice HTML not only in my Phone but also in the Computer. Can anyone help me out?

12:40 PM
Thanks for providing more info. In general, stackoverflow is here to answer specific questions more of the "why does this code error out?" or "Why is my view always black even though I'm...." variety than questions about approach or code review. I think you are asking for help with handing the XML data that was sent to you, but you haven't supplied that code. Saying this is not very helpful to you, so I'm going to post an "answer" that can continue the dialog outside of comments. — tobinjim 32 secs ago
@CaptainObvious Off Topic!
My Mug is Empty, Time to go to work though!
@SimonAndréForsberg TCG is fine, at the same rate as the others... ;-)
I will visit there more often
@rolfl Okay. TCG it is. Just to make sure it works correctly there will be one message in about two minutes, and then I'll change so that it's at 15 minutes before reload, every day.
i see it, and much obliged.
No problems, was just a single change in the database :)
12:53 PM
Q: Calculate at which time the round number ends with 0

4tireshttp://www.codecademy.com/pt/4tires/codebits/EGoQHs/edit This is my code. It's really incomplete because the console.log doesn't even work on the page ...

Q: can a c function return an array?

Mohamad MistoCan a c function return an array? so that if i defined a function say int sum(int A[5][5],int B[5][5]) { int z[5][5],i,j; for(i=0;i<5;i++) {for(j=0;j<5;j++) {z[i][j]=A[i][j]+B[i][j];} } return z;} am i allowed to return z.?

Four off-topics in a row!
This forum for getting rectified exact issue you are facing. For code review you can post question in other forum from Stack Exchange known as code review. — Panther just now
Note that if you post this on Code Review, you need to include the code in the question itself. — Simon André Forsberg 1 min ago
1:14 PM
@SimonAndréForsberg can you do one for the next person for me to beat Rep Wise?
Q: Codechef Challenge - Broken Telephone

nishanthttp://www.codechef.com/APRIL15/problems/BROKPHON My code is giving the correct o/p. But it's not accepted. Pls correct my code. #include<iostream> using namespace std; int main() { int t; cin>>t; while(t--) { long int count = 0, N, *msg; cin>>N; if(N>=...

I was already wondering who @Lyle'sMug was...
hmmmm I think I might be over engineering this first assignment...
This might be a better fit for codereview.stackexchange.com — reto 1 min ago
So, what do you guys think is better to use in an interface, an IEnumerable or an IList?
1:33 PM
Q: How to optimize the highest pit algorithm

ErnuscI've got an exercise for training my abilities to write algorithms when i were in job's interview. I got a description of exercise: A non-empty zero-indexed array A consisting of N integers is given. A pit in this array is any triplet of integers (P, Q, R) such that: 0 ≤ P < Q < R < N; sequenc...

Q: A trivial command line utility for trimming whitespace from lines in C

coderoddeI was practicing some C and decided to write this simple command line utility for stripping leading and trailing white-space characters. The code: #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define LINE_LENGTH 8096 #define HELP_MESSAGE "Usage: trim [FILE1, [...

@RubberDuck Depends on your usecase
Should people be able to add to it or only iterate it? Do you want to use iterator blocks? Do you want to propagate lazy loading?
Will you be working with arrays or just any collection type?
All very good questions to ask. Thanks you.
Although, I'd say asking the last one breaks the abstraction.
Meh, it's a question that should be asked with regards to performance
If you know beforehand that you'll have heavy usage of arrays in that code then returning an IList<T> means that every array will have to be turned into a list
Either way. Thanks @JeroenVannevel.
de nada
1:52 PM
@skiwi Malachi
@Lyle'sMug Yeah, I noticed that by reading your profile :D
Something's off here..
@skiwi that is going to be a problem.....
I will have to change my profile everywhere.... ugh!
last message in TCG was posted an hour ago, I thought they were going to post every 15 minutes?
Generally using this amount of pointers in C++ code is frowned upon, and hints that the design of the tree classes/interfaces is not ideal. If you want us to look at your entire binary tree code, I suggest posting it in codereview.stackexchange.comzennehoy 8 secs ago
We lost a peering session with one of our ISPs and experienced a network reconvergence at 14:37 UTC. We are still working on the issue.
The Cogent router we peer to has disappeared off their network. their emote hands are on the way to get it back online.
2:10 PM
is it a good idea to form Documentation around Unit Tests? @JeroenVannevel what do you think?
Our BGP session to Cogent is bouncing - we are disabling and moving to Lighttower. One more reconvergence will happen in a moment.
@Lyle'sMug What kind of documentation are you thinking about?
I think my next name change is going to be "phteven"
What is being documented?
@JeroenVannevel the entire project. if they can't figure out the HTML, they shouldn't be looking at my code in the first place, right?
2:13 PM
I'm a bit confused about what you are talking about
like full Documentation of my project. I hate even thinking about it, doesn't feel as rewarding as actually writing the code... but I know that it must be done, and now I have this project and about 4 others that I need to document as well.
I guess it would be Technical documentation.
Ehhh I'm not sure what you're talking about
Did you play StackEgg on Stack Overflow last week? Here's the story of how it came to be: http://balpha.de/2015/04/the-making-of-stackegg/
Maybe this is a good starting point:
A: Is "unit test is a form of documentation" realistic?

Jeroen VannevelUnit tests are not meant to describe what a method does, they're meant to describe what a particular workflow of a unit should yield. Note that I used unit, not method since a unit can span multiple methods. I will reiterate this from a recent post of mine on CodeReview: if you phrase the name o...

We are now communicating entirely through the Lighttower. We will work with Cogent to get redundancy back online ASAP.
2:21 PM
Q: code help in stock trading code - C++

Sammyusing namespace std; typedef basic_string<char> string; class CHighLow { public: CHighLow() : nCurLow(0), nCurHigh(0) {}; void add(int nHigh, int nLow) { if (nHigh > nCurHigh) nCurHigh = nHigh; if (nLow < nCurLow) nCurLow = nLow; } ...

@Mat'sMug (The Original Mug) I am looking at your code and about to post something that I am unsure of.....
Sam Brand on April 07, 2015

Every year we ask our users to tell us a little about themselves. This year we asked our users to tell us a lot.

For 2 weeks in February 2015, we ran a 45 question survey. We asked where you live, what programming languages & frameworks you use, how much money you make, how much coffee you drink, and whether you prefer tabs or spaces when writing code. More than 26,000 of you responded, making this year’s survey quite possibly the most authoritative developer survey ever conducted.

A few findings: …

   return context != null && ((context.CALL()) != null && (context.CALL()).Symbol.Text == Tokens.Call);
is it ugly or clear?
You're executing context.CALL() twice
I agree. will you check my answer. I explained why I left it like this
	private bool HasExplicitCallStatement(VBAParser.ECS_MemberProcedureCallContext context)
        var statement = (context.CALL());
        return context != null && (statement != null && statement.Symbol.Text == Tokens.Call);
2:26 PM
More male students prostitute themselves than female students to earn some money
I could do that..
@Lyle'sMug Now you're executing it three times!
@JeroenVannevel wat
@JeroenVannevel is that better
@Lyle'sMug nope
2:28 PM
A: Here's my interface, so call me ...maybe

Lyle's MugI am thinking that you could shorten up your private boolean methods a little bit by including the early return into the return conditional, so you would take this private bool HasExplicitCallStatement(VBAParser.ECS_MemberProcedureCallContext context) { if (context == null) { re...

The first part of your return can never be false
context will always be not null
if it was null, it would've thrown a NullReferenceException before that
when you call context.Call()
@JeroenVannevel Uh wow, that's quite desperate
So that has to be at the top anyway -- it's parameter validation
@JeroenVannevel then his code is wrong to begin with, as it will always return false.
@Lyle'sMug I don't see why it would always return false
2:30 PM
> Your Stack Overflow rep is a strong indicator of how much money you make.
Oh oooh
context can be null or not be
if the first condition is false I want it to return false, if there is a context, then I want the other conditions to be validated
in your case it will throw an exception if it's null instead of returning false
var statement = context.CALL();
It will never reach the return statement if it's false
^ this line throws an exception before that
why can't a var be assigned a null,value? it is weakly typed if context.CALL() is null then statement will be null
> 26,086 people from 157 countries participated in our 45-question survey. 6,800 identified as full-stack developers, 1,900 as mobile developers, 1,200 as front-end developers, 2 as farmers, and 12,000 as something else.
2:32 PM
@Lyle'sMug Let's walk through this line by line
Given this code:
private bool HasExplicitCallStatement(VBAParser.ECS_MemberProcedureCallContext context)
    if (context == null)
        return false;
    var statement = context.CALL();
    return statement != null && statement.Symbol.Text == Tokens.Call;
I am going to see if I can run the code and test it
If context is null, the method will return false. Agree?
However when you look at your code:
private bool HasExplicitCallStatement(VBAParser.ECS_MemberProcedureCallContext context)
    var statement = context.CALL();
    return context != null && (statement != null && statement.Symbol.Text == Tokens.Call);
If context is null, it will execute context.CALL() anyway
Resulting in a NullReferenceException
You can't call a method on a null reference
So your method immediately crashes
This also makes the following context != null statement useless, since it can never reach that code anyway if context == null
Q: Highest pit - only climbing through the pit once

Simon André ForsbergFor a problem description, see other question. Imagine I would write this code at an interview. What would you say? Time complexity: \$O(n)\$ Space complexity: \$O(n)\$ Auxiliary space complexity: \$O(1)\$ public class FindDeepestPit { public static void main(String[] args) { in...

@JeroenVannevel this makes sense
@SimonAndréForsberg Yes, now that the stupid basketball .... crud ... is over, we can get back to the regular CBS lineup.
2:40 PM
I guess the next question is can I reorder this: ((context.CALL()) != null && (context.CALL()).Symbol.Text == Tokens.Call)
lol jk
> Source control is an industry standard tool. However, fun fact: about 10% of developers still don't use it.
Reading the SO blog, I think I've found a correlation...
Developers who drink lots of coffee, seem to be the happiest.
> Most developers prefer tabs to spaces.
I prefer a tab the size of 4 spaces.
@JeroenVannevel stargreed
It's wonderful how in hindsight my day seems totally wasted when I game instead of study compared to when I program instead of study, while in both cases I'm not doing what I'm supposed to be doing
2:49 PM
@skiwi That's my daily feeling exactly
I try to offset it by applying for a company or two and reading a blogpost each day
Well, but your study is going succesfull, no?
Depends how you look at it
I typically look at it from the most glamourous side
@JeroenVannevel That's a shady statement
@rolfl Would you believe me if I told you that UScale determines the OP's original highest pit method to actually be O(n) ?
Yeah... I sort of would.
2:51 PM
I edited my answer to show that
Well, I'll have done my studies in 5 years instead of 3. But that is very common in Belgium. And I'll be finished in December 2015 so I'm almost finished
I think I should also do some real benchmarking here
Would you believe if your own program told you you were wrong?
@JeroenVannevel I see, also a 3 year study here... currently finishing Y4 Q3, estimated to finish halfway 5th year, realistically it might take the full 5 years
Bad students unite!
Good thing we don't have American college tuitions
Ummm...... no. No I'm not going to turn off an error report just because you asked me to...
2:54 PM
Yeah... luckily
@Simon - consider this:
    for(int j = pos; j < A.length; j++) {
        if(less) {
            if(value > A[j] && A[j] != value) {
                q = A[j];
                if(j+1 < A.length) {
                    r = calcPit(A, j, value, false);
                    int tmpResult = Math.abs(Math.min(value-q, r-q));
                    return tmpResult;
                } else {
                    return -1;
        } else {
            if(value < A[j] && value != A[j]) {
                return A[j];
if(value < A[j] && value != A[j]) {
Though I don't know the case in Belgium, but next year I'll need to pay my own fees :(
That code is funky
@skiwi My parents forced me to pay my tuition 2 years ago because I had less than 50% at the end of the year
It's a bitter pill but only 600€ in the end
That's a week and a half of student work in the summer
@JeroenVannevel The government here covers nominal + 1, so that's 4 years
2:56 PM
@rolfl Agreed. It's very hard to follow what is actually happening...
I'm actually more or less getting paid to study right now
My problem is that I'm not really studying, it's hard to concentrate on it
@SimonAndréForsberg The reason it probably comes up as O(n) is because the recursion depth is dependent on the distance to the next peak, not the size of the input array.
@skiwi Yeah I feel you. That's why I tend to pass for half of my classes each year
This year has been particularly good though! 6 out of 8 passed in the first semester
That's unseen
My first year was exceptionally good, then it got worse
@skiwi and @JeroenVannevel I don't think it has to do with being a bad student in a majority of cases, a lot of people need to work while they go to school these days, which means they would need to take less classes at a time in order to give each class the amount of study time required to perform well.
3:00 PM
Except... I'm not working
Yeah, me neither
lucky so and so's
Though I've been having a side-job for 1,5 years and in hindsight I think it has actually impacted my study
@skiwi which way?
@Lyle'sMug Working less on study, but it may just have been 1 hour max I would've spent during that workday
3:01 PM
I see.
having a family impacts study time as well.
having a girlfriend/wife actually.
There are people that can use almost all of their free time to study, and there are those who cannot
When programming I often feel like I'm learning more than when studying even
I've passed all but one programming-related course. The only ones I have left are economics and math classes. It's particularly hard to motivate yourself for some stupid bookkeeping stuff when you have all the knowledge needed to start working
I can't get myself to study hard for Artificial Intelligence right now, I mean it's all cool and interesting for sure, but the exam consists mainly of meth math
Other painful class is Algorithms
3:24 PM
@rolfl yes, that makes sense. I think there is a worst-case scenario in which his code would be more O(n^2)
3:48 PM
See if this question is appropriate for: codereview.stackexchange.com/help/on-topicAlex K. 1 min ago
What's more annoying? People who cannot merge properly on the way towards work or during office hours?
@rolfl As expected, there was a O(n^2) case. Edited my answer. Have you seen that other answer on that question btw?
A: Highest pit algorithm

MT0I don't have time for a full review (at the moment) but the code below is O(N) and just looks for the maximal bounds of each pit: public static int findDeepestPitDepth( int[] heights ){ int leftPosition = 0; int bottomPosition = 0; int rightPosition = 0; int maxDepth = 0; final int len...

@SimonAndréForsberg That whole thing has p'd me off.
I had an answer primed and ready, and you answered it...
then the next answer came in with the O(n) solution, but it's a messy solution, and is not a review.
I thought a rags-to-riches was in order, but then you asked, and I thought I would answer there instead.
then I realized I got the question wrong.
4:04 PM
@rolfl Not your day today, huh?
So first I stole your answer, and then I stole your rags-to-riches, and then your solution was wrong...
You got it.
You've seen my deleted answer, I presume?
Hello critters.
Q: A trivial command line utility for trimming whitespace from lines in C - follow-up

coderoddeSee the previous iteration: A trivial command line utility for trimming whitespace from lines in C Now my code looks like this: #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define HELP_MESSAGE "Usage: trim [-h] [-v] [FILE1, [FILE2, [...]]]\n" \ ...

Q: Why is not my content in full width in @media queries?

Karin AnderssonI am trying to make my wordpressblogg responsive. When Im trying to set the sizes to 100% the posts gets really thin even though it says that the element is 360px wide. I don't get what I'm doing wrong here. Here is my style.css @media only screen and (max-width:1100px){ .datebox, #sidebar { ...

Q: What namespaces are predefined in the C# language?

Shaun LuttinI'm trying to figure out which namespaces (not assemblies) are predefined in C#. By predefined, I mean built-in to the language and that, to use a predefined namespace, we don't have to reference any assemblies. For instance, I've created the following program. class Program { static void M...

4:10 PM
Over the weekend, I found a new algorithm to add two Gray codes. It's currently slower than the previous one I tried to optimize which in turn was already slower than a naive solution.
Way to go /o/
@rolfl yup, I've seen it. I didn't quite understand what you were doing, the point of the inflection variable especially confused me. It seems like I didn't miss much though as it doesn't produce correct results.
Correct... it measures the pit relative to the highest neighbouring peak, not the lowest peak.
So, all I had to do was measure between one peak and the next pit (or between one pit and the next peak.)
So, all I had to do was record the location of the previous point of inflection, and take the max of the altitude difference.
So, all you had to do was to read the description and understand it correctly.
&^%^($@ off
Interview failed for me, right?
4:18 PM
@rolfl Sorry :)
Thanks for the MathJax, @Morwenn!
@SimonAndréForsberg Not sure you'd like it ^^"
Why wouldn't I like MathJax?
Well, when you put it like that...
Never mind, being silly. — rolfl ♦ 2 hours ago
@Simon there was that ^^^ tooo
Q: Regex to extract selective lines

RanPaulI have a list of error messages: def errorMessages = ["Line : 1 Invoice does not foot Reported" "Line : 2 Could not parse INVOICE_DATE value" "Line 3 : Could not parse ADJUSTMENT_AMOUNT value" "Line 4 : MATH ERROR" ...

4:26 PM
Does the number of zombies include the closed questions? It seems that there has been a number of closed questions these days compared to some months ago. — Morwenn Apr 3 at 8:41
^ I still don't have my answer :o
Zombies are any open questions with no upvoted answers
So, no, closed questions cannot be zombies.
Ok, so the number of zombies is definitely growing...
Q: Logic error with list indicies when finding optimized binary search tree in Python

Sage GerardI adapted pseudocode for an optimized binary search tree algorithm from Cormen to run some sample data, but there is a logic error somewhere that is preventing correct output in the root list. My output is a two-dimensional list of nothing but zeros because t always ends up as inf. I've checked ...

Q: Match all youtube links in a string of text

BrettI'm looking to pull all the youtube links from a string of text and was wondering how does this look? if (preg_match('/(https?:\/\/)?(www\.)?(youtube\.com)\/[^\s]*watch\?v=([a-zA-Z0-9_-]+)[^\s]*/gim', $this->content, $matches)) { } Obviously this doesn't take into account the youtu.be links a...

Now this is why I'm doing my internship outside Belgium
4:49 PM
@SimonAndréForsberg - undleted answer: codereview.stackexchange.com/a/86152/31503
Also, for those who are counting, there are now three zombies that can be killed in my profile ;-)
Q: Tune SQL Server 2008 Stored Procedure

DJSI am running a test load using Telerik Test Studio using 100 users at once entering search filters on a page that calls a stored procedure. My application that calls the stored procedure is an asp.net mvc 5 application and it returns "Timeout expired. The timeout period elapsed prior to completio...

@JeroenVannevel Eh, I have no clue what I'm about to watch
Well, I have an obvious clue, but yet at the same time, I have none
Just don't watch it with your parents
Or do, if you're into that. I don't judge
translate: Poepen in het buitenland
(from Dutch) Pooping in abroad
about what I thought ;-)
You know that in Dutch it means taking a dump, right?
Belgians gave it a... different meaning
(They confused the holes I think)
4:59 PM
Yeah, but in Flemish it means.. rumbling in the sheets
TIL that that ^^^^
Firefox > History > Delete
Entered my erasmus application a few days ago
My single worst fear is someone looking at my chrome history.
If the US doesn't work out, I'll be going for London
5:01 PM
@RubberDuck Eh...
And not for the reasons everyone thinks
My history here is completely clean, that is if nobody manages to figure out how to recover Safe Search visits
> Hmm..... let's see here. Algorithms... Libertarian Politics... Famous Serial Killers....
I'll never be able to remember Pitch, Yaw and Roll :|
well, roll is easy
Yaw = Yank on the tail
Roll is easy, so if you can remember Yaw, the only one left is Pitch.
5:07 PM
Yaw == Heading is rememberable and logical
How is that rememberable? meh. So long as you've got it.
I don't know how my brains works
Now only issue to fix is that when translating a rotated object, the translation gets messed up
Fair enough
So @JeroenVannevel I figure that's your main goal of your abroad studies? ;)
You appear to have mistaken Stack Overflow for a Code Review site. — cimmanon just now
5:15 PM
Q: Sourcemap translator service - Error handling | Code structure

AbacoThis is my first attempt to a serious Node.js application, I've tried to follow the async style of Node at my best, but I have several doubts and I am sure that this code can be massively improved. The idea behind this little service is to get a minified stacktrace and return a 'translated' stac...

@CaptainObvious Yikes! That's a lot of subqueries!!
@forTruce If you would like to improve working code, you may delete it from Stack Overflow and instead post to codereview.stackexchange.comPhrancis 31 secs ago
Q: Making my 'attack counter' more FPS efficient - javascript

Jammeh CarrI have a code snippet which i wish to improve to increase my programs FPS, but i do not know how. I know the problem, which is the fact my counter mechanism used to delay attacks is causing lag. I just dont know how to change my code to minimize this lag. I am looking for helpful criticism and co...

I am not asking for a code review. I provided a working solution to demonstrate that I have tried to solve the problem, but, as I stated, my solution is a hack relying on overriding styles later on in the stylesheet. I am seeking other methods entirely, not a review of my own. — forTruce 46 secs ago
@Duga Fair enough, let the SO people deal with it then.
5:28 PM
Looking into it. Why codereview.stackexchange.com? — dmahapatro 51 secs ago
@SimonAndréForsberg See that? ^^
Q: SICP Exercise 1.3: Sum of squares of two largest numbers out of three, Rust Version

Marcus Vinícius MonteiroThe exercise 1.3 of the book Structure and Interpretation of Computer Programs asks the following: Exercise 1.3. Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers. My answer is this: #![feature(core)] use std::cmp; fn su...

We rule :D
My CR answer was moved to SO, and it isn't too good of an SO answer: stackoverflow.com/a/29496833/2509848
@skiwi It's been/will be a major part of my travels as well
I'd say.. 50% importance!
5:39 PM
@sᴉɔuɐɹɥԀ Those data points seem very weird. Few people live that far north in Sweden. And WTF is the point for Germany doing halfway into Netherlands?
@SimonAndréForsberg Zhey inveded us.
"I would like to know whether my scripts are properly coded?" - Code review codereview.stackexchange.comFred -ii- 1 min ago
I was at the maximum value for a 16-byte signed integer two upvotes ago!
^^^ That is the most interesting tidbit in the survey
> Upon closer examination of the data, a trend emerges: Developers increasingly prefer spaces as they gain experience. Stack Overflow reputation correlates with a preference for spaces, too: users who have 10,000 rep or more prefer spaces to tabs at a ratio of 3 to 1.
Q: Erlang parallel server using sockets

BulaThe task was to build a simple parallel server in erlang that prints what it receives through a socket and alerts when the socket is closed. -module(server). -export([start/0]). start() -> {ok, ListenSocket} = gen_tcp:listen(8211,[binary,{packet,4},{active, once}]), spawn(fun() -> acce...

5:53 PM
Broken sort?
Nope, just the french doing their thing.
@SimonAndréForsberg After RandomSort, SO has introduced BrokenSort
@rolfl #SpacesToRuleTheWorld
Underloved answer here
A: Summarizing a CSV file containing census data

Dmitry The first if group can be slightly simplified using the else if: if (ageForPeople[placeValueHolder] <= 0) { // Trigger error. } else if (ageForPeople[placeValueHolder] <= 18) { agesForCensusGroups[0]++; } else if (ageForPeople[placeValueHolder] <= 30) { agesForCensusGroups[1]++; } e...

6:08 PM
@SimonAndréForsberg That would made the population of Sweden approximately 3.55% Stack Overflow users
When you get this all working correctly, I'd strongly suggest posting it to CodeReview.SE so that people can work help point out these small things that aren't that small and you can understand all the minor gotchas and ways to implement what you are working on better. — MichaelT 1 min ago
@SimonAndréForsberg I'm older than two Indian developers put together.
6:25 PM
Hmm, I prefer spaces, but prefer pressing tab. Also, I like backspace to clear a tab's worth of spaces at a time.
I like Xcode.
Also, I am slightly below average age for my country.
I told you guys the op wouldn't like my answer, @Mat'sMug
I can't believe you'd compare this to the ease of #import statements! :) ...that said, this is an extremely helpful guide, and it does look like this is the best we're going to get. Practically, it means that I'm going to write everything first and then chop it up into modules near the end of the project, which isn't that bad a way of doing things. Thank you very much, this will be really helpful. — Le Mot Juiced 2 mins ago
Oh... He edited it to something a bit better.
"didn't wanted the question to become too long" I consider 'too long' to be when the site software approaches the point where it hits a char limit for posts. I experienced that on the File Browser GUI thread. That code was pushing 650 LOC. ;) — Andrew Thompson 41 secs ago
6:41 PM
Q: Groovy : create map from another map

RanPaulAm trying to create a new Map <String, List<String>> headErrors with selective elements from another Map <String, List<String>> invoiceErrorLines invoiceErrorLines = ['1660277':['Line : 1 Invoice does not foot Reported', 'Line : 2 MATH ERROR'], '1660278':['Line : 5 Invoice d...

@RubberDuck Now there is another underloved answer there too ;-)
I'm less than 2/3 of the age of the average developer in my country.
@rolfl You had me at lookup table.
6:58 PM
Q: C++ program that calculates and generates a report card for a student

BeckI'm working on this small program for practice and would like to know how I could improve it from here. I'm still a relative beginner with C++ and would like to know if there is a better why to design this program. Things I want to do: implement a while loop so that the program will continue t...

7:20 PM
Q: C++ Forward Class Declaration not working

nodebaseIn the code below, it only builds successfully if I comment out the code on <Line 11>, the constructor for class Course. It also builds successfully if don't comment-out <Line 11> but instead I change <Line 18> to a pointer, as in list<Student> *roster. But then I am having trouble inserting ne...

Q: Library Management System c++

DonkI have created a Library Management system. Can anyone please look at if see if there's any bad practices or if anything could be done better. Main.cpp #include <stdlib.h> #include <iostream> #include <fstream> #include<iomanip> #include<stdio.h> #include <string.h> #include "Book.h" #include ...

Q: AST for LISP Interpreter

Kevin MeredithI wrote a LISP REPL using parboiled2: Here's the AST that I used: sealed trait SExpr sealed trait Atom extends SExpr case class Comb(sExprs: List[SExpr]) extends SExpr case class Number(x: Int) extends Atom case class Ident(x: String) extends Atom My main method, evaluate, has the type sig...

Q: Small "Text-Based" C++ Game

NealCSo I'm extremely amateur when it comes to C++ in general, but I wanted to make a little "Pyramid Escape" text based game. I'm not done whatsoever but before I continue I want to see what I could possible do differently. // // main.cpp // TextFiles // // Created by Neal Carico on 3/12/15. // ...

7:38 PM
You might want to consider code review for this kind of question. — RubberDuck 1 min ago
That is a keen observation, @SimonAndréForsberg. You're probably mistaken on a couple of things though (as well as me). As I look at it, I can't actually say for sure that the lookup table is faster. We're talking about 256 or so bytes in memory that will be cached very close to the core (L1 cache), but, 4 if/else statements may be faster than 1 L1 lookup. It's a margin call. I would guess that all the systems (if/else, 4-value table, and all-value table) will be about as fast as each other in this situation.... Code Readability is probably the important thing, and I am not sure mine is best. — rolfl ♦ 55 secs ago
@Simon - it will likely require a benchmark to prove which system is fastest.
Q: Expected value (and distribution) of sum of six balls labeled 1-49, no replacement

ADGThis code finds expectation and standard deviation of sum(x) of 6 digited base-49 numbers with all digits distinct. The expectation is sum(y) of sums(x) upon the total no of sums(x),i.e. e=(x_1+x_2+..x_n)/n whereas standard deviation is squareroot of sum of squares of sums(x) minus the expec...

8:04 PM
Please format your code so it is easy to read. That wouldn't only be helpful for us to help you but also for you to find those kind of errors easily. The checkbox construct especially is something I, as a code reviewer, would just throw in the bin. — b.enoit.be 7 secs ago
@rolfl probably so
8:26 PM
@RubberDuck i develop VBA myself, and my comment was not supposed to transfer any negative message towards VBA development. I was just pointing out, that there is no error in the code, and that it is better placed in code review as you mentioned, because here i would expect more questions where things are not working at all or have errors. So from that perspective the code is fine and it surely can be optimized - but not here :) — hexerei software 18 secs ago
@Simon, do you understand this comment?
The sequences must be strictly monotonic and you return "Deepest pit in [7, 3, 3, 1, 7] is 6" (instead of 2). — maaartinus 21 mins ago
@rolfl strictly monotonic??
Nevermind.... I do understand it now.
mutter grumble, that questio n has been nothing but trouble for me
@rolfl Another test failure?
I agree that [7, 3, 3, 1, 7] should return 6
Nahh..... the actual question is:
sequence [A[P], A[P+1], ..., A[Q]] is strictly decreasing, i.e. A[P] > A[P+1] > ... > A[Q];
Note,> and not >=
8:32 PM
oh crap!
^^^ that
So my code is in fact wrong?
and mine ;-)
Let's say that I solved another case then ;)
I am OK with that ;-)
8:33 PM
In my code it would be easy to fix though, I think.
I think in mine too..... I think.
We certainly think a lot.
My thinking is focussed on:
Q: Expected value (and distribution) of sum of six balls labeled 1-49, no replacement

ADGThis code finds expectation and standard deviation of sum(x) of 6 digited base-49 numbers with all digits distinct. The expectation is: \$\mu={\rm E[X]}=\frac1n\sum_{k=0}^{n}x_i=\frac{x_1+x_2+\ldots+x_n}{n}\$ whereas standard deviation is: \${\rm \sigma[X]}=\sqrt{{\rm E[(X-\mu)^2]}}=\sqrt{\f...

Welcome to Stack Overflow! According to your question, your script works. It's not clear what you are asking for help with. Stack Overflow is great when you have a specific question, but it's hard for us to provide help with "how can I make this better" questions. If you're looking for a code review, try codereview.stackexchange.comDave Bacher 1 min ago
Q: BaseTableViewController with pull to refresh and auto load more

dopcninterface #import "DXYBaseViewControllerHD.h" // Displays a table view for its UI. // // Unlike `UITableViewController`, this controller's `view` is not the table // view itself. This means it is possible to insert content above the table // view. @interface DXYBaseTableViewControllerHD : DXYBa...

I'm not completely certain this had to be closed. :/
8:42 PM
Thanks for the responses everyone. I'll post over in code review as well. I'm not familiar with what the "typical VBA way" is since I'm new to programming and vba in general. — learningAsIGo just now
Q: VBA Sub to Remove Blanks From Row Improvements

learningAsIGoI wrote a sub to remove the blank entries in a row without shifting the cells around but it seems unnecessarily clunky and I'd like to get some advice on how to improve it. Public Sub removeBlankEntriesFromRow(inputRow As Range, pasteLocation As String) 'Removes blank entries from inputRow a...

@nhgrif Then what should we do with all those no-context-horrible-questions?
Downvote them? I mean, I'm on the fence, I think.
8:58 PM
Q: Code should include a description of what the code does

Simon André ForsbergRelated: What criteria do you use to upvote a question? What makes a good question? I feel that it is currently too easy to copy some code that you have written and put it up for review here on Code Review. My opinion is that if you want a review of your code, then you should also be able to ...

Please add your suggestion there.
IMO, it would even deserve its own close reason in a way, but it is suggested that "unclear what you are asking" should be used instead.

« first day (703 days earlier)      last day (1953 days later) »