« first day (1331 days earlier)      last day (2691 days later) » 
00:00 - 15:0015:00 - 00:00

12:00 AM
RELOAD! There are 3237 unanswered questions (91.9783% answered)
 
0
Q: If in doubt, post the question on meta first?

JodesNot for lack of trying, I get down votes on some questions. And on those questions I nevertheless often get answers. So if I try to delete the question to approach it differently, I get the warning that doing this repeatedly can get my account frozen. So I'm wondering if I should instead first p...

 
12:17 AM
I don't have any .cs files.
Oh, nice catch.
 
12:28 AM
0
Q: How could I increase the speed of this code?

ThePinnacleOfCyncialI am fairly new to programming and even newer to C++ but I am currently in a class for scientific computing, and our task from two weeks ago was to improve the speed of a primality test program, I regrettably do not have the original code because I wrote over it... my bad, but the long and short ...

 
12:40 AM
@StackExchange Voluntarily drafting a question on the SE network doesn't even seem to be a bad idea, actually pretty good
LOL I just heard someone talk about a flying plant
51
Q: Are flying plants possible?

VincentIs it possible for a plant to have the ability to fly? More exactly, the plant would either need to live without having roots (and it would never need to touch the ground), or with the ability to re-root itself in another location from time to time, or maybe a plant that has a permanent pedesta...

Of course there is a WB question for it
 
1:03 AM
@StackExchange Answered
 
1:48 AM
0
Q: check determine match

Lin MaWorking on below problem, any advice of code functional bug, performance in terms of algorithm time complexity, code style are appreciated. Code written in Python 2.7. Problem, Write an algorithm to determine if all of the delimiters in an expression are matched and closed.{(abc)22}[14(xyz)2]...

 
2:16 AM
0
Q: Implementation of Resenblatt’s perceptron ,LMS algorithm Single Layer Network and Back-propagation algorithm (MLP) Network

Eslam AliI wrote a Java program implementing Resenblatt’s perceptron Single Layer Network , Least Mean Square algorithm for Single Layer Network and Back-propagation algorithm (MLP) Network. i'm trying to write efficient and clean code. NeuralNetwork class package fcis.asu.neural; import java.util.Map;...

 
I made a burnished steel theme for my Checkers:
 
0
Q: Which way is better building new object in javascript

Gokhan OzturkI have two functions that does the same thing. But I am not an expert on Javascript. In fact, I am recently learning the beauties of javascript. So could you explain me which way is better for performance issues and which is more elegant. In conclusion which one should I use. function formatOutp...

 
This person keeps doing minor tag edits: codereview.stackexchange.com/users/103677/tolani-jaiye-tikolo
Should I stop approving them as being too minor, should we just let them get to 2k and stop naturally, ...?
 
2:35 AM
@Hosch250 Looks good
@Hosch250 Tags edits are fine, I'd just let it go as long as they are good edits
 
3:06 AM
I just added bevels to my pieces.
 
0
Q: Connect Four game (Java)

SoloNasusThis is a simple implementation of Connect four in Java. It is working correctly so far. What I haven't done yetis the diagonals check and input validation. package game; import java.util.Scanner; //TODO check for diagonals, input validation public class Game { private char[][] gameBoard;...

 
3:30 AM
0
Q: Synchronization of transaction processing

aquirelThere's a server which does the following: Receive request with transaction id Load corresponding transaction from storage. New transaction object is returned each time Process transaction Save updated transaction back to storage The task is to properly synchronize steps 2, 3 and 4. Since fo...

 
3:52 AM
0
Q: Check if the array contains duplicate values

CodeYogiDescription: The problem is old ans simple but I wanted to try it by different way. With some extra memory I have created OOP based solution. Hopefully it doesn't hurt in the interview. Code: import java.util.*; import java.lang.*; import java.io.*; class Main { static class Solution { ...

 
4:13 AM
posted on December 25, 2016 by mamun

