« first day (840 days earlier)      last day (3192 days later) » 

11:01 AM
is it possible to find an (approximate) circumcircle of a polygon?
just an idea
or the "smallest circle that encloses it"?
I guess it's similar to this one en.wikipedia.org/wiki/Smallest-circle_problem
 
It is hard to answer your question generally. Creating a new object every time you want to call a method sounds like a strange approach, though. I suggest you to ask your question on codereview.stackexchange.com and include the code. — x squared 25 secs ago
 
Probably. I haven't really done geometry in years though.
 
a different topic... is the library here a good example of proper programming? introcs.cs.princeton.edu/java/stdlib
 
I'll let someone who actually knows Java answer this question x)
 
lol :)
 
11:10 AM
@ambigram_maker could have been, if it would have been a "real" library. They're not even using a proper package name for the files.
 
naming is inconsistent i agree... but apart from that?
 
> A. The libraries in stdlib.jar are in the "default" package. In Java, you can't access classes in the default package from a named package. If you need to use our libraries with a named package, you can use the packaged version stdlib-package.jar.
that's just crazy ^^
 
i don't actually use it... i just see how they did it
 
it's GPL... so it's open source...
 
there seems to be some useful methods there, but some of them could use a review or two...
so "proper programming"? depends on your definition of "proper".
 
11:14 AM
oh yeah... they have all the methods as static in all classes, even in the StdDraw. But they uses swing. Is it possible to create a static library using JavaFX?
 
0
Q: CheckedChanged event RadioButtons doesn't work

LuïsI have make a structure like this: Topic 1Topic ATopic αTopic βTopic BTopic γTopic δTopic 2Topic CTopic εTopic ζTopic DTopic ηTopic θ First comes topics 1 and 2 on screen. By checking one of them Topic A and B or C and D comes on screen. Finally coms α until θ on screen dependent on the chose...

 
@ambigram_maker sure, you'd need to pass scene on every call though.
or at least the component you draw on
 
is there some way to generalize it? like they did?
(without swing)
(don't get the wrong impression... i love swing, but i prefer javafx)
 
I haven't checked with the code, but sure, there should be
on a related note: preferring JavaFX over Swing is definitely a good idea
also IIUC you can actually embed swing into JavaFX
@SimonAndréForsberg I secured you some SO swag btw.
 
i tried to keep a static data member of a scene... but the way javafx works is a little differeny
"different"
it should extend Application and follow a structure... TL;DR I'm stuck
 
11:18 AM
I don't understand what you mean by the first sentence
 
I tried to keep a scene as a private static variable
but i couldn't find a work around for initializing the stuff
 
why would you have to keep it static?
 
how else would i keep the methods static?
 
pass in the scene as argument
that also keeps other code from modifying the scene while you work on it for the most part
 
yeah but... i want a library that could be called from simple classes
(without extending anything)
(like Application)
 
11:24 AM
but then you shouldn't rely on Scene anyways
 
@Vogel612 oh? Nice!
 
why would your library need to know about Application? let alone extend it?
 
precisely
 
so what's the problem then?
/me confused
 
@SimonAndréForsberg Can you finalize the rejection on the pending edit for this answer?
 
11:26 AM
i don't my other code to know how to make a Scene ;)
 
And do you have the ability to give a longer reason?
 
why would it need to?
 
Because the person who posted that edit posted an edit on two other answers to that question removing code from blockquote tags.
 
@ambigram_maker let me ask something for clearing stuff up:
 
okay... see their example code to see what i mean
 
11:27 AM
Is you library intended to draw shapes?
 
or to work with these shapes
 
yes + yes + much more (all possible 2D graphics related things, like theirs)
 
@Vogel612 Thanks. :)
 
@ambigram_maker do you want to support multiple different drawing possibilities? (e.g. openGL, swing, JavaFX)
 
11:29 AM
see their simple example here (the StdDraw part) :introcs.cs.princeton.edu/java/15inout
 
it's not about "their" code
it's about your code
you're intermingling responsibilities
 
0
Q: One element only subarray max length

CaridorcTask description You are given a list and an item, find the length of the longest consecutive subsequence of the list containing only the item. Testcases [1, 1, 2, 3] 1 -> 2 [1, 0, 0, 2, 3, 0, 4, 0, 0, 0, 6] 0 -> 3 This code is pretty readable in my opinion but I fear that the O(N^2) tim...

 
you don't need to actually draw two rectangles to check whether they intersect
 
