« first day (1063 days earlier)      last day (3252 days later) » 
00:00 - 16:0016:00 - 00:00

16:01
Mads is on!
0
Q: Checking if a single linked list is a palindrome in C++

ThomasThe following is my first try at this classical interview question. It is quiet different from the solutions Gayle Laakmann provides in her book, and in another question on stackoverflow, someone initially mentioned there are better ways to do it. ) I think my solution should run in O(n) time a...

Kaz
Kaz
@Mat'sMug I wrote a lot there. Must be Friday ^^
0
Q: class NetBuffer - buffer specialized for socket read / write

NickThis is class for fast and small footprint buffer made specially for network I/O. It is similar to so called circular buffers, but is not circular. #include <cstdint> #include <cstring> #include <cstdio> #include <unistd.h> // read namespace net{ template<size_t CAPACITY> class Conne...

well-earned checkmark there, well done!
(I still think my code is better mwahahaha)
on an unrelated note, I just rewrote a nasty unmaintainable VBA macro involving some O(n^2) lookups, into dead-simple O(n) code
16:17
@DanPantry C++ wasn't released in the past 2 decades. It got an updated spec, sure, but the fundamentals haven't changed.
I am having a brain fart....I need to know how get the element that called the function inside the function (JavaScript)
I didn't know that was possible.
Kaz
Kaz
@Mat'sMug I'd say it has somewhat more, finesse
it's an object calling a function, you would think there is some way of pulling in data from the object that did the calling...right?
0
Q: Slim 3 - loading middlewares dynamically

user101774Recently I started playing a bit with Slim and what is making me confused is a necessity of container and middlewares hard coding. As because I am a staunch supporter of a dynamic loading I decided to write a piece of code for middlewares that suits my preferences. Considering my programing skill...

0
Q: Read group of keywords from file, modify value, store new group to variable

Martin - マーチンI would like to use the following routine in my submission script for GAMESS calculations. I am not entirely sure if this is the optimum way to go. This function would need one of the messaging routines, message, to function properly, but I decided to put echo in front of it, since this is basic...

16:23
I think I am looking at this the wrong way. I have an idea
Light Bulb
it was dark in here...
@Malachi I had that problem once in C++, the solution was very hacky.
Very.
I am creating the element dynamically to begin with, so I should be able to pass that into the function call as a parameter
💡
@Mast I am thinking this is going to be a little hacky as well, but it just might work
I basically had to either wrap everything or use globals for state. There's probably a better way.
16:27
I am out of PB&J sandwiches......
@Kaz I edited the "final code" in, too
> I would require Mat’s Excel expertise as I’ve been told he can work miracles.
^ just been CC'd on an email
looks like I'm not done with VBA/Excel
16:45
@Mat'sMug It isn't like that language is going away anytime soon, so what's the problem? :P
"what's the problem with VBA?" he said
...
^^
VBA is awesome.
'tis. when you're the one writing it. when you inherit it, it's less-awesome-ish.
2
@Mat'sMug couldn't you say that about any code?
yeah, well, VBA has its own way of being less-awesome-ish when you inherit it from a non-programmer
16:56
-1
Q: mysqldb inserting list of values into a table

Long DogI am trying to pass some values from a list into an insert statement and thought it would be straightforrd enough but I find myself wasting far too much time on this: please could eomeone explain what's going wrong here? WORKS WITH HARDCODED LIST of values cursor=db.cursor() cursor.execute(" I...

0
Q: Better way for to output an array of size 1

Jackson JacobI execute the following SQL statement to get back an data object into a variable. try { $getUser = $db->query('select * from user where user.user_id = '.$user_id); } catch (Exception $e) { echo $e->getMessage(); die(); } from this I print out the information on the page wher...

0
Q: From Q to compiler in less than 30 seconds

EdwardAs an adjunct to From new Q to compiler in 30 seconds, I've created a Python script to automatically download the markdown from any question on Code Review and save it to a local file using Unix-style line endings. For instance, to fetch the markdown for this question, one could write: python f...

0
Q: Identity repository pattern with UnitOfWork, GenericRepository and Unity

Kob_24I created an application from 3 layers, DAL, BLL, and Representation layer in ASP.NET Web API. In DAL i have 4 Classes: - DatabaseContext.cs, UnitOfWork.cs, GenericRepository and UserInfo. In BLL i have a class called UserRepository that implemnet the IUserRepository interface. In the Represent...

17:11
Parsing formulas is hard.
@CaptainObvious Needs more upvotes. It's a great idea and his second question in that series.
Could end-up to be a valuable tool for the regulars.
I could use more opinions on this question.
@EBrown You linked to an answer.
0
Q: Manipulate original DOM in React.js

