« first day (557 days earlier)      last day (3462 days later) » 

12:01 AM
if (color1 != "red" || "yellow" || "blue"){
"yellow" always evaluates to true, eh?
even I, a non-C++ coder knows that.
 
Yes.
 
"The code I have posted below works"
 
0
Q: Function to return percentages in Python

Xodarap777I created a function for giving me percentages from two integers. I want two decimal places in the result. def percent(num1, num2): num1 = float(num1) num2 = float(num2) percentage = '{0:.2f}'.format((num1 / num2 * 100)) return percentage It works, but I doubt it's very python...

0
Q: Haskell program to turn off computer

ValekHalfHeartThis a program I wrote to execute various power-related function on my computer. It accepts one command-line argument that describes what action to take and then performs that action. Usage looks like this: C:\Users\Noah\My Code\GHCI> power sleep execute sleep? (y/n) y //computer goes to sleep ...

 
Worse, it doesn't even compile because of a missing semicolon.
Sorry, I was wrong: it does not even catch the exception since there is a type mismatch.
> It works, but I doubt it's very pythonic (since I have no idea what I'm doing)
 
@Morwenn Yeah I was just thinking about that... catch (string e) ... can you throw a string in C++?
(wouldn't surprise me, technically...)
 
12:17 AM
@SimonAndréForsberg You can throw anything.
 
std::exception is not some kind of special type.
 
but there is a std::exception ?
Let me guess, std::exception produces a stack trace, while other types does not?
 
Nope, it doesn't do anything.
 
but it is possible to get a stack trace in C++ I hope?
 
12:20 AM
It's just that every standard exception type derives from it, so writing catch (std::exception& ) will catch any exception deriving from it.
 
aha
well, even though the question is technically not working, I think we might as well review it while it's here.
 
And user-defined exceptions tend to derive from std::exception too.
 
to avoid the migration stuff.
 
There is no standard way to get a stack trace actually.
 
I have downvoted, but not VTC'd the question
@Morwenn but it is possible at least using debuggers I hope? Might not be possible in production I guess.
 
12:22 AM
@SimonAndréForsberg There are several tools to print stack traces :)
 
and what happens if you get an error without catching it? Such as... hmm... trying to come up with something that would not produce a segfault...
I assume both NullPointerException and ArrayIndexOutOfBoundsException returns segfault in the worst case, and unexpected behavior in best case.
 
The program calls std::terminate.
 
which produces exit code.... 1? 2? 42? 0?
 
I don't know, it prints the error message associated to the thrown exception if any.
 
1
Q: Recode C -> C++ trampoline function macros using templates

P i I'm reworking PyCXX (C++ wrapper for Python). I'm currently examining the following macro code, and wondering whether there is away to write it using templates rather than macros. #define PYCXX_NOARGS_METHOD_NAME( NAME ) _callNoArgsMethod__##NAME #define PYCXX_VARARGS_METHOD_NAME( NAME ) _callV...

 
12:26 AM
seems like I need to do more C++ stuff
 
Ok, std::terminate calls std::terminate_handler, which by default is std::abort.
I don't know much about all of this. Generally speaking, when an exception is thrown, it more or less means "shit is fucked up and stuff".
2
 
@Morwenn excellent description!
oh well, TTGTB now
 
There is an std::out_of_bound exception, but it is not used much since operator[] does not fire it.
 
