« first day (1181 days earlier)      last day (2829 days later) » 

11:01 AM
0
Q: Implementing a string class in c++

JagannathThis is more about an opinion based question than code review.Please feel free to close down if it's not an appropriate question or doesn't belong here. Recently I attended an interview for a C++ position in a very reputed bank. The interviewer started off by asking me to implement a string c...

 
Zak
11:21 AM
I actually have a reason to use regex for once. Need to validate folder names are conforming to convention.
Where the convention allows anything from
"[Surname], [Firstname]" to
"[Surname] ( [misc] ), [Firstname] ( [Misc] ) & [Firstname] ( [Misc] ) ; [Other Surname] ( [Misc] ), [Other Firstname] ( [Misc] ) & [Other Firstname] ( [Misc] )"
 
0
Q: Make Quicksort doing fewer comparisons using first element pivot

Floating PointI'm trying to get my Quicksort implementation doing fewer comparisons. The first element is used as a pivot. Could you give me some directions if there are any places that should be optimized in a sense of making fewer comparisons? As I understand, it's due to a redundant recursion pass, since th...

 
11:35 AM
0
Q: Html rendering framework for emails

t3chb0tSometimes I need to auto-generate html-emails. To make this task a little bit easier I created a simple framework that takes care of renderinghtml. Because I'm mainly interested in generating html for emails the framework adds styles only via the style attribute. Although the code is several hun...

 
Zak
11:49 AM
Turns out, validating a file system structure is a lot more complicated than I thought it would be...
 
haha
 
who is the Mod online at the moment?
 
Quill?
 
CR Mod
 
^^
 
11:53 AM
I forgot that there was 5 mods
 
yeah.... was gonna say
 
could be Janos or Simon....
 
Check their 'last-online'.
Reminds me I still got to write an automated way to check that...
 
Janos then jamal
 
@Janos should I leave my comment for the time being?
 
Zak
11:54 AM
jamal, janos, simon in the last 15 minutes
 
@Jamal is online?
Simon's say last seen an hour ago
 
is it urgent?
 
not really
 
What do you need a mod for anyway @Malachi? Just leave it here, or if it's too private, raise a mod flag somewhere.
 
I had a comment removed and also left a comment for the user
so I wanted to know how long I should leave my comment for
the flag was handled rather quickly...
 
11:57 AM
Flags sometimes get handled within seconds here, yea.
Lightning fast mods.
 
The comment was deleted and mine remains. hoping that the user sees the comment.
 
Just leave it for a while till you're almost sure the user has seen it.
 
I need more coffee
2
I have to do.....QA Documentation
 
possible answer invalidation by Bassie on question by Bassie: codereview.stackexchange.com/posts/136166/revisions
 
@Duga Rolled back.
 
12:01 PM
@Malachi You need more rep
 
@N3buchadnezzar I meant at work
 
Yeah. Doubt work has a reputation system. That would be interesting to say the least
 
I wouldn't have much here....
yet
 
@N3buchadnezzar bonuses?
 
Since when do those work as intended?
 
12:11 PM
just discovered git sendmail. why is git so awesome?
 
Why would you want git to send mail?
 
in the case of our org currently the bitbucket server is in a state of flux
 
git fire is more awesome
 
but our email is always up
so you could send a patch file of a range of commits to other users
you'd have to be very careful, obviously, but it's cool to know it exists
 
@skiwi How does that work?
 
