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

03:00
yeah I know but Windows introduces a stupid width on Console windows which I know will break this application
A new Python question is coming up.
I just have to transfer some files.
It's the one that I found on my RPi
23 hours ago, by Ethan Bierlein
Oh god, my old Python code is horrid
23 hours ago, by Ethan Bierlein
There are a few things here that might be review-worthy...
No, it's not quite that bad.
But I did write it about 1.5 years ago
Hardware Recommendations site is close to launching.
193
Hardware Recommendations

Proposed Q&A site for people seeking specific hardware recommendations.

Currently in commitment.

2
1
A: Project Euler, Challenge #12 in Swift

nhgrifThe spacing on your parenthesis in your function declarations is odd and distracting. Try not to fight what autocomplete will give you. It should look like this: func nameOfFunction(firstArgumentName: Int) -> Int Notice the lack of spaces inside the parenthesis but the addition of the space ...

@200_success Are you ready to learn Swift?
03:08
Why do you ask?
Probably a good idea to learn it, if it goes cross-platform as promised.
Because it's magic.
yeah yeah
I don't remember hearing anything promised about it going cross-platform... just open-source (which probably leads to cross-platform).
Why do people keep saying that it's magic?
Zak
Zak
hello again from the office
03:10
@200_success Because it is.
hey welcome back @Zak
> - At launch we intend to contribute ports for OS X, iOS, and Linux.
Tell me about this magic.
oh well there you go
Well, what are you interested in? What features must a language have for you to like it?
I believe, you should ask this type of question on CodeReveiw forum. — MaxZoom 46 secs ago
In a nutshell, what is its niche?
For example, C is high-level "assembly", Python is "executable pseudocode", …
03:15
@Zak Is it really 04:15 in the UK on Saturday, and you are at the office/work?
As Apple puts it, Swift builds on the best of C & Objective-C without the constraints of C compatability.
It looks and feels more like Java or C#, so it's not as ugly as Objective-C which people complain about
iAgree
4
0
Q: Builder - Another bad 2D Minecraft clone

Ethan BierleinI was poking around on my Raspberry Pi that I hadn't turned on or used in a while, and I stumbled upon this Python script that I wrote ~1.5 years ago, and I was intrigued. Essentially, it's a 2D Minecraft clone with no concept of survival. It does have a slightly, complex control scheme, so here...

I'm going to bed, but I can discuss more tomorrow
This question could be suitable for Code Review, as long as (a) your code works as intended, (b) your code is real code, rather than example code, and (c) your code is included in the body of the question. If you wish for a peer review to improve all aspects of your code, please post it on Code Review. — Phrancis 53 secs ago
03:18
@EthanBierlein how do I do the textures
There should be a link at the bottom of the post. Does it not work?
Good night.
@nhgrif 'night!
@EthanBierlein Hmm, they're a bit small, I guess we'll see
@nhgrif 'night!
@Quill Well, they literally are 8x8 pixels in size.
Anyways, I need to get to work on my game.
I promised 60 Twitter followers that I'd have game screenshots by "screenshot-saturday"
03:23
@200_success you did see this, right? where's your story?
65
Q: 10 Million Questions - Let's Share Some Stories That the Number Doesn't Convey

Tim PostIt's easy to look at numbers; numbers tell us that billions of developers have been helped by what we built. That alone is very warming and makes us feel exceptionally great about what we're doing, wouldn't it be nice to take a little time on a Friday to share some stories that the numbers can't ...

The code applies directly to prototypal inheritance and has nothing to do with vehicle info, I used cars as example code. The title is misleading and obtuse. — Data 2 mins ago
1
Q: Builder - Another bad 2D Minecraft clone

Ethan BierleinI was poking around on my Raspberry Pi that I hadn't turned on or used in a while, and I stumbled upon this Python script that I wrote ~1.5 years ago, and I was intrigued. Essentially, it's a 2D Minecraft clone with no concept of survival. It does have a slightly, complex control scheme, so here...

12
A: Spelling mistake in "Not a fan of **teh** twitters?"