12:40 AM
HTML/CSS-only questions generally received well on CR? Or would it be better on something like Webmaster SE? (haven't seen much code there)
 
1:06 AM
Heh, another of my answers is on a Hot Question list on SO
except it only has 70 views after 2 hours
Maybe I'll wake up to jon-skeet levels of rep
2
Bloody hell
This stupid Chrome bug
if your search query starts with "c#" it will automatically turn it into "c/#"
which won't even execute the query
 
2:12 AM
Any MATLAB pros in the house? codereview.stackexchange.com/q/69547/27623
 
0
Q: Counting Words in Files - MATLAB style

syb0rgNote: this question may seem quite large, but the code to review is actually quite short For my Matlab class I'm taking, I was given the task to write a function ReadAndCountWords that takes in the name of a text file (specifically from this zip file) as an input argument and then prints out the...

 
0
Q: Swift comparing generic struct types

nhgrifHow do I determine whether two instances of a generic struct are of the same type? For example, given the following struct: struct FooBar<T> { let variable: T init(arg: T) { variable = arg } } And the following snippet: let foo = FooBar(1) let bar = FooBar(1.0) let baz = ...

 
2:28 AM
Hello @nhgrif
and @hosch250!
 
Hello!
 
Hows it going?
 
Great!
I asked a question here last night, and I got a lot of excellent tips:codereview.stackexchange.com/q/69451/34073
Now, I have implemented almost all of the suggestions.
 
Good good! Do we have you hooked yet? ;)
 
Yup.
I have a question though.
 
2:30 AM
What's that?
 
In a similar situation, and I want another review, should I ask a second question and link to the first?
Or just edit my old question?
 
Former, I reckon
 
No, don't edit the old question
 
That is what I thought.
 
Is it a "new" version of the code?
 
2:31 AM
Well, I have it down this time.
I was just curious.
 
Generally any question edits that invalidate answers are discouraged, from my understanding
 
I have many ideas about handling common problems like deadlock that I am going to write and submit for review as I have time.
 
1
Q: Simplifying Program which converts fractions to mixed numbers

dabigoneI'm pretty new to programming, so sorry if this seems dumb. I've been making a program for an assignment that converts fractions to mixed numbers, and I'm done, but I was wondering if I could simplify it in any way, since it seems quite complicated right now. Also, keep in mind that I am not all...

 
Let me scour meta...
 
BTW, thanks for the upvote, whoever that was.
 
2:33 AM
Either post self-answer with your edits (if you don't wish for further review) or ask for another review in a new question (if you do wish for further review)
 
OK, I will post my changes once I get them all done just so people have them.
Next, I am going to do multiple producers/consumers all working together.
 
@hosch250 jingle jingle
 
That is a little tricky though - I've already done a couple preliminary tries.
Thanks, syb0rg.
Thanks again, upvoter #2.
 
I'll have a nice question badge at this rate.
3
 
2:36 AM
44
Q: For an iterative review, is it okay to edit my own question to include revised code?

JoelIs it okay to edit the question to include the improved code? I would like to do so for the following reasons: To share the improved code with others To show the answering persons that I take their feedback seriously To make sure that I understood (and implement) the feedback in the right mann...

I think this is what you are looking for?
 
Yes, thanks.
I don't know which answer to accept though, svick or ChrisWue.
They are both excellent.
I learned about equal amounts from them both...
 
Which helped more?
 
I don't know.
 
If you learned equally, truly, and if you're at a complete loss, mark the one that was posted first. That's the absolute final tie-breaker for me.
2
 
It's often a difficult decision. Flip a coin, if it comes to that
 
2:41 AM
I am leaning towards svick right now, but Chris answered first.
 
Unless I can tell that one obviously has more effort. Even if I learned equally, I do like to reward obvious effort.
 
Or what @nhgrif said
 
I was thinking I should write a random number generator, post that for review, and use it to choose the answer.
3
Sorry to just pop in and out, but I need to groom my dog and wash the dishes.
See you all soon.
 
Take care @hosch250
 
You too.
 
2:46 AM
I have yet to decide which are the greater of a PITA between dogs and dishes. Tending to lean towards the former personally
 
3:05 AM
@JeroenVannevel thank goodness I'm not the only one losing my mind over that damned nonsense.
I'd expect crap like that from Internet Explorer, but not chrome.
2
 
3:29 AM
0
Q: Maximum code efficiency

Joel A. ChristophelThis program takes lines of input. The first line is an int specifying how many further lines will be input. For the following lines (comprised of characters a-z), it will be determined if removing one character from the line can result in a palindrome. I know this can be substantially improved,...

 
Maximum title efficiency
 
4:12 AM
0
Q: The stripping extensions

Mat's MugIn order to make my life easier with parsing some VBA code, I have written a few extension methods to extend the string type, and put them in this StringExtensions class: [ComVisible(false)] public static class StringExtensions { public static readonly char StringDelimiter = '"'; public ...

 
@SimonAndréForsberg It broadcasts at 10pm EST/PST and 9PM CST/MST. I just finished watching.
 
4:36 AM
var instruction = "'Debug.Print mwahaha this is just a comment.";
 
4:57 AM
@Phrancis Definitely the latter.
This is lovely - it is the best thing I've read today:
@Crizly: That reminds me of the (possibly apocryphal) story of the (UK?) government once considering a warning label for Internet access. Somebody suggested "may contain nuts." — Ilmari Karonen 7 hours ago
Get the pun?
This is also great:
 
@200_success I was wondering in my original answer to codereview.stackexchange.com/questions/69550/… if I had gone too far to the answer... I guess not?
 
5:14 AM
@hosch250 I had not seen a Larson cartoon for a while. Thank you for posting :)
 
