« first day (1222 days earlier)      last day (2789 days later) » 
00:00 - 17:0017:00 - 23:00

12:00 AM
RELOAD! There are 2677 unanswered questions (92.8217% answered)
 
TTQW!
 
If this code is working then it's off-topic here. Try codereview.stackexchange.com instead. — Chris 41 secs ago
I'm voting to close this question as off-topic because generic code review/optimizations of larger code dumps is not apt here. — bwoebi 12 secs ago
 
I'm having so much fun with C++.
5
 
12:16 AM
@Phrancis @user2296177 You guys have funny ideas of what fun is.
5
 
@Vogel612 Huh, I'll need to look that up.
You mean essentially having the recursive call be the last statement?
 
correct.
 
Huh. This would work in my instance.
I wonder if the F# compiler features tail call optimization?
 
Awesome.
On the other hand, I've already figured out a working, and fairly clean, loop implementation.
 
12:37 AM
@200_success I actually enjoy programming in C++, much better than PHP, JavaScript, CSS and HTML.
On the other hand, stack overflows are never fun.
 
12:48 AM
@200_success Few things are more fun than breaking things :D
Programming in HTML and CSS... lol
 
Really not a front end guy.
Its not logical. :D
Stack Overflows are more fun that HTML and CSS.
3
 
1:32 AM
-1
Q: Testing Code in Production Code - how bad is it?

SB2055Say I have a class DoStuff: public DooHickey DoStuff(int thingId) { var thing = GetThing(thingId); SendNotification(thing); DoComplicatedStuff(thing); } Today, I encountered a bug with DoComplicatedStuff for a particular kind of Thing. So I rewrote DoStuff as follows...

 
28,227,546 rows added to a table... and no indexes at all. I feel like an idiot -.-
 
@200_success You can just do things with C++'s templates and memory that are either impossible or more difficult to achieve in other languages.
 
2:33 AM
0
Q: shared_ptr code implementation

xersiI have never used std::shared_ptr before and I don't really know how this smart pointer actually works but I decided to create one to verify my knowledge. Here is my code : namespace myStd { template<class T> class shared_ptr { public : shared_ptr() : refCount(null...

 
2:47 AM
Got my HDD partition 44% fragmented with all this data processing stuff, yeouch
 
2:59 AM
0
Q: Ambient Context

