« first day (683 days earlier)      last day (3630 days later) » 

19:02
@Mat'sMug That edit to the question does not invalidate your answer?
not at all
I hadn't even noticed the typo
K then
woohoo, 94 points short of 30K!
I have all the privileges I care about (except deleting answers), if the site graduates.
& is not even close to the same as &&... Same for pipes... Don't confuse them @Hosch250
19:07
@nhgrif OK.
You certainly shouldn't be interchanging them for the sake of controlling short-circuiting.
@Hosch250 it's not for the privs anymore ;)
wow, haven't posted as many answers in a day in a long, long, LONG while
feels good =)
@rolfl any mod-hat thoughts on this CW answer?
19:27
I'm in another discussion at the moment... will look in a bit
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.com — lurker 59 secs ago
0
Q: Multiple guard clauses vs. Multi-part conditional

Jared BeckWhich do you prefer? Multiple Guard Clauses def save return false if @banana.invalid? unless kiwi_banana_set? return save_non_kiwi_changes end if @want_mango && cannot_have_mango? @error = I18n.t('banana.mango') return false end save_kiwi_changes end Multi-Part Co...

19:44
@CaptainObvious Opinions on topicality of this question, please?
0
Q: BrainFuck Interpretor

Loki AstariGeneric Headers #include <vector> #include <string> #include <iostream> #include <fstream> typedef std::string const BFProgram; BF Interpreter class BFInterpretor { static const std::size_t MemorySize = 10000; std::vector<char> memory; std::vector<std::size_t>...

@200_success IMO that's almost literally asking "what's the best practice regarding X?" which is explicitly off-topic. Good call closing it, that one is asking for opinions.
@200_success "Which do you prefer?" - sounds primarily opinion based to me.
I'll add a comment
@Mat'sMug I often post compiler warnings as a CW answer, particularly on questions asked by newbies.
cool. those are Rubberduck code inspection results though. I hope the answer doesn't look too much like an infomercial for my open-source project...
19:50
Welcome to Code Review, Jared. Unfortunately, your question has been caught in a net of very borderline "A vs. B" questions, which we have debated a bit on meta and in chat recently. I believe this question falls on the wrong side of a very gray line. You are asking about something that seems primarily opinion based, and it is not your real code. If you would like help making this question on topic, you are welcome to visit us in chatSimon André Forsberg 7 secs ago
What is "CW"?
@nhgrif Community Wiki
or Close Wote.
@SimonAndréForsberg Comminuty?
@Mat'sMug yes. Have you never been part of a Comminuty?
(witty reply fail)
19:58
I'm voting to close this question as off-topic because it fits better at codereview.stackexchange.com (but there is not an option to select this site in the menu for choosing an alternate site for migration). — Mr. F 1 min ago
lol.. I like when the only reply I can come up with is "well, buddy, post your own answer!"
@Steven feel free to post your own review/answer. I've never felt the need to inject my IoC container anywhere, whatever the reason was for doing so. But I've never used Simple Injector either. — Mat's Mug 4 mins ago
the guy seems to be behind Simple Injector.
0
Q: math expression On the fly interpreter

Ahmed Abd El Mawgoodlast few day I wanted to sharpen my C skills a bit so I wrote a math expression interpreter that can handles + - * / ( ) and only integer so I just want to know how good is the code and if any one have any comment on any part of the code and does writing such code guarantee that I understand eve...

0
Q: Set Class Implementation ADT

LindseyIs the following functions implemented correctly for the set class? Please let me know if any changes need to be made # Implementation of the Set ADT using a Python list. class Set : # Creates an empty set instance. def __init__( self, *initElements ): self._theElements = list() for i i...

0
Q: Searching for a substring in a ring queue

arjang27I am implementing a function which searchs through a ring queue for a given substring. The function returns true if substring is found otherwise false. there is a cell containing null between the tail and head to signify the end of string. I would appreciate if you guys give me feedback on this i...

