« first day (1528 days earlier)      last day (2503 days later) » 

12:02 AM
@Schwern we can already use our code review tools to see why code was written in a given way. That will include not only the incorrect/unreviewed code, but also all comments written by the reviewer AND the writer. That seems a much better source of info for answering the "why" question. Then the "how" question can be answered by just looking at a clean history that shows the effective code changes that were pulled to master. Just my 2 cents.. — roim 53 secs ago
I'm voting to close this question as off-topic because it is not a programming question. It belongs on Code ReviewG5W 19 secs ago
 
0
Q: C: Chroot implementation is segfaulting

Sreehari SreedevI have written a chroot implementation in C to further understand Linux system calls. So far, here's my code: https://gist.github.com/sreehax/c555f3342ee31ebab3bb9e4fe7ca10cb When i try to chroot into a directory and run busybox, it segfaults. When i use the regular chroot command to do the same ...

 
12:25 AM
-1
Q: tkinter button not displaying output - Unable to determine why no results. Code shows no error

Abraham ValenciaTkinter widget not displaying output in the label - Unable to determine why no results showing once I press the calculate button on my widget. Code shows no error. Any advice? maybe I am not doing the calculate function correctly or missing something. Are my variables not actually getting the use...

 
12:53 AM
0
Q: Shopping Cart in pure javascript (already 100% complete)

Thomasi need help in making this shopping cart adhere to the W3C rules. This is already 100% functioning. I just need help in making this code as clean and as short as possible. I want it in pure Javascript and not on Jquery. I heard that you can use DOM instead of innerHTML. I've used innerHTML since...

 
1:07 AM
0
Q: Walking Git History