12:13 PM
$ git fire is not a command
:(
 
@N3buchadnezzar It instantly fires the user on the spot and starts a fire in the server room
3
 
Monking!
 
@DanPantry Sending patches by e-mail? That's backwards.
 
The second part is more or less of a side effect
 
@Mast its how the git world worked before hosted repositories ^^
 
12:14 PM
Before internet...
 
Send the patch per post.
 
@Mast lol
print out the patch and send it via snail mail
 
And you think I'm making a joke.
 
12:15 PM
Diskettes. A4 papers.
Copying code went by manual labour.
 
Alright, granddad
:p
 
lol
I'm not that old. Just a dinosaur.
 
@Mast You are not getting a star for that :p
 
Sure?
Aug 25 '14 at 17:14, by Pops
Wow, this really is a star-happy room.
We got so many stars, the universe is envious.
 
where is the Meta post I need here?▼▼▼
@Malachi Great I made it a wiki - is it reasonable to accept this as the answer when available, as it is basically all the other answers rolled into one? — Bassie 39 secs ago
 
12:22 PM
@Malachi huh
 
@Malachi There's no point in doing what he proposes.
Why doesn't he just post a follow-up?
 
15
A: Self-accepting own answer when competing answers exist

janosThere's nothing wrong with self-answering a question. There isn't even anything wrong with accepting your own answer if you review your own code and provide new insight that others haven't. The problem is when your selfie is not actually a review. If you just implemented the advices given in one...

 
Hint: for working code, turn to codereview.stackexchange.com ... and please: improve the formatting. You expect us to read your 50+ lines of code, understand it, fix its performance problem; and you don't even find the time to use the "preview" to ensure your source code is formatted for human reading? — GhostCat 16 secs ago
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.com — GhostCat 30 secs ago
 
1
Q: CodeKata: Find all the runs in the set

jlvaqueroGiven a finite set of unique numbers, find all the runs in the set. Runs are 1 or more consecutive numbers. That is, given {1,59,12,43,4,58,5,13,46,3,6}, the output should be: {1}, {3,4,5,6}, {12,13}, {43}, {46},{58,59}. Note that the size of the set may be very large. This implementation seem...

 
Could use some "reactions" on this Github comment of mine: github.com/cmusphinx/sphinxbase/issues/…
@Mast I'm trying to avoid the overhead of installing all those dependencies myself ^^
If he doesn't reconsider, I may have to look for a new offline speech recognition engine.
 
12:34 PM
That would be bad.
By the by, where did you get your MinGW w64? The official site only supports w32.
 
@Mast Well the alternative is installing 6+ dependencies and adding at least 10 minutes to the build time
@Mast I have a link in the README, one sec
 
@syb0rg That 4.0.6 links to a tar.gz without binaries.
Which indicates there's a lot of nix going on and not a lot of win.
 
I'll make an edit to the README real quick
 
No binaries in there either.
You aren't insinuating the build tool has to be build first?
 
12:39 PM
I could simply run it in VS, but that will probably screw up a lot of other things in return. So I try to find out what you pulled :-)
 
@GhostCat Just because the program works doesn't necessarily mean that it needs to be migrated to codereview... — assylias 43 secs ago
you need to use linq or lambda expression for it Check these link: stackoverflow.com/questions/3183626/…; codereview.stackexchange.com/questions/105336/…Pankaj Gupta 54 secs ago
 
@Mast I just ran a simple installer... I thought
Now I just have to relocate it
 
lol
I may be stupid, but I haven't found that simple installer in the zip :P
I expected a msi.
 
I couldn't have built it on my machine, so I know I installed it some other way
@Mast Yeah, thats the installer ^
 
Running.
Now I hope I got the parameters right or I'll have to do this another 3 tmes.
 
12:47 PM
@Mast You clicked on the MinGW link in my readme initially, right?
 
Aye.
 
Okay cool, this will be a good correction for the future then
@Mast Make sure the arch is 64 bit
 
There's a limit to method size. IDK if there's something else limining that number but you'll probably be lynched by angry code reviewers before reaching that limit... — fabian 13 secs ago
 
Threads don't matter I don't think... I forget what I put it to
 
You could try posting your code on Code Review and tagging it with performance. — gcampbell 35 secs ago
 
12:52 PM
> CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as

cmake_minimum_required(VERSION 3.6)

should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project.
Just a warning, but still, wanted to notify you.
 
@gcampbell This would only be a valid Code Review question if he had JavaScript code to review. Right now it is just some HTML, which he is asking for code to transform from one to the other; if this question was asked over there in it's current form it would be off-topic. — syb0rg 34 secs ago
 
@Mast Huh? I do have that
CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
 
Don't shoot the messenger.
 
pew pew
No, not your fault
But I would like to know why it's saying that... silly build system
@Mast It still completes the setup?
@Quill We're next to each other on the SO rankings: stackexchange.com/leagues/1/week/stackoverflow/2016-07-24/…
 
code reviewers invasion
Quick question as I'm not used to posting in this tag:
If I've got a setup script in Bash, do I need to include the related stuff?
As in, it calls some node scripts, installs packages, etc. This is the file: github.com/The-Quill/StackNews/blob/master/setup.sh
 
1:05 PM
@Quill Code Review or Stack Overflow?
Stack Overflow no one cares
 
here <_<
I'm used to posting literally all my code at once
 