@Mr.F Vote to close because the question is off-topic for Stack Overflow, not because it belongs somewhere else. Voting to close because it belongs somewhere else can cause situations where the question is closed on two places. It is okay to redirect people to other sites, but don't vote to close with that reason. Also, this question is not a very good fit for Code Review. To post at code review, it is preferred to be quite confident that the code works as intended, this asker seems to be very unsure about that. — Simon André Forsberg 1 min ago
@Mr.F For the sites that are in the list, yes. Code Review is not in the list, partially because Code Review is scheduled for graduation but still in beta and partially because Code Review still gets some bad recommendations to cross-post from Stack Overflow. Some questions can be on-topic on both sites, some questions might be on-topic on no sites. Can you specify what exactly make this question off-topic for Stack Overflow? — Simon André Forsberg 1 min ago
20:19
1
Q: Homework>>Hex Editor

EdeniaI had a homework to create a simple hex editor that reads binary files as well as write integers to it. However I enhanced it a bit. Homework is already given but that doesn´t mean this code will remain without a review :) #include <stdio.h> #include <stdlib.h> #include <string.h> #include <lo...

Since I have no choice but to try to infer the intention, and I usually want to give this about 1 second of mental bandwidth as I am moving through the back log of quality control items to help the site, I have to make a judgement call, and in this case the intention seems to be mostly about the "did I do this right" academic homework syle of correctness, which is absolutely a code review question and not an SO question. Now that I've given it more brain cycles than I should have due to your comments, I still believe that's the right takeaway. — Mr. F 1 min ago
Always fun to look at code with other language locales!
    /* Вход в програмата */
    puts("Стартиране на програмата..");
    printf("Локализация: %s\n", locale);
    if(argc > 1)
    {
        char choice;

        printf("Зададен е аргумент към програмата:\n%s Искате ли да го заредите? y/n: ", argv[1]);
        scanf("%c", &choice);

        switch(choice)
        {
            case 'y' : case 'Y' :
                if( (fp = fopen(argv[1], "rb")) == NULL )
                    puts("[!]Проблем при отварянето на файла.");
                else
                    puts("Успешно зареждане на файл.\n");
oh wow
Bulgarian.
ukrainian or russian, I think
or well, could probably be Bulgarian as well...
20:27
Google says it is, anyways :)
The user says it is.
yeah, it's not ukrainian.... or I don't know enough Ukrainian yet :P
I forgot that Bulgaria also uses the a cryllic alphabet.
> It has a Bulgarian interface.
it's funny how much I can actually read though
> printf("Локализация: %s\n", locale);
Локализация = lokalizatseya (something like that)
obvious that it's related to localization :)
Localization?
20:29
yup ^^
/* Вход в програмата / ---> / vhod v prohramata */ (no clue what this means)
This isn't enough for a full review, but it's very strange to have your variable/function names in English, but the comments remain in Bulgarian. — nhgrif 30 secs ago
If you included your actual real working code, this would be a nice question to ask on Code Review =) — Mat's Mug 1 min ago
By the way, any Mac users?
Option + P = π
Option + Shift + P = ∏
> Argument specified to the program: \n%s do you want to load it? y/n:
Bing appears to be fairly good at Bulgarian translation.
Potentially new CRitter?
20:34
So does Google:
> Asked an argument to the program: \ n% s Do you want to load it? y / n:
first post after 3.5 years!!
Hahaha, thank you @Mat'sMug. My first post on CodeReview, but I'm 'famous' on Stackoverflow for my long posts :-) — Steven 7 mins ago
@SimonAndréForsberg I don't understand the relevance. The question of whether to specifically add Code Review to the list of sites that are pre-populated in the close-vote popup is different than disallowing migration to Code Review as a reason for closing. Not every site that should be a migration target must appear in the close-vote dialog popup. It would be nice if they did, but even when they don't you can still vote to close, select 'other' for the reason, and use a comment to explain that the reason is for migration to a different site that's not on the list. — Mr. F 9 mins ago
Often, the languages that don't use the English alphabet don't do too well.
@nhgrif a little help on that comment please? I'm fed up.
Does @Duga crawl MSO?
Seems like no-ish.
When you choose the custom option and type "I'm voting to close this because it belongs on Code Review", the question is closed. And sometimes the user will post their question to Code Review... and often times, it'll be closed there too, because most Stack Overflow users are still pretty bad at knowing what's on and off-topic as Code Review. — nhgrif 2 mins ago
I'm not sure it'd be useful.
20:46
@nhgrif no, it doesn't. At the moment I don't think there's a need to do so either. Questions about codereview tends to be tagged with codereview-se, which is picked up by the chat feed bots.
Isn't there a CR meta for useful comments?
@Phrancis What should I be looking for to adjust the color and hover color of hyperlinks in my posts?
0
Q: Need Help Solving Error in Lua Code (GMod)