@Vogel612 umm... i would like to stick to 2D graphics with JavaFX. I hadn't thought of supporting multiple possibllities
 
which means you should make the drawing (and accordingly stuff that has to know about Scenes and Applications and all the drawing stuff) one or more separate classes
 
11:32 AM
@Vogel612 keeping things static is the problem
 
Rectangle / Circle / Line / Figure / 2DGeometrics doesn't need to know about where it'll be drawne
@ambigram_maker then don't what's the problem?
 
but a library is supposed to be static (isn't it?)
 
Holy broken code this morning. Monking @all.
 
@ambigram_maker no, why?
 
for easy access
 
11:33 AM
who said that shouldn't be teaching or writing libraries
 
@RubberDuck Monking
 
@ambigram_maker Definitely not. You just need a way to access the library, that's all. But you can do that by creating objects as well.
 
i'll do that i guess... that'll make thinks simple
"things"
 
@EBrown I don't know what that guy was up to. Submitted edits removing quote blocks from every answer on that Q. shrugs
 
@ambigram_maker you can edit messages for 5 minutes after posting.
 
11:35 AM
You just need a "point of entry". That could be a static method, or creating an instance of a class (and probably a few other things I can't think of right now).
 
use the arrow up key :)
 
thanks :)
okay... i think that i'll need to brainstorm for a moment... will keep visiting... bye....
 
@ambigram_maker Write some code, post it for review, then use your gained knowledge to review other people's code ;)
4
 
@RubberDuck Yeah, I haven't the foggiest. I tried to indicate why those code blocks were in blockquotes when I submitted my reject reasons, but who knows what'll happen. Maybe he'll realize that we intentionally put certain blocks of code within blockquotes.
 
@EBrown you are aware editors are not notified of rejections (IIRC)?
 
11:41 AM
@Vogel612 He can still see them in the history, IIRC.
 
that may have changed though...
@EBrown if they check
not many people do, I think
 
Yeah, I don't remember how that system works.
Does anyone have something on Database Administrators or Programmers I can attempt to edit and you can reject to see?
 
I'm going to edit a post of yours.
 
@SimonAndréForsberg OP can always reject
 
11:45 AM
ok, ping me when I should reject
 
@SimonAndréForsberg Done.
 
You can see the reason if you check, but there's no notification.
 
@EBrown rejected
 
And IIRC you have to look at the review queue history to find it.
 
Yeah, @Vogel612 and @RubberDuck are correct: I got no notification when you rejected it.
 
11:47 AM
@RubberDuck there definitely is a over at [mse]
 
It does show up on my activity tab, though.
(Not sure if anyone else can see that link.)
 
activity (aside from votes) is public
 
I was just about to say that it shows on your profile. codereview.stackexchange.com/users/41243/…
 
Yeah, but no notifications.
That definitely should be a .
@Vogel612 I was unaware of that. :) Thanks for clarifying that for me.
 
Idk. No notification prevents a good bit of butthurt.
 
11:49 AM
@EBrown doesn't work for deleted stuff
 
@RubberDuck But it also prevents some learning.
 
359
Q: Decision on rejected edits should be displayed as a notification to the editor

slhck Update, April 2014: I fully support Shog9's proposal of adding the message where it belongs—in the actual editing form. This is less intrusive than displaying it as a notification, but it serves the same purpose. Can has? Background When you suggest an edit, the outcome of whether it was ...

^^ that's marked status-competed..
because it refers to the activity stuff only
 
Ah, yes, there is that banner.
Also, @RubberDuck, your comment just now gave me an idea to post my Inventory structure as well.
 
Yeah. Sorry about the poor advice.
 
Oh know, it's completely valid for what information you had. :)
I may still consider it.
(You guys cannot know that Inventory inherits Container which implements IList<T>.)
 
12:01 PM
Can I see Inventory? Is it very big?
 
Yes, so I'm making a new question for it. :)
 
Oh. Right. Okay. I was just hoping to help decide on whether or not it should be injected. =)
 
0
Q: Inventories, Containers and Filters