Code Review, post the more relevant (tend towards popular) tags relating to the code. If they need to be changed, then a mod will usually do so
 
I wasn't asking about tags <_<
 
Oh, I get the question now :P
Uh, include what you want reviewed :D
@Mast How's the build going?
It notably takes longer to build on Windows than Unix, but I also have a shitty Windows machine
 
0
Q: PHP MVC Implementation without a framework

FrancisI've been using PHP for years and in every project I've ever done I've included the HTML, PHP, SQL etc ... in the same page. Upon looking through Github at large projects like Wordpress and MediaWiki it appears there are much better ways to lay out your code. I want to use MVC for my next project...

 
Zak
1:12 PM
@Mat'sMug Wow. I did not know VBA had FLS
 
@syb0rg Why not dual boot?
 
@N3buchadnezzar Hm?
Oh, with my Mac?
 
I don't have that much disk space (only like 30Gb free)
 
Ah, thought W7 / W10 took less space than that
 
1:14 PM
captain pls post my pretty face
 
@N3buchadnezzar It does, but you have to partition a set amount for the OS and if I have a Windows machine already with plenty of space I figured it wasn't worth the trouble
 
@Quill *Captain Slowpoke
 
@Quill Updooted
 
<3
 
@syb0rg you sound very entitled there. .. You maybe could try to implement this yourself and open a PR. I think that's more likely to be accepted..
 
1:17 PM
@Vogel612 I can edit it, any part you had in mind for me to reword?
Oop, nvm it was locked
 
@Quill Do you only want the bash reviewed
 
well yeah
 
2
Q: Server setup script for Redis, HAProxy and Node.js