Pixels_I am trying to program a column in the scoreboard for Garry's Mod (Trouble in Terrorist Town) that displays rank of the person. I am also trying to program the name colors of admins, owners, etc. so their steam name is a unique color based on rank. I thought I was done, but when I launched Garry'...

15
Q: Frequently Posted Comments

Simon André ForsbergOn Code Review we often encounter questions with the same kind of problem over and over again. Some of us are using the auto comments script which allows you to maintain a list of comments to post. What are some useful tin-can comments that can be good to have in your list of comments? If you ...

(I knows it's W3S but it's actually good, for once)
20:54
@SimonAndréForsberg Would it be appropriate to add an answer there for common replies to SO comments about close voting because CR
@nhgrif probably yes. I have two comments that I frequently use for SO
@Phrancis Will it always be a: thing?
You should post the ones you use. Here's a link to my SO meta
31
Q: Does being on-topic at another Stack Exchange site automatically make a question off-topic for Stack Overflow?

nhgrifI regularly come across Stack Overflow comments which take this form: I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.com This always bothered me. I've read the Stack Overflow help center. I've read the Code Review help center. Nowhere in either...

But... nobody converting C# to VB.NET should be happy ;) </semi-sarcasm>Mat's Mug 1 min ago
@nhgrif Yes, the 4 a:foo classes are basically all you need
a {
	color: #24890d;
	text-decoration: none;
}

a:focus {
	outline: thin dotted;
}

a:hover,
a:active {
	outline: 0;
}

a:active,
a:hover {
	color: #41a62a;
}
What's the difference between the bottom two?
a:hover, a:active and a:active, a:hover
20:59
nothing
could they be combined into the same group?
silly
0
Q: Can someone help me furnish my php validation class. I want to reduce its size and make it easier to use