hans-tAs an introduction, I would like to have my inputs validated with the built-in validation HTML5 attributes, e.g. use pattern for text input. So this is my sample code that implements that. Is it considered best practice while handling event, to access event.target, which is the original DOM, and...

0
Q: Twitch client that notifies me when a followed streamer comes online

DanI've been writing code for a little while but I'm a little slapdash. I'd like to get better so I've been having a glance at best practices, other peoples code and reading a whole lot. I'd appreciate it if you could read through my code and make some suggestions and explain why. You'll find some o...

17:32
Guy on the right makes me think of @Jamal for some reason.....
he frantically edits his tacos?
@Mast I assume you can scroll. :P
@EBrown My scroll button broke down today.
@Mast try , or reach for your mouse ;-)
It looked at the calendar, noticed it was Friday and decided to strike.
17:36
It's Friday?
4
all day
And today too
Oh crap.
I thought it was Thursday.
Don't worry, you can start over next week.
...the typical response to that isn't "oh crap"
17:37
These work hours really have my schedule all effed up.
Good news is I have tomorrow off.
So that is nice.
Oh yeah, it's April Fools.
still waiting on the RFC for this year :|
Will there be one?
there usually is
@DanLyons I hope it's a good one. I love the RFC's.
A way to fix this would be to add another field to the User object, "is_jeff_atwood", and remove the user from moderator lists if it's set to true. — 404 1 min ago
lol
17:41
@Mat'sMug I feel like that's far too specialized.
posted on April 01, 2016 by CommitStrip

A few changes at CommitStrip!We are really excited to be able to share some amazing news with you: from today, George R. R. Martin will be writing the storyboards for our daily strips. When we approached him about letting him take over the destiny of our friends Coder, Sysadmin and CTO, he immediately accepted, saying he would ‘make the world of coding his own’. George, you’re up.

2
@CommitStrip here be dragons?
@EBrown Works though.
Wrote an answer.
17:56
anyone bothered verifying the output of that code?
2
Q: Fibonacci Sequence in BrainF***

