« first day (845 days earlier)      last day (3471 days later) » 

@EBrown I wonder how I'd score..
0
Q: Is it bad practice to call a function before it is written in Python?

Bram VanroyIn other languages I often do something like this: someFunc() someFunc() { // This is my function } This way I can stack all my functions lower in the file, but make the function calls at the top. Now I have a nice overview of everything that's happening. However, when I did this in Python...

-2
Q: Is it bad practice to call a function before it is written in Python?

Bram VanroyIn other languages I often do something like this: someFunc() someFunc() { // This is my function } This way I can stack all my functions lower in the file, but make the function calls at the top. Now I have a nice overview of everything that's happening. However, when I did this in Python...

17:19
Huh. Why is there a 3452 under my username there?
Total Rep
@SuperBiasedMan your total SE network-wide rep
var strengths = {};
for(var k in this.strengths)
{
    strengths[k] = this.strengths[k];
}
return strengths;
Shouldn't CS be first?
@Quill That's a shallow copy
Objects are passed as references
That avoids changes on the object
17:22
@gwg Beats me. I tried the question on CodeReview, but that didn't work out. So I posted it here. Apparently not welcome I either. — Bram Vanroy 55 secs ago
@Mat'sMug Oh weird. Didn't realist it was that high? I thought I was still basically a newbie.
1
Q: Rock, Paper, Scissors, Lizard and Spock - Improving my answer

Ismael MiguelToday I saw an extremelly interesting question on the Rock, Paper, Scissors, Lizard and Spock game. And I've decided to take my swing at it. And I've written the following OOP implementation: function RockPaperScissors(name, hard_action, soft_action) { this.name = (name + '').toLowerCase();...

0
Q: C++ Multithreaded Ip Range Port Scanner

Sessions1024Been working on creating a multi-threaded port scanner that can scan an IP range. However my results are being skewed. I feel as if I have a race condition in my code but I cant seem to find it. All feedback is appreciated! Link To Full Source On Git: https://github.com/Sessions1024/prjRudeScan

I wonder if people really use Stack Exchange swag on their daily life...
I wear my mod hat all the time.
17:32
@IsmaelMiguel How else can they demonstrate their wisdom and virtue in public?
3
@IsmaelMiguel I would.
Zak
Zak
@Donald.McLean You get a Mod hat?
@Zak I'm a mod on both Astronomy and Music Fans.
@Donald.McLean I hope you clean it once in a while
@SuperBiasedMan By giving them their profile URL?
@RubberDuck I surelly would use a mug. But it wouldn't be for breakfast. The only thing I drink in a mug is coke or pure vodka
@IsmaelMiguel You never mix em?
17:35
@SuperBiasedMan Only black vodka. But for that, I use a 0.5L glass
By "pure vodka", I mean the clean one.
@Mat'sMug What do you know about the CLS?
Because over half of it was CLS specific.
Who loves spam?
0
Q: JavaScript solution for diagonal difference

Vishwajeet VatharkarProblem Statement You are given a square matrix of size N×N. Calculate the absolute difference of the sums across the two main diagonals. Input Format The first line contains a single integer N. The next N lines contain N integers (each) describing the matrix. Constraints 1≤N≤100 −100≤A[i]...

FWIW, I use my stackexchange mug multiple times a day for good-old-coffee.
I wear my diamonf hat when I have the sunroof open in the car.
My SE waterbottle is used daily too.
Has been a few months since I drank a homemade coffee
17:43
Keurig ;-)
?
What does that mean?
Coffee machine - makes a cup at a time.
My friend uses the stove.
He makes a really good coffee
Right it's quittin time. Later all
17:44
The problem is that the coffee must be 1 day old for me to enjoy it
@SuperBiasedMan Have fun
@EBrown it's the specifications for the Common Language Runtime... interesting; you'd think a C# /.net assessment wouldn't focus on the CLR as much as on the language itself.
@Mat'sMug That was .NET only, C# is a different test.
The C# one is all about the language.
#UpForGrabs #OSS #CSharp anyone wants to implement a PermissiveAssertClass that checks equality like VBA would? https://github.com/rubberduck-vba/Rubberduck/issues/755
17:51
@Mat'sMug Care to explain that class?
did you click the link?
it's a COM-visible type that VBA code instantiates and uses the exposed methods to assert Rubberduck unit tests
And you want to make it more permissive?
because "123" == 123 in VBA, yes
the current implementation will deem a test inconclusive if you Assert.AreEqual(int,long)
17:54
And you want help on those points?
So the C# one was much easier.
@EBrown understandably
There were only three I had to guess on.
;)
@IsmaelMiguel I don't really care, that's why I'm leaving it
One was regarding what anonymous types are actually compiled into.
17:56
Alright
I'm afraid that "Can you show me how to write software" is a bit too broad for a single Stack Overflow question. There are many design patterns in software which address many different purposes. If you come up with an overall design and want to get feedback on it, codereview.stackexchange.com might be a good place to post it. (Check their FAQ first, of course.) — David 28 secs ago
i.e. I'll take a PR if one comes.
PR?
Push Request?
pull request
17:58
And @Mat'sMug it doesn't tell you how you did. :(
Sorry, it's just too many abbreviations and acronyms for me
Only says "Completed."
aw that shucks
@IsmaelMiguel IKR.
2
@rolfl Right. That's why I've made Memer. And sorry for not staring it. I've spent my stars
18:01
It always surprise me that there are still people using <conio.h> in their C++ code.
using namespace std;
@Morwenn Why's that?
There are better standard solutions to interact with the console.
> conio.h is a C header file used mostly by MS-DOS compilers to provide console input/output. It is not part of the C standard library or ISO C, nor is it defined by POSIX. This header declares several useful library functions for performing "console input and output" from a program.
And that's not standard nor portable.
18:05
MS-DOS compilers
like, that's... old.
Yeah...
24
A: Why can't I find <conio.h> on Linux?

Sangeeth Saravanarajconio.h is a C header file used in old MS-DOS compilers to create text user interfaces. Compilers that targeted non-DOS operating systems, such as Linux, Win32 and OS/2, provided different implementations of these functions. The #include <curses.h> will give you almost all the functionalities th...

Some tutorials don't know better
curses.h sounds interesting
18:07
It does
I've seen things in tutorials that are simply plain wrong
2
Q: Hangman game school Project

neema525This is my current code , it is very long. It is a school project and took me a while to write the code. Any help to improve my code is welcome! #include <fstream> #include <conio> #include <stdio> #include <stdlib> #include <iomanip> #include <windows> #include <time> typedef char string[50];...

0
Q: _getch is not working

MandrukThe problem is that _getch() scans the input only once, after that it assigns random staff to the variable #include <iostream> #include <stdlib.h> #include<windows.h> #include<conio.h> #include<time.h> #include<iomanip> using namespace std; void TIC_TAC_TOE_PRINT(){ char mass[9][74] = { ...

@CaptainObvious Speaking about the devil...
For example, if you try to find a C++ Hello World! program with Google, you quickly end up with that:
And that's terrible.
> This program has been tested, it works perfectly without any errors or warnings.
I've learned that at school, but for C
main.cpp:1:22: fatal error: iostream.h: No such file or directory
18:11
At least they returned a value at the end of main...
HAHAHAHAHAHAHAAHAHAHAHAHAHAAHAHAHAHAH
Maybe their old compilers had it?
@IntensifierDescriptorMan Which is useless. Not returning a value at the end of main is legal and a good way to document that you won't be returning any error.
I always have using namespace std; in my stuff.
Just because I can.
I don't do c++
But shouldn't it be #include <iostream>?
@Morwenn Hmm... Never heard that about never returning an error. I just figured it was one of those annoying ease of use things like optional semicolons in JavaScript.
> The body of the main function does not need to contain the return statement: if control reaches the end of main without encountering a return statement, the effect is that of executing return 0;.
@IntensifierDescriptorMan They aren't exactly optional. They are statement delimiters. Javascript happens to have , (in special situations), newlines and ;
@Morwenn Yeah I know that, I just thought it was good practice to return stuff.
@IntensifierDescriptorMan Actually it depends on who you're talking to x)
18:16
@IntensifierDescriptorMan I mean, if you're talking to me or @LokiAstari, you will be told that it's better to not write it if you don't intend to return error codes. On the other hand, other people will consider it a good practice to always return things.
@Kennah CodeReview is for Code that is working as intended. This is not. — Zak 43 secs ago
18:39
0
Q: Java 8: Converting from one collection to another

java_mouseIs this a good practice in Java 8? Do we have better way of doing this? bitDao.getResearchModules().forEach( m -> res.getModules().add(new ModuleType().withModuleNum(m.getLeft()).withModuleName(m.getRight())));

Is it working, right? If you need code review - maybe you could try here: codereview.stackexchange.comnevermind 57 secs ago
0
Q: Number to Word Application in C#

Hassan AlthafI've created a Windows Form Number to Word converter application in C# which converts any number from 0 to 1 million. MainInterface.cs using System; using System.Windows.Forms; namespace NumberToWords { public partial class MainInterface : Form { private NumberToWordsConverter ...

oh boy, I'm delving into a dark world...
@EthanBierlein Have you been playing The Legend of Zelda: A Link to the Past?
@Morwenn No
I might though
But that's not what I was talking about. I'm delving into the dark world of C++
18:55
I'm elevating by mastering C++ and everything becomes brighter.
(That's not true)
lol. I'm mostly learning C++ for kicks, and because I'm interested in it.
And so I can go around and say "I know C++"
Although, one thing has been on my mind.
Is it better to declare the contents of functions/constructors directly in the public: body of a class, or should I do it outside of the class?
@EthanBierlein Outside, if it's large enough (over 3 LoC, roughly).
Which is almost always.
Also, this allows to move the definitions to be moved to a different file.
Ah, thanks.
So you have a class.cpp containing the class bodies and a class.hpp with the underwater stuff.
oh, okay.
I was declaring the underwater stuff in the same file as the class.
Whoops
Meh, I think I'll just keep doing what I'm doing for now
19:02
@Mast Is .hpp the standard file extension? I've always heard it was just .h, including in my recent college course.
@IntensifierDescriptorMan Both are allowed.
@IntensifierDescriptorMan Generally .h is for old C developers, and .hpp is anything C++. (Just like .cpp is C++, and .c is C.) Either file type is permitting, though there are conventions.
But since it's possible to use C headers in C++ projects, it's best to keep them seperated.
@EthanBierlein I always defined it outside of it in another file, unless the class is small.
That said, everything I write uses templates so everything can be inlined...
So the preferred method is .hpp for C++ headers and .h for C.
@EthanBierlein That's bad practice ^^
19:05
@Mast Yeah, that makes sense. Strange that Visual Studio only shows .h files. I do like the idea of having .hpp for C++ to avoid importing them in a C project.
@IntensifierDescriptorMan Visual Studio has some quirks, yea ^^
@EthanBierlein class::function(arguments){}
:23716188 #include "class.hpp"
You define the class structure in the hpp file, and the implementation in the cpp file.
Nevermind, intellisense just took a bit to catch up.
Then, first line of the cpp should be #include "class.hpp".
@EBrown Other way around.
19:07
@Mast No.
The structure, the class body, in the cpp.
What those functions actually do, that's in the hpp.
@Mast No.
The hpp is the "header" file.
Pretty sure implementation is in the .cpp
The cpp is the "source" file.
The "header" is the "what's included" bit, the prototypes, etc.
The "source" is the implementation, the "how to do it" bit.
I usually have 3 files. main.cpp, class.cpp and class.hpp
hpp is included by class.cpp which is called by main.cpp
19:08
I always thought "h => header"
@Mat'sMug That's the correct, idiomatic way.
Though, you can do it either way. C++ is open like that.
backs away
Though, it's expected that the hpp, or h header will have the prototypes.
And it's expected that the cpp or c source will have the implementation.
@EthanBierlein Got some racetrack for you if you're interested
Or m
19:10
@nhgrif That's Obj-C, right? C++ doesn't use .m files AFAIK
The header has the public parts of the class.
@Mast Ooh, nice..
@nhgrif Gah, you and your objective-c...
C++ had .mm files. ;)
@IntensifierDescriptorMan He usually talks swiftly
2
19:11
My freaking damage adjuster is out of town, and my car is supposed to be done tomorrow.
Objective-C++ that is
@nhgrif That's a thing?
Never thought anyone used that.
I will say this: Swift enums are the best enums.
You can also find .tpp, .tcc and .inl files out there.
Swift enums are - wait -
2
19:12
@Mast My co-worker had to go through some code that used that. I have no clue about it.
Generally speaking, the extension isn't relevant. There's what you call "source files" and "header files" and you can tell by hand which is which.
@Mat'sMug Recruiter called and said I did "a good job" on those tests.
@Morwenn Unless you go all auto-linkage, yea.
@EBrown nice! well done!
@Mat'sMug Thanks. :)
19:13
@EBrown Is he speaking manager or speaking in useful terms?
@Mat'sMug I should write a language that uses .magic extensions.
In case of the first, you don't know anything more now. In case of the latter, great!
@Hosch250 Call it Merlin
I thought Merlins were swift.
that tends to reinforce the .magic extension idea
19:14
Merlin is a legendary figure best known as the wizard featured in Arthurian legend. The standard depiction of the character first appears in Geoffrey of Monmouth's Historia Regum Britanniae, written c. 1136, and is based on an amalgamation of previous historical and legendary figures. Geoffrey combined existing stories of Myrddin Wyllt (Merlinus Caledonensis), a North Brythonic prophet and madman with no connection to King Arthur, with tales of the Romano-British war leader Ambrosius Aurelianus to form the composite figure he called Merlin Ambrosius (Welsh: Myrddin Emrys). He is allegedly buried...
Bret Copeland on August 27, 2015
There are lots of domain-specific languages for schedules. The most prominent might be Cron (for *nix scheduled tasks), but there's also RRULE (for iCalendar events) and many others. Cron isn't exactly what I'd call human-friendly. Can you tell me what 10 8,20 * 8 1-5 means if you don't use Cron often? Some DSL's go in the opposite direction and are wildly verbose, or will sacrifice expressiveness for simplicity.
ahh! too much onebox!
@Mast Yeah, I know about him. I know about multiple Merlin's.
@Mast I'm sorry?
19:15
lol, I just found this line of code in a really old Python project of mine:
# TODO: Do something here.
@EBrown Is he a smooth talker or somebody you can rely on?
Sometimes I find insults in my code...
@IntensifierDescriptorMan Yea, I had to clean-up my string -> Brainfuck translator before posting here.
It literally fucked everything up.
@IntensifierDescriptorMan It's awkward when youo realize you're not the one writing them
Or when you never intended it as an insult but didn't realize it may be considered as one after looking back on it.
@EthanBierlein If you're interested
19:23
0
Q: Sprite cache and Directory reader

AcornI have been fiddling around with creating my own Sprite Cache. Currently, I am using the C header file, dirent.h, to open up a directory and load all .bmp files. I do not have to check if the file ends with .bmp, as SDL_LoadBMP will return a null pointer if it can not read the supplied file as a...

-3
Q: Checking value from another C# script using getters/setters?

user3002109I am having a little bit of a problem with my code. I have 2 C# scripts for a game i am creating in Unity, one is called characterstats.cs, and the other is enemycontroller.cs I have declared a public variable which is set to a getter and setter in the characterstats.cs script: public int d...

good evening
hello @IntensifierDescriptorMan
@janos Evening
hey Mast!
19:27
@janos Good afternoon
afternoon Ethan!
I should have a C++ question up for review by tonight.
Of course, assuming I can get things to work.
getting into C++ ? how come?
@EthanBierlein Good luck. The first time will be hard.
@janos I'm curious. Looks like an interesting language as well
19:29
@EthanBierlein You're not using namespace std; are you?
@EthanBierlein It's the best :-)
it sure is
Well, one of the best.
Python is very interesting as well.
@Mast I shall never sin in such a way.
@Mast Agreed
I wouldn't say "the best" but it can indeed be interesting.
void*'s are my favorite part of C/C++
19:31
Void pointer?
I don't remember having used a void* in months if not years.
How does that work?
@EthanBierlein
Yes, Objective-C++ is a thing.
It can point to anything and can be cast to any other pointer.
19:32
@Mast Of course! ;-)
It was eye-opening for me to see how to use them to make generic functions.
Er, in C, yeah. In C++ it's next to useless.
Well, doesn't C++ already have generics/templates?
@EthanBierlein Exactly.
Hmm, now I'm going to go learn what templates are.
19:34
@Morwenn Not even from a usefulness standpoint, but seeing all the background logic. Really cool.
@Morwenn I can't recall the last time I used a void* in C++ indeed.
It's a C thing.
@EthanBierlein Good luck then. It's huge (and become bigger with every standard).
We had templates in C++03, variadic templates in C++11, variable templates in C++17 and we will probably have concepts for C++17.
It even has lambdas now.
Generic lambdas as of C++14.
@Morwenn I think I have at the least, a basic understanding of templates.
For example, wouldn't template <typename T> class MyClass be class MyClass<T> in C#?
19:37
No.
@janos I took your advice about argparse and used it in my racetrack.
BTW, for a more thorough context around the specific specialness of the JVM/Java readResolve method and case classes, here's an doc I wrote (along with a CodeReview update) which delves down way deeper into WHY I wanted to always prevent invalid instances of a case class from being instantiated: docs.google.com/document/d/…chaotic3quilibrium 19 secs ago
Speaking of lambdas, does anyone know any functional languages like F#. I recently started learning it, and I think it's really cool.
@EthanBierlein Do not compare C++ to C#. They work differently.
@Morwenn Oh, so C++ templates are slightly different than C# generics?
19:38
Oh wait, yes. I mistook it for Java.
@Mast one less thing for me to pick on ;-)
@janos Plenty left, I'm sure
IIRC, it does create a whole new class for every specialization in C#, right?
Like, Foo<Bar> and Foo<Baz> are not the same class.
I'm, not sure. I don't think it does, but I'd have to test that.
I think that they changed it between C# 1 and C# 2 or something like that.
Well, C++ creates a new class/function/variable for every instanciation of a template.
@Mast it's lookin' pretty good, actually
@Mast He's a recruiter for a pretty large company.
They are a recruiting company, in fact.
Basically, C++ templates are a compile-time functional programming language with a really heavy syntax.
19:41
He's already got me lined up for a phone interview tonight, it looks like.
@EBrown That's definitely positive.
Yeah. I probably won't go work for this place because it's still in Detroit (which I hate this city) but it'd be nice to refresh my skills.
Well, I have to go. I'll be back in a couple of hours.
@EthanBierlein What I mean is that when you declare template<typename T> struct Foo;, then Foo<int> and Foo<float> will be two different classes.
In Jave, Foo<Bar> and Foo<Baz> are the same class.
Oh, I see.
@Morwenn Again, I think so. Still not sure though.
19:44
If you take a static variable from a class template, there will be only one instance for all specializations in Java while there will be one instance per specialization in C++.
I just checked: these are different classes in C#.
@janos Your SE score is 99.6k. Only 400 site-wide to go ;-)
How far is your gold Python badge?
yeay :) 32 to go for Python
@Mast on my "flair" it already shows 100k :D
@janos Congratulations!
Zak
Zak
hello again people.
@Zak Welcome back
19:52
@Mast thank you!
hello Zak
0
Q: Implementing a van Emde Boas tree in Rust

zrneelyI wanted to implement a van Emde Boas Tree in Rust, to start learning the language. Much of my implementation is derived from the pseudo-code on wikipedia, with the exception that empty subtrees are not stored. Besides the obvious lack of docstrings on public methods, what could be improved? us...

Zak
Zak
hey :)
@CaptainObvious A what, FIFO with priority settings?
Zak
Zak
haven't updated my LinkedIn in a long time, decided to actually fill in the stuff I've done in my job. It came out sounding kinda... badass :)
Every time I re-read it I like it more and more :) uk.linkedin.com/pub/zak-armstrong/64/184/854
@Zak Can't see it, asks me to sign up first.
Zak
Zak
19:59
ah, stupid LinkedIn

« first day (845 days earlier)      last day (3471 days later) »