@psaxton I think the way you have it now is good.
As long as their code originally compiled and worked reasonably well, I think giving them improvements regardless of whether it is an assignment is good (that is, if it would have gotten reasonably good grades on the assignment as is).
 
In CR, when someone posts what is clearly an assignment question is it appropriate to write the answer for them like that, or should we only be reviewing their code?
 
If they showed that much work towards a completed assignment, it shows they are willing to learn.
 
And I take too long asking the question.
Thanks.
 
I mean, if they would have gotten a a reasonably good grade, and their code is correct for all but the edge cases they could reasonably have missed while debugging, it should be good.
Just don't essentially re-write their entire program if the first version is thoroughly broken.
 
5:23 AM
@hosch250 Perhaps you should write a CR meta question about this
 
@Phrancis Maybe I should. We probably need some set rules.
I just found this: "Better to remain silent and be thought a fool than to speak out and remove all doubt." - Abraham Lincoln
I thought Mark Twain wrote that.
 
Could be. My Google-Fu is not always the greatest...
Nov 6 at 22:55, by Phrancis
"Better to remain silent and be thought a fool than to speak out and remove all doubt." - Abraham Lincoln
 
I was agreeing with Part 2 exactly - no need to post my comments.
 
All these are almost 4 years old (not that it should count against them)
Maybe those are still relevant though
 
I think they are.
 
5:29 AM
I tend to agree
 
That is how many tips in answers to my question were given.
 
> Homework help belongs on SO, anyways. :P
 
@psaxton If the fact that it is homework is mentioned in the question, then we add a tag. If it's tagged , then we refrain from giving complete solutions. There are plenty of ways to cheat on homework. Doing so publicly on Code Review is likely to get them caught, if the instructor is using any kind of cheat-detection service.
2
In any case, we require working code to start with, so gimmetehcodez questions won't fly here.
2
 
Exactly.
 
Of course, if they just want to copy a solution without thinking it through or making a good effort to learn from it, then they are only cheating themselves.
 
5:35 AM
True - it will catch up sometime.
 
Anyway, thanks for spotting the bug in my solution. Serves me right for trying to review code on my phone. I'll award a bounty to you when it's feasible to do so.
 
monking
 
Now, what are the rules about similar tags?
For example, a lot of questions have , or maybe ,
Shouldn't these just have one of these - especially if, for example, the C++11 only uses generic C++ features?
 
@200_success hi
i have question about interface
 
5:51 AM
Monking @all
 
monking @Heslacher
 
What does monking mean?
 
14
A: What's a Zombie? And what are the many other memes of Code Review?

Vogel612Meme: Monking Originator: Morwenn Cultural Height: The 2nd Monitor Background: A morning greeting to the Monkey doing his monkey-business, in other words: monking Examples: A small chat search Variations: Monkernoon, Monkevening, Monknight, ... Important is only that it begins with Monk... ;...

 
Ohhh, I see.
I feel sorry those poor people who don't know the difference between binary and hexadecimal: puzzling.stackexchange.com/questions/4126/…
 
@overexchange So you should ask it.
 
5:56 AM
See you later - midnight here.
 
see you @hosch250
 