Travis Jµ$iÑg "teh twitters" à$ w┌ï┼tεn ì$ $împ└ÿ á ╒ün p└ä¥ σ∩ thè sen┬éncé. ╒úrthεr, ßy ü$ïng thí$ P└a¥ƒu└ ┼ôÑé í┼ @vòíd$ tHë Pò$sib└e ┼ången┼ïä└ çòn√ër$@┬ïò∩ δ╒ réâ$ó∩$ fo┌ dì$└íkïÑg ┼wî┼┼ε┌. φf wHìçh ì wì└└ a└s° avóïD.

Zak
Zak
@Phrancis sorry, missed that initially. Yes, it is 4:30 am. My sleep schedule is, well, erratic to say the least
@Mat'sMug Weird. I don't get it...
03:33
@Mat'sMug Dunno. I'm a pretty unexceptional Stack Overflow user. No spectacular questions or answers to my credit.
@Zak Y U NO SLEEP?
Please stop using code markup for quotations. There is a perfectly good quote markup. — Josh Caswell 9 hours ago
Zak
Zak
Caffeine, blue/white screen light, atypical brain chemistry, take your pick :)
> Examples of this don't need to be nearly as epic as explaining branch prediction like a boss - it could be as simple as an answer where someone finally grasped how memory is addressed, or why a regular expression did what it was doing, or the like. Let's pick some of our 10 million moments that we're the fondest of, and allow others to share in them.
it's about moments, not about being a spectacular user ;-)
Zak
Zak
I've got some really bad questions from when I first joined SO :)
back before I'd grasped the basic structure of an OOL
03:35
inb4 10+ answers about Jon Skeet
3
Zak
Zak
then I bought a textbook and read the whole thing and things made much more intuitive sense
this one looks like the most naive
0
Q: VBA - is it possible to call subs or functions from a collection or other storage location?

ZakPretty self explanatory, I have a set of subs/functions which I'm going to be calling a lot. I would like to be able to store them in a collection or something equivalent so I can just write, for instance: for counter = 1 to 10 call MetricSubs(counter) next counter Is this possible?

<btw>I hate HTML/XML comment syntax</btw><!-- I really do. -->
@Zak you're in the UK too?
Zak
Zak
ooh, 1 sec
yep
St Albans, just north of london
Manchester / Huddersfield - I live in two places
Mostly Manchester now though
Zak
Zak
03:42
I give you my first ever VBA code
Forgive me as I've never really worked in earnest with VBA but has it no concept of a switch?
Ahhh. I hate the macro recorder. =;)-
2
What on earth is =;)-?
@Zak the indentation is... isn't
(PS: If the answer is no, it enlightens a massive issue at work for me)
03:44
It does @mplf. Same as VB.Net. Select Case.
@RubberDuck it's VB.net that has the same!
@EthanBierlein it's me back when I had a Mohawk and goatee.
2
Lol Mug
Zak
Zak
it gives me chills just to look at it now
Sooooooooooooo bas
bad
Lol. No. *.bas is right.
Thanks @RubberDuck not only have you clarified something for me but also told me that @Zak's code could have been better written. I'm guessing that was early code?
Zak
Zak
03:47
my first ever.
how many years ago?
Zak
Zak
please don't emulate it, in any way, shape or form
about 9 months
a lot can happen in a week, let alone 9 months
Zak
Zak
oh no, wait,
closer to 2 years
I wrote that right before I went off to uni
2 years is a loooong pregnancy
Zak
Zak
03:49
but effectively 9 months, seeing as the next time I wrote any VBA again was about 15 months afterwards
@mplf you actually wouldn't even need a switch for that. A range offset would work just fine. Just one or two lines of code really.
Do yourself a favour, never write any again ;-) (p.s. there are far better languages)
Depends on the task at hand IMO.
If you need to automate an office app, there's really nothing better or as tightly integrated.
@RubberDuck when I see large if/elseif statements, I instantly think switch/ENUM, only when they become ugly do I look for alternative solutions
When I see switch statements, I start looking for an OOP solution.
03:53
I'd be inclined to agree, depending on scope. If it's a large switch, yes.
mind you, if you have a large switch, the architectures wrong
That ^
But sometimes they just happen with Excel. No matter what language you use. Can't say why that is though.
Zak
Zak
I know that there are almost certainly much better languages and much better solutions, but all I have is me, stuff I learn as I go along, and a job where everything people want implementing is in MS office, and almost always excel.
Been there done that @Zak. Nothing wrong with it.
I wonder. Could the problem be excel??? :-o
Zak
Zak
so for the time being, I'm focusing on getting good at vba, and general good coding practices while I'm at it
03:55
Try to learn & push people to real databases though. Life will be easier. I promise.
@Zak if you learn about databases and SQL, you'll be a star at the office
The tool HP once hailed as being (and I quote) "An agile tool"
Zak
Zak
I was sorely tempted for this latest file filtering thing
@mplf it is actually pretty cool when you're using TFS or VSO to track bugs and user stories.
Zak
Zak
03:57
but it happened to coincide with bad life circumstances
@RubberDuck you'll never get me to swear by anything other than JIRA
Zak
Zak
so I didn't really want to try and learn a whole new thing
life stuff has only recently been dealt with
I was on sick leave from (I think) April - Late september
july
september would be impressive :)
seeing as it's still int he future and all
@Zak a good engineer doesn't need to learn, he just does
Not my choice of tools, but VSO isn't bad. Give me a GitHub/BitBucket repo any day though.
That's nonsense. A good engineer learns every day.
Zak
Zak
I didn't mean it like that
03:59
@RubberDuck ever had to deal with VSS?
Zak
Zak
I meant given 2 options:
yes, Visual Source Safe
Visual Source Safe? No. Thank god.
Zak
Zak
Figure out implementation in language you are familiar with
or learn entirely new one
It's not nonsense, I never stop learning but I learn by doing ;-) and that's what engineering is about
Zak
Zak
04:00
a) requires a lot less upfront work
b) gives greater eventual payoff
you learn without thinking
Zak
Zak
and so I went with a) at the time
(which sounds bad when I wrote it but the meaning is, you don't think about the fact you're learning)
Speaking of learning…
@Mat'sMug I've found a post worthy of attention. Here you go, @Veedrac. Bounty coming your way.
0
A: 10 Million Questions - Let's Share Some Stories That the Number Doesn't Convey