EBrownComing off a comment on this question, I figure it cannot hurt to post my Inventory work here as well. Basically, I have Item, which is a base item, and then Container, which is a specialized item that has sub-items in it. The Container object, however, can be filtered to only permit (or restric...

 
@EBrown I would definitely inject that. It's non-trivial. I would want to isolate your Actor from the Inventory implementation in test.
Also, auto-properties brother. Auto-properties.
 
12:14 PM
@RubberDuck Alright, I'll do that then.
@RubberDuck This was before I was really comfortable with auto-properties. :P
 
Are you writing tests?
 
Not yet, unfortunately.
There's a lot of things to try to test, to be quite honest.
And it's cumbersome to maintain them. (I'm not good at unit-testing anyway.)
 
@EBrown Join the club.
I should probably read a good book about it, but so far I've only read junk...
 
If you're not testing, you might not want to bother. More work for little gain.
I wouldn't recommend a book. I'd recommend actually trying a few TDD katas. Or building a massive system that changes frequently...
 
@RubberDuck I'm not testing because I don't want to, I'm not testing because I'm not good at it. :P
 
I'd love to get some unit-tests in here.
I'm just piss-poor at creating them.
 
That is a really good book on the topic
 
Too bad my C# skills are worse than my tests.
 
Try the Roman Numeral kata. I found that it's a good one for getting your feet wet.
 
eh, C# is like Java just less verbose
 
12:19 PM
Roman numerals, the numeric system used in ancient Rome, employs combinations of letters from the Latin alphabet to signify values. The numbers 1 to 10 can be expressed in Roman numerals as follows: I, II, III, IV, V, VI, VII, VIII, IX, X. The Roman numeral system is a cousin of Etruscan numerals. Use of Roman numerals continued after the decline of the Roman Empire. From the 14th century on, Roman numerals began to be replaced in most contexts by more convenient Hindu-Arabic numerals; however, this process was gradual, and the use of Roman numerals in some minor applications continues to this...
 
If you can read Java, you can read C#
2
 
It's not too complicated to implement, but complicated enough to make you think about the requirements.
s/requirements/test cases
 
I'm not very good with unit-testing either
 
@JeroenVannevel What's worse is I can't even afford to pick that up...lol
 
I might take a look at that book Jeroen linked
 
12:23 PM
Last tests I wrote were in Python. But it got kind-of complicated...
I should upload one of them for review.
 
Greetings
 
@Mast if your tests are getting too complicated, it's usually a signal there's something wrong with your design.
2
 
wow haha... this answer is suddenly 3rd...
2
@EBrown This is always the worst reason not to do anything. There's only one way to get better at something.
 
@nhgrif I know, and while I'd love to get better at them, I keep hitting the "this test looks really f'd up."
 
@RubberDuck Definitely ^^
 
12:36 PM
Well, as @RubberDuck just said... if your tests are getting too complicated (or I'll add, if they 'look really f'd up'), then it might be a sign that there's something wrong elsewhere.
 
Or a sign that I'm not built for Unit Testing.
 
The worse any given method is at following SRP, the more complicated the unit test for that method is
2
Don't we have a tag?
 
Another problem is not having a clearly defined boundary between your code and the external world. RD suffers from that in many places.
 
@RubberDuck Can you elaborate on what you mean by this?
 
12:38 PM
@EBrown they're literally the same thing [tag:tag] and that link
 
For example, RD integrates with the VBE and calls on it's interface in many places. Because of that library's poor design, each test class takes a crap ton of setup.
 
@Quill Nifty, was unaware of that. I thought [tag:tag] was cosmetic.
 
Isn't there a setUp method in VBE unit testing?
 
If we'd done things smarter, we would have defined our own interface and an adapter to work with, but as it is, that API pollutes our code and tests.
 
My unit-test is the MainGame class. :)
 
12:40 PM
Most unit testing has things like setUp or beforeAll and afterAll and such.
 
Yeah @nhgrif there's a Setup method, but the setup methods tend to be 30-50 LoC. Just to make things work. Too many dependencies.
 
> If it doesn't work in production, it doesn't work.
 
There are two things that are really easy to start writing unit tests for.
1. Model classes (particular those for which you parse something to construct them)
2. "Helper methods", the best/most common example I can think of is stuff like helper methods for turning dates into particularly formatted strings
 
@nhgrif I have written a few unit tests for some helper-methods in an old VB.NET project of mine.
It was a method to transform IP addresses from "string" format to byte[] format.
 
Right, that's a perfect example.
 
12:44 PM
That was really easy to test.
 
Unit tests like to ask "Given known input, does this method return the expected output?"
 
Supply an IP of 192.168.0.1 and 2607:5600:cc:1:: and verify they return the appropriate byte[] output.
 