@Heslacher am analysing the answer which i feel is the best answer for the reason to use interface.
But i feel introducing polymorphism becomes a bit non-obvious with this, because core behaviours will be in one abstract class and peripheral behaviours will be in interface so reference variable of type abstract class would not view the peripheral behaviour so it becomes difficult to implement polymorphism
as far as other answers about subtype inheriting behaviours from multiple super types and interface has not state or implementation, this info is of no use while coding. compiler itself will tell this to you try breaking such rules
 
105
A: When to use an interface instead of an abstract class and vice versa?

Jorge CórdobaI wrote an article about that: http://www.thecoldsun.com/en/content/01-2009/abstract-classes-and-interfaces Summarizing: When we talk about abstract classes we are defining characteristics of an object type, specifying what an object is but in the case of an interface we define a capability and...

You need to know when you want to use an interface and when you need to use an abstract class.
Read the Summarizing there.
 
i do not understand the meaning of this statment we are talking about establishing a contract about what the object can do. because...
abstract class Critter { public abstract Critter update(Ocean currentTimeStepSea);
}
here am telling that critter object can update(), is this not the contract?
why the word contract only aligned with interface
 
6:12 AM
An interface is an contract assuring specific methods and properties can be called/used.
An interface has to be implemented with all methods and properties.
 
abstract methods in an abstract class are also a contract
 
All methods and properties have to be public.
 
if i dont implement all methods of interface compiler will not allow you proceed running the code. i dont neeed to worry about all this definitions, what i need to worry is for all sub classe, when to place a method in interface and when to place in abstract class. i guess this is basic point we need to understand before using abstract or interface. other app design will definitely go bad with weird consequences.
 
if you want to share common functionality between implementing classes -> abstract class
otherwise interface
roughly
 
i would like to share a good example, if you would like to understand...
 
6:18 AM
0
Q: Binary Search Tree C++ Suggestions

Dirty Mike and the BoysI am currently attempting to become proficient in C++ and started by implementing a basic binary search tree. Most of the programming I have done is in Ada, Python and C. I would like to be able to program efficiently in modern C++ and become familiar with current best practices. I do not have ...

 
thank you for your time
 
440
Q: Interface vs Abstract Class (general OO)

HoomanI have had recently two telephone interviews where I've been asked about the differences between an Interface and an Abstract class. I have explained every aspect of them I could think of, but it seems they are waiting for me to mention something specific, and I don't know what it is. From my ex...

 
@JeroenVannevel are you around?
 
6:36 AM
1
Q: Count occurrence of words in a .txt file

DamianJI'm taking an intro to programming class and although I've learned some things I didn't know before (I've been using Python for about 1.5 years) I feel like I've not progressed much in writing "beautiful" code. My professor is committed to keeping this as a general intro class, and chose Python f...

 
7:05 AM
@Webby: sort of
What's down?
 
7:40 AM
hey
need some sort of help on my CR question I have
see if you can help me out?
http://codereview.stackexchange.com/questions/69254/efficiently-using-zeromq-sockets-in-java
@JeroenVannevel I am here now
took a nap after I ping you
 
java threading isn't my strong point, but I'll take a look in a bit
 
thanks Jeroen. The problem I am facing is, how do I wrap ZeroMQ stuff in a class so that I can keep on using it
just like we make a singleton class for connection to get the connection and keep on using it from the connection pool
 
7:56 AM
0
Q: Unreadable Content in Excel: added Hyperlink using OpenXml

AshwinWhen i run the bellow program,it run fine without any error or excelption, but when i open the file which contains the desired result; while opening document it gives improper data error,and ask to repair it. In my program i am trying to add custom tool bar and a hyperlink in my excel file, cust...

posted on November 12, 2014 by MortezaLSC

I have the following script: #!/usr/bin/python import os import sys import requests if len(sys.argv)<3: print 'Usage: python %s <ARG1> <Arg2>'%(sys.argv[0]) sys.exit(2) try: with open(sys.argv[2]) as File1: msg="[*] Trying {} for {}".format(a, b) sys.stdout.write("\r "+msg.ljust(70)) sys.st

 
8:29 AM
monking @all
 