Dmitry NoginWhat do you think about this way to make logging available across the application without passing log object around? Let’s say we have something which allows us to write things this way: class Program { static void Main(string[] args) { using (new Log("c:\\a.txt")) As...

1
Q: Project Euler - Problem 1 (Java)

HaroutI consider myself a beginner at Java but, The question was an easy one, my only concern is if there is a more efficient way to write this program. i'm very open minded i don't care how advanced your answer is, i'm willing to learn. public static void main(String[] args) { long limit = 1000;...

 
3:26 AM
0
Q: Uni-Directional Singly Linked List in Javascript

Still QuestioningI've been studying data structures and taken a stab at implementing Singly LL in Javascript below. Please review and advise any additional improvements and optimizations: var prettyjson = require('prettyjson'); function Node(val){ this.data = val; this.next = null; }; function SinglyLi...

 
Oh man. I just finished implementing this polymorphic storage I've been working on.
It feels so good to make it work.
 
0
Q: Adding multiple events in gcalcli bash script

Dyslexic#!/bin/bash assigning variables start="14:00" duration="150" title="Exper. Lab" year="2016" start2="17:30" duration2="230" title2="Calc1" Here I refer to dates that the event occurs on piping the variables into gcalcli (Google calendar command line interface) creating a repeated event on my ...

 
3:45 AM
possible answer invalidation by Harout on question by Harout: codereview.stackexchange.com/posts/140695/revisions
 
4:05 AM
For further code review, maybe post a question to codereview.stackexchange.com rather than here. — nnnnnn 41 secs ago
 
4:29 AM
@nnnnnn please note that pseudo-code/hypothetical code is off-topic on Code Review. See What topics can I ask about here?Phrancis 24 secs ago
 
4:47 AM
0
Q: Hex encoding and decoding of ASCII strings in VBA

ThunderFrameI needed to convert some Ascii text to binary in Hex format 0x00FF.... I've written an EncodeHex and a DecodeHex function to do the conversion. I've avoided using concatenation in favour of performance. I'm assuming that assigning the results of CByte("&h80") to a byte array, and then using St...

 
@Duga thats ok
Monking
 
@Heslacher Monking
 
5:12 AM
@Heslacher Monking
 
0
Q: My 1.5 hours interview coding challenge

Student TIt is a 1.5 hour coding test, started the moment when the question was sent by email. My solution was done under the strict condition. I was not told anything before the test. The question is about counting word occurrence in natural language processing: https://drive.google.com/open?id=0B1WTDP...

0
Q: Producer consumer in c++11

user3666471I'm trying to practice some C++ and I wrote a simple queue to solve the producer consumer problem. The code is: class Queue { public: Queue() : mutex(), cv(), queue(), process(true), consumer(&Queue::dequeue, this) { } ~Queue() { process = false; consumer.join(); } void enqueue(int i)...

 
5:49 AM
> How does that work?
 
Just curious: Why are Captain Obvious and Duga called those names?
 
6:09 AM
@Heslacher Thanks :) Forgot to check the Duga profile, since I didn't find anything on the chat profile of the Captain... My bad...
 
6:20 AM
That's a strange expression by the way... I'm Norwegian, and we have the same word "Duger", which means the same thing, but translating that sentence to "A bot out of the ordinary" is just very strange...
Do you know why Captain Obvious is called CO? Why the Obvious part?
 
Hmmm.. I don't know why he is called CO actually
I looked around but couldn't find anything.
Comic relief?
 
6:40 AM
possible answer invalidation by JensB on question by JensB: codereview.stackexchange.com/posts/140669/revisions
 
0
Q: Finding mongodb records in batches using mongoid

tesI want to get records in batches. But mongoid doc says to avoid using skip due as it can be expensive. I wrote this method to iterate through a large number records efficiently. module Mongoid module Batches def find_each(batch_size = 1000) return to_enum(:find_each, batch_size) unle...

0
Q: Efficient implementation of aggregating test/train data

envy_intelligenceHere is a short python snippet to ingest train data: x_train = [] y_train = [] for x,y in train: x_train.append(x) y_train.append(y) x_train = np.asarray(x_train) y_train = np.asarray(y_train) The variable train is a list of 60000 (x,y) tuples.

 
@Duga rolled back
 
7:14 AM
wow c#7 looks cool
tuple / deconstruction syntax, local functions...
 
Your post seems to be a request for Code Review - the best place for the kind of questions is Code Review StackExchange. — ishmaelMakitla 21 secs ago
 
@StewieGriffin When the feed started, many of the regulars were so active they'd already seen the new questions. So the feed was stating the obvious.
Something along those lines, I'll see if I can find the entire story.
 
/cc @Mat'sMug @JeroenVannevel @EBrown @Hosch250 @otherC# guys blogs.msdn.microsoft.com/dotnet/2016/08/24/…
of particular interest is the tuple literals
(int x, int y) GetPoint() { ... }

(var x, var y) = GetPoint()
 
7:29 AM
0
Q: BigInteger Finding Prime Factors

Harout I wrote a program to find the prime factors of the number 13195 and it worked perfectly. but the second part of the question was to find to the prime factors for the number 600851475143. after a little bit of searching I found out that I need to use BigInteger. So I converted all my co...

0
Q: Makefile which only forwards to subdirectories

pseyfertI have a Makefile, which should when calling make just call make in a list of subdirectories. The subdirectories should not be automatically detected but are fine to be hard coded (Tool1, Package2, Submodule3 below). Furthermore, if I call make Tool1, Tool1 should be built (i.e. the directory nam...

 
@DanPantry just read the blog post. Looks nice
 
apparently they're looking at non-nullable types for c# 8 which would be huge
all they need to do then is improve the performance of c# :p
 
0
Q: Constantly checking for activity in a page then log out if no activity

guradiofunction executeQuery() { $.ajax({ url: '../include/activity.php', success: function(data) { // do something with the return value here if you like if(data.error == true){ window.location.href = "login.php"; } } }); setTimeout(executeQuery, 3000); /...

 
7:48 AM
In case this is a working code, I think it should be asked on codereview.stackexchange.com (with a better title). — Gábor Bakos 12 secs ago
 
@DanPantry please no
 
@JeroenVannevel lol
 
You can't change a fundamental language semantic like that
 
pretty sure it would be opt-in, not default
think NonNullable<T> like Nullable<T>
 
If you don't want to break backwards compatibility, you'll end up with a mess trying to avoid interaction issues
Last I heard it was about literally changing class to be not null by default
and then use some settings to determine what would be active
which would give issues with referenced libraries and stuff
 
7:58 AM
that almost, almost sounds like a bad idea
until you realise that if that would be an issue at runtime itw ould be an issue anyway, so it would be a compiler flag
if they go the way they did with TypeScript (which would make sense, it's the same language designer) it'll be a compiler flag where strict null checking is opt-in, but global
 
8:09 AM
0
Q: Deriving classes to decorate auto-generated base class code with attributes

toadflakzBackground: I am currently in the process of abstracting and refactoring out EF for Dapper with Dapper.Contrib and the entity class definitions from EF are currently being generated by a T4 template. I have not swapped out the entities entirely for generic POCO base classes as yet as the EF impl...

 
Naruto answer; accepted non-selfie answer with 0 score: Proper class user.php
 
> It was a slow day at work
> To accomplish this I chose any true programmer’s favorite tools: excel sheets and VBA.
3
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: XML/HTML batch generator
 
@SimonForsberg Subtle reminder:
in The CRonicles, Nov 2 '15 at 17:33, by Simon Forsberg
Just saying quack. And that maybe I should tell the story about a bot named @Duga in here some time...
 
8:40 AM
possible answer invalidation by xersi on question by xersi: codereview.stackexchange.com/posts/140693/revisions
 
@Duga Not sure, possibly.
 
Does your code work? If it does, you should check out Code Review. It's for improving/optimising working code. If your code isn't working, you shouldn't be trying to prematurely optimise it. — Brandon Ibbotson 41 secs ago
 
GWT is fun
//STOP STOP STOP STOP STOP
event.stopPropagation();
event.getNativeEvent().stopPropagation();
event.preventDefault();
event.getNativeEvent().preventDefault();
 
Is that an overly verbose way of stopping something?
 
that's me finding all the possible things that stop a keyboard event and hoping it works
it seems to work
now to figure out which one actually works
 
8:51 AM
@Hosch250 Is that intended to be a collection of solutions for the Community challenges?
 
I am sorry for this minus question.I have fix my question on this link codereview.stackexchange.com/questions/140718/…O.Blue 1 min ago
 
0
Q: Keil string data length on st mcu

O.BlueI need to use longer than char(255) data types for string operations. I solved but I have doubts for my below solution . Can you fix the best solutions? len=strlen((char *)userBuffer2); HAL_UART_Transmit(&huart2, (uint8_t *)&userBuffer2, len, 1000); this (uint8_t*) and (char*) using is this t...

 
@Pimgd When not sure what button to smash, smash them all.
 
the final option would have been Thread.currentThread.stop()
 
@CaptainObvious UWYA
 
8:54 AM
or using reflection to change the keycode of the event passed in to "end" or something like that
 
@Notlikethat Please link to the on-topic help centre next time. Now the question is at risk of getting closed twice. — Mast 6 secs ago
 
this (uint8_t*) and (char*) using on the len=strlen((char *)userBuffer2); HAL_UART_Transmit(&huart2, (uint8_t *)&userBuffer2, len, 1000); is this true or not ? — O.Blue 2 mins ago
Unclear comment is being unclear.
 
9:07 AM
Congrats 200_success, You're Jon Skeet of CR. (y)
6
 
0
Q: Extract Pages from PDF based on search in python

RahulEverything is working fine except timing. it takes lot time for my file containing 1000 pages and having 100 pages of interest. import re from PyPDF2 import PdfFileReader, PdfFileWriter import glob, os # find pages def findText(f, slist): file = open(f, 'rb') pdfDoc = PdfFileReader(fil...

 
9:24 AM
I think this question is more suited for: codereview.stackexchange.comVladNeacsu 43 secs ago
@VladNeacsu code review is for working code, which this certainly isn't — stuartd 42 secs ago
 
@Mast ew
 
This question belongs indeed on codereview.stackexchange.com . I don't understand the reason of this harsh downvoting thought. At least the OP made some effort with giving a MVCE. — eliasah just now
 
9:41 AM
0
Q: Efficient use of scala map and flat map

Shams Tabraiz AlamI am new to spark and scala and I solve the following problem. I have a table in database with following structure. id name eid color 1 John S1 green 2 Shaun S2 red 3 Shaun S2 green 4 Shau...

 
@eliasah MCVE belong per definition not on Code Review. — Mast 7 secs ago
@eliasah As intended. The amount of off-topic content redirected to Code Review can be staggering at times. — Mast 31 secs ago
 
0
Q: Parse Websites Using Different Control Flow Strategies

Usama AshrafRecently I attempted a coding test in node js where I was supposed to parse a list of websites provided by the user, and display the content of the title tags on each page. Here is the problem statement: https://gist.github.com/caremerge/b71716d403d62542a7e5 I was supposed to do this 4 times; us...

0
Q: How to remove code duplicate?

LeestexHere is a simple filter function I have: function filter (attributes, data, include) { if (include) { let res = {} if (typeof attributes === 'string') { res[attributes] = data[attributes] return res } if (attributes.length) { ...

 
9:58 AM
SO is dead!
 
because?
 
Zak
10:21 AM
@Pimgd It's back up now. It was down (for regular maintenance I think).
Damn. Now I really want one of those impossibly detailed hand-wavy TV visualisations showing all the internet traffic that went to SO, found it was down, and then dispersed over the rest of the internet.
 
@Zak Yup, other SE sites were as well.
 
10:41 AM
@Mast Quack, yeah I know. @Vogel612 told parts of it in here:

 Duga: A Bot out of the Ordinary

Discussion of the book about Duga
@Mat'sMug What have you been up to now? tristancalderbank.com/2016/09/06/…
 
Monking
 
@SimonForsberg I wonder why the list of nicknames in the last screenshot is actally a list of capacitors...
 
@Mast Perhaps they give their capacitors nicknames?
I'm feeling lazy again still feeling lazy, thinking about making some simple script ran inside the browser to automatically create adverts on an advertising site
 
Oh crap, @DanPantry already posted it:
3 hours ago, by Dan Pantry
> To accomplish this I chose any true programmer’s favorite tools: excel sheets and VBA.
 
Probably not really detectable as long as I just do it slowly and the whole process is not automated anyway
 
10:57 AM
In fairness, I expect @Zak to have implemented such a chat already a long time ago.
4
 
I wonder how difficult a chat system via Excel would be...
 
I think it depends on how much you cheat.
IIRC Excel has some browser-like capabilities.
There's also Excel Web App.
There's even businesses selling solutions to turn Excel into web applications.
> SpreadsheetWEB can turn any complex spreadsheet into a web application
 
@Mast Wow...
That's desparate
 
I think it's awesome.
 
Awesomely desperate.
 
11:06 AM
It feels like making a boat out of duct-tape, just because you know how duct-tape works.
But it will work.
Have I mentioned recently I love duct-tape?
 
You could make a great combo of duct-tape and Excel
2
 
Zak
@skiwi The ultimate Universal Tool
 
user image
2
 
Zak
@Mast Damn. $999 per month, I'm in the wrong business ^^
 
0
Q: How to optimize code parser?

Narnik GamarnikI'm new to Python, and just started to learn the principles of object oriented Programming, this does not judge strictly. This code is fully working but confused some elements: 1) I dont anderstend what needs to return init 2) I do not like so much self. in def get_parse(): Initially, I did it ...

 
11:11 AM
@CaptainObvious How to optimize title?
 
Zak
> Finance departments are usually the heaviest users of Excel spreadsheets within any organization
 
@Mast How to optimize my amount of open tabs?
 
possible answer invalidation by Rahul on question by Rahul: codereview.stackexchange.com/posts/140719/revisions
 
Zak
Pretty much. There's an inverse relationship between the size of a transaction and the sophistication of the software executing it.
 
This got automatically flagged as spam. It's broken and CBL, but not spam...
 
11:16 AM
It mentions another site, though github shouldn't trigger the spam flag if that's why it got flagged
 
That's probably why it was.
 
Zak
To the point where you get this. Where you basically just call up the Federal Reserve in NY and say "Hi, this is the central bank of bangladesh. Here's my account number. Could you please send $1 Billion to this other bank account. Cheers."
 
Oh well, at least it caught a crappy question.
@Zak lol
I've heard about that. Caused a ruckus.
 
477ms for a 410,27 KB request is a bit much, isn't it?
Seems like Chrome "unlocks" the site way earlier than Firefox though, with Firefox I'm waiting on basically nothing in the end and in Chrome I can instantly interact with my tab again
 
Don't tell me you've converted from Firefox to Chrome?
 
11:26 AM
No, I just sometimes use Chrome when I want to do something quick
I don't want to convert, I doubt it could handle my tabs
 
lol
 
have you tried not using browsers like a drunkard and opening lots of tabs :P
 
It worked fine with 2000 tabs!
Clearly the issue is that I closed a lot of my tabs
2
 
Clearly.
 
11:34 AM
0
Q: Does custom essay writing service help students to create their own work without fear?

ronrogersI am a first year degree student.I feel some difficulty in my coursework. This is my first work and has to be submitted within this month itself. There is only few days are remaining for completing these tasks. So I need genuine support for my job. I have searched through online to know about ess...

 
Try Code Review. They'd love this question over there. — Brandon Ibbotson 28 secs ago
 
@CaptainObvious HAMMERTIME!
Also, free spam flags.
It's not often I get to close a question for being primarily opinion-based.
3
 
Guys can you quickly look at this and tell me if my bad answer is still there? I tried to delete it. codereview.stackexchange.com/questions/140688/…
@Zak love the cartoon response, it's perfect.
 
Zak
@pacmaninbw It's gone.
 
Thanks
 
Zak
11:44 AM
@pacmaninbw There's always a relevant XKCD.
It's like the XKCD corollary to rule 32:
"If you can think of it, there exists a relevant XKCD for it"
 
Comment Review: what's wrong with asking for a Lamborghini in a restaurant?
BTW
 
some asshole swapped my chair with armrests to one that had armrests but without cushions on
so i've just managed to cut my elbow open on the sharp plastic bits
very funny
ha ha
 
Nice to be a short timer I guess
They should wait until you're gone before they steal your chair
2
 
the chair without armrests was a spare chair we had
so someone decided to swap them around as a joke while i was away
 
I used to take my shoes off at work. Someone came in while I was working with my head phones on and hid them.
 
11:55 AM
0
Q: Fast rounding function with variable precision?

ElmiI already had this question on Stackoverflow but was pointed to this page here. So: surrently I use following macro for rounding: MY_ROUND(inVal,numDig) (((double)(int)((inVal)*pow((double)10,numDig)+CNCO_SIGN(inVal)*0.5))/pow((double)10,numDig)) Here inVal is the input double to be rounded an...

0
Q: Singly linked list implementation in pure C

Oleg NykolynIs there a way to improve this code? Any suggestions are highly appreciated. #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #define DEBUG #undef DEBUG typedef struct Node { int data; struct Node *next; } Node; typedef struct LinkedList { Node *head, *tail; int size...

 
@pacmaninbw That's why they're starting with the armrests now
Note to future self: Please close opened tabs
2
Note from future self: Who are you even kidding?
2
 
12:30 PM
Welcome @MarioAlexandroSantini
 
Thanks @Mast
Hi all
 
@skiwi I need your help!
(monking)
 
@Phrancis I can give you advice on how to open tabs, if that's what you want
 
@Mario This is the Code Review general chat. Did you have a question about our site? We also have a Code Review Meta. If you're wondering what's going on here, have a look at the chat FAQ.
 
@skiwi Well, it's related to that, actually...
 
12:31 PM
@Phrancis Are you going to open tabs based on XML data?
Will you be storing the opened tabs in your MSSQL database?
 
@Mast I'm following stackoverflow, and code review this days, but as I'm new I just want to have a look on the chat.
 
I forgot to close my laptop overnight (was doing a disc defrag, etc.) and well one of the cats spent some time on the keyboard and managed to open so many New Tabs in Firefox that now it won't respond =(
9
 
@Phrancis Force close and restart Firefox?
Or is there something you want to keep
 
I'm trying to not have to uninstall it and lose my settings, scripts, etc.
@skiwi I tried that, but it keeps trying to restore the last session...
 
There's a way to remove the last session I believe
I have done it unvoluntarily
 
12:34 PM
Ooo OK that may help... let me Google, maybe I was searching for the wrong problem
 
@skiwi Yup.
You really want to do that.
No uninstall required.
 
Down to 666 tabs for now
 
@skiwi Is there a reason you chose the number of the beast?
 
cus firefox is the devil
 
Anyone want to see some really ugly C++ code? codereview.stackexchange.com/questions/140732/…
 
12:42 PM
@pacmaninbw Not at all, not at all...
@pacmaninbw Holy beep!
 
@DanPantry I always thought IE was
 
Oh... so the 700 I was mentioning earlier was only per window, I'm sure another window had 100 tabs on it as well
 
Zak
@pacmaninbw Nah, being the devil requires some actual competence
 
@skiwi Do you ever close anything?
 
@pacmaninbw Yes, quote often, actually
 
12:46 PM
You may want to think about Phrancis's problem.
 
Looks like I close less than I open though
 
OK, now that I've removed one of my answers (apparently low quality) and answered another, and fell off my chair twice due to laughter in this chat room I'm going back to debugging C++. See you all later.
 
I'm voting to close this question as off-topic because it belongs on Code Review. — zero323 55 secs ago
 
1:05 PM
@pacmaninbw !@#$
 
Zak
1:15 PM
TIL that you can burn diamond just like you burn coal. Well, assuming you can get it to 900°
 
Maybe I found a breakthrough... seems like Firefox mainly hangs on loading resources
Having opened thousands of tabs could of course have filled up my cache
Looks like I've got a cache of 350 MB, that's pretty big, isn't it?
 
> Computers aren't the thing. They're the thing that gets us to the thing.
@Zak What if I told you, you can burn water?
 
have you ... tried looking for where firefox keeps that info
and editing it
 
Hmm Firefox is still slow... WHY
 
1:28 PM
@skiwi Nah.
Shouldn't be your problem.
 
Fixed it
Booted the PC in safe mode, then started FF
Never been so happy to see the "Well this is embarassing" page
 
{"version":["sessionrestore",1],"windows":[{"tabs":[{"entries":[{"url":"http://‌​localhost:8080/#/home/report/select",
so starts my sessionstore.js
seems pretty editable
 
Mine crashes my JS reader ^^
 
0
Q: Implementation of a singly linked list data structure in C

Oleg NykolynThis is a follow-up to the previous question located at Singly linked list implementation in pure C Any suggestions on design and optimization are highly appreciated LINKEDLIST.H #ifndef NYO_LINKED_LIST #define NYO_LINKED_LIST #include "stdbool.h" #include "stdio.h" #include "stdlib.h" typede...

 
... so open it with something else
then look for whatever a new tab looks like
and get rid of all the new empty tabs
{"url":"about:home","title":"Mozilla Firefox-startpagina","charset":"","ID":81288840,"docshellID":5,"docIdentifier":3‌​,"persist":true}
that's what a single empty tab looks like for me
=D build a script that parses the json, navigates the tree and tosses all the about:home entries?
 
1:32 PM
I once made a script that would read an old sessionstore and open the tabs one by one
It had to open about 2000 tabs, I decided to abandon it
 
You could put your tabs in a SQL database -.-
 
monking
 
monking
 
monking
 
what do you call an inverse decorator
basically instead of wrapping something it's more like an event listener
wow I suck at explaining this
I'm just gonna go with "event listener"
 
1:43 PM
Just found a random tab: smbc-comics.com/?id=3266
TFW
 
0
Q: Inefficient Parsec parser to skip unreachable block

cornuzIn a parser written with Parsec 3.1.11, I have a performance issue with parsing (or better, skipping) the unreachable branch of a if-then-else statement. The syntax to be parsed is as follows: _if (condition) { # block of statements } _else { # block of statements } (with the _else branch...

 
2:03 PM
So you have working code and you want help reviewing and refactoring it? Try the Code Review site instead, this is off-topic for Stack Overflow. — David 1 min ago
I'm voting to close this question as off-topic because it is asking for help refactoring working code, and may instead belong on codereview.stackexchange.comDavid 21 secs ago
 
TTGTW
 
After you get it working you should post your code on Code Review. The experts there will analyze it and give you pointer on how to refine it. — Thomas Inzina 58 secs ago
 
Lol, digged up an old project and it's basically just a big //TODO
 
2:28 PM
@zero323: Being on-topic on Code Review does not mean being off-topic on Stack Overflow. It is perfectly possible for a question to be on-topic on more than one site. (I can easily imagine a single question being on-topic on at least Stack Overflow, Programmers, Database Administrators, Code Review, and Computer Science, for example.) You can choose your venue according to the kinds of answers you would like to get. You should avoid cross-posting, however, you may still ask about the same problem on multiple sites, as long as you make sure to tailor the question in such a way as to avoid overlapping answers. — Jörg W Mittag 41 secs ago
The guys at Code Review are very good at doing Code Reviews, and so, if I had a Code Review question, I would certainly prefer to post it there, not here. They are incredibly dedicated, taking hours or even days to do very thorough reviews. something you almost never see on Stack Overflow. But still, if someone prefers Stack Overflow, there is nothing wrong with that. — Jörg W Mittag 12 secs ago
3
 
@Mast What did I do wrong now?
 
0
Q: Extract Element and its Followers from List

Kevin MeredithI wrote the following function to convert List[Int] => List[List[Int]]. Its intended purpose is to extract 1, followed by its non 1 followers, into a group. input: List(1,2,2,1,3,3) output: List( List(1,2,2), List(1,3,3) ) Function def leadingOnesGroup(xs: List[Int]): List[List[Int]] = ...

 
Zak
TIL there's a "European Spreadsheet Risks Interest Group"
2
 
@JörgWMittag except, if you read the tag wiki of the defunct code-review tag, it plainly states "On Stack Overflow, questions to review code are generally off-topic. It is recommended to post such questions on the Code Review sister site." - it's probably best to just close them as too broad or primarily opinion-based on SO, and recommend posting their working code over on CR. ..but you are entirely correct that "because it belongs on Code Review" isn't an appropriate close reason on SO (and that CR reviewers are awesome) ;-) — Mat's Mug 2 mins ago
 
@Zak lol
 
2:45 PM
1
Q: JS: Any field change in form, disable button and activate another

ClementineI have a JS code that activate a button and disactivate another if a select is changed. HTML <select name="list" id="list"> <option value="">choose</option> <option value="1">1</option> <option value="1">2</option> <option value="3">3</option> <

0
Q: Why is my ReadWriteLock approach a lot slower than my Object-synchronized one?

KarussellI have one writer thread and 10 reader threads of a byte array. It is important to synchronize writes and reads over a "row" (16 bytes). There are a lot less locks than rows, e.g. in the current configuration 1024 (chunkRows) rows have one lock which makes the overall operation faster, but also ...

 
#ComicSansFTW
 
@Mat'sMug I'm more worried by the code actually
 
OMG is so evil
31
Q: What does a && operator do when there is no left side in C?

JoshuaI saw a program in C that had code like the following: static void *arr[1] = {&& varOne,&& varTwo,&& varThree}; varOne: printf("One") ; varTwo: printf("Two") ; varThree: printf("Three") ; I am confused about what the && does because there is nothing to the left of it. Does it evaluate as nul...

 
I keep finding those gems in my old opened tabs!
 
lol
 
2:59 PM
@Mat'sMug Wow wtf
 
&& label; // <~ goto
because, y'know, goto is evil, so let's HIDE it behind a unary operator that looks exactly just like a logical AND operator.
makes you think the compiler design team has been infiltrated by PPCG
2
 
1197
Q: What does the C ??!??! operator do?

Peter OlsonI saw a line of C that looked like this: !ErrorHasOccured() ??!??! HandleError(); It compiled correctly and seems to run ok. It seems like it's checking if an error has occurred, and if it has, it handles it. But I'm not really sure what it's actually doing or how it's doing it. It does look l...

 
lol
 
I guess it's rather unusual to use GitLab CI without using GitLab, hence it's unlikely to find a GitLab CI integration for any other code review platform than GitLab. — sschuberth 10 secs ago
 
@DanPantry I saw that earlier, most of it's pretty neat.
 
3:05 PM
Why are trigraphs even a thing in C++??!??!
 
Zak
@skiwi I lost it at "??!??! operator"
 
-1
Q: Android: URLConnection .connect() doesn't work

wurstfacherthe following code is basically taken from the Android Developers Tutorial "Connecting to the network". It crashes at conn.connect();, until there everything works fine. I copied the complete code just in case, but the whole table-buidling part works fine. Can anyone explain why the connect-metho...

0
Q: Auto-INSERT query for NLog

t3chb0tI use NLog everywhere and I really don't like writing the inserts everytime. You need to write the same variable three times: two for the insert and one for the parameter for example: <target xsi:type="Database" name="Log" dbProvider="System.Data.SqlClient" connectionString="..."> <commandText>

 
Added to my answer how I'd handle it. It'd be better to normalize the data first and then go through more logic. I'm assuming there will be changes from Code Review. Also, you could just use this in your code and use Call to run it first. — Kevin 48 secs ago
 
Zak
in VBA Rubberducking, 2 mins ago, by Zak
I'll give good odds on "VBA Developer" still being a stable profession in 2050.
 
3:22 PM
I always do it like this, but I have problem on code review in my company. — Damjan Pavlica 48 secs ago
 
1
Q: Scrape points from CTF sites

Tristan TI am relatively new to classes. This one uses one. I am pretty sure this is not the correct way to do this. But I also do not know the correct way. You can use the certified_secure function when you make an instance of crawler that has the url of hackthissite.org Do I have to many comments? A...

 
@Mast Not originally, but I don't mind if it becomes that.
If anyone wants to use it, I'll give them owner access.
The only restriction is that I can make a PR if I'm interested.
 
You should change the code review standards as it seems outdated to use the html attributes - they will only accept a pixel value so you would not be able to code responsive images — Pete 59 secs ago
 
@DanPantry Cool. I like the new out variables a lot.
 
3:53 PM
This is a topic for codereview rather than here — mplungjan 35 secs ago
 
4:08 PM
@skiwi lol
@pacmaninbw What's that a reaction to?
 
@Mast You got it on Nth Monitor
 
Yea, didn't see in time it was you who pinged me there.
Np.
 
It was tempting to vote it down. Poor guy has to maintain bad legacy code.
 
By the way, you could also ask for optimisations in your code at Code Reviewhjpotter92 22 secs ago
 
-1
Q: Libgdx | Optimize simple looping code

WyattThis code finds the next obstacle in the players path, then moves it. I am trying to make it more efficient, because it lags a bit. It does work though. There are 8 blockers, which are basically obstacles. This subtracts from the players rotation, until the rotation is equal to one of these eight...

 
4:31 PM
@Vogel612 ok done Please be merciful.
 
@Yvette clean and simple improvements. upvote applied
 
@Vogel612 ah cool. the question was downvoted and I didn't understand why. As op stated it was working. Do you know why?
 
The question is lacking context. It currently has 3 close-votes as "unclear what you're asking"
 
ooh and I answered it
ok
 
additional note: instead of the while-blocks (that you made into if-blocks) it might prove beneficial to use the modulo-operator instead
 
4:37 PM
hm yes the while loop may be unnecessary
 
I finally have a working contiguous polymorphic storage.
 
@Vogel612 how would you apply the modulus to that?
 
rotation %= 360
I doubt that shorthand exists
 
ah sorry I thought you were talking about the outer while loop
well I'm officially born to the site O>O it's good. I'm offline for nearly a week soon, but will try and pop in and answer questions at least once a week and ask when a good one pops up. Thanks for the prompt ;)
 
pleasure :)
@user2296177 wat?
 
4:45 PM
@Yvette Good to see you've joined.
@Vogel612 You know how normally, polymorphic storage's elements are individually allocated elsewhere.
 
@user2296177 thanks!
 
@user2296177 because you don't know how big they are, yea
 
That is, if we have std::vector<base*>, you have to allocate children of base and then pass in the address.
Correct.
So I made a container that does store them contiguously.
No matter what their size is.
Even if you add new types to the inheritance tree.
 
wow ... that sounds like a hack to me
 
It's not.
It's the most fun I've had with C++.
 
4:47 PM
do you need to store the sizes with the elements so you know how much to skip til the next element?
 
I store offsets.
and since I know that they are definitely children of base, I know that I can access them as such.
My current test code looks like this:
int main()
{
	polymorphic_storage<base> ps{ der0{ 11 } };
	ps.emplace_back( der1{ "aa" } );
	ps.emplace_back( der2{ "bb" } );
	ps.emplace_back( der1{ "cc" } );
	ps.emplace_back( der2{ "ee" } );
	ps.emplace_back( der0{ 13 } );
	ps.emplace_back( der2{ "ff" } );

	for ( auto offset : ps.offsets_ )
	{
		reinterpret_cast<base*>( ps.data_ + offset )->print();
	}
}
Notice how there's no new or address taking involved anywhere.
I need to make an iterator for the class, to mask reinterpret_cast<base*>( ps.data_ + offset ).
der1, der2, der3 all inherit from base. At compile time, you cannot do ps.emplace_back( 5 );
I will post the code for review once I've added some additional features.
 
♪ I've been through the desert Code Review on a horse as a guy with no name, laaaa, laaaa, la la, la la, laaa ♪
6
 
00:00 - 17:0017:00 - 23:00

« first day (1222 days earlier)      last day (2789 days later) »