right
But I might argue that even there you might be unit testing too much
You probably should have written another method to turn a string or integer into a byte[].
Before you can turn 192.168.0.1 into a byte[], you have to be able to turn 192 into a byte[], right?
 
@nhgrif What if you program on a different abstraction level?
 
such as?
 
12:48 PM
I mean, helpers are easy. Everything converting something is a helper.
And sorting is probably a helper as well.
 
@nhgrif I don't remember...trying to find the exact unit test now.
 
@EBrown What I mean is... your method...
 
But what would a model be?
 
convertIPToByteArray() should have been calling convertIntegerToByte[]
 
The instance of a class?
 
12:49 PM
A model refers to a "model class". A class designed to represent part of your data model...
 
@nhgrif Well I had several test methods.
I had a few that were literally, "Expand IPv6".
<TestMethod(), TestCategory("IP Tests")> Public Sub ExpandIPv6_FE80__1()
    Dim ExpectedHexString As String = "FE80:0:0:0:0:0:0:1"
    Dim Result As String = Globals.ExpandIPv6("FE80::1")

    Assert.AreEqual(ExpectedHexString, Result)
End Sub
 
For example, if you're writing some sort of app for running a school, you probably have the following model class... Student, Teacher, Class, Semester, etc.
 
Like that one, for example.
 
I'm not talking about your tests @EBrown.
 
Oh.
 
12:50 PM
I'm talking about the methods that your tests are testing.
Converting an IPv4 to a byte[] is a series of converting four integers to a byte[]
And actually, in the case of IPv4, we know it's a 1-byte integer
 
Yeah, but those were done differently.
 
So the entirety of the work shouldn't be in a single method.
 
An IPv4 address was first converted to an IPv6 address.
Then the IPv6 address was converted to a byte array.
 
What's the format for IPv6 exactly?
Because you're still missing a step.
 
What step am I missing?
 
12:52 PM
What's the format for IPv6?
 
When I tried using your second example, Spyder threw the error AttributeError: 'DataFrame' object has no attribute 'precedingWord'. I have decided to post on CodeReview. If you are still interested in helping me with this, you can take a look here. In the meanwhile I'll accept your answer because you explained why my script is slow. — Bram Vanroy 46 secs ago
 
It's 8 groups of four hex digits (when fully expanded).
 
How big are the groups? 2 bytes?
 
Yeah.
 
@nhgrif I don't write tests for model classes. They're often just trivial containers with no real logic. Testing them is tantamount to testing the compiler.
 
12:54 PM
Okay, so you should have had a method which took a 16-byte integer (or hex number) and returned a byte[] with two values in it
@RubberDuck Basically all of the model classes that I work with are the result of parsing JSON or some sort of response from a web api.
 
@jeremycg In case you're interested, I added a post on CR to improve performance. — Bram Vanroy 24 secs ago
 
I'm not concerned about the case that I created a model and set all its values manually. I'm concerned about the case of...
let person = Person(json: jsonResponse)
 
0
Q: Speed up Python execution time

Bram VanroyI first made a topic on SO to ask why my script is so slow. I then tried to figure out the suggestions to improve the performance of the script. Unfortunately, I am incredibly new to Python but I have some background in PHP and JS. In this post I'll first explain what the script does and then I'l...

 
@Dason As you proposed I added a post on CR. — Bram Vanroy 1 min ago
 
12:57 PM
@nhgrif That's more than a fair point.
 
And then I'll have files like bob.json in my unit test target that are used for testing that parsing.
And some of them are intentionally broken
XCTAssertNil(Person(json: brokenJson)) // or however failure condition is supposed to be handled
by the way... I'm thinking about making a FizzBuzz server as a way of learning RoR...
And to wrap up this conversation about unit testing (unless Mast/EBrown had more stuff to say/ask)...
The key to being good at unit testing is to be good at eating elephants.
6
 
@nhgrif I'm not really good at eating elephants...lol
Generally, when I programme, I start with one large monolithic method, then break it down later.
 
Rule of thumb: If it works, then you don't need help from Stack Overflow. Consider heading over to codereview.stackexchange if you would like people to make code suggestions. — Oka 32 secs ago
 
@nhgrif fizzbuzz server? like the advanced fizzbuzz with parameters?
 
@Quill I'm not sure yet. First goal is just making an API end point that takes two arguments and replies with JSON full of a FizzBuzz sequence
the arguments will be starting index and length
or maybe first number and last number
 