QuillI wrote a pretty basic setup script that handles most of the setup for a Three-server solution. The solution and setup file are available on GitHub The three servers are Redis, HAProxy and Node / Cron. All three options handle only solution specific stuff (not including installing the framework...

0
Q: Re-Ordering the draw order for my entities in my Isometric game

Jammeh CarrIntroduction I am making a 3D Isometric game. I have a Tower, filled with Block's in a 3D Tower map, which is made of nested ArrayList's, And Entity's which roam free in my game Not bound to a tile I have no tile system in my game. To create my isometric projection, I use Graphics2D g2d.rotate() &

 
@Zak more useful for UDT's and writing to binary files
The example doesn't do justice to the feature
 
@syb0rg If I use the CMake GUI, I get everything set-up but make doesn't find anything to make. If I use the CMake CLI, it fails for not knowing what build tool to use. I presume the -G isn't enough indication or something, I haven't used CMake on Windows since forever.
 
1:24 PM
@Mast Hm, do you have MinGW-w64 in your path?
 
I vaguely remember setting it in PATH. Let me double check that.
 
I may have had to fiddle with my PATH, another step I should add to the instructions
 
My PATH is definitely getting a bit long, I should probably fix that as well.
 
@Mast Hm, I'm able to build it with the GUI
Config and generate with the GUI, run make in CMD
 
I blame Windows for messing with my PATH.
 
1:29 PM
I blame Windows for having a PATH
Unix does just fine without it
 
@CaptainObvious hi there
you look familiar
 
@syb0rg windows path truly is awful
it took them until windows 10 just to add a decent ui for manipulating it/other environment variables
 
Don't even get me started on DLL's
 
Fails on building sphinxbase.
Can't find MSbuild.
 
1:35 PM
@Mast Wat
Oh
 
I magically expected it to find that since VS is already installed.
Guess I was wrong.
 
@Mast Do you have the VSC++ stuff installed?
 
IIRC I got the full crap installed.
VS 2015.
 
Zak
My latest CR Question http://codereview.stackexchange.com/questions/136192/validating-filesystem-structure
"This feels very hacky. It's a 6-level nested For/If Loop. There must be a better way."
 
If this works, it belongs to codereview.stackexchange.comDogbert 8 secs ago
 
1:38 PM
@Mast I thought it comes with it
Oh, it's the build tools it comes with: microsoft.com/en-us/download/details.aspx?id=48159
 
@syb0rg I have 25 instances of Microsoft Visual C++ 20xx installed.
Should be enough, no?
 
I certainly hope so
 
It's MS, you never know...
Well, heck, let's install more crap.
2
 
1
A: My Brainfuck interpreter in F#

Foggy FinderLet me make a few comments: 1. F# has a good system of type inference. You don't need to specify the type explicitly, the compiler in many cases will do it for you. You can read more about it here. 2. In function getValue. Usually, matched with None|Some value: match Map.tryFind position memor...

 
@Mast Did you click on the MSBuild link in the readme?
If so, I should make it more helpful
 
1:43 PM
Every reboot introduces more bugs.
 
@Mast Reboot?
 
@syb0rg That gave me a wall of text.
@syb0rg Yea, after every installation you need to reboot or Windows has no clue what you're doing.
Standard practice.
 
@Mast cus of window's dumb file locking
 
Now make is complaining again while it wasn't 5 minutes ago...
 
make me a sandwich
 
1:45 PM
3
Q: Validating FileSystem Structure

ZakI have a File System. It is *supposed* to be laid out / used / added to in certain ways. This is a program to report on the *actual* state of the file system versus what it's supposed to be. In particular, pick out unexpected folders and (eventually) validate that Client Folder Names follow a ...

-1
Q: MusicBox design

almogI need to model a music box that play songs, have a playlist etc. Is this design seems ok? using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace NET.Modeling { public class User{} public class MusicBox { CDPlayer CDPlayer; User User; List<CD>

 
Crap like this is exactly why I develop on Ubuntu instead of Win.
Or OpenSUSE, or whatever I have around at the moment.
 
@DanPantry Zap you're a sandwich
 
OpenSUSAME?
 
98
A: Installing MSBuild 4.0 without Visual Studio 2010

FrederikIf you're looking for msbuild, you'll find that for 4.0 it's at: For 32-bit: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe For 64-bit: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe

 
@syb0rg The other link you gave me linked to an installer, so that was fine.
 
1:46 PM
@Mast Ah, good
 
Anyone want a Stack Overflow mug, or perhaps a Stack Overflow t-shirt?
 
@DanPantry sudo make me a sandwich
 
Make is failing and I have no clue why. Oh joy.
Can't find makefile.
Keep looking!
 
@Mast Did you do the generate?
 
1:49 PM
dots have to be escaped in a jQuery selector
why?
 
@syb0rg Configure + Generate, I know how CMake works :P
 
@JeroenVannevel because dots are CSS selectors for classes?
 
@Mast I don't doubt you, just going through the debug "script" I have
 
@Zak I guess I'm just good at stating the obvious.
 
@syb0rg Output
 
1:50 PM
Like all of those IT help center people
 
@Quill Something seems off there... Not quite sure what
 
even for stuff like conn.display.qa
 
@Mast From GUI or CLI?
 
that's not a valid CSS selector, is it?
 
1:50 PM
@JeroenVannevel feel free to use XPath
@JeroenVannevel don't think so
 
Oh, you aren't using the MinGW Makefiles option
 
Wait, why isn't it using MinGW...
It was doing that 5 minutes ago.
 
Every year, in the summer, I think it is about time to upgrade my fileserver at home....
 
Stop changing my settings...
2
 
panabox:~> uptime
 09:50:16 up 346 days, 13:50,  1 user,  load average: 2.11, 3.34, 3.32
 
1:51 PM
lol
 
@rolfl I'm sad that it's not named bananabox
 
Am I correct when I say that const connDisplay = $('#conn\\.display\\.' + connectionName)[0]; won't let me use jQuery functions on that element I found? What's the best way to do that then?
 
heh, the name pana is significant....
But, panana would have been cool
 
I would buy a panana, heck I might even buy two.
 
@JeroenVannevel yeah, [0] gets the actual DOM item (not jQuery wrapped), try using eq instead
 
1:53 PM
Oh, magically the CLI CMake started to work.
 
Zak
@pacmaninbw Yeah. Believe me, the whole time I was thinking about this, I was trying to figure out a better way. And, well, I can't think of anything. Well, anything that isn't vastly more complicated.
 
@Quill The alternative is wrapping another $() around it, right?
 
yeah
 
@syb0rg Output
 
@Mast :(
I'm assuming it can't find sphinxbase.sln
 
1:56 PM
That's what I assume as well.
 
Can you try to locate that in the build/lib/sphinxbase folder? If the download succeeded then it should find it
 
File is perfectly there.
Perhaps it fails because I'm likely using platform 150 instead of the expected 140.
 
@Mast Hm, you could try setting that and see what happens
 
3
Q: Check if a number ends up being a palindrome when added to its reverse

Farhan.KFor example if I start with the number 146. I first reverse it, so it becomes 641. Then I add this to the original number to make 787 which is a palindrome. I would repeat the process if the answer is not a palindrome. I made this program show how long it ran for when it finishes or is interrupt...

 
@syb0rg No joy.
 
2:06 PM
@Mast Damn... I don't know how to make that more portable either
I'd need some CLI wizardry
0
A: Check if a number ends up being a palindrome when added to its reverse

syb0rgA few notes: A more pythonic way to determine if a given value is a palindrome: str(n) == str(n)[::-1] You do something similar in your code, but are converting from a string back to an int. This is more readable to me. Use the palindrome test as a check with the while loop: while str(n) !...

 
@syb0rg I suspect PATH, again.
Except I have no idea where Windows put the MSBuild files. C:\Program Files\MSBuild is surprisingly empty.
Well, not exactly, but nothing sensible to be found there.
 
possible answer invalidation by asibahi on question by asibahi: codereview.stackexchange.com/posts/136036/revisions
 
@Mast I think I was using VS14 2015 for the build? You have that installed, correct?
 
2:23 PM
@syb0rg I have VS 2015, yes.
I think it's simply not finding MSBuild. Since I don't know where it got installed either, I'll have to find that first.
Windows is not a great system to find things.
@syb0rg This might be related, scanning the register now.
Just don't choose Welsh. Everything sounds stupid in Welsh. — Aron yesterday
 
possible answer invalidation by Dawny33 on question by Dawny33: codereview.stackexchange.com/posts/136169/revisions
 
Hello
anyone there
 
@asibahi Hello, sorry I was meeting with someone at work
What's up?
@Duga Okay
 
yeah I am just wondering about making the code self containing thing
 
@asibahi What do you mean "self-containing"?
 
2:37 PM
@forsvarir About this, you realize we got a tag for ?
 
i was using types that are not defined in the question
so i added them in
 
@Mast It's not a great system to develop for either... I might just make a binary and distribute that
 
Since it's Windows, I think most can live with that.
 
why is this chat called the 2nd monitor
 
@asibahi I'll revert back to the edit you made, but please don't edit code in the future after a review. The only reason this is okay now is because the answer you have don't mention it
 
2:41 PM
C:\Windows\Microsoft.NET\Framework\v4.0.30319
 
@asibahi It's the place it lives on for most of the regulars here, we do work on our first monitor and chat on our second monitor
 
Oh, there it is.
 
ok thanks @syb0rg
 
@asibahi Sorry for the confusion!
 
i understand the intention behind the rule but i believed my edit was within reason
 
2:42 PM
@asibahi I agree, after taking a look at the answer
 
This seems more like a codereview.stackexchange.com question. — jaco0646 20 secs ago
 
anyway. thanks
have a nice day
 
If it invalidates, it's not allowed.
If it doesn't, you can.
 
@asibahi Not gonna stick around? :P
 
need to get breakfast
 
2:43 PM
Aw, you just made me hungry
 
:D
 
Incoming C question, off-topic?
 
0
Q: Avoid hard-coded format strings in C

Woodrow BarlowIn C, we like to use #define or const globals to avoid hard-coding values and strings. How can we avoid hard-coding strings that need to be formatted? Consider, for instance, a filepath to an i2c bus in linux: int format_i2c_bus(char *dev, size_t size, unsigned int bus_no) { return snprintf (...

 
Scratch that, move it to Programmers.
Ugh, caching.
 
@Mast Back on track, or still broken?
 
2:52 PM
I'll reboot in a couple of minutes. After that I'll see.
 
Off topic because it should have been posted on Code Review SEMatias Cicero 1 min ago
@Matias just because the question mentions "code style" doesn't mean it belongs at Code Review. — CodeCaster 16 secs ago
I don't think that this question would be a good fit for Code Review, as OP's specifically asking a question: "I want to be able to change X in my code dynamically, how do I do that?". He/She's not asking "That's my code, do you find anything I can improve here?" — Henrik Ilgen 18 secs ago
 
0
Q: Is the format of this PDO mysql statement correct

mp252I have been writing simple php programs, trying to adhere to the PSR standards, for writing code. However they do not seem to have any standards for writing mysql PDO statements in. For example I have written the mysql statement; $sql = "INSERT INTO `users`( `name`, `phone`, ...

 
@Duga Noice, SO users fighting for the good of CR
 
@CaptainObvious Poof.
 

« first day (1181 days earlier)      last day (2829 days later) »