Dennis Kiptugen<?php class validate { function check_empty($name,$value) { if(!empty($value)) { $msg=""; return array($name=>$value,$error=>0,$err_message=>$msg); } else { $value=""; ...

21:10
@CaptainObvious Can someone help me furnish my title. I want to reduce its size and make it easier to read.
lol
Ooh checkmark! And 30 29 short of 30K!!
@Mat'sMug Are you rep cap for today?
Not at all!
thanks @santa!
@Mat'sMug You hit it.
yay!!
21:16
I was just about to give a couple votes, but I see someone beat me to it.
at last!!
Congrats @Mat'sMug on 30K!
5
@Icn, but the point of stack overflow is to answer specific problems about programming. There's no problem asked about or present here. The post by definition is code review -"What do you think of the code below?" It's best suited for CR. Too late to migrate it though. — Chief Two Pencils 1 min ago
21:20
-1
Q: Car Speed Checks

Angelina Ashworth'On many major roads average speed checks are in place. Two sensors are placed a known distance apart and vehicle number plate recognition is used to identify a vehicle and the time it enters the section of road being monitored. The time is recorded when the vehicle leaves the monitored section. ...

0
Q: Maths Q&A game in JavaScript

Darik<!doctype html> <html> <head> <title>Math.floor</title> </head> <body> <h1> Math.floor: The Maths Game</h1> <script> // Universty work // @author Darik // Math.floor var score = 0; var times = 0; function questions(e) { var x =...

@nhgrif I'm not sure if you like a model but this CSS I wrote has a style scheme that's not too far removed from your blog's looks, in case you wanted to copy anything from it
1
Q: Obtaining prediction bands for regression model with python

GabrielI'm trying to generate prediction bands for an exponential fit to some 2-dimensional data (available here). The data (blue points), best fit found by scipy.optimize.curve_fit (red curve), and lower & upper 95% prediction bands (green curves) can be seen in the image below. (the MWE is at the ...

0
Q: Python function to strip inline repr'd unicode strings

Travis KaufmanI have to write a python function that takes a string that contains raw unicode strings (e.g. "u'hello' there") and transform it into a string that strips the u'' identifiers from it. For example: strip_inline_unicode("u'hello' there") # -> 'hello there' Without getting into too much detail a...

Stack Exchange UI change proposal:
0
Q: UI suggests that better fit elsewhere is a valid reason for closure

200_successThe criteria for migrating a question are: The question is off-topic on the current site. The question is high-quality. The question is on-topic for the target site. Or, as stated in the faq, Don't migrate for the sake of migration. We only migrate questions because they are off-topic ...

Can you not declare an explicit variable type in JavaScript?
21:32
No.
@Phrancis the only type in JS is duck
3
And sometimes goose.
Well that's silly.
That's why JavaScript has === operator.
var foo = 42;
foo = "hello";
// did I just change foo's *type*???
21:34
@Phrancis That's Javascript
What's the difference between, "link", "visited", "focus", "hover", and "active"?
visited: after clicking
hover: while hovering over it
That's all I can remember
I have text-decoration: underline; in a:hover, and text-decoration: none; in a:link, but it appears to do the opposite.
Link is the default class. Visited is for when the link has already been visited. Hover is mouse over, active is while it is being clicked
active: being clicked.
Focus, not sure
In what order did you write those rules in the CSS?
@Phrancis Is focus for when it is selected with TAB?
@Hosch250 I bet you're right
Taking a quiz, be back shortly.
21:37
a:link {
	color: #23FF83;
	text-decoration: none;
}

a: visited {
	color: #786DFF
	text-decoration: none;
}

a:focus {
	color: #00A0FF;
	outline: thin dotted;
}

a:hover {
	outline: 0;
	color: #23FF83;
	text-decoration: underline;
}

a:active {
	outline: 0;
	color: #00A0FF;
}
The space in a: visited would be a problem.
@Hosch250 Focus can be gained in multiple ways, not just by using TAB
@200_success Okay. Fixed that, but still seeing same thing.
Clicking with mouse, programmatically, TAB, etc will all focus an element
Missing semicolon.
but... still, the underlining is backwards...
Text-decoration appears to do absolutely nothing.
21:44
What if you just do this?
Try temporarily removing everything else in your stylesheet.
a {
    text-decoration: none;
}
Does it change the default style?
@rolfl were they ahead of us on the list for graduation? I somehow feel like we are the Red-Headed step child of the Stack Exchange.....
That was one crazy quiz.
At the very end, he asked us about a case study that I didn't even know existed (still haven't been able to find it).
@nhgrif how many style sheets do you have attached to the HTML document?
21:51
@Malachi lol
I got the right answer by eliminating two of the answers and randomly guessing, but I got a different one wrong :(
@JeroenVannevel Yes, I know that. Just used TAB as a quick example.
Boy, virtual machines are handy.
Installing a big update for Windows 10 on my VM and doing my own thing here :)
22 hours ago, by nhgrif
3 hours ago, by nhgrif
I HAVE NO IDEA WHAT I'M DOING
But I think it's working now.
@nhgrif CSS is pretty simple to learn and re-learn.
Just do a quick web search, and it usually has just what you need in the first hits.
A few hours to learn, a lifetime to master.
Yes, but fortunately we don't need to be a master to set up a webpage.
I created this website for my final project in school:
I'm not proud of everything on it, and he has made some changes.
21:58
Stray bullets look like a drive-by has occurred.
Where?
0
Q: Loop an array of dictionary with keys containg sets; comparing each {key, value} pair; and combining dictionaries

user1157751I'm trying to optimize a nested for loops that compares an element in the array with the rest of the element in the array. There's two part, the first part is for example, an Array has 3 elements, and each element is a dictionary: [{"someKey_1":"a"}, {"someKey_1":"b"}, {"somekey_1":"a"}] 1...

@nhgrif Hopefully that's all the web design stuff you have to do. It sometimes take a particular type of patience to make something look the way you want to
2
Good thing is once you're done, you won't need to fiddle with it again until the next WordPress update screws up your design
@Hosch250 Floating your nav > ul > li > a is a bad idea.
.column, .span-1, .span-2, .span-3, .span-4, .span-5, .span-6, .span-7,
.span-8, .span-9, .span-10, .span-11, .span-12, .span-13, .span-14,
.span-15, .span-16, .span-17, .span-18, .span-19, .span-20, .span-21,
.span-22, .span-23, .span-24 {
    float: left;
    margin-right: 10px;
}
@200_success I don't like float at all.
Using it was part of the assignment.
Hmm. It looks like the stylesheet didn't load properly the first time. Looks better now.
Also, so was using bootstrap, or whatever CSS library we had to use.
If I had my way, I would have written everything from scratch, and it would have taken less markup/down too.
I've had a really positive experience with Bootstrap CSS
Why do you change the font-size when hovering over the navigation links?
nav a:hover {
	color:			#8C5E22;
	font-size:		1.1em;
}
22:06
Me?
To give a bit of an animation effect.
1
Q: Taking flight with JavaFX

LegatoJust another step in my educational Trek. I didn't know when/why I would use the transparent feature and in experimenting with it, I made this. This one was fun to behold once done. It's an animated flying gif and you can move it around the screen and press keys to alter its speed or add effects...

0
Q: My Rational struct, version 2

Rick DavinI implemented most of the suggestions from Version 1. Thanks to all who took time to review and offer really good comments. namespace NotSystemAndOthersThingsThatIHaveNoPracticalUseFor { // This is Version 2. public struct Rational : IComparable, IComparable<Rational>, IEquatable<Rational>

Whoa!
> namespace NotSystemAndOthersThingsThatIHaveNoPracticalUseFor
We told him to not use namespace System for his program.
2
Q: My Rational struct, version 2

Rick DavinI implemented most of the suggestions from Version 1. Thanks to all who took time to review and offer really good comments. namespace NotSystemAndOthersThingsThatIHaveNoPracticalUseFor { // This is Version 2. public struct Rational : IComparable, IComparable<Rational>, IEquatable<Rational>

@Mat'sMug ^^
0
A: My Rational struct, version 2

nhgrif namespace NotSystemAndOthersThingsThatIHaveNoPracticalUseFor I couldn't possibly imagine a worse namespace. Why not use something both simpler and more descriptive? namespace RationalMath

22:25
4
Q: Math expression on-the-fly interpreter

Ahmed Abd El MawgoodIn the last few day, I wanted to sharpen my C skills a bit, so I wrote a math expression interpreter that can handle + - * / ( ) and only integers. I just want to know how good this code is, if anyone has any comments on any part of the code and if writing such code guarantees that I understand ...

4 answers by one user!
I don't understand this:
private void ReduceOrThrow()
{
    try
    {
        Reduce();
    }
    catch
    {
        throw new ArgumentException(string.Format("Invalid Rational(int.MinValue, {0})", Denominator));
    }
}
The name is terrible.
He is trying to reduce the fraction by calling Reduce(), and if Reduce() throws an exception, he catches it and throws a custom exception, it appears to me.
Yes.
But why?
And more importantly, why should Reduce() even throw an exception?
I don't know.
When Denominator == 0
He's doing it the other way around though: creating a method that does argumentvalidation by simply calling the method and putting a try-catch around it
22:31
He should be checking for that in the constructor or something.
instead of doing the == 0 check inside the method
Shouldn't he?
@JeroenVannevel Are you writing an answer?
GreatestCommonDivisor can never be 0 so sure, constructor would be fine too I suppose
no, I don't do math
lol...
22:34
@nhgrif Reduce can throw in the case new Rational(int.MinValue, -1), it's in the comments
I didn't mean to ask how his implementation of Reduce can throw an exception.
he's missed some other cases where it can throw
Constructor shouldn't throw, period. I'd return the Undefined value instead
TTGH
There's no reason it should throw though.
If you create a rational with int.MinValue and -1, okay...
Is he still throwing in the constructor?
22:42
it can't reduce, and it'll look weird
I don't know
I'll try to take a look tonight.. but I want to work on grammar, not math tonight :)
It will look really dumb too, because you can't just covert it to a positive value and divide by 1.
(VBA grammar)
BUT... you can still do math with int.MinValue/-1 and if he's done his math correctly, then Rational(int.MinValue,-1)/Rational(2, 1) should return Rational(Math.abs(int.MinValue/2), 1) which is correct
Yes.
22:45
AND... if he somehow ended up with int.MinValue and -1 anyway, what does throwing the exception do? It just has to be caught... but the fraction actually still has this invalid value.
OR... if you do reduce it, just reduce it to int.MaxValue and 1.
It's not the same, I know...
But what happens if you do abs(int.MinValue)
You can't do that.
Let me test.
Does it throw an exception in C#?
In Objective-C, abs(int.minValue) returns int.maxValue
Even though it's not technically correct...
It throws an error.
@nhgrif it throws an exception, that was the cause of the bug in Random that we were talking about the other day
> Unhandled Exception: System.OverflowException: Negating the minimum value of a twos complement number is invalid.
How can Obj-C do engineering/complex math then?
22:48
uh...what?
I suppose the programmers have to write their own number function?
What the hell are you talking about?
In engineering, you can't just change numbers like that.
You check if the number you're about to take the absolute value of is int.minValue.
22:50
Wherein C#, you wrap every single call to absolute value in a Try-Catch or risk a UE.
... or just check if it's int.MinValue, like you suggested
Because in 99.999999% of use cases, it's not going to matter that abs(int.MinValue) actually returns int.MaxValue, so why punish 99.999999% of the users by forcing a try-catch around the call when you can just tell the other 0.0000001% to check if value is int.MinValue if it actually matters.
@mjolka The difference is that in C# you MUST check or wrap in Try Catch or you risk a UE.
In Objective-C, if that detail doesn't matter, you don't have to check OR wrap in try-catch.
You only have to check if it this detail matters.
And to 99.999999% of programmers, it doesn't matter.
@nhgrif what? you don't need a try-catch, to get obj-c like behaviour you do x == int.MinValue ? int.MaxValue : Math.Abs(x)
Where as in Objective-C, you just do x = abs(x)
You have to check if x is int.MinValue or risk a UE in C#.
You do not have to check it at all whatsoever in Objective-C.
A ternary operator is a check.
22:55
i understand that, i was responding to when you said "you wrap every single call to absolute value in a Try-Catch or risk a UE", where you didn't mention doing a check
Ok.
C# isn't the only one like this though. Most programming languages work this way. You're forced to either catch or wrap in a try-catch lots of different things.
Objective-C just takes an entirely different approach to exceptions.
An exception should be thrown when it's truly exceptional behavior--something that the programmer must fix. Otherwise, the problem is handled in other ways.
Like consider file IO.
If you try reading a non-existent file, in almost every language, this throws an exception.
So you wrap file IO stuff in try-catch blocks.
0
Q: Unity simple map generation

user2351722I am trying to generate simple map like this. Everything works as i want, but i am new to programing so my question would be, is it a good way to do something like this? And if not maybe someone would explain me where and why it is bad to do something like this. And how bad is it on performance. ...

In Objective-C, it doesn't throw an exception. Instead, you pass in a pointer to an error object, and if there was a problem, it creates an error object for you to deal with.
23:12
    switch (change){
    case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10:
        Instantiate(cube,here,Quaternion.identity);
        break;
Does this look weird to anyone else? ^^
Yes.
I don't know Java. Is case 0-10: possible?
Or... how many other cases are there?
Because if you're stacking that many cases together... you're defeating the point of a switch and might need if (change >= 0 && change <= 10)
That's C# there (see this last question that just came in)
By the way... I just found where my syntax highlighting plugin lets me make custom themes.
Oh nice!
@nhgrif it's C#, and no.
23:38
I need a good snippet of code that looks muddled and unclear and can be fixed simply by changing the function name and variable names
Without it being too drastically long...
Or simple refactoring anyway...
Why do you need to implement this method in Swift? It doesn't do anything. Your Swift code could be improved by simply not calling this method at all, rather than implementing and then calling an empty method. — nhgrif 6 secs ago
Really good question here that got a good number of upvotes, but no answers. I just placed a bounty on it.
7
Q: Quicksort async vs serial

Bill BarryI am playing with async and I figured I'd write a parallel implementation of Quicksort while trying to look at various optimizations. I want to keep the generics (and the overhead of the virtual calls going on here). Other than that I am looking for optimizations that can be made. class Program ...

@RubberDuck well the shuffle is wrong :) but i don't think that's a bounty-worthy answer
If there's no other answer after a week it would be. =;)-
lol. have you tried playing around with the code? i found it really difficult, the way the tests are set up
I was going to try a review myself, but the async stuff is still a bit over my head.
23:50
yeah i've been making an effort lately to really understand it. getting there, but still not quite there
Anyone feel like helping me come up with a code snippet?
Not too much. Enough to know I don't care for the delegate in the tests...
Foo.bar(baz)
^ code snippet
some algorithm that's relatively simple (15ish lines) but not so simple that you could understand it on first-read too easily if the variable/method names and factoring was bad.
13
Q: 'Team Split' problem

arunkrishnamurthy01Below is my solution for this 'Team Split' problem. In summary, the problem is to find relative strength of 2 teams by finding the difference between their total strength (individual strengths can be found using a quadratic expression of form ax2+bx+c). The solution in Java manages to solve the...

wow...
23:52
Hmm...
I might have something you could use as psuedo code.
I'll be putting it in as Swift, but psuedo code definitely works.
I don't really want to grab something out of someone's SE post. Or on the Internet at large.
Well... VBA might as well be psuedocode
2
Because I'm going to put it in my first blog post...
> VBA. It's code. Sort of.
23:54
you could try to mangle the hell out of names on a simple Fibonacci implementation
not sure if that's be confusing enough
since it's so simple though :/
SE is CCSA, attribution required. Should be safe to copy to a blog post
Oh, look! It's the lurker!
void calculate(int x) {
	int p = 1;
	int c = 1;
	std::cout << current << ' ';
	for (int i = 0; i < x; ++i) {
		std::cout << c << ' ';

		int tmp = p + c;
		p = c;
		c = tmp;
	}
}
@nhgrif the code in the question stinks...
for it to be unreadable because of variable names, it does need to be something not too trivial.
10
Q: Karate Chop Kata

RubberDuckI had some time to kill today, and I found the Karate Chop Kata. Specification: Write a binary chop method that takes an integer search target and a sorted array of integers. It should return the integer index of the target in the array, or -1 if the target is not in the array. I...

Awww man. You guys weren't supposed to star that. Lol
23:56
For some reason I can't ask any more questions on my account, I must have done something wrong? But I have one more question i'll post here just incase you have the answer — user2034047 5 mins ago
GTMagBarDevice.sharedDevice().delegate = self; I am getting an error with this ... "type view controller does not conform to protocol GTMagBarDeviceDelegate", any ideas? — user2034047 4 mins ago
:(
I just can't imagine why he's question banned. Simply unfathomable.
Did you see the question he asked?
It's impressive how oblivious some people are to the system trying to tell them that they suck at using the system :/
3
@nhgrif Yeah.... he probably should be question banned.
@Corbin One word site: SO
    public static int d(long n) {
        if (n <= 0) {
            throw new IllegalArgumentException();
        }
        int d = 1;
        long l = 0;
        int c = 0;
        while (n != 1) {
            if (n % 2 == 0) {
                c++;
                n /= 2;
                continue;
            }
            for (long i = 3; i <= n; i += 2) {
                if (n % i == 0) {
                    if (l != i) {
                        d *= c + 1;
                        c = 1;
                        l = i;
0
Q: Improving my Ruby IRC bot

user68447This is my first project in the Ruby language, I'm generally looking for advice on what I can do to improve and also help on the way I have my code and project laid out. I have all my code hosted on my github at https://www.github.com/Virtual-/roobybot

23:58
@nhgrif obfuscated a method for you ^^
RELOAD!
@Corbin Tell me about it.
There are 1213 unanswered questions
@Duga That's early..
23:59
@SimonAndréForsberg wow, that's impressively obfuscated.
@Mat'sMug what? Is it daylight savings time again?
@SimonAndréForsberg What is that exactly before I try to figure it out?
Prime number?
@Corbin thanks! I guess :) figured out what it is doing? :)
Need. More. Reviewers.
I think it's gcd
but i'm too lazy to figure it out
23:59
lol
it's definitely not gcd

« first day (683 days earlier)      last day (3630 days later) »