200_successCase-insensitive string comparison is tricky Digging through my favorited posts, I found this question: How do I do a case insensitive string comparison in Python? The answer seems like it should be obvious and trivial. Several answers, including the "accepted" one, suggest doing case normali...

21
A: How do I do a case insensitive string comparison in Python?

VeedracComparing string in a case insensitive way seems like something that's trivial, but it's not. I will be using Python 3, since Python 2 is underdeveloped here. The first thing to note it that case-removing conversions in unicode aren't trivial. There is text for which text.lower() != text.upper()...

seen this one?
41
Q: Ignore case in Python strings

Paul OysterWhat is the easiest way to compare strings in Python, ignoring case? Of course one can do (str1.lower() <= str2.lower()), etc., but this created two additional temporary strings (with the obvious alloc/g-c overheads). I guess I'm looking for an equivalent to C's stricmp(). [Some more context r...

04:07
Those answers suck, though.
0
Q: Node.js RethinkDB connection wrapper with built in retries

JustinI wrote connection logic for a wrapper around RethinkDB in node.js. While it works, I know it can be cleaned up, and done in a better manner. Essentially the logic is start at the first host in config.hosts, if _connect() fails, then try the next host in the array. This continues for three times,...

> Heck, your second-most-upvoted answer is to a question titled "Implementing a proper linked list for a professional environment"!
Well, goodnight.
All I have to leave you all with is this:
lol 'night
04:20
BTW.WebDev - AngularJS is very cool.
0
Q: A data structure with push(int x), pop(), min() and max() in O(1)

MehrdadI have written this Java code for a data structure which includes 3 stacks to supports four operations in O(1): push(int x), pop(), min() and max(). Instead of pushing new max and min in every push, I tried to optimize code in this way to have less space. Any comments or improvement is appreciate...

04:59
@Phrancis It is, isn't it? :-D
05:15
Night.
'night!
@Quill Was that you who followed my blog?
@Hosch250 It was.
If so, thanks, but don't expect a lot of posts.
That's okay
Quality > Quantity
05:17
I might start writing about code quality.
Or I could try to post more on SO...
why can't you have both
Zak
Zak
05:34
Tired. Probably a sign that I should go get some brief exercise :)
@Quill <h1>{{acknowledgment}}</h1>
@Phrancis <action ng-directive="p in app.people">p.star</action>
05:56
Not pretty yet, but almost completely functions as intended
what if you just remove the grid lines?
@Mat'sMug "Not pretty yet"
Grid lines will be gone as soon as it works
meh, just a few margin adjustments, and those grid lines - and done ;-)
good job
"Desc" column is getting null data, probably a silly naming that's off. But yeah, I'll make it look a lot nicer shortly :)
0
Q: Mechanics question about energy