Mark WrightI have been trying to write a BrainF*** program that prints the Fibonacci sequence numbers repeatedly. I was wondering whether this is the most efficient way to do it. I basically repeatedly duplicate two cells into a third cell, and shift one cell forward and repeat. +++++[->----[---->+<]>++.-[...

@Mat'sMug I suppose 200 did before posting his answer.
yup. and I suggest you verify the output of both the question and 200's answer ;-)
On it.
WTF...
It times out my interpreter.
17:59
huh
try a better one
Better than repl.it?
0
Q: Multitenant app authorization

Dmitry NoginRole based security does not work for me well in a multitenant app, as I need to query DB to decide on permission allowance. Here the solution I came to. All implementations of this interface will be auto registered in IoC container (note covariance/contravariance support): public interface IRe...

0
Q: Primitive Twitch.tv IRC Chat Bot

XaroticSo currently I have this basic little chat bot that can read commands and can timeout users if their message contains a banned word or phrase. I was wondering how I can improve on this bot to be able to !add "word" to the set of banned words and overall general flaw improvements. import string ...

@Mat'sMug About to try it in BF#.
Ideone times out as well.
@Mat'sMug 200's runs fine ^^
Good one.
No fibonacci though :P
Well, for some values of fibo...
I'm not sure whether those numbers mean anything at all.
Found a huge bug in BF#.
@Mat'sMug VTC...lol
18:07
I didn't know Brainfuck was legal in titles, didn't Shog kill that with his filter?
I wouldn't be surprised if the filter was case sensitive.
Hey @Mat'sMug, what's the best way to do a "Save" and "Save As" feature? So that when you hit "Save" it doesn't reprompt for a filename.
(I assume you have one in RD.)
Ctrl+S and Ctrl+Alt+S
@CommitStrip Uh oh.
I'm not sure I like the way this is going. I bet there will be blood and guts in most of them now...
LOL: "Well that escalated quickly"
I'm pretty sure that if @nhgrif ever saw all my code he would have a fit.
18:24
@Malachi Still stuck?
The way that jQuery does it is like this
function someFunction() {

}

function $(element) {
  return {
    someFunction: someFunction.bind(element)
  }
}
Then you can access the element from within someFunction as this
that is interesting
you could also just pass it as an argument using bind, still, through partial application
I would have never found that. I passed in the element to the function. but I was creating the elements on the fly with MVC so I had to do a little more than just pass the element.
function changeHtml(element, html) {
  element.innerHTML = html
  return element
}

const boundChangeHtml = changeHtml.bind(null, element)
boundChangeHtml('<h1>Hello, world</h1>')
@EBrown I think I'd have some FileName property on the "document" - if it's null, and Save command runs, you need to run SaveAs - if it's not null, try a Save (overwrite the existing file). SaveAs always prompts for a filename
18:27
it's just weird because the element I wanted work done to is the element I used to call the function
oh noes my winrar expired
clicks "ignore"
0
Q: std::vector with custom growth factor

screwnutSo, yes, I know that "you shouldn't derive from std containers" but by now it's more of philosophical rule in my mind than a technical one. I've googled again for the one fundamental reason one should never-ever-ever-ever-do-that-ever-ever-ever-or-you-die but couldn't find it. So, if there's not...

took all night for one out of 7 updates to Visual Studios 2016. but I was adding all the xamarin and stuff like that too. 36 GB worth of updates
hopefully I can get XNA working before the movies tonight
19:04
@Mat'sMug I'm currently automatically generating CSV files with data one column wide. Can I somehow tell Excel to automatically fill-in the statistics I want about that data (distribution, minimum, average, maximum, etc.) using a template or VBA?
Open file.
Click magic button.
File now has stats.
=AVG($A:$A)
well, yeah but then you no longer have a CSV file
I know how to do it once, but I want to do it automagically for all files I need it on.
if it's for different files, what you need is probably an excel add-in
@Mat'sMug It already wasn't, it's a whole bunch of numbers really and the newline makes Excel put them on one value per cell all in one column, as intended.
I can modify the data stream though.
@Mat'sMug How hard would it be to write such a thing?
An add-in seems the logical choice, yes.
However, if I could somehow template it, that would work too.
not very
you could start by macro-recording it. you know what formulas you need, right?
19:10
Yea.
0
Q: NodeJS Configuration Exporter

Evan BechtolI have created a NodeJS script that I will be using to export front-end configuration details from my Zabbix installation, which will then be sent to my secondary (backup) Zabbix installation to keep them in sync. The script works, but I find myself chaining promises in a really ugly way. Is the...

19:28
0
Q: Java inheritance issue

imotebI am developing java program for web scraping. The code is too long and I can not publish it here and will ask my question using some class names. I have 4 classes. Class Main starts the whole application. Class Robot(extends Thread) has all the methods that Class Crawler1 is using .(Crawler1 ext...

@CaptainObvious poof
that was fast @200
0
Q: A "policy-based" design for a generic CUDA kernel

icurays1I am faced with a design issue that has been discussed on SO several times, the most similar question being this one. Essentially, I want polymorphism for a CUDA kernel in the form of a "generic" kernel that can apply a "user-supplied" function to every element in an array. In C++, one could ac...

Valar Codaeris - all men must code https://twitter.com/CommitStrip/status/715961677485907968
couldn't resist
Senior BrainF--k Developer --> maketime.workable.com/jobs/232182 In Lexington, Kentucky
19:39
@Malachi haha excellent!
right?
it's April 1st after all
The Best thing to come from Google since Sliced bread --> google.com/get/cardboard/plastic
@Malachi Worst April Fools since ever.
19:54
lol
TTGH!
0
Q: Shortest route between nodes c#

Imdad AliTrying to find the shortest route between two different cities. I've included what I have done below. I am not sure how to fix it and make it work properly. public static List<City> Cities = new List<City>(); public static List<City> ConnectionNodes = new List<City>(); public static st...

@CaptainObvious nope
Naruto answer; accepted non-selfie answer with 0 score: Ackermann function
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Game engine/C++11 software 3D renderer/WebGL library
Getting lots of comments on my Roslyn PR just now.
20:11
0
Q: Shortest path calculation c#

Imdad AliTrying to find the shortest path route between any two cities. Using a for loop to loop through the lists to find the paths. Any ideas how I can improve the for loop to make it work better and properly. originCity = GetUserInput("Pick the starting city: "); //e.g. Buenos Aires destCity ...

@CaptainObvious those seem related.
"ok, so I'll post the part that works but stinks"
@Mat'sMug This discussion probably needs moderator attention.
low-priority
Good question by a new user:
2
Q: A "policy-based" design for a generic CUDA kernel

icurays1I am faced with a design issue that has been discussed on SO several times, the most similar question being this one. Essentially, I want polymorphism for a CUDA kernel in the form of a "generic" kernel that can apply a "user-supplied" function to every element in an array. In C++, one could ac...

@Mast roomba'd
20:39
0
Q: CodeEval Read More challenge, C#

user101795Here is the task Click me Could somebody point out, where am I making a mistake please? I am getting a really low score, but when I try it with my text file, it seems like it's working how it should work. using System; using System.Collections.Generic; using System.Linq; using System.Text; usin...

Iterating in Excel, something I didn't miss.
0
Q: Erlang Fibonacci sequence sum

RudziankoŭI am new to Erlang and functional programming. It very hard for me to catch up with it without objects and states. I would like to sum up all Fibonacci numbers that not exceeds 4,000,000. Actualy this code doesn't even compile. Could you please comment on my mistakes? -module(erlang_task). -aut...

@CaptainObvious Borked.
@janos Reminder
The current answer on that question is rubbish IMO, but that's not my problem anymore.
April Fools, Tex style:
34
Q: What is CTAN.org now?

alfCToday I clicked in this link in TeX StackExchange http://ctan.org/pkg/svg and I got this message (screenshot below). In particular, what does it mean that "Latex Productions International has acquired the world wide exclusive rights from D.F.Knuth" !? Obviously ctan.org changed hands or somet...

 
1 hour later…
22:04
0
Q: Parsing a string as fast as possible that is using comma delimiters

CaperneoignisI have made a simple static parser for a bigger program. This parser takes a string that has comma deliminators and I need to separate the strings in to a vector for handling in a different section of the code. I would like this to run as fast as possible so the rest of the program isn't tied up...

0
Q: Conway's Game Of Life in Java

Levent DiviliogluI've written a simple demo for Conway's Game Of Life for self-practice. How can I improve the code, especially the processLife() method which traverses and updates the next state of every element in the matrix. The complete code is down below; For those who's eyes are tired of looking code her...

22:28
monking
0
Q: Refactoring tips? <WIP>

InoriI'm working on a program that generates a maximal geometric progression of at least 3 integers when given a number that the greatest value shouldn't exceed. My current code works, and it's quick(ish) with small numbers, but anything past 100 takes far longer than I'd like, as I need to calculate...

0
Q: madfasdfasdfasdfasdfasdfasdfadfasdf

Mahad AliWrite a program by using if-else statement, which can generate Grades for students depending on the Marks. Here under is the criterion for awarding Grade. • If Marks is equal to 50 → Grade is ‘A’ • If Marks is greater or equal to 40 and less than 50 → Grade is ‘B’ • If Marks is greater or e...

@CaptainObvious edited so it doesn't end up hitting smokey
0
Q: C# Connect 4 Game

user101804Hello everyone im making a connect4 game in c# and i am currently programming the checking wins into my project. i'm currently working on the horizontal wins and keeping it inside the grid array. I've managed to get the left edge inside the array when the token is dropped into the most left colum...

22:56
0
Q: c# connect 4 game wins

codeyHello everyone im making a connect4 game in c# and i am currently programming the checking wins into my project. i'm currently working on the horizontal wins and keeping it inside the grid array. I've managed to get the left edge inside the array when the token is dropped into the most left colum...

23:07
> p.s why does the mod jamal always put my question on hold?
Duplicate of | this | c# connect 4 game wins - codey - 2016-04-01 22:47:40Z
Hi, all!
Hey there @Edward
@Quill I think that pigeon left an "Error Message" on my car earlier today.
I'm just a few short of rep-cap for today and thought I'd pimp an answer or two. Like this one
0
A: C++ Address Book (2nd follow up)

EdwardThis code is greatly improved! Well done. Still, there are some things that may help you improve your code. Don't overspecify member functions Within the Address_book.h file, the member functions are declared like this void Address_book::resize(size_t entries); void Address_book::sort(); B...

23:37
31
Q: Is my SO Coffee Mug defective?

Kit Z. FoxI received a really nice SO mug as swag for the choose your own swag contest this year. Everything was working fine until this morning. Was there a patch or update or something? Here's the relevant code snippet: if (owner.isCoding() && mug.isEmpty()) { mug.fill('coffee'); } Here's a scree...

@Mat'sMug ^
April 1 is my favorite holiday.
Mug is very much instantiated, OP has it in their hand. And mine even reviews code. — Mat's Mug 9 hours ago
oh lol didn't even see it
I'm very tempted to write a bot that listens to every chatroom for "is it coffee time?" and responds "YES!"
My beer glass recently suffered from a similar defect, but I'm hoppy to say it's been addressed.
let's hop it doesn't start to affect my beverage containers of choice...
like barrels
23:45
a barrel full of coffee sounds fatal
who said we're talking coffee here? that'd have bean a problem
hmm... yea those are gruesome...
Welcome to the 2nd @charles.milette btw
1
Q: DBSCAN in C++ for general and Android use

BenI've implemented a templated DBSCAN for general use. At the moment, it's going to be used on Android through the JNI. I used Wikipedia's pseudocode and a little bit of the DBSCAN paper for reference. It's pretty naive, so I'm wondering how I can speed it up, and what I can do to make it perform r...

hello
the code as supplied by the user was incorrect...
does it work now?
does that fall into the 'off-topic' category? Normally I'd think 'yes', but in this case I'm leaning towards 'no'.
00:00 - 16:0016:00 - 00:00

« first day (1063 days earlier)      last day (3252 days later) »