RubberDuckI've recently taken an interest in analyzing commit history to find files with a lot of churn. The idea being that high churn files are likely targets for refactoring. Right now it's a simple console app that returns the number of times a given file was committed. (Renames are not currently follo...

0
Q: C# - Shorter way to get current Opened File Version?

user143026FileVersionInfo.GetVersionInfo(typeof(Program).Assembly.CodeBase.Replace("file:///", "")).ProductVersion That code, is a one-liner, but has quite a lot of steps for it to return the File Version. Is there maybe a AppDomain way to get the File Version?

 
1:37 AM
0
Q: Multi-threading the Chudnovsky algorithm with a task system

tuskiomiI've tried my hand at creating my first task system that hands out simple tasks to threads for asynchronous computing. As a warm up, I've decided to use the Chudnovsky algorithm. My method of doing this is via a very simple object called a 'computable payload', as seen below public interface Com...

 
 
1 hour later…
3:00 AM
possible answer invalidation by Jamal on question by InfinityStream: codereview.stackexchange.com/posts/168759/revisions
 
3:20 AM
0
Q: Validate data in spreadsheet checking for errors

Ashton MorganGood day. I wrote this sub in Excel VBA. I am a novice, but I was able to get my code to work how I wanted it to. Unfortunately, I can see there is a lot of repetition, but it is too complex for me to figure out how to extract the duplicate if statements. I am sure there is a lot of other...

 
 
1 hour later…
4:27 AM
Monking
 
5:04 AM
Hello. :D Anyone still online? I need some help that should hopefully be quick and easy.
 
5:49 AM
0
Q: apply user inputs to code

hemant _Let's say user gives me an input 1,2,'>' and I want to operate third argument in between first and second and return the result for example in this case it will be false as 1 > 2 is false. In python I tried using eval like this: eval('1'+a+'2') Buts its quite hardcoded and have to convert the ...

 
 
1 hour later…
6:55 AM
possible answer invalidation by janos on question by Rahul Shivsharan: codereview.stackexchange.com/posts/167469/revisions
 
0
Q: Separating presentation from data

CodeYogiI am making a web component which shows data from two different entities Merchant and Address. A merchant can have multiple offers. I am developing a web application and writing a custom component which show offer details like title, description etc. I also need to show merchant thumbnail in the...

 
7:10 AM
possible answer invalidation by Deyan Georgiev on question by Deyan Georgiev: codereview.stackexchange.com/posts/168775/revisions
This question belongs on another site in the Stack Exchange network Code ReviewSatpal just now
possible answer invalidation by globalturist on question by globalturist: codereview.stackexchange.com/posts/167176/revisions
I'm voting to close this question as off-topic because it should belong to codereview.stackexchange.comPatricK 22 secs ago
 
7:53 AM
@Satpal Not necessarily. OP is looking for a specific solution to a specific problem. On Code Review, the result may very well be a longer line of code for readability purposes. — Mast 6 secs ago
@PatricK No! OP is looking for a change in functionality. That's an unacceptable question at Code Review. Please read their help centre before making such a recommendation again. — Mast 50 secs ago
 
8:07 AM
Is this a question for Codereview? Because you have a working piece of code, but would like to improve it. — Ludisposed 19 secs ago
 
0
Q: Please help me tweak the code. VBA

Jem EripolGood day everyone, I found this code in the internet and i want to use it. The current output is too long to be read esp when number of output exceeds 100. It shows cut part one by one so it takes too much space in screen.. I have been looking for programs in the internet but i cant find anythin...

0
Q: Tokenize a binary stream

graham.reedsThis is my code to extract values from a binary stream. I am fairly happy with it, the only thing I can think should change is the fact it throws if there is an error. The only option for failure is boost::optional (limited to C++11 by target platform). struct Token { enum TokenClass {...

 
possible answer invalidation by globalturist on question by globalturist: codereview.stackexchange.com/posts/167176/revisions
 
8:55 AM
0
Q: Simplify generic method helper

ShaamaanI was tasked with creating a sort of "smart read-only" repository decorator which, using a "mock, in-memory" repository and a "real" repository allows the user to try and do things without actually affecting data in a database while still being able to read said data. The implementation of this ...

 
9:11 AM
0
Q: create the GradeBook Program

Trang TranCreate a Grade Book class that contains instance variables for the course name, number of credits, room #, and student capacity. Create mutator/accessor (or commonly known as getter's/setter's) methods for each of the instance variables. Create a driver program that creates a grade book and pres...

0
Q: Inherit from Dictionary or create my own class with a dictionary

VansFannelI'm working C# on an exercise that is it very strange. I have these three classes. public abstract BaseClass<T> Where T : BaseClass<T> public class Class1 public class Class2 : BaseClass<Class2> On the exercise there is this strange declaration: var dictionary = new Dictionary { [class1] =...

 
9:26 AM
0
Q: Too much public methods and bigger protocol

D4ttatrayaI have an messaging app I am working on where I am using 3rd party messaging library to send and receive messages. It also allows to retract whole conversation with particular contact or retract particular message. To decouple library from my app I have written MessageService and structure is lik...

 
 
1 hour later…
10:39 AM
0
Q: Simple PHP pagination not working properly

Oke TegaI have a search query that shows results from database and should paginate the results. But the pagination function is not working. The page shows the search results but when i click on link to the next page, it still shows the same result and i noticed that the results are not shared across the ...

 
11:01 AM
I've read this question a couple of times, but it still isn't entirely clear to me what you're asking. Why can't you just use Vector3? What specific question do you have about the code you posted? Do you just want it reviewed? — Cody Gray 35 secs ago
If your question is not about a specific problem, it is definitely off-topic for SO. Currently, it is just far too broad. Questions about best practices are more suited to [codereview] or [softwareengineering]. — ekhumoro just now
I'm voting to close this question as off-topic because it seems to be asking for a code review, which is off-topic here. Try codereview.stackexchange.com or rephrase your question so it is actually asking something that is on-topic. — Mark Rotteveel just now
 
11:18 AM
@CaptainObvious Broken.
 
@MarkRotteveel In it's current form, it wouldn't be a great question at Code Review either. But it could work if cleaned up. Author is recommended to take a look at their help centre. — Mast 45 secs ago
 
@200_success Should we add 'not working' to the title filter?
 
11:33 AM
0
Q: Extracting all the data from a javascript encrypted table

SMth80I've written a script to harvest all the data out of a table from a webpage using python in combination with selenium. It takes a while to parse them all. There are seven steps to hurdle to get to the target page. The search criterion for the table is "pump". However, when the table shows up, the...

 
Greetings, Programs.
 
11:49 AM
Greetings.
 
12:04 PM
0
Q: Threadsafe static initialization of ExecutorService

SteveI am trying to create a threadsafe singleton class based on Initialization-on-demand holder idiom . Here is my code public class Check{ private Check(){ } private static class Provider { static final ExecutorService INSTANCE = new ThreadPoolExecutor(5, "read this va...

 
12:23 PM
Try storing operands and operators inside an array and traverse it. Also, this look like a question for Code ReviewPelocho 37 secs ago
 
Kaz
Monking
 
Monking
 
Monking
 
12:47 PM
Editing code sounds like a potential better fit on CodeReviewSE. — Lexi 23 secs ago
 
Hello, all!
 
0
Q: Custom Lightbox

Martyn Ballcould some review my lightbox plugin. I have created a codepen here for you to see the code in action. It started out pretty neat but I think the code get slightly messy, just looking for some general advice on how to improve upon this next time and maybe in the next version. It has got a cou...

 
1:01 PM
Monking All!
@Edward Do you have much experience with MFC and Visual Studio 6 C++? I've got a project with functions as large as 314 lines of code that I think needs to be refactored.
COM
 
@pacmaninbw I have lots of experience with C++, but neither MFC nor MSVC++. Generally, I work with Linux and/or embedded.
 
@Edward that would be my preference as well. I originally worked on SunOS (BSD 4.2) and Solaris (System V).
OK thanks.
 
All I remember about MFC is that the last time I had to use it, the experience was deeply unpleasant.
 
0
Q: OleDbContext to keep OleDbConnection alive

t3chb0tI'm writing some automated tests that read and write data from/to excel (so end-users can define their test cases themselves). I use dotTratce to optimize the algorithms and found that the worst bottleneck was writing to excel. It turns out that OleDb does not have connection pooling and opening/...

 
@Edward This past week I've been searching for a bug that caused the product to crash, it doesn't crash when it's compiled for debug, only in release format. Found it Saturday, index past the end of the array by 1 location.
In the function with 314 lines.
 
1:10 PM
@pacmaninbw Is there an associated automated test suite?
 
No, but there will be soon.
 
Smart move.
 
@pacmaninbw Always those off by one errors nagging about.
 
I fixed all of the off-by-one errors in my code, so now I have -1 left.
14
 
@Mast :) Programmer started his loop at zero, but then stopped at size of array rather than size of array - 1. The nasty part was finding where in the library it was happening since I couldn't use the debugger. The code is now twice as large due to all the logging messages.
 
1:25 PM
@pacmaninbw But all your logging messages are easy to trace so you can throw them all away with Ctrl + F, right? Right?
 
@Mast Visual Studio 6, originally released in 1998(I think) Last update released in 2004, no longer supported by Microsoft. I doubt there are friendly features like that. :) I could be wrong. We can delete the log files.
 
0
Q: Adding and Deleting in ES6 Javascript Alone

ThomasI need help in making this as short as possible and it should follow the latest ES6 standards. It it already 100% working. But I need help because i want to follow the best practices in using ES6. The code is a little bit long and messy so maybe you can help me edit my code to make it short and c...

 
@Edward I like that one, one -1 left. :)
I'm writing a proposal to refactor all the functions over 60 lines of code right now.
 UpdateRecipe               223
 CreateRecipe               218
 GetCookbookWithRecipes     208
 GetRecipeBySerialId        197
 UpdateCookbook             144
 GetIngredientList          130
 CreateCookbook             120
 PropertyListToJson         314   Where we found the off by one bug.
 ParseRecipeFromJson        116
 
@pacmaninbw No, I mean, Ctrl + F all the functions you used for logging purposes. Notepad should even be able to do that, assuming you named your functions correctly.
 
1:44 PM
@Mast Sorry, I'm not following, can you give me a link to some documentation?
No control over existing function names.
 
@pacmaninbw I think Mast just means that if you named all of the debugging functions something like "Debug_xxx", they'd be easy to search for and easy to delete.
Or to #ifdef out.
 
Yes, they all start with logFunction.
I'd put all the current code on CodeReview to get reviewed, but it's proprietary.
And it's very ugly.
 
I remember cleaning up an ugly project many years ago. I wrote test functions to make sure I understood how things worked.
Then I added comments in the code documenting how the functions worked.
Then I threw away the original code and re-coded to match the comments.
4
 
If the code works as intended, you can get a thorough peer review with feedback on any/all aspects of the code on Code Review. — Mat's Mug 40 secs ago
 
2:03 PM
1
Q: Checking if a tree is balanced

zwyI'm trying to implement balanced tree checking by python like following. # Balanced tree definition: # if tree's left and right sub tree are balanced, and their height difference is not bigger than 1, then the tree is balanced else not. class Node: def __init__(self, val): self.lef...

0
Q: Running SSH commands on multiple servers

MayubeAt the company I work at, we have no real way to quickly execute shell commands on all of our customers systems, which often results in what we call Tiny Tim tasks, where the list of all of our systems is split between the 5 devs we have, and we simply go through one-by-one, SSHing into each one ...

 
@Edward Exactly. Or a comment behind the functions mentioning // debug or whatever.
 
2:17 PM
0
Q: compile time template bernstein polynomial

dgratI wrote a compile time bernstein polynomial instead to define several functions for different coefficients. I wonder whether there is a way to make the function faster. std::powf is known to be relatively slow and the binominal coefficient is for some cases 1. Also style fixes are appreciated. ...

1
Q: Add To Query Based Off Date Picker Or Drop Down List

BellHopByDayAmetuerCoderByNighI have a page where the user can either input a start date and an end date into two date fields, OR the user can select 10 days, 20 days, 30 days from a drop down list on the page. My php/html knowledge is very basic and I have the syntax set-up like such which works, but there is probably a mor...

 
Thanks for the discussion, talk to you all later.
 
monking @all
 
2:32 PM
0
Q: Decreasing complexity of loop & Find- VBA

JordanI have written the following code; both Sheet 1 and Sheet 2 are rather big sheet with lots of data. Run this Macro is extremely time comsuming ( It has a high complexity I guess). I'm quite new at VBA and therefore having trouble make the code more effective. Sub Find() Dim rgFound As Range ...

 
I"m not sure, perhaps on the stackexchange code review site, but before posting there, do read all of their requisite help documents to make sure that your question is as well-crafted as possible, and on-topic for that site. Also @GhostCat's book recommendation is heartily seconded by me. Excellent book. — Hovercraft Full Of Eels 56 secs ago
 
Kaz
@SimonForsberg See, now I feel compelled to go find it ^^
 
2:53 PM
@Kaz Find what? The 10000nd "Monking"?
 
Pretty sure it looks just like the 9999 others ;-)
 
Kaz
@Mat'sMug I know, but it doesn't feel like the other ones ^^
 
lol
^ that lol felt like all others though hehe
 
Kaz
@Mat'sMug Pretty sure it's not the 10,000th lol though ^^
Or even the 65,535th ^^
It was the 15,642nd
Only 741 left to go to a nice, round number
 
Might be better suited for codereview.stackexchange.combaao 47 secs ago
 
3:08 PM
@Kaz That's not a round number, add 742 to a round number.
 
Kaz
@EBrown Depends if you're 0-basing ^^
 
...
 
3:19 PM
0
Q: Can you override the detection of a audio jack in Android/IOS

JannDear knowledgable community, If Android or IOS detects an audio jack which is plugged in, are you able to force the system to ignore it? I know that the detection is made with hardware(simple Switch).

 
3:32 PM
 
4:02 PM
@CaptainObvious You know if a question starts with "Dear," it's going to go poorly.
 
From this day henceforth I shall begin all question bodies with "Dear knowledgeable community" nope
3
 
Molnking
 
4:30 PM
possible answer invalidation by Pedro Duarte on question by Pedro Duarte: codereview.stackexchange.com/posts/167636/revisions
 
4:50 PM
0
Q: How long does it usually take to get code reviewed on this site?

Ashton MorganI submitted this code yesterday, and I am just curious when it would be reviewed. I was looking forward to learning some new things.

 
@CaptainObvious Migrated to meta.
1
Q: How long does it usually take to get code reviewed on this site?

Ashton MorganI submitted this code yesterday, and I am just curious when it would be reviewed. I was looking forward to learning some new things.

 
1
Q: How long does it usually take to get code reviewed on this site?

Ashton MorganI submitted this code yesterday, and I am just curious when it would be reviewed. I was looking forward to learning some new things.

 
0
Q: Fast case-insensitive hash-code and int representation for specific codes

t3chb0tI'm trying to fix another bottleneck identified with a profiler (dotTrace). This time it's a case insensitive hash-code. Currently I'm using the StringComparer.OrdinalIgnoreCase as a comparer for a dictionary and a custom implementaion of an IComparable<string>. With 40 millions calls it costs...

 
5:32 PM
in VBA Rubberducking, 27 secs ago, by Ashton Morgan
this site is just what i needed
oh yeah
 
0
Q: Header-only variadic console output and runtime input validation in C++ using templates

JoseTemplate IO Module This is a single file header-only input validation with two variadic output functions. One output function simply inserts a new line char after every output and the other one inserts a space, this is the only difference. The end goal of this project is a conventient, cross-pl...

0
Q: Ruby class to encapsulate Retrying (for instance, with email)

MustModifyOne of my clients sends quite a few emails a day ... I would think over 500. They are mostly reports to clients or employees. The volume has become sufficient that intermittent issues with gmail (like the occasional and annoying "please try again later" error, or "too many logins" error) are caus...

 
5:49 PM
@RMunroe fluid dynamics was a PITA :|
 
0
Q: (codefights) check for almost increasing subsequence

alphacapture(This problem is from CodeFights, so I'm not entirely sure that I should be posting a solution here, but given that some people posted a solution to this problem in the comments I think I should be OK.) The input to the code is an array of integers, and an almost increasing sequence is such an a...

0
Q: Web scraper for harvesting a full-site

Shahin IqbalI've written some code using python. My goal was to harvest name, phone, and web address from extracting all the links available in that webpage. The scraper is so far following the instructions nicely and harvesting data as it is supposed to. The logic I applied here is crystal and easy to main...

 
Since your query is working already, then this question would be at home here: codereview.stackexchange.comJeff Puckett 24 secs ago
 
Hat-tip to @EBrown8534 and @aggieben for their perspectives in this article and in the meta discussion that led to… https://twitter.com/i/web/status/884461972837855232
I got Shog9 to tweet about me.
 
0
Q: Writing service/network layer for mobile apps

Matthew DrillI have an app that gets and posts blog posts to and from a server. Right now I have a network client object which is passed into a service object. The service object is created and called from an Android Activity (though my question could apply to iOS also). Success and failure callbacks are pas...

 
6:18 PM
0
Q: A simple math torture game

N3buchadnezzarIntroduction. It is commonly known that the worst form of torture is performing monotonous tasks ad nauseam. So I constructed this simple game I can give to my students when they misbehave. Task. The goal was to make a problem that could take in two numbers, and construct n distinct multiplic...

 
@EBrown ZOMG you're famous!!
4
 
Only internet famous lol
 
6:40 PM
Monking
 
So your code works now - great! Looks terrible though (no offense intended)... feel free to post it (all!) on Code Review along with a description of its purpose; reviewers will help you make it do the same thing, only much, much better. — Mat's Mug 32 secs ago
 
7:05 PM
0
Q: GSAP's TweenMax callback to a tween in a function

ChrisCormier x=valuesX=[360,180,0]; y=valuesY=[360,180,0]; function logoAnimate(){ x=valuesX=[360,180,0]; y=valuesY=[360,180,0]; var h = Math.floor(Math.random()*3); var i = Math.floor(Math.random()*3); console.log(h); console.log(i); TweenMax.to($('.animate'),1.5,{rotationY:x[i],rotationX:y[...

 
 
1 hour later…
8:09 PM
If this code works fine, then this question is off topic on Stack Overflow, but may be good for our sister site Code Review. — Joe C 30 secs ago
 
8:37 PM
1
Q: Selecting site to browse in python

heatherThis code is for part of my first major contribution to open-source, for the socli project. The purpose is to allow the user to select a site from the stack exchange network to browse and fill two variables with the appropriate urls (used through the rest of the program). Since the stack exchange...

0
Q: How to count the appearance of each number?

dimoboHow could i know from the below code how many times it appears each number one next to the other, for example the number 5 had appeared 6 times and this i would like to be shown as:5-6 My code is:import random L=range(1,46) Q=range(1,21) for i in range(100): f=random.sample(set(L),5) ...

0
Q: Communicating events between entity components with minimal code overhead

Ashley DaviesI'm working on a game which utilises a variant of the entity component system pattern. In my current code, I have been communicating between components using code of the form: _entity.GetComponent<MovementComponent>().TargetPosition = targetPosition; I wanted to remove this very strong couplin...

 
@CaptainObvious Looks not working as intended
 
 
1 hour later…
9:43 PM
0
Q: Rails & RSpec - Testing API with request specs and shared examples

BrunoFaccaI have written the following request spec and shared examples to test a namespaced RESTful API in a Rails 4.2 app with RSpec 3.5. I would greatly appreciate your suggestions on how to improve it (e.g., efficiency, readability, maintainability, DRYness). A few points I would like to improve are: ...

0
Q: Reliability Of TextReader.Read

j.doeI have this code and I want to know if it is sufficiently reliable class StreamPrinter { public void Print(TextReader reader) { int cde = reader.Read(); while (cde!=-1) { Console.Write((char) cd...

 
You may want to consider posting at Code Review instead. — CodeCaster 29 secs ago
 
10:15 PM
1
Q: Cleaner simple imgur api

jodekpotasuI slowly make imgur Client and everything works but i have few questions about how to make classes more OOP and cleaner. 1.Is that correct to make generateToken static when it is private? 2.calling method from constructor is anti pattern? public class ImgurClient extends Imgur { publi...

 
Linter giving a warning, not sure what my other options would be though
Or what is so "dangerous" about this
Ah, fixed it
 
10:50 PM
monking
 
@Phrancis dict is a builtin function
 
@syb0rg Hmm thanks for pointing that out
 
The warning is just saying you are overriding it and won't be able to use that function within the scope that variable is defined
 
OK
Well, already posted the question, so feel free to point that out in an answer =)
 
@Phrancis Where?
 
10:54 PM
Actually, no answers, so I'll just edit now
@syb0rg Incoming as soon as Cap'n posts it lol.
Got a gold badge on DBA o.O
Famous Question
 
0
Q: Project Euler 22: Names scores using dictionary

PhrancisI solved Project Euler 22 using Python 3. The problem reads as follows: Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each na...

 
0
Q: Filter on an object literal multi property array object

ArrowThis is a function which filters on the Object's properties arrays and property values. I need to be able to check all the matching property arrays for a number of possible string values and once found, filter out all matching objects. This is currently working but it's ugly and rigid. The "some"...

 
11:45 PM
0
Q: Using friend unit test or create extra getter

21koizydBetter option is create one extra getter(which is conflicted with TDD, because it's extra code) or create a lot of FRIEND_TEST(I must check variable in class). Which way is practised in company (which use TDD).

 
11:59 PM
0
Q: Print a String's even and odd indexes

TheLearnerI implemented this method and wanted to get suggestions and or improvements. The objective of the method is to print the even and odd indexes of Strings contained within an array. Each set of indexes(even and odd) should be seperated by a space. public static void printEvenOddIndexes(String[] st...

 

« first day (1528 days earlier)      last day (2503 days later) »