I am trying to write simple quantum chemistry code in C++ (to learn both C++ and quantum chemistry). Here is my header file "Molecule.h" using namespace std; class Molecule { public: int natom; int charge; int *zval; double **geom; void print_geom(); void write_geom(char *outfile); double bond(int atom1, int atom2); Molecu

 
Any idea what I'm doing wrong?
 
@Phrancis What compiler?
 
Um GCC I think. Running on Windows 10
 
You can use C as a script?
 
I have no idea
Just trying to get C to work
 
4:25 AM
Usually it's compiled with gcc.
(Et. al. but that's the easiest example.)
 
What would the command be, instead of ./helloworld.c ?
 
gcc helloworld.c
Then it will (possibly?) generate an a.out (et. al. file).
 
Phrancis@MSI ...c/Scripts/C % gcc helloworld.c
zsh: command not found: gcc
 
I have no idea lol
 
Me neither
I know it can find the file and run it, I'm just puzzled about the syntax error
 
4:29 AM
Try int main(int arg, const char* arg[]) instead.
 
Same thing ./helloworld.c: 3: ./helloworld.c: Syntax error: "(" unexpected
(3 being the line that main() is on)
 
Huh, I'm out of ideas. It looks like valid C to me.
 
Is the #include <stdio.h> supposed to have a semicolon to terminate it?
Very strange, I guess
Phrancis@MSI ...c/Scripts/C % #include <stdio.h>
zsh: parse error near `\n'
Phrancis@MSI ...c/Scripts/C % int main() { printf("test"; return 0; }
Phrancis@MSI ...c/Scripts/C %
Phrancis@MSI ...c/Scripts/C % print("test");
zsh: missing end of string
Fun stuff
Guess running C from the command line is not how it works :D
 
4:47 AM
@Phrancis I'm not too sure, but is it expecting \n, and you have \r\n?
I'd be shocked if that was it...
 
I changed the code now to
#!/bin/bash
#include <stdio.h>

int main() {
   print("Hello, World!");
   return 0;
}
And getting
Phrancis@MSI ...c/Scripts/C % ./helloworld.c
./helloworld.c: line 3: $'\r': command not found
./helloworld.c: line 4: syntax error near unexpected token `('
'/helloworld.c: line 4: `int main() {
 
@Phrancis Use printf.
#include <stdio.h>
int main() {
    printf("Hello World!");
    return 0;
}
 
OK, same error though
I'm just not sure where to look for the issue, apparently syntax error near unexpected token '(' is a pretty common error
 
On a better note, I got plastic pieces working in my checkers.
@Phrancis Huh, it looks like it isn't expecting the \r.
Change all your line endings to plain \n.
> line 3: $'\r': command not found
That's the blank line.
If anyone has experience with UI, feel free to ping me in my warroom.
 
Still can't get it to work after changing the line endings
I'm not sure if it's a compiler issue or a code issue
 
5:05 AM
What system are you running?
 
I'm not sure what you are asking exactly
W10 with the Ubuntu install thing
And added zsh
Phrancis@MSI ...c/Scripts/C % bash
Phrancis@MSI:/mnt/c/Scripts/C$ ./helloworld.c
./helloworld.c: line 2: syntax error near unexpected token `('
./helloworld.c: line 2: `int main() {'
Phrancis@MSI:/mnt/c/Scripts/C$ zsh
Phrancis@MSI ...c/Scripts/C % ./helloworld.c
./helloworld.c: 2: ./helloworld.c: Syntax error: "(" unexpected
Ah well, maybe later. It's Monxmas. Gotta enjoy it.
I wonder if maybe the issue is with Sublime Text 2
 
Well, unless you need C, I'd say to just learn C++.
And use VS.
 
5:37 AM
 
6:14 AM
0
Q: Check if a given integer is power of two

CodeYogiDescription: Given an integer check if its the power of two. Code: class Main { static class Solution { private final boolean answer; Solution(int num) { if (num <= 0) { answer = false; } else if ((num & (num - 1)) == 0) { answer = true; } ...

 
Got it to work, following directions from MSDN -.-
 
6:54 AM
I'm voting to close this question as off-topic because it belongs on Code Review. But even for there, "it feels a bit messy" is borderline. — Jim Garrison 41 secs ago
 
What the...
int main() {
	float pi = 3.1415;
	printf("%d\n", pi);
	// -1073741824
}
Oh, found the issue
%d casts to an int
BTW.RTFM
 
7:15 AM
1
Q: Best of Code Review 2016 — Now Accepting Nominations!

janosAs 2016 comes to an end, let's kick off Best of Code Review 2016! All Code Review users will be invited to nominate (link to) the best questions and answers from this year, and showcase them as examples of what great CR questions and answers should look like. Prizes in the form of bounties will...

 
7:53 AM
You should put this on codereview. — Jeroen van Langen 50 secs ago
 
8:05 AM
@square1001 Now that you have code, and if you think it works, you may post over at codereview.stackexchange.com/tour instead. — cricket_007 1 min ago
I am confused. What's your question? You may want to go to StackExchange Code Review, this seems like a code review post? — Tee See 29 secs ago
This doesn't sound like working code, from the description, and would be off-topic on Code Review. I'm voting to close as unclear, because there is not a clear question to be answered here. — Phrancis 43 secs ago
 
8:25 AM
I wish upon a star, that I had VTC privileges on Stack Overflow.
Getting tired of flagging...
 
8:43 AM
Some friend of mine said one can learn C in 2 hours. I'm pretty sure he is wrong...
 
0
Q: Transforming text after preprocessing to tfidf vector and reducing the dimension using pca

An studentclass StemmedTfidfVectorizer(TfidfVectorizer): def build_analyzer(self): analyzer = super(StemmedTfidfVectorizer, self).build_analyzer() return lambda doc: (english_stemmer.stem(w) for w in analyzer(doc)) vectorizer = StemmedTfidfVectorizer(min_df = 1, stop_words = '...

 
9:06 AM
posted on December 25, 2016 by CommitStrip

 
9:27 AM
@Phrancis You can learn Hello World in 2 hours.
Afar from that, no.
 
0
Q: Getting error on form submit using jquery

Go PrestigeI have a jquery function which is perfectly validating all fields using .blur function but if i click the submit button without filling the data it comes with null values . How can I validate the button so that no null values will send. jQuery $(document).ready(function () { if ($("#your-n...

 
Hmm, managed to crash C for the first time :D
The compiler didn't say why
 
You crashed your compiler?
 
More or less, yes
 
That doesn't happen often.
 
9:35 AM
Crashed at run time
 
Ah, that, yea.
 
Merry Christmas, CRitters!
6
 
That's not your compiler.
Monking @DanP
 
Monking
 
Merry Monxmas!
I made it not crash anymore, but I must be missing something fundamental
 
9:37 AM
If it's small, drop it in chat.
 
It's a fizzbuzz, but an empty string is being printed instead of the number, when it fails the fizzbuzz check
#include <stdio.h>

char * getFizzBuzz(int n) {
	if (n % 3 == 0) {
		if (n % 5 == 0) {
			return "FizzBuzz";
		}
		else {
			return "Fizz";
		}
	}
	else if (n % 5 == 0) {
		return "Buzz";
	}
	else {
		return "\0";
	}
}

int main() {
	for (int i = 1; i < 20; i++) {
		char* result = getFizzBuzz(i);
		if (result[0] == "\0") {
			printf("%d\n", i);
		}
		else {
			printf("%s\n", result);
		}
	}
}
I need to set Sublime Text to use spaces instead of tabs, sorry -.-"
 
Np.
Your if statement is likely always true. Add a debug printf there.
 
It couldn't have a normal settings menu like every other program, instead it's a JS object file you have to edit and save in another location and it just doesn't work right
 
if (result[0] == "\0") {
 
So, yeah apparently my empty-string check or return is wrong, not sure which yet
And fixed, by returning NULL instead of "\0"
Still kind of perplexing why it wouldn't work though
 
9:49 AM
:-)
And that's why you can't learn C in 2 hours.
 
char* getFizzBuzz(int n) {
    if (n % 3 == 0) {
        if (n % 5 == 0) {
            return "FizzBuzz";
        }
        else {
            return "Fizz";
        }
    }
    else if (n % 5 == 0) {
        return "Buzz";
    }
    else {
        return NULL;
    }
}
Freaking tabs man
 
You cannot compare (the contents of) C strings with ==
 
^^
 
That makes sense, I suppose
How do you do it then?
 
That's what strcmp() is for.
And Merry Christmas to everybody!
 
9:52 AM
So strcmp(foo, "") essentially?
@MartinR To you as well!
 
if(strcmp (foo1, foo2) == 0)
strcmp will give you the difference. If the difference is 0, they're equal.
 
Strange, but I guess I shouldn't be surprised; it is C, after all...
 
It's not hard, it's just not as 'intuitive' like other languages.
Unless C is your first language.
 
So returning NULL is probably not a good idea if it's a char* myFunc() right?
 
9:55 AM
Meh, it works.
 
I personally like NULL just fine, but... programmers get angry about stuff :)
 
If you're looking for best practices in C, I don't know them by heart either.
MISRA C is a set of software development guidelines for the C programming language developed by MISRA (Motor Industry Software Reliability Association). Its aims are to facilitate code safety, security, portability and reliability in the context of embedded systems, specifically those systems programmed in ISO C / C90 / C99. MISRA has evolved as a widely accepted model for best practices by leading developers in sectors including automotive, aerospace, telecom, medical devices, defense, railway, and others. There is also a set of guidelines for MISRA C++ not covered by this article. == History... ==
MISRA C is one of the best industry C standards around.
 
I can't imagine debugging a program written in C
 
Why not?
Much easier than debugging ASM.
It just takes some getting used to.
 
Maybe it's a lot easier than debugging Node.js also
 
10:11 AM
0
Q: Strongly typed Dependency Property builder & extensions

t3chb0tI've been working on another builder, this time for the DependencyProperty because it's object-based. This means that every parameter is an object and thus their usage is inconvenient (requires casting). In my experiment I tried to make its creation easier and at the same time generic. This is ...

 
I think C is more intuitive than Node.JS, but that could be me :P
 
I think it is too
C is just very... crude. Like, too simple or something
 
One of the reasons C was invented was to have an architecture-independent version of ASM, a bit higher level.
Programming was different back then.
 
For someone who likes melodic / instrumental music, Final Fantasy XV opening theme may be very enjoyable
@Mast That makes sense
Isn't a lot of modern programming inspired or derived from C?
 
@Phrancis Totally different from what I expected, expected more something like this. More bombastic.
@Phrancis That's like saying a lot of inventions are inspired or derived from the wheel.
It's kind-of true, but it's also kind-of an empty statement.
 
10:17 AM
Ah
@Mast They worked in the Prelude music in the menus in XV: youtube.com/watch?v=HHS8sJuE0dA
I really dig the chilled-out Moby-like feel
 
I believe @HovercraftFullOfEels intends codereview.stackexchange.com. — Ole V.V. 37 secs ago
possible answer invalidation by Super Mario's Yoshi on question by Super Mario's Yoshi: codereview.stackexchange.com/posts/150696/revisions
 
@Duga got it
Oh golly, C even has time.h gee that's gotta be fun
 
10:40 AM
@Mast As someone who likes Node - yes, I agree
C is more intuitive because it has so little substance in the language. It's very easy to learn all of C
 
10:51 AM
The new thing for me is pointers. I never thought of them, and always had a puzzled look when they were mentioned. That time is no more.
 
@Phrancis Now you can get confused about segfaults :)))
 
@skiwi return 1;
 
MOV EAX
 
ouch
 
0
Q: User Authentication PHP script

Super Mario's Yoshifew days ago i made small PHP Authentication API with all basic functionalities (log in, log out, registration, getting authenticated member) and i got suggestions that i should use prepared statements for better performance and SQL Injection defense, so i made some changes on my script and it lo...

 
10:56 AM
Gah how do I multilingual om phone
Multiline..
MOV EAX, 1
RET
 
@skiwi Implement a Shift key first.
 
@skiwi I installed CodeBoard keyboard on my phone to type code and otherwise do things that the normal keyboard isn't designed to do
It even has arrow keys for scrolling characters and lines
such recommend, many useful
 
11:29 AM
Oh wow this is weird
Why in the world would it do that
 
Putting your array size on the identifier makes you a bad person
 
Wait I have a choice?
 
Haven't you?
I know both ways work in Java so I assumed that came from C
 
Compiler disagrees with you
 
bleigh
 
11:38 AM
IKR
I much prefer the array size on the type definition
So I guess I pass an undefined struct to a function, and maybe that's why it puts these screwed up values into the fields...?
OMG, I fixed it... with pointers
Things are making sense now
3
 
This question belnogs in CodeReviewGuy 59 secs ago
 
11:54 AM
> PEP 528, Change Windows console encoding to UTF-8
PEP 529, Change Windows filesystem encoding to UTF-8
They make it so hard not to switch, but I can't...
 
I was passing an empty/null struct into a function, then trying to change it then return the struct back, and of course it didn't work; once I passed a pointer to the struct instead, then changed the values, and returned a pointer back, it started working
 
Ok, thanks I will move it to the Code Review. — wdsa 41 secs ago
 
@Phrancis When to pointer and when not to pointer seems ambiguous, until you realize what a pointer is and why you'd want to use it.
 
Right, I can totally see that
 
I'd recommend you a good book, but my book catalogue isn't finished yet...
 
11:59 AM
@Mast One day, :P Hopefully the library you require update to Python 3 by 2020...
 
The thing I made is, more or less, like a constructor... it wouldn't make sense to give it an empty copy of itself and then expect the copy back with values added... rather you tell it where the self is, and then put the values there
 
@Peilonrayz I wonder whether they'll ever upgrade the AS/400 port to 3.6 as well.
@Phrancis Keep in mind C was created before the concept of OO was a big thing.
 
@Mast *frantically Googles AS/400* *finds nothing*. Oh, best of luck, ;P
 
@Mast Right. This is just one of those times to me when you finally figure out something that's been mysterious to you all along
 
and sometimes find something stunning
3
Q: Is infinite loop still undefined behavior in C++ if it calls shared library?

cshuIt's said that infinite loop for(;;); is undefined behavior. From http://en.cppreference.com/w/cpp/language/memory_model In a valid C++ program, every thread eventually does one of the following: terminate makes a call to an I/O library function reads or modifies a volatile o...

 
12:08 PM
The IBM System i is IBM's previous generation of midrange computer systems for IBM i users, and was subsequently replaced by the IBM Power Systems in April 2008. The platform was first introduced as the AS/400 (Application System/400) on June 21, 1988 and later renamed to the eServer iSeries in 2000. As part of IBM's Systems branding initiative in 2006, it was again renamed to System i. The codename of the AS/400 project was "Silver Lake", named for the lake in downtown Rochester, Minnesota, where development of the system took place. In April 2008, IBM announced its integration with the System...
 
So in OO, when you use this (or self in Python) it's really just a pointer to the location of the object
Right?
 
@Phrancis in C++, yes. You can even write delete this;.
 
@Mast I thought that was more than just AS/400, as it the tables at the bottom go to 2008
 
@Peilonrayz It got renamed or something.
Computer names get complicated.
@Phrancis self had something to do with instance attributes, but something along those lines, probably.
 
If your code works well, you need to improve it, you can ask in codereview — Danh 45 secs ago
 
12:21 PM
@Duga Very well put together, if I say so myself
 
12:42 PM
Oh wow, C's union looks evil
 
@Phrancis it can be useful in raw form sometimes ;) though in a very limited cases. C++ has std::variant which actually builds on top of it
 
0
Q: Script to retrieve new youtube videos

Jac08HHi fellow python programmers! I wrote a script which retrieves youtube videos from your favourite channels - channels you specify in a .txt file. github page Example output Let me know what do you guys think about that. Thanks a lot!

 
I believe g++'s std::string uses it to minimize space: until the string is small, they use three 8 bytes variables as 24 byte storage (23 user space, 1 for null terminator), and when it grows, they repurpose it as 1 pointer, 1 capacity and 1 size
 
That's clever
Seems like a micro-optimization, but applied on every string I'm sure it adds up to a lot
 
Merry Christmas & a Happy Yule to All ~ Rubberduck & Family
2
 
12:52 PM
@Phrancis they store flags in the bits of the null terminator, to differentiate between small string and big string, and some others. Actually it made a big difference, since always mallocing is slow compared to on stack variable creation
@RubberDuck thanks! You too
Facebook did an optimization to std::string called fbstring, which gave them 1% better performance, but 1000% more obfuscation
 
@Incomputable C != C++
 
@Mast yeah, I forgot to mention that in C++ union is actually a class. It is possible to add functions, constructors, destructors, etc. Thanks for noting.
 
@Incomputable 1% performance over the entirety of Facebook traffic sounds like a lot of performance
 
@Phrancis If you got a hundred servers running, you now need one less. However, you just increased maintainability hell, development time and the risk of bugs.
 
@Phrancis not over entirety of Facebook :) but over std::string. From what speaker said 17% of the time CPU spends in strings, so it seems like it is 0.17% performance gain
 
1:06 PM
Doesn't sound like a good trade IMO.
 
@Mast totally agree with you. They did rather rush move
though they helped g++ to understand that it is bad idea, so they won't write that version
 
Ah, makes sense
 
lol
 
0
Q: Classes representing items in an RPG game

wdsaI wrote a little program in C# that contains classes representing Items in RPG game. I wanted to have access to all inherited classes parameters from list contains parent Item class instances, so this is my code: using System; using System.Collections.Generic; public interface SpecialObject { ...

 
Monking
I know it's Christmas and all, but I just joined the dark side :D
 
1:11 PM
@skiwi new Darth Vader? :D
 
@Incomputable Darth Caching for now
The Caching Vader
 
@skiwi who is caching horde of Heisenbugs to invade us in 2017
 
@skiwi On the internet, nobody knows you're Santa.
 
by the way, when I first heard about Santa, I thought it is Santa Claws, not Santa Claus. I thought Western people like claws
 
Santa Claws is real.
3
 
1:19 PM
@Mast Damn, it should be said "Merry Christmas!" on the hat :P
 
As a cat lover, I approve of Santa Claws.
 
 
AWWWWWWWWWWWWWWWWWWWWWWW
 
I liked pets when I was a kid. Now I don't like pets because I have a computer
 
 
1:23 PM
Cats and dogs can wreck a computer, each in their own unique ways.
4
 
for some reason last picture opens zoomed in in my browser, but the monitor is big enough to fit it in
 
@Phrancis Not just your computer either, your entire house.
 
^ dat
 
 
@Mast that's one of the reasons I don't like pets. I'm lazy
 
1:25 PM
#include <stdio.h>

struct {
    unsigned int isValid1;
    unsigned int isValid2;
} simpleValidation;

struct {
    unsigned int isValid1 : 1;
    unsigned int isValid2 : 1;
} bitSizeValidation;

int main() {
    printf("size of simpleValidation: %d\n", sizeof(simpleValidation));        // 8
    printf("size of bitSizeValidation: %d\n", sizeof(bitSizeValidation));    // 4
    return 0;
}
That's kind of neat
Now I remember what I forgot to do tonight... Sleep!
 
Sleep is irrelevant.
 
a very small catch: main() is not valid function signature for main
 
G'night Phrancis :-)
@Incomputable It is.
 
@Incomputable Compiler's not complaining
 
It's not best practice, but it's allowed.
 
1:28 PM
@Mast not in C, if I remember correctly
 
What compiler are you using anyway @Phrancis?
 
Uh, whatever the one that comes with Windows 10/Visual Studio is
 
0
Q: Make method call shorter

FCinI wrote a method for validating properties based on passed conditions. It works well, but declaration takes more space than the actual condition. Is there any way to make it shorter? public virtual string Validate(string propertyName, params Tuple<Expression<Func<bool>>, string>[] predicates) { ...

0
Q: Counting the Number of Inversions in an Imperative way in Scala

Filipe MirandaI have developed the following algorithm to count the number of inversions in an Array: However, it is not counting appropriately, I am missing some of the inversions over the merge step. How could I accomplish that? One important note is that, I want to solve this problem using a for loop, and...

 
@Phrancis should be enough if you're not planning crazy preprocessor metaprogramming
 
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.
So anyways, TTGTB :)
 
1:30 PM
You usually pass arguments to main: int main(int argc, char **argv);
 
@Phrancis good night
is there any cheat sheet for the abbreviations like TTGTB? I tried to google it a few times, but couldn't find anything useful.
 
@Incomputable Time To Go To Bed
23
A: What's a Zombie? And what are the many other memes of Code Review?

Mat's MugMeme: [TTQW | TTGH] | TTGTB Originator: [attributed to] Simon André Forsberg (first TTQW here) Cultural Height: The 2nd Monitor Background: leaving the chatroom and/or going AFK isn't something we do often. These funky acronyms efficiently communicate that it's either time to quit work (or tim...

 
@Mast I got that one. I just thought that I could learn more and not ask about them each time. Also I forget/confuse them sometimes
@Mast oh I thought it is english abbreviations. Now I understood why google was useless
 
No, we invented them, kind-of.
29
A: What's a Zombie? And what are the many other memes of Code Review?

Vogel612Name: Overly long acronyms Originator: Simon André Forsberg with this message Cultural Height: The 2nd Monitor Background: IWNPFETTOLAI (I will not provide further explanation than this overly long acronym itself)

 
they look like ntos or ntol (linux sockets functions)
 
1:47 PM
@Phrancis Isn't it too late for that by now?
 
@skiwi American time, subtract 7 hours or so.
 
Point still stands ^^
 
Sleep is a weird thing.
I used to keep odd hours before I married.
 
Why?
 
And I still went to bed after 4 this morning, so...
 
1:53 PM
@Mast I do the same when I'm in dormitory. My sleeping hours slowly shift through the whole day.
 
I slept from 2am till 10.30am, yay for no sleep schedules
 
@skiwi There's 24 hours in a day. That's all great if you have enough energy per day for 16 hours and can regenerate that exact amount in the remaining 8.
What if you can't?
What if your optimal day would be 30 hours?
A cycle of 24h is quite restrictive.
Some of us aren't wired like that.
 
@Mast that's actually the thing for me, though my effective day is ~10 hours.
 
That would be slightly annoying indeed
 
So what you could do, let's ignore the fact work schedules usually aren't this flexible, is keep 30h days instead of 24h days. Shift your go-to-bed-time 8 hours a day.
But that doesn't work.
So you start varying.
Start skipping nights.
Which could work for a long time, if all days would be regular days.
And it usually isn't that regular, so you keep shifting.
Which effectively means bedtime can be any time.
 
1:57 PM
I'm lately not rested even after 8 hours of sleep, which sucks
Now I don't need to wonder anymore why university was so difficult with averaging 6 hours of sleep though :D
 
I'm reading a holywar of C vs C++. For some reason, I'm becoming convinced that C++ is a tool for 2-3 cases, very special cases. Though C is like emacs, needs a lot to be able to do something useful
 
Most developers have no need to learn C. It's often used if you need something extreme-high-performance, extremely-low-latency or on an embedded platform, but afar from that, there's usually better alternatives available now.
 
@Mast I thought they were available like 10 years now
and yeah, no real reason to learn C++. Unless the programmer is sadistic
 
I think C++ is the most powerful language of all... but
I find it hard to justify starting a C++ project
Usually another language will do the job easier, especially if you're not a C++ professional, I do have a project involving raw performance and I'm thinking about C++ for that
 
@skiwi it has overwhelming amount of things programmer needs to think about. It might be able to produce the best solution, but creating that is outside of humans' capabilities
 
2:08 PM
I'm not so sure about that in C++17 and even more recent versions
 
@skiwi they actually make things worse for insane performance applications. But for everyday use, it's great
the reason is that things change too much, and programmers will need to rethink the choices
also, I still don't have idea if lambda is actually constructed or compiler does magic. With every version it just adds up magic, which will one day break it
 
not that I'm an expert, though. I think checking out compiler is a good place to start, since they offer tons of macros, extensions and whatnot to help with that
 
If this is working code that you think could be improved, see Code Review. — jonrsharpe 23 secs ago
 
@Incomputable No, I was talking about C. There's still plenty of reasons to pick C++.
C++ is also the reason we have fewer and fewer reasons to pick C, because it does what C does with less downsides.
Well, different downsides really, but this is getting longwinded.
6
Q: Idiomaticy of macros in C++

MastMacros are considered a good thing by one and evil by another. Is there a rule of thumb when to and when not to use macros in C++? When are macros idiomatic and when should they be avoided?

 
2:17 PM
well, when I write line of C++ code, I start hoping that it does what I want it to do. I don't have the confidence even after 1.5 years of nitpicking it's features
 
As far as I'm aware C++ code will do exactly what I tell it to do
 
@skiwi At least it won't go all JavaScript on you and parse whatever bogus you throw at it.
 
@skiwi try to return an object with user defined move semantics (make it output something) from a function by value. It will move from the returned value instead of copying it
 
Both C and C++ have plenty of undefined behaviour left though, that's one of the reasons you should follow a style-guide for them.
And use ALL compiler warnings.
 
^ that. Try to fire up everything you have
 
2:20 PM
I guess I'm fine with programming in C++ after having programmed in Assembly
 
@skiwi I think learning template metaprogramming will be fruitful for you then, if you know both Assembly and higher level language. It is really game changer
 
My best bug was that I writing into the memory pointer instead of the memory where the memory pointer pointed at
 
0
Q: A modern and extensible C++14 Logger

MattMattI recently wrote this C++ Logger API code for a game engine. It needs to be as fast as possible so I tried to do postpone everything to compile time using different template meta-programming tricks (for instance static_if). Any advice, bug fixes or suggestions are welcome :) Here is Log.h: // C...

 
@CaptainObvious @Incomputable It's as if you asked for it :P
 
@skiwi I didn't ask for obfuscated code ;)
he tries to return string from constexpr function. He got it wrong
 
2:26 PM
I'm curious why he's using FILE* though, I'd suppose C++ has something better for that by now
 
@skiwi that's why it's here for review ! :)
it has something more convenient, but it is slow at least in default mode (it syncs with C stdio, I guess some mutex lock or something). Haven't tried to benchmark "unleashed mode" (std::sync_with_stdio(false)). But C# did it right
but C++ allows to write C# reading function, which is actually written! fmt. I'd use it if I could make sense of all of that licensing thing
wow, it actually has ~2.5 times compilation time increase. Not so bad thing
 
If code is generally working, consider codereview.stackexchange.com. Otherwise, do you have any question besides improvements? — chux 24 secs ago
 
00:00 - 15:0015:00 - 00:00

« first day (1331 days earlier)      last day (2691 days later) »