1:07 PM
Hmm, what came to mind was something like fizz = 3, buzz = 5, turtle = 10 where all values can be changed around
alongside the range
 
A FizzBuzz server could be nice, many angles to expand on.
 
Right...
But I don't know anything about Ruby, Rails, or web server programming at al
so... baby steps
 
RoR isn't all that common around here, is it?
 
Not in chat, that I'm aware of
But almost all of the server side stuff where I work is RoR.
 
@BramVanroy this still feels like a question for Stack Overflow, because your code is broken. CodeReview is for reviewing working code. — Eli Korvigo 51 secs ago
 
1:14 PM
Here's an old ruby q on fizzbuzz:
17
Q: FizzBuzz in Ruby

UndoI have this implementation of the FizzBuzz challenge in Ruby: (1..100).each do |n| i_3=(n%3==0) i_5=(n%5==0) case when i_3&&i_5 puts 'fizzbuzz' when i_3 puts 'fizz' when i_5 puts 'buzz' else puts n en...

 
So my question about "Entities and the things they do" is on the "hot" list on the main SE site.
 
Someone want to be the hammer here? Broken code.
-1
Q: CheckedChanged event RadioButtons doesn't work

LuïsI have make a structure like this: Topic 1Topic ATopic αTopic βTopic BTopic γTopic δTopic 2Topic CTopic εTopic ζTopic DTopic ηTopic θ First comes topics 1 and 2 on screen. By checking one of them Topic A and B or C and D comes on screen. Finally coms α until θ on screen dependent on the chose...

 
0
Q: Avoiding code repetition while handling exceptions

vikingrFor my application, I need to use two slightly different algorithms for persisting an entity: def persistRandomAlias(self, alias): try: self.em.persist(alias) self.em.flush() except DBALException as e: if e.previous.code != 23000: raise e ...

 
@RubberDuck Already hammered by me.
Still needs one more, though.
 
@EBrown Is closed as of post time
@CaptainObvious That's @RubberDuck and @Heslacher
(It clearly looks like Python, but also says it in the MD <!-- language comment)
 
1:23 PM
@Quill I know that. OP needed to know that it needs a language tag.
 
That.
 
This seems like a comparative review question
 
I think it's important that we be extraordinarily mindful of what we're doing for OPs.
If they get a comment within minutes of posting saying that they need to add a language tag, can we try to let them have a chance to add it? If 5 hours later, they haven't added it (or responded at all), does anyone really want to help that user out? I mean, really?
If they reply with a comment saying "This is python" but didn't edit it, then maybe they don't know how to edit, and we can change it for them...
But unless the thing getting in the way of making the question on-topic is the OP's capabilities with the site, we should be very hesitant to edit an off-topic question into an on-topic one.
 
I agree to some extant, language tags are pretty menial, though
on another note, it's crossposted on SO, of which, the author seems to be editing
 
Monking
 
1:30 PM
Monking
 
> What a fascinating solution! It seems that for every smart decision you made, you also threw in a poor decision or two.
0
A: Automating the aggregation and filtering of an 8-worksheet spreadsheet

RubberDuckA wise programmer once told me What a fascinating solution! It seems that for every smart decision you made, you also threw in a poor decision or two. I now completely understand where he was coming from, because I feel the same way about this code here. It's a beautiful mix of good and bad...

 
Yes, but if the OP doesn't even reply to a comment suggesting that he needs a language tag, either by making a comment or an edit... again, is it a question/user we really want?
 
So long as the spice flows, who cares?
 
wut
 
i.e. I don't care who uses the site, so long as we keep them from making a mess.
Or, did you not get the Dune reference?
 
1:33 PM
nope
 
Melange (/meɪˈlɑːndʒ/ or /meɪˈlɑːnʒ/), often referred to as simply "the spice", is the name of the fictional drug central to the Dune series of science fiction novels by Frank Herbert, and derivative works. In the series, the most essential and valuable commodity in the universe is melange, a drug that gives the user a longer life span, greater vitality, and heightened awareness; it can also unlock prescience in some humans, depending upon the dosage and the consumer's physiology. This prescience-enhancing property makes safe and accurate interstellar travel possible. Melange comes with a steep...
The spice must flow.
 
Consider asking on CodeReview. This is opinion-based question and is likely to be closed. — BartoszKP 19 secs ago
 
I just noticed somebody got Populist over my accepted answer on Information Security. Good for him.
 