user302898A body of 10 kg weight drops from a height of 60 cm upon a spring whose modulus is 60kg/cm. what will be the speed of the block when the spring is deformed 2 cm?

05:59
You could mix the + and - button into one row
and if you have a white background it's probably best to re-colour them
@Mat'sMug lol
or use icons (.png's) instead
There we go
"description" === effect // don't ask
you sure [Flavor] is right?
the word "flavor" is a place holder, on purpose
I figured as much, then thought it could have been a bug
06:03
I know it works, I'll make some fancy mouse-over or clicky thing to show the texts for that and Desc, so it doesn't clutter the table
can't wait to see the final result!
Yeah, me too
Haven't even touched the CSS yet :|||
There's also this^ little extra information shown at the top when a card's name is clicked (also a WIP)
But yeah, AngularJS - Love it.
0
Q: Print Java Object graph

Senthil Arumugam SPPls. share your comments and better ideas, to print java graph, which manipulates selelcted (@Mask) fields as XX, thus avoid logging confidential data, through this tool. https://github.com/senthilaru/sp-util

@Phrancis maybe a popup would be better
One of the old Yu-Gi-Oh clients had a card preview system that was really nice
I can't exactly remember what it was
@Quill How about a window.alert({{flavor}}); :)
(joking)
Pop-up might be good. I'm sure Bootstrap has something nice-looking I can use for this
06:11
reminds me of that recursive, 'do you love pandas' question
^^ the RD 2.0 Test Explorer (WIP)
06:30
Before SO I always thought the only friendly ninjas were mutant teenagers. — Trobbins 13 hours ago
lol
07:09
@Quill I might use a nifty tooltip like that :)
Zak
Zak
mmm. tired. nap time.
'night
I'm out as well
0
Q: In a Content Pane mouse movements are logged and shown. Call is from an Eclipse plug-in

ManishI was trying to learn to develop plug-ins in Eclipse and after following the tutorial provided with Eclipse, tried to expand the code by writing a short Java class to track and display mouse movements on a text area. I got the code for that too from an Oracle Java document. Following is the java ...

07:26
Thanks for the suggestions regarding CodeReview forum. I have posted my code over there. And @TheDark - I can make the call static, but my idea regarding posting the question is to understand the best way of doing this, and is there something fundamentally wrong in the way I have designed the code? — Manish 10 secs ago
 
1 hour later…
08:35
Monking
0
Q: Excel userform crashes excel

ZeusI have a multipage userform stored in an add in and opened from a macro. The userform opens and functions without problems the first time I open it and then close it when no longer needed (by clicking the x in the top right corner), but when reopened again (not necessarily the next time) it rando...

09:27
Monking.
I think that perhaps this question is better suited on CodeReview, but my first step to optimize the run time performance on this would be to measure where the hotspots are. Make sure to include all the code that is using it as well, you might even find that the biggest gain in run time performance would be somewhere else completely. Also, do you really need it to be generic, could you do with a ConvertToByte, ConvertToInt32, etc.? — Lasse V. Karlsen 1 min ago
If this question could be moved to CodeReview, it would be appreciated, I suppose it could be written as Extension-per-type instead of generic, which would get rid of all [un]boxing, would that make a major difference — Rikoshay 25 secs ago
09:45
0
Q: Performance Byte[] to Generic

RikoshayI'm in need to make a byte[] -> T extension method and need it to be fast (no need for it being pretty) This function will be called 100's of 1000's of times in very short succession in an absolute performance critical environment. We're currently optimizing on "ticks" level, every tick transla...