Monking @chillworld
 
woo, silver java tag badge
 
nice
just got lastweek bronze
 
8:51 AM
0
Q: MinCostMaxFlow implementation is not fast enough

michaeluskovI'm trying to solve this problem. This problem can be solved by finding maximum flow of minimum cost on specified network. Here is my Java realizlation: import java.io.IOException; import java.io.InputStreamReader; import java.io.StreamTokenizer; import java.util.ArrayList; import java.util.Arra...

 
9:20 AM
0
Q: How to pass on button click listener via Bundle?

Leonid SemyonovI have simple class. public class AlertDialogFragment extends DialogFragment { private static final DialogInterface.OnClickListener DUMMY_ON_BUTTON_CLICKED_LISTENER = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { ...

0
Q: Insert JSON data into rendered template after AJAX call

confused00I have an already rendered template and I want to update it with some JSON data I obtain via AJAX. The template as it is before rendering looks like this (using jinja2 template engine): <table> <thead> <th> Time </th> <th> Destination </th> <th> Bus number </th> </thead> <tbody id=...

0
Q: A faster way to obtain multiple XML files from a server

MX DI got this back ground console script running, which pulls all necessary XML files from the server, and stores them locally for faster performance. These XML files contain Graphs full of data, which will be shown inside the application. Right now the user can get to the graphs in about 45 secon...

 
9:41 AM
Holy macarel, where is everyone?
Get up, @Simon
 
@kleinfreund morning
good to see you around
 
Hey hey. :)
Wait, you use that more like bye, do you?
Or is that a multifunctional way of greeting in Sweden?
Yeah, I'm studying. Being super busy.
 
"good to see you around" was meant more like "long time no see" :)
 
const size_t size = 64;
char resultBufNative[size+1];
 
got released yesterday so no worries if you haven't :)
 
9:47 AM
error C2057: expected constant expression
What.
 
@Pimgd I guess 64 + 1 is not constant :)
 
I saw it on Twitter. Looks good, but I haven't tried it to be honest.
 
No worries
 
I have no idea why or how that will break
 
0
Q: Binary to decimal number converter

kleinfreundHere I am doing some exercises for my studies with Python. This is a binary to decimal number converter (currently restricted to that). These are the very first steps, so there is no error handling. You can even input non-binary numbers and get a result. However it works for converting binary nu...

 
9:49 AM
I meant the question. Do you use "Hey hey" for saying bye only or does it work both ways?
Ah, there it is. Thanks, Captain.
 
@kleinfreund works both ways
Oh, you've started using Python now?
 
Yeah. I'm studying Computer Science and Media. Therefor I'm going to do some Python and Java.
 
Wow, a wild @kleinfreund has appeared!
5
 
Hey @skiwi
 
@kleinfreund Did I hear Java? :D
 
9:51 AM
Yah. :x
 
If you ever need Java experts, here we are!
 
I'm more excited to do some Python, really.
:P
 
brings in pitchforks
2
 
But yes, I know. :p
lol
Atleast it's super simple for the start. I have no clue how both things will work out, though.
Gonna have some classmates here soon, so I might be silent for a while.
Also, I maybe should get out of my pyjama.
 
9:57 AM
0
Q: const size_t + 1 is not a constant expression

PimgdI'm completely baffled by this one. Relevant function: jstring Java_com_nabto_api_NabtoCApiWrapper_nabtoGetSessionToken(JNIEnv* env, jclass thiz, jobject sessionObj) { const size_t size = 64; char resultBufNative[size+1]; size_t resultLen; //Get the session nabto_handle_t ...

welp here we go
 
and into your onepiece
@Pimgd what happens if you declare size = 65 ?
 
const size_t size = 65;
char resultBufNative[size];
error C2057: expected constant expression
 
wtf
is size_t restricted to max 64 or something?
 
Dos char resultBufNative[65]; even work?
And [64]?
 
what about char[64] resultBufNative ?
 