What is populist?
 
Twice many votes as an accepted answer with at least 10 votes
roughly
 
1:38 PM
Ah.
 
@nhgrif, did you get [badge:populist] over Jon Skeet on that swift question?
 
Yes.
 
@nhgrif has one of... that ^^
 
When a @jonskeet answer isn't quite good enough, I'm #SOreadytohelp http://stackoverflow.com/help/badges/62/populist?userid=2792531
 
@nhgrif It's about score, not about votes, right?
 
1:40 PM
Probably, yeah
 
@IsmaelMiguel, does my message render Jon Skeet as undefined for you?
1 min ago, by Quill
@nhgrif, did you get [badge:populist] over Jon Skeet on that swift question?
 
I probably got some downvotes on that answer as well. It was kind of controversial but absolutely the truth.
 
@Quill ?
 
@IsmaelMiguel I thought it might be a memer thing
Jon Skeet renders as undefined on my machine
 
Weird
Probably someone changes a json file
 
1:42 PM
@Quill Jon Skeet defined the universe, not the other way around.
 
 
@Quill lol
 
Recursion.
 
Congratulations, you found a bug.
 
1:44 PM
*sigh*
 
Zombie?
 
and my coffee is cold
 
Okay... so I don't know if this is rails specific or just a web programming thing...
a "controller" is where I'd write a method that actually gets called when I hit an API end point, right? and I use routing to link a url to a controller method, right?
 
And that has nothing to do with the HTML page, right? (This is getting more rails specific)
 
1:46 PM
euh
 
Rails command line has a "generator" that will create stubbed out files for you
 
in ASP.NET or Java stuff you then build up the HTML page with data from that controller method
 
right
mmk, I'll see where this goes..
 
oh nevermind, I see where I was confused.
In rails, you can generate a "scaffold", which creates several things at once
when all I want is a controller
 
1:49 PM
sounds a lot like angular with factories instead of scaffolds
 
and if I just take input and return output, that should be a GET, right?
 
Yeah
 
GET = SELECT
POST = CREATE
PATCH = UPDATE
DELETE = DELETE
 
The goal is to beat a similar R script in execution speed. I read Python was fast, so where did I go wrong? If I had a nickel for every time somebody stated something along those lines... A language being fast doesn't mean every implementation in the 'faster' language is going to beat the implementations in the 'slower' languages. It's a fallacy. — Mast 14 mins ago
 
yeah... it's not exactly a select... but close enough I guess.
 
1:55 PM
a GET should never manipulate data
 
@NehalJain Nothing wrong with asking for an opinion - but not on SO. To ask for a code review post on Code Review. Please read their help center first, to be sure your question is on-topic. — BartoszKP 42 secs ago
 
because it can be cached client-side
like on a WP app
 
well, for this... I'm not even storing any data
I'm writing a fizzbuzz server as my first rails project
just returning output based on input
 
yeah, that's a GET
I don't mean literally querying a database
 
right
 
2:06 PM
0
Q: Why is the ranged for loop not working with the iterator defined the following way?

MAKZObjective is to illustrate the usage of iterators in ranged for loop. I have the following piece of code: #include <iostream> class str{ char *s; int c; public: str(char *x): s {x} {c = 0; while(*x++)c++;} struct iterator{ iterator(char* x) : c ...

 
@CaptainObvious Very broken.
 
@CaptainObvious Close Hammer time
 
2:24 PM
thank you @EBrown and @RubberDuck --> codereview.stackexchange.com/review/suggested-edits/43127
 
1
Q: Project Euler #9 implementation in java

Altamash KhanThere exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc. I got the code to work using algebraic simplifications. let num = 1000; since a+b+c= 1000; hence a2 + b2 + c2 + 2ab + 2bc + 2ca = num2 (by the way....anything^...

 
Meta Effect engaged. +6 upvotes since I linked to my Swift answer over Jon Skeet. ;) And +0 for Skeet. ;)
3
 
You're welcome @Malachi. He did that to every answer on that question. No idea why.
 
I'm a little disappointed though that this one doesn't have more upvotes. ;)
 
@Malachi On a related note, I find doing an empty line with > and then format your code normally works well, Markdown wise
 
2:53 PM
I just paste in the code, select it all and push Ctrl+K to indent it, then select it all again (including the new whitespace added) and click the blockquote button.
 

« first day (840 days earlier)      last day (3192 days later) »