10:04
@CaptainObvious can we have some VTC's here`?
10:20
Hi, this is my 2nd time... I need some suggestions about a geometry class that I created: "Line". Is anyone there?
hmm...
why not ask a question?`?
Yes.. the class has many factory methods to create instances (wait for it)
u can create a line from 2 points
no no I mean on site...
it's not complete yet
I need naming suggestions.... let me continue
ah okay, that makes sense :)
10:24
yeah, u can create a line from given slope and a point
u can create a line from given slope and its intercept
My 'question' is
I think this question better fits on codereview.stackexchange.comCliff Burton just now
How should I name the methods? Should it be Line.getLineFromTwoPoints()? Or something smaller?
@Duga wait... its not complete yet
I think the name is a bit too wordy... can someone suggest something smaller?
why not just fromX
like fromTwoPoints?
exactly
Line.fromTwoPoints(arg0, arg1);
10:29
Oh... and if i move the factory methods to another class called Lines containing only static methods?
does the scheme hold, or will it change
it theoretically holds, but I'd keep object construction in the class itself
allows for better encapsulation
the constructor of Line is protected and for a good reason... to prevent ambiguity
there are tons of methods with two args
for creating a line
I'd still keep it in the same class..
but that's just my opinion :)
perhaps...
so... fromTwoPoints? fromSlopePoint? fromSlopeIntercept?
hello?
@ambigram_maker what else would it be??
10:38
oh... and what do u think is the best way to check for collinearity of point(s)
(maybe >=3)
Overload operator//.
@Morwenn (in java)
@ambigram_maker I know, it's just that it would have been fun :3
boolean areColinear(Line li1, Line li2) { /* ... */ }
Wait, there aren't free functions in Java -_-
@Morwenn I meant by 'points'. I don't know if 'lines' can be collinear
think "language agnoistic"
generalize
TIL "collinear" is not quite the same in French and in English.
10:43
@Morwenn u want to know my current approach? 'Find area enclosed and check if its 0'
Oh, you meant how to make the algorithm?
Compute the line equation of two points and check whether the other points satisfy the equation.
what would be the running time?
O(n)?
Oh.. i guess so
Well yeah, where n is the number of points.
10:45
but my 'area calculation' approach is also O(n)
i can even reuse my code
At least, you can break out from the algorithm as soon as you find that one of the points isn't collinear.
point to be noted ;)
Also... what's the best approach to see if 2 polygons (or shapes in general) are overlapping?
I don't know. I ould probably check whether there are intersections between every side, but that might not be very efficient. You could probably go for a quadtree approach and check whether things actually intersect in the smallest quads.
But I never implement such an algorithm. You could probably try to find optimal ones on the internet. I think that it's a problem that has already been solved several times.
'quadtree'?
That's the algorithm used for pixel-perfect collisions in video games.
But you want math-perfect overlapping, not pixel-perfect one. That said, when you have many sides to your polygons, I think that you can impement pixel-perfect overlapping, then math-perfect overlapping.
That's only an idea though, it might actually be worse than simply computing collisions between every line in your polygons.
10:52
hmm.. the first image of the quadtree (in wikipedia) looks like a square fractal
That's it.
A quadtree is a tree data structure in which each internal node has exactly four children. Quadtrees are most often used to partition a two-dimensional space by recursively subdividing it into four quadrants or regions. The regions may be square or rectangular, or may have arbitrary shapes. This data structure was named a quadtree by Raphael Finkel and J.L. Bentley in 1974. A similar partitioning is also known as a Q-tree. All forms of quadtrees share some common features: They decompose space into adaptable cells Each cell (or bucket) has a maximum capacity. When maximum capacity is reached, the...
@Morwenn you can get pretty close with static imports
@ambigram_maker Approximate the polygons to a squares, check whether the squares intersect (that's easy), and where they do, find which sides of the polygons are in the squares and check whether these sides actually intersect.
@Morwenn i'll try it now... i guess
@Morwenn or, rectangles would be better than squares
10:55
@ambigram_maker Anyway, first of all, make a quick internet search to find whether there are known efficient algorithms. There ought to be some, and they will probably be more clever than my half-thought ideas.
@Vogel612 « pretty close »
import static bla.bla.foo.bar.Lines.areColinear;

// later:
    if (areColinear(line1, line2)){
      // do stuff
@Vogel612 what does 'colinear' mean? I found only 'collinear' (double 'el')
typo
@Vogel612 rofl
XD
10:59
@ambigram_maker It's « colinéaire » in French. Every language does not use two L, so it's easy to mistype it when you're not from an English-speaking country :)
soory
sorry
(sorry again)

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