10:07 AM
Opinions wanted... Is it better to put a DLL needed by Java in the working directory everywhere, or to let the underlying OS handle it by placing it in a library directory?
 
I have to clarify, I'm using C here, not C++ as I thought
getting two projects mixed up
 
0
Q: Array-Based Queue program

Sheun PaulI help help, I want to write an array-based queue program that can hold 5 item in the queue, then i will insert 3 integer, the delete 2 integer, then insert 1 integer. Display the output

0
Q: Javascript library for Cookie Information

StromgrenI've always struggled to write JavaScript code that I thought of as great and "correct" code. And I've struggled to find good information on how to do it. Recently I was given a task at work to write a library for displaying an information box with info on our cookie usage. Since this was a pret...

0
Q: Optimize code - to use constructors or methods in C#

John4I think that my code isn't perfect and I need a help to understand how to optimize it. In my application I have main form and several forms for data editing. Edition modes are: Add new item, Edit selected item, Delete selected item, Duplicate item with new name. Example of my code you can see ...

 
10:37 AM
welp,
Visual Studio 2013 still doesn't support C99
Sooo if you compile in C,
you can't do such things.
 
Fun fun
 
Also, this problem has been solved on linux ages ago.
It's only windows that's lagging behind.
fk u, windows
 
How about... people drop Visual Studio
2
 
well, at least that's resolved now
...
 
Not easy in corporate organizations I'm sure
 
10:43 AM
102 errors, 62 warnings
 
And there's not even replacements for all that Visual Studio offers, but it won't come along in the next 10-20 years if they don't speed up
 
...
Error 164: error C1003: error count exceeds 100; stopping compilation
what did I do wrong...?
 
@Pimgd I would've expected that on the 101th error
 
it's like the entire header file I'm including has disappeared
//enum declaration in some file...
enum nabto_status {
    /**
     * The operation was successful.
     * @since 3.0.2
     */
    NABTO_OK = 0,
typedef enum nabto_status nabto_status_t;//typedef in same header file...
nabto_status_t nabtoStatus = NABTO_OK;//code in .c file...
das ist VERBOTEN! sais the compiler
no wonder they said "Welll, you can try, but we're not gonna support it"
THEY KNEW
int nabtoStatus = nabtoSetStaticResourceDir(nabtoResDirNative);
error C2143: syntax error : missing ';' before 'type'
Clearly the compiler has had it
oh, riiight
it's retarded C
gotta define your variables first
just
what
It's like I'm back in delphi
It's a compiler error to have a variable declaration anywhere but at the top of a block
 
11:03 AM
0
Q: ArrayList contains wrong type objects without explicit raw-type casting

kiruwkaCan anyone suggest how given code could possibly result in such issue, giving occasional ClassCastException when data is parsed from file. Details : I have a generic methods in superclass. public T getItem(int position) { return mItems.get(position); // mItems is an ArrayList } // corresp...

 
oooooh
it builds =D
 
I would really like to answer these kinds of comments with "because it's SO"
why downvotes ? — kiruwka 47 mins ago
 
11:28 AM
Lol
 
11:39 AM
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\User\Documents\NetBeansProjects\NabtoLibTest\NabtoJavaWin32.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
Can't load a 32-bit dll in a 32-bit JVM on a 64-bit windows installation.
 
0
Q: Shapes that can be saved to a database

MikeI have been asked to refactor the below code using SOLID principles and I was just wondering how you would go about it? Not really sure if I am winning or not :) Could you have a stab at it and let me see what you come up with? public class Box { private BoxType _boxType; ...

 
That... kinda sucks.
I bet you also can't run a 64-bit dll in a 32-bit JVM
so we get to re-install the JVM that my co-worker nuked
... the thing is... I forgot why we had to uninstall the 64-bit JVM...
 
@Pimgd That sounds wrong... you mean a 64bit JVM right?
 
java -version
 
because you should be able to load a 32-bit DLL on a 32-bit JVM on either a 64 or 32-bit hardware system.
 
11:44 AM
Well somehow it's not loading my 32-bit DLL in my 32-bit JVM in my 64-bit Netbeans on my 64-bit windows 8 computer.
 
You using the -d32 commandline option?
 
no =)
 
java -d32 -Xmx... ;-0
 
Error: This Java instance does not support a 32-bit JVM.
Please install the desired version.
Java Result: 1
Right, I have a 64-bit JVM.
where, I don't know.
 
Yup... you need to probably manyally set the JAVA_HOME and PATH variables to the right location
Or get a 64-bit version of the DLL
 
11:47 AM
That's a problem
That means installing a 64-bit visual studio...
and redoing a days work
Actually I think installing visual studio is a days work
right... Okay lemme see what I can do
I guess, download and install 32-bit jvm
I just need a JRE for that, right
theeere, installed
 
hiya
 
Hayi
 
nope, I need jdk
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\User\Documents\NetBeansProjects\NabtoLibTest\NabtoJavaWin32.dll: Can't find dependent libraries
Hmm...
slowly, we're getting there.
 
12:12 PM
@Pimgd As long as you're getting a different error message, that's a good thing.
 
Hey Alex M.
 
Well... apparently I'm missing DLLs now, but nobody knows which ones =)
huh.
I'm missing DLLs that were moved with the windows 8.1 update.
 
12:46 PM
0
Q: Can we now `implement Singleton` using Java 8?

OldCurmudgeonAfter my success with extending enum - I thought I would try to make Singleton creation as simple as possible since Java-8 makes Multitons comparatively easy. My aim was to create a class which is a Singleton solely by the simple fact that it implements a Singleton interface. Unfortunately there...

 
what
whaaat
You're supposed to load the dlls yourself?!
That's... derp-ish?
so instead of
 
template<typename... Args>
auto sum(Args... args) {
    return (args + ...);
}
 
static {
    	System.loadLibrary("masterdll");
    }
it's
static {
    	System.loadLibrary("subdll");
    	System.loadLibrary("masterdll");
    }
weeeelll okay
it works
Hurray! Hurray! Hurray!
Now I have to do the whole joke again, but on unix
 
@CaptainObvious I think we have some German Overengineering around.
 
I like the idea, though.
implements Singleton and you're done
or maybe not, I dunno
 
12:57 PM
I don't think it's really possible to make it that easy
And why on earth would you want a singleton?
Besides, public enum MySingleton { INSTANCE; } and you're done.
 
time to start the crying on unix, where I'll be writing my own build file
 
monknig..
 
@Vogel612 I was just thinking about you.
6 mins ago, by Simon André Forsberg
@CaptainObvious I think we have some German Overengineering around.
 
@SimonAndréForsberg how sweet of you ;)
@Pimgd good job on the java silver...
I seem to be missing out on CR lately..
 
I just got enough upvotes from the posts I had; the post count itself was probably provided when I was A) posting those 25 JDQ duplicates and B) cleaning the java tag
 
1:03 PM
0
Q: When dereferencing an iterator returns a set, what type to use?

mrmConsider the following iterator that enumerates all possible k-combinations of an n-element universe {0,...n-1}. #include <iostream> #include <vector> #include <numeric> #include <algorithm> #include <iterator> #include <cassert> #include <boost/iterator/iterator_facade.hpp> template <typename T>

 
Speaking of JDQ, it's been over a month now since the last one...
 
1:16 PM
I don't think we have to worry ...
 
0
Q: Sieve of Erathosthenes speedup

john mangualWhile reading HackerNews, I learned about a data set of the first 50 million primes. This would be a lot, but his website has disclaimer: n this directory I have the first fifty million primes in blocks of one million. Usually it is faster to run a program on your own computer than to downl...

 
@CaptainObvious on-topic, even if a code change is requested
 
1:45 PM
0
Q: Input check class

Prolinerpublic function get($item) { if (isset($_POST[$item]) && $_POST[$item] != '') { $_POST[$item] = filter_var($_POST[$item],FILTER_SANITIZE_SPECIAL_CHARS); if(is_numeric($_POST[$item])) { return (int)$_POST[$item]; } return $_POST[$item]; }else if ...

 

« first day (557 days earlier)      last day (3462 days later) »