« first day (1019 days earlier)      last day (2984 days later) » 
00:00 - 22:0022:00 - 00:00

12:00 AM
RELOAD! There are 1859 unanswered questions (94.1059% answered)
 
I am unit testing a method that sets a set of values to the default.
Do I just hard-code these values in and pray that the defaults never get changed to match?
Do I create a method to check the default values and assign the values to non-defaults with a big series of ifs?
Hi, @kuzyn.
 
Hey @Hosch250
what about || assignments operator? that way you can default without doing ifs
 
Why are you using == True? :(
 
And @nhgrif comes in just in time to talk about unit tests. Are you listening for mentions of unit testing?
@nhgrif Using == True?
Where?
 
Probably in the answer I shared above
 
12:14 AM
 
Oh, I thought you were talking to me.
 
I hopped in here to see if @rolfl is around... I've got an email in my inbox he might know something about..
 
Nope, not here
4
 
12:18 AM
Someone is up to do a superquick code review a JS object definition+prototype etc? just for general flow and style. 200 lines
 
Bluemix-related hackathons are quite common. I had nothing specific about this one and your inbox, though. IBM has been pushing hard on the swift front, and that may be the connection.
 
Post a question, @kuzyn
@rolfl So, you think there's a chance this will be a Swift-oriented hackathon
??
 
I am about 6 months out of date on bluemix. I don't know how advanced their swift support is, but I believe you can run server-side swift apps on there, and it has full support for iOS-related mobile apps.
(as in, bluemix can be the app server)
 
Is there an outstanding issue with this js object style (references, prototypes) gist.github.com/kuzyn/f87edc8afac42509d737
 
@kuzyn You should be asking this in a question.
 
12:23 AM
ah, i see
i'm a bit confused by the codereview premises
 
Have you taken the tour/read the help center yet? That will help you understand.
 
@kuzyn Go and read the tour and the help center. Those will be able to get your started, and from there you can read this Meta post for some more info as well: meta.codereview.stackexchange.com/questions/2436/…
 
not in these parts... i just found out that so had chat, & just in the last 10 minutes that it had a section called 'code review'
@Quill alright will dom thx!
 
Nvm about the unit tests. I wrote a suite and will post this entire section + tests for review. I have a few different views, so there will be a couple questions coming up over the next few days.
Some things will be very similar, but the things I really want a review on are the minor differences as they are the new things for me.
 
12:52 AM
Please take this to the CodeReview site. — Prune 33 secs ago
I'm voting to close this question as off-topic because it belongs in the codereview.stackexchange.com site. — Prune 35 secs ago
Belongs on Code Review isn't a valid close reason @Prune — Quill 14 secs ago
Migration is a valid reason; CodeReview isn't on the list. What do you recommend as the proper action, then? I took this suggestion from a search on Meta. — Prune 45 secs ago
 
*sigh*
 
1:09 AM
@Quill, that's not the impression I got last October (I looked for how to handle things that belong in CodeReview). I have no problem with my closure vote dying for lack of a second; that's why a single vote can't close a question. — Prune 45 secs ago
@Prune, Quill is quite correct in stating that code review (nor migration) are close reason for Stack Overflow. In addition please read a Guide to Code Review for Stack Overflow usersholroy 37 secs ago
 
Thanks @holroy :-)
 
No problem...
 
-2
Q: Hiding numbers in python

Michael RodriguezI am creating a ATM in Python 3.5 and I was wondering how I could hide the pin numbers so they don't show like at a real ATM. Thanks in Advance!

0
Q: Unit Test Settings

Hosch250Recently, I redesigned the Rubberduck settings pane. Here is the unit test settings view, which is posted in this question: The part we are referring to is the section in the right pane. The rest of the window is part of a parent control that will be posted in its own question later. This i...

 
I recently read about remote teams in my project management course.
Seems the Rubberduck team is a lot better than it should be for a remote team.
4
And apparently Rubberduck is a high-risk project.
 
1:38 AM
Thanks; I haven't reviewed this one since I first encountered Code Review. I found the critical portion about 1/3 way down. — Prune 25 secs ago
 
Hello.
No longer active here...
 
cough
 
-1
Q: Attempting to run a function in a class but only getting errors

Matthaeus JumpertzHi I'm trying to create and use a class to contain a batsman scores. I am also trying to create functions inside the class to allow the user to input the variables and then calculate the average. Although when building I get the error: Error 2 error C3867: 'batsman::readdata': function call...

 
@Hosch250, Do you have a minute?
 
1:50 AM
Yes.
 
I'm kind of confused on your UpdateConfig method? What is the purpose of that method? It seems like it ought to return the current configuration, but you don't pass config by reference, and the method return type is void, so what's the point of it?
 
Config has reference semantics.
 
What do you mean?
 
Internal changes are saved.
It means that the internals are basically passed by reference, even if the value itself isn't.
 
Changes are saved when they are made, so no saving or reassigning needs to happen
 
1:53 AM
Icky... And what happens when you call it with a function as you in SafeConfigWorks ?
Does it change the config object created in the function which is locally scoped within that function?
 
Yep.
It doesn't change the instance, but the internal properies get changed.
 
That is hairy, to say the least.
 
LOL.
 
In addition in your test method SafeConfigWorks you initialize the view model with non default config, and update it with non default config. In other words, you check if it changes from A to A... That is kind of a void test...
 
Oh, bother.
OK, I'll change that
 
1:55 AM
@Hosch250 you might want to edit/include the code that calls that SaveConfig method
 
@Mat'sMug That belongs to the parent view.
 
I know, and it provides relevant context, too
 
I guess I could.
Yeah, I'll add that.
 
That usage of configuration scoped within the calling function might give you troubles later on... That is not a recommended approach, you should at least use a temporary scoped Configuration object within your test method.
 
haha that one is a gem:
@Jaywalker the correct term for "pedanticism" is pedantry. (Normally I wouldn't point this out, but in this case I couldn't resist the irony.) — Nathaniel 13 hours ago
3
 
2:01 AM
@holroy There you go.
@Mat'sMug That's what triggered the "p---ed---antry" joke earlier.
 
oh
> If this were bright and strong enough, it ought to break down the proteins and structures within your cells and potentially, reduce you to a steaming pool of jelly.

So, my advice is, wear sunscreen!
 
@Hosch250 Made a small addition to my current answer on MultiAssert.
 
So, is that part of the .NET framework?
 
possible answer invalidation by Hosch250 on question by Hosch250: codereview.stackexchange.com/posts/120254/revisions
 
Holy smokes, I have an answer of my own now.
 
Actually, I won't bother.
So he wrote that?
 
As far as I know Brian Elgaard Bennett wrote the MultiAssert class. There are however other similar aproaches to be found, but I based my own extension on his code.
In the firm where we used this, we added that class as part of the unit test project. Always available, and a great tool!
 
Monking
 
There is my answer.
 
2:22 AM
monking @ethan
 
2:42 AM
this valentines day why not get something special for that computer in your life like finally installing those updates you keep promising
2
 
3:02 AM
-13
Q: Jon Skeet easter eggs

zondoI have heard things about Jon Skeet such as if you search for guru in google, it will ask if you meant Jon Skeet, but are there really any Easter eggs on this site related to Jon Skeet?

 
Can't you use Assert on lists to compare the content?
Assert.AreEqual(customConfig.UserSettings.ToDoListSettings.ToDoMarkers.ToList(), viewModel.TodoSettings.ToList());
The values are the same, but it is failing.
 
SequenceEqual
that's for order and content, there's another for just content
var correctLinks = new List<string>()
{
    "http://google.com/pass",
    "http://google.com",
    "google.com"
};
var processedLinks = Utils.GetAcceptableLinksWithBlacklist(links, blacklistedSubdomains, "http://google.com");
Assert.IsTrue(correctLinks.SequenceEqual(processedLinks));
 
3:28 AM
0
Q: Is this a good example for using both abstract classes and interfaces?

DontForgetTheSemiColoninterface Flyable{ public void fly(); } abstract class Aircraft implements Flyable { float speed; @Override public void fly() { System.out.println(" Flying High!"); } abstract void getMaxSpeed(); } class Jet extends Aircraft{ public Jet(){ th...

 
4:02 AM
0
Q: Is using an index list considered bad practice?

samlafI am writing a function that merges two ordered lists such that in the resulting list, the elements are still ordered according to the elements in their respective starting list. For example, merging (a b) with (1 2) would result in ((a b 1 2) (a 1 b 2)(a 1 2 b) (1 a b 2) (1 a 2 b) (1 2 a b)) ...

 
@Quill Thanks.
 
np
 
4:24 AM
SO isn't a code review service. Take a look at how to write a Minimal, Complete, and Verifiable example to improve your questions. — Steve 46 secs ago
I'm not asking for a code review, I'm specifically asking how to do something to enhance my code since I cannot seem to find the answer. Two completely different things. — Brandon Caylor 9 secs ago
 
4:55 AM
Hi tao lin unfortunately your question is off topic here because of the rule: Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. If you already have the code and are looking for a better algorithm I would recommend you to put in a question on codereview.stackexchange.com there the guys will look into it and recommend best corrections and algorithms for you. Best of luck. — Jorge Campos 48 secs ago
@JorgeCampos we don't do no code at Code Review, and we certainly don't suggest just suggest algorithms. In addition, he's not asking for an off-site material, he's asking for a solution. Which I personally would and did flag as too broad. — Quill 53 secs ago
 
@Duga What in the world?
We "don't do no code at Code Review"? And "don't suggest just suggest algorithms"?
@Quill ?
 
Wat
The second block is confusing
 
So is the first block.
 
The first seems fine
 
We do too do "code" over here.
And, "don't do no" is a double-negative.
 
5:08 AM
 
@JorgeCampos, as it stands, this question would be off-topic on Code Review for having no code. Provided it had (A) working, complete code that was (B) non-hypothetical, it may be on-topic — Quill 31 secs ago
 
^ there
@Hosch250 it's confusing, but it's grammatically (and logically) sound
 
Actually, it is less confusing in terms of its meaning than its grammar.
Grammar doesn't like double negatives because they make a positive, just like in math.
So technically, yes, you were right. We don't do no code here.
 
it wasn't the best comment, I don't have the autocommenterscript on my work station and jammed it out with my code was cleaning and building
So it's since been deleted, replaced with a better, clearer comment
 
Your code was compiling? You should have been having a sword fight!
4
 
5:19 AM
I've never seen a standard like that. It's unfortunate that Java didn't give us a way to explicitly say that a class (or other declaration) is package-private. Any time I see a code review with that kind of code, I have to ask whether they inadvertently left out public or private. Usually it's intentional, but there's no way to tell. However, I've never seen a style standard that helps distinguish this (and putting PackagePrivate in every name is just ugly). — ajb 28 secs ago
 
5:35 AM
What is the problem? in code review it was suggested to ask in StackOverflow because there has different purpose and I accepted and removed the post from there. — Abolfazl 10 secs ago
 
0
Q: 1 form, 2 buttons with seperate actions (Submit and Reject)

Arash  EaindrayI'm trying to create a form for my wedding RSVP website. Currently the Submit works and all teh details are sent to my email however my option for rejecting the RSVP doesn't work - it is still coming to my email as an acceptance. I'm new to PHP and Jquery - I suspect I'm not closing a loop of som...

0
Q: How is this implementation of the Incremental Steepest Descent (gradient descent) Algorithm?

Grant WilliamsHere is the code i wrote to calculate the minimum of a complex function. The code uses the incremental steepest descent algorithm which uses gradients to find the line of steepest descent and uses a heuristic formula to find the minimum along that line. The algorithm should zig zag down a functio...

 
6:05 AM
0
Q: Method or helper function to return objects from EntityFramework with linq

Alan WayneThe following code reads from Microsoft EntityFramework 6.0 domain model and returns the single view_patient object. The view_patient object is defined in the backend database and uploaded to the .edmx model of EF. I am new to EF, but it seems there should be a better way--(better means less typ...

0
Q: Finding Closest Sibling in a BST efficiently

DontForgetTheSemiColonTrying to print the closest sibling in a BST. How can I improve on this algorithm in terms of space/time efficiency? Please point out any potential bugs too!i'd appreciate that. import java.util.ArrayList; import java.util.List; public class ClosestSibling { public static void ...

 
6:48 AM
0
Q: Most efficient and low-memory way to get digits in an Integer

NeilIn Java, there is an int 123456. How to pull out 3 ints (12,34,56) from it? Mine is int i1 = int / 10000; int i2 = int / 100 % 100; int i3 = int % 100;

 
throw new NotImplementedException();
best way to leave methods before going on a trip
 
7:18 AM
0
Q: Depth Limited Search for Map Coloring Graph in Python

SamHey I'm trying to solve the Map Coloring Problem using a Depth Limited Search. I found an example of the problem here (https://courses.cs.washington.edu/courses/cse473/10au/slides/chapter05-6pp.pdf), but the idea is to assign each node in a graph a color, where no two adjacent nodes can have the ...

 
your question would better fit to this stackexchange site imho: codereview.stackexchange.comlow_rents just now
 
Zak
I'm voting to close this question as off-topic because this is useless rant. — Shadow Wizard 18 hours ago
Also, monking.
 
7:37 AM
0
Q: Why i can see login form if im already login

user97913Hi guys can i ask what is the problem on my code. all i want is if there is someone already login then if i click back i don`t want to see the login form what is the problem in my code thank you for you help //php check for login <link rel="stylesheet" href="bootstrap.min.css" /> <?php i...

0
Q: Retrieve rich text from GridFS with Java

yarixI am writing a storage for articles and I have decided to use GridFS from MongoDB. I have found and tested some code, but I am not sure that it is a best one. Could you advice me how to make it better? private GridFS gridFs; public String getPostContent(String name) { GridFSDBFile file = gr...

 
Code Review is only for working code, which this one is not. Even without taking a hard look at it, let alone running it, I can already spot at least two bugs, just by skimming it. There is an obvious SyntaxError on line 2 and a semantic error on the third-to-last line. — Jörg W Mittag 36 secs ago
Since we are doing Code Review here: calling new without arguments and then setting up the object using setters is a code smell. Objects should be valid after construction, but in your case, a UserInputProcessor instance would blow up with NoMethodErrors for nil all over the place if you tried to use it directly after constructing it. And a minor one: puts already treats Arrays specially by printing the elements line-by-line, there is no need for that call to join on the last line. — Jörg W Mittag 40 secs ago
 
8:40 AM
ello
 
8:59 AM
hi
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Extracting values from refs pointing to form inputs
 
Had an epiphany this morning
I don't want to encourage using IE9... but it's my job to do so. So I'll do it but I'll make damned sure I make fun of Ie9 in my code the entire way
6
 
0
Q: i need top 5 records in sql

chaitanyathis is my query. i get the table records but i want only top 5 records based on salary. i am new to this sql please try to solve my problem thanks in advance select a.jobdescription,a.salaryFrom,a.salaryTo,a.AboutCompany,a.expYearFrom,a.expYearTo,b.roleType from JOBPOSTING a inner join Mast_Ro...

 
9:26 AM
I have posted the problem at [codereview ](codereview.stackexchange.com/questions/120279/…) with most of the code that needs optimization — PhoenixDD 42 secs ago
 
0
Q: Optimizing A-star for N-Puzzle C++

PhoenixDDI have coded A-star for N-Puzzle where N=3 or 4. The program finds out the solution correctly but it's slower than most of the programs out there which use the same algorithm. For the hardest instance of 8-Puzzle as stated here the program takes ~2.5 seconds where as most other programs take ~0.0...

 
@DanPantry just try not to overdo it. Remember that one php question with the comments
 
monking @all
 
9:53 AM
0
Q: Find Duplicate with 2 criteria VBA

manuMy code below find the duplicates based on 2 criteria: The first criteria is the Name in Column A The second criteria is the Country in Column D Sheet("RawData") : Sheets("Conso") after the macro: Sub MDMDuplicates() Dim WB As Workbook Dim wsRawData As Worksheet, wsConso As Worksheet D...

 
10:03 AM
omg microsoft why
so IIS will display the same error for insufficient file access permissions as the one for not having a module installed
and it won't tell you which is the real issue
 
0
Q: 'Retry' mechanism with callback

JᴀʏMᴇᴇWe've had a situation whereby we have to cater for certain exceptions and retry a particular method whenever these exceptions occur. This is required in various parts of the system. In addition, we (might) want to invoke a 'callback' upon the need to retry. I'll show you the code, then give you ...

0
Q: Design a main function which determines which secondary function to be used

mickkkI am writing an R package. The package consists of a main function and lots of auxiliary functions that perform different calculations. The main function The idea behind the package is to make the user use only the main function and through it select which auxiliary function to use. This would ...

 
@chillworld monking
@DanPantry it's a choose your own adventure story... but actually scary
 
10:19 AM
I think you're probably right. I would prefer that this already happens at compilation time, but a separate test that scans files for the errno string and checks that errno.h is included by them is another solution. If developers run tests before they commit, as they should (we haven' enforced it by commit rules yet), then this should save them. Code reviews happen later in our process (after the code has gone through the CI server, and the bug has already cost the developer's time), so that's not going to work. — Enno 33 secs ago
 
@Quill And frustrating :( But I've fixed it now
Just checked the source control logs and noticed I'm the only person who has committed to the client application project since 15th January. LOL
 
lol
source control is for loozers
 
TFS is for losers god damn its awful
 
you're using TFS?
 
Zak
So I play on an MMO which uses the same timezone as me. Bizarrely, my computer time is 53 seconds ahead of server time.
 
10:23 AM
Unfortunately....
 
seriously man, get a new job
 
@Zak not all time zones are synced.
For example, my PC is currently 2 minutes behind my phone.
They are both right next to each other.
(it's my PC that is wrong)
 
windows computer and servers are usually screwed for timezones
 
My home PC works perfectly fine as it syncs online
I'm not sure what our internal one does but it isn't that.
 
0
Q: Java 8 BigInteger Factorial

bosco1Here is the code: package com.bos; import java.math.BigInteger; public class Factorial { public static BigInteger factorial(BigInteger x) { if (x.compareTo(new BigInteger("2")) < 0) return BigInteger.ONE; else return x.multiply(factorial(x.subtract(...

0
Q: n dimensional array creator python

Daniel GeeIs there any way I can make this function more inline? def nDimensionalArray(n, s): x = 0 for i in range(n): x = [x for j in range(s[i])] return x

 
10:25 AM
possible answer invalidation by RobH on question by JᴀʏMᴇᴇ: codereview.stackexchange.com/posts/120283/revisions
 
@Duga that's fine
I had a timezone issue once on a Mac, it literally kept resetting itself at reboot to 1970 or a similar date
 
@Quill Back To The Future
 
3 mins ago, by Quill
seriously man, get a new job
Find a job that uses Git, hunts IE8 for sport and doesn't care when you have blue hair
 
I enjoy where I work. There's a lot of technical debt and some of the workflow sucks but it's great people, I'm trusted to do my work and generally speaking looked at as an equal
My boss doesn't care that I have blue hair :) As long as I wear office shoes and not converse.. lol
And we odn't support IE8. Only IE9 - and only one of our customers use it, and they are dropping it after they get our product anyway. They just can't upgrade to IE10/11 at the same time as getting the product - too much of a culture shift.
 
> culture shift
;-;
 
10:29 AM
I can respect the reason as to why they don't want to upgrade
The system we are supplanting is literally older than the company and they have been using it since the company formed
While I don't like it, it's a genuine use-case that needs to be considered, with me kicking and screaming along the way.
 
I suppose so
 
Like I said - we know they will drop it a little while after receiving the new system, but the staff can't upgrade ahead of time
Mainly because the current existing software they has requires ie9.
No, I have no idea how, or why. It's bad software. My software is less bad software.
So many grammatical mistakes in that last sentence..
 
10:48 AM
I think I'm going to write an Atom package that inserts userscript headers
 
11:01 AM
 
hey
 
hey there @skiwi
 
I'm tempted to start a new project...
Projects++;
vimeo.com/79098420 (That's actually a rather old video by now)
> Flexible Muscle-Based Locomotion for Bipedal Creatures
I'm tempted to code it in Vulkan 1.0 with C++
Now I know nothing about all three subjects, so that's great
 
> C++
 
Need to figure out if I want to have code that I can easily understand or code that can create awesome things... Java vs C++
Yes... graphics in 3D are definitely possibly with Java, but C++ is simply the main language
 
11:11 AM
0
Q: On Click of button tab is not getting active

user97936Here is the tabing designed. <ul class="nav nav-tabs nav-justified"> <li class="active" ng-class="{ active: isSet(1) }"><a href ng-click="setTab(1)">Summary</a></li> <li ng-class="{ active: isSet(2) }"><a href ng-click="setTab(2)">Survey Design</a></li> <li n...

 
@CaptainObvious nope
 
nope.avi
 
nice memes
 
nicememe.website
 
nice.meme
 
11:32 AM
0
Q: AFNetworking 3.0 Get JSON from code 400 in failure block

吴孜健I use the AFNetworking 3.0.I want to get the error code 400, and get the error message described that missing header paramsters.How can I do this? Thanks very much!

 
11:51 AM
0
Q: performance issue of application using entity framework 6

Lamloumi AfifI have a console application in which I used Entity framework 6. In order to reduce the time of the first instanciation and the first read operations . I used Three ways : AsNoTracking Interactive Pre-Generated Views for Entity Framework 6 Precompile views After these modifications, I get 2,...

 
Zak
Apple today *after* a court order to help the FBI hack an iphone: "The U.S. government has asked us for something we simply do not have, and something we consider too dangerous to create." - Props to them for that.
5
 
@Quill blocked by uBlock lol
 
12:10 PM
0
Q: Python sprint game

D.CHere is my python sprint game code. You have to tap the 'a' and 'd' keys as fast as you can to sprint 100 meters. import msvcrt import time high_score = 50 name = "no-one" while True: distance = int(0) print("\n--------------------------------------------------------------") print('...

0
Q: Adding border to required fields when fields are empty

Daniel G. R.I want to add red borders to required fields, if the fields are empty. The ShowSelection() function is run when the interface is loaded, and everytime the interface is refreshed. The code is written for Siebel OpenUI, which has some proprietary functionality such as "GetPM()", "GetInputName()" et...

0
Q: Python sprinting game, improvement suggestions?

D.CHere is my code for a sprinting game in python, you have to tap the 'a' and 'd' keys as fast as you can to run 100 meters. import msvcrt import time high_score = 50 name = "no-one" while True: distance = int(0) print("\n--------------------------------------------------------------") ...

 
possible answer invalidation by D.C on question by D.C: codereview.stackexchange.com/posts/120214/revisions
 
Zak
12:39 PM
OMG. How did I miss that the NSA have an AI system (for identifying suspected terrorists in Pakistan) called SKYNET. Like, come on NSA, that's just asking for trouble.
 
2
Q: Scrape websites using Nokogiri for information on printers

user97942At work we have a need to know what printers are getting dangerously low on their toner, and paper consumption, etc.. So I've created a program that pulls the printer information off the websites the printers are located at and outputs the information. This program has the option to use two sepa...

1
Q: C - Un*x Terminal History Wiper

MangoUsing various answers from StackOverflow & AskUbuntu I've hacked together this simple C program that wipes terminal history. It works but I'm relatively new to C so I'm not sure if everything is correct. CODE: #include <stdio.h> int main(void) { // check if the program is being executed in a...

 
12:59 PM
Database fell over during the stress test. Not good.
 
@DanPantry Was that "test" during production?
 
@skiwi No, it was meant to be a stress test with all of the users we're meant to release to in 2 weeks
with just them on, the database maxed out, as well as the database for our authentication servers
 
That's why you do these tests riight
Monking!
I woke up with a [badge:wpf] this morning :-)
2
 
yo @Dan, how evil is this?
var momentJS = document.createElement("script");
momentJS.src = "https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.2/moment.min.js";
document.body.appendChild(momentJS);

while(!moment){}
 
@Quill Might crash your browser in several cases, is that evil enough?
 
1:16 PM
@Quill This might only be on the initial load, but if you append it to the head, then I think the browser automatically waits for the data to be loaded.
 
Yeah, I just decided to swap it to a load handler
 
@Quill Don't
JavaScript is single threaded, your while loop will never resolve
Add it to <head>, <body> (and document.addEventListener('DOMContentLoaded')) or use something like RequireJS.
BTW HTML is loaded synchronously, so simply putting that script tag in front of your script is enough to make sure that it's always avaliable (if a bit hacky)
 
wait wat. add it to both?
 
No, sorry, , was meant to be "or"
 
Picking a DBMS is hard these days.
Greetings, Programs.
 
1:27 PM
Hello, @Donald.McLean
 
1:50 PM
someone shoved 10 lines of html code on a single line and it looks like someone barfed html code into the file. how did they read this
Somehow expanding it into 10 lines has made it have a drop down list.
What
 
2:13 PM
If your code works and your only issue is that you want to make it more maintainable, you should probably post this question to Code Review instead. — ZeroOne 28 secs ago
 
2:28 PM
because of while code review I got -1 for studentInfo["name"] and suggested use studentInfo.objectForKey["name"] that why I want to clear this point. — Pravin Tate 29 secs ago
 
2:39 PM
slammed some zombies in the hope of scoring bronze performance tag badge
 
0
Q: Stack Exchange API Python library

AndyI wrote a package a few years ago to make my interactions with the Stack Exchange API more straightforward. I've maintained it over the years and used it in several scripts I've written that interact with Stack Exchange. Now my goal is to release it to PyPI. Before I do so though, I'd like to ens...

 
edge is a useless browser which seeming just fails at inspect element
inspect element anywhere, get view source in developer tools
that's nice, but could you perhaps highlight the thing I selected?
also failing to search with CTRL+F, typing in the search field doesn't generate any characters, CTRL+A can't select all the html (does nothing)
like why
somehow all of this
is not working
probably something on the page is making edge give up =/
(rant rant rant complain)
On a less frustrating note, I now have 12000 rep =D
 
3:04 PM
Hrngh... Imma go downvote code-dumps mercilessly now
sifting through the active tab of zombies you slammed I understand why nobody wanted to answer these
they're terribly uninteresting
on an unrelated note, my crappy userscript is at almost 40 votes now
 
@MartijnPieters you think I should ask it in Code review? Sorry last question. Or i'll delete if it causes problems. — Hani Goc 24 secs ago
 
3:21 PM
Wow, this is some next-level sorcery
 
3:32 PM
I tried to implement the closed_list and open_list as unordered_set so that the look up turns to O(1) but for some reason it's taking more time than 'set' am I doing something wrong? here is most of my code codereview.stackexchange.com/questions/120279/…PhoenixDD 55 secs ago
 
@skiwi holy carp
and all of that with paint and a UI from Windows 98 or so
 
I would recommend you post this on the code review site. — rghome 24 secs ago
I think this is more suited for code review? — Fraser 16 secs ago
 
0
Q: Multiple bugs with python code, suggestions?

D.CThe following code is a python sprinting game. It was posted as an answer to my previous post, by @mango You have to tap 'a' and 'd' as fast as you can to run 100 meters. However, there are a few bugs... 1) If you hold down 'a' and 'd' at the same time, the game is completed as fast as possible ...

0
Q: how can we make Code in R has command solve faster

user3478697This code in R takes about 9 minutes. I need to reduce the time by modifying it. m=21 S =c() w=rep(1,20000) for(i in 1:100){ w[m]<- i*5 A=diag(w) u0=t(Z1)%*%A%*%(y-mu) V1=t(Z1)%*%A%*%D%*%A%*%Z1 v=solve(sqrtm(V1)) U=as.matrix(t(u)%*%v0) S[i]=(U)%*%(t(U)) print(i) }

0
Q: MPI search the same set

lukasszI wrote a program that compares two sets of one main and checks that the set contains the same elements. I used MPI. I wanted to ask you about whether my program is correctly written. And if I could somehow draw a set number which is identical? The function should return to the array which I w...

0
Q: JavaScript for toggling appearance

CharlesI have a dedicated stylesheet <style id="dynamicStyles"></style> for my page's dynamic styles. They are controlled by this JavaScript: function style(className, sty) { var sheet = document.getElementById('dynamicStyles').sheet; sheet.insertRule('.' + className + ' {' + sty + '}'); } // ...

0
Q: Ruby backup/restore for provisioning

setevoyThis is my second Ruby coding attempt. Also - this is my first OOP usage in Ruby. I'm using if __FILE__ == $0 form here - same as it was in Python because it's really useful as for me. Is there is any objections/restrictions for such usage? Any other tips/links about this code appreciated as w...

 
3:48 PM
@CaseyCrookston, just because you like a given type of activity doesn't mean that it's necessarily a good question for Stack Overflow. Open-ended code review questions are explicitly off-topic for SO - questions are expected to be, at least to some degree, about a specifically and definitively answerable question. Please don't upvote off-topic questions. — sphanley 14 secs ago
 
 
0
Q: refactor a function to be more pythonic

user97965Here is a function that I'd like to refactor it to be more pythanic and efficient. One thing that strikes me is that there are three nested loops. def convert_to_internal(self, agenda): x = [] ...

 
4:05 PM
I'm voting to close this question as off-topic because it belongs in codereview.stackexchange.comgsamaras 39 secs ago
 
4:38 PM
Hi @user3139574, there is a stackexchange site dedicated to questions where you want appraisal done on working code : codereview.stackexchange.comDavid Barker 27 secs ago
 
0
Q: Longest Collatz Sequence- Memoization- Python- Iterative vs Recursive

Utkarsh Mittaldict={} def recur(n): counter=1 original=n while n!=1: n = n/2 if n % 2 == 0 else 3*n+1 if n in dict: counter=counter+dict[n] dict[original]=counter return counter counter=counter+1 dict[original]=counter return coun...

 
@StenPetrov It does, but this is a quick and dirty copy-and-correct. I'm not going to re-implement this method for him, as it seems mainly like test and through away code. If this is anything that's going to production, a definite code review is in order. But, the purpose of my answer is to convey the technical way of doing this, not the proper way to implement multiple task execution. — Yuval Itzchakov 54 secs ago
 
5:09 PM
Where have the rss feeds gone??
 
That is so strange! It means doing HelpRequested += delegate { }; in the constructor will prevent the additional links from opening. Try explaining that one to codereview :) I'll accept this as an answer tomorrow unless someone explains why it's happening. — Ulf Kristiansen 9 secs ago
 
It looks like it might be from the OP, but I'm really not sure.
 
@Pimgd Slamming zombies is always a good thing, even if the questions themselves aren't top-notch.
@Hosch250 It might, but I rejected it.
> If you're the author of the post, please log-in as such. Edits of this magnitude can't be accepted by anonymous users.
 
0
Q: Passing Node.js SQL connection to multiple routes

SQUALLIEBelow is the app.js, users.js and user.js routes of a node application I am building. As you can see I am connecting to the SQL DB in each route, and this is not ideal. I have tried passing the connection to different routes at least 3 different ways based on examples online. I have failed multip...

 
5:19 PM
@Hosch250 OP seems happy with it.
 
Just because OP is happy with it doesn't mean it is an answer...
 
^^
You have presented an alternative solution, but haven't reviewed the code. Please explain your reasoning (how your solution works and how it improves upon the original) so that the author can learn from your thought process. — Ethan Bierlein 9 secs ago
 
@Hosch250 No, but it means there's no point in flagging it IMO.
 
I didn't flag it, but I did upvote Ethan's comment.
 
Same here.
 
5:24 PM
It seems like the answer made a lot of good improvements to the OP's code. It just needs some more elaboration.
 
I was looking for the solution here originally. There we others posted, but they used lower level solutions that we contained within the Guzzle package. I am not sure I would have found the solution under the code review forum. Anyway, I will post similar questions there in the future. — user3139574 41 secs ago
 
Do you guys think this should be a CW answer? codereview.stackexchange.com/questions/120254/…
I would have edited into the question if holroy hadn't written an answer on the code already covering other points.
I really don't think it is worth being a real answer.
 
I think it's fine as a normal answer.
bbl, lunch
 
> Don't assume things won't blow up. They always do.
5
 
6:01 PM
I guess I'm getting an A in valid flags - 98.3% accepted.
Hmm, I think a mod just upvoted my answer. That means that Mat's Mug did not handle those flags.
Why else would the answer I just flagged a couple of comments on randomly get an upvote?
 
Matt Sherman on February 17, 2016
Spoiler alert: It’s hard! Here’s what we’ve learned.
Nick Craver on February 17, 2016
The first in a long series of posts on Stack Overflow’s architecture.
 
6:35 PM
possible answer invalidation by Andy on question by Andy: codereview.stackexchange.com/posts/120312/revisions
 
-1
Q: Applying the DRY principle to this PHP code

user3935156In PHP how can I implement the DRY (don't repeat yourself) principle in this piece of code? The 2 classes in question share an awful lot of code. <?php interface iSelect { public static function display(); } class CountrySelect implements iSelect { static $template = 'select_template...

 
@Duga Seems OK.
 
http://www.commitstrip.com/en/2016/02/17/all-this-effort-all-this-skill-for-this/
CommitStrip
All this effort, all this skill, for this?
CommitStrip
1455733881
5
 
@CommitStrip It's sad to think about how much brainpower is spent on harming others and where humanity might be if it was used for something helpful.
3
 
possible answer invalidation by 200_success on question by user97965: codereview.stackexchange.com/posts/120325/revisions
 
6:51 PM
@skiwi Ooh, I remember seeing that one many years ago. It is truly awesome.
 
I saw it mentioned in my Algorithms book :D
Finally understanding a little bit more about greedy algorithms: In particular greedy activity selection
 
@Hosch250 I've applied it, as it came from the same IP address.
 
@200_success Thanks.
 
It suddenly sounds so logical that if you want to schedule a maximum amount of activities (given start and finish time) in a certain time, that if you schedule the one that ends first first, then you will always get the optimal solution, as there's no more optimal answer
 
@skiwi OGNext?
 
7:03 PM
@SimonForsberg No, Algorithms course
 
> Should the apocalypse happen (probably caused by the GPL, Punyon, or caching), [...]
 
I'm voting to close this question as off-topic because it belongs to codereview.stackexchange.com — JB Nizet 24 secs ago
I'm voting to close this question as off-topic because this question is about running code and should be ask at codereview.stackexchange.comJens 18 secs ago
Ok I am posting this question in codereview.stackexchange.com — Rahul 34 secs ago
Note that in this form, it would be closed as off-topic on Code Review due to being hypothetical. — 200_success 17 secs ago
 
7:20 PM
0
Q: Enum Singleton implementation in java

RahulI just wanted to implement the enum singleton in java. Below is my implementation where I have tried to create a singleton datasource instance. public enum EasySingleton { INSTANCE; private DataSource dataSource; private EasySingleton() { this.dataSource = MYDB.getDataSourc...

 
Is that hypothetical? It looks like a basic implementation to me.
 
IDK, it looks like an enum that's trying to be a class to me
 
haven't answered on SO in a while, feel like I have to pimp my answer here though
0
A: Translate Low level disk name to high level disk name

BenVlodgiIf you want to see a list of all your mapped drives and their resolved paths Console.WriteLine(String.Join(Environment.NewLine, GetUNCDrives().Select(kvp => string.Format("{0} => {1}", kvp.Key, kvp.Value)))); If you want to get a list of possible shorter resolutions for a path. v...

also monking
 
0
Q: Enum Singleton implementation in java

RahulI just wanted to implement the enum singleton in java. Below is my implementation where I have tried to create a singleton datasource instance. public enum EasySingleton { INSTANCE; private DataSource dataSource; private EasySingleton() { this.dataSource = MYDB.getDataSourc...

 
@Mat'sMug dang son, you're rolling in the rep these days
you too @200_success
 
7:38 PM
@BenVlodgi huh?
 
imagine this is reputation, and that is you
http://hellogiggles.com/wp-content/uploads/2015/02/06/75149-Huell-rolling-money-bed-gif-D6gB.gif
 
hmm, I'd rather it be cash :)
 
I haven't been on in a while, and every time I do, you guys are just woosh, up there :)
 
hehe
 
@Mat'sMug gotta make meth instead of methods
 
7:47 PM
0
Q: Testing a socket-based application

PhrogzSummary: How can I best write tests that override socket-based communication for a library, capturing what is sent over the socket, and simulating responses based on what is sent? Details I'm adding a new feature to ruby-mpd, and it's extensive enough that I'd like to add tests covering many sc...

 
8:04 PM
@BenVlodgi @Mat'sMug is a review-aholic.
 
meh, I'm barely half as active as I used to be
I need coffee
 
8:31 PM
Alright, I'm back in Belgium
hi friends
 
Asking for a library that does the same thing is discouraged here. Also: there's no real concrete question here except, 'how can I make this better?' That may be okay on Code Review, but I would strongly encourage you to independently profile and test this code on your own so that you can identify performance bottlenecks. It's too broad for here and I don't want you to copy-and-paste this same question over there, but I do want you to profile this and figure out what kinds of pain points you're running into. — Makoto 5 secs ago
 
@CaptainObvious That was deleted on SO and reposted here.
 
9:00 PM
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: Is my design is still a state design pattern, or some abomination?
 
0
Q: Python sprint game - follow-up

D.CThe following code is a sequel to the original Python sprint game. The original owner of this code is @mango. If there are any improvements, please let me know. # these are the modules we'll need import sys import tkinter as tk class SprintGame(object): # this represents the distance we'll ...

 
This question might be better suited to Code Review. It certainly doesn't seem Pythonic, though. — jonrsharpe 54 secs ago
 
9:24 PM
0
Q: Best practice for ajax response

user2751085I want to create an Ajax-Login, but I'm not sure if my solutions is generally correct. I want to do everything correct, so i need someone who checks this code and give me some improvement hints. public static function Login($username, $password) { $result = \Helpers\Database::get()->select("...

 
@Mast hooked on code
 
Cross-posted on Code Review; should be deleted on Stack Overflow. — 200_success 46 secs ago
 
0
Q: File presence check for an automated workflow

dongleI am working on a script for an automated workflow. It expects a CSV and a disk image to be present in the directory that is supplied as args.input. I want to check for and handle every possible scenario: no CSV, no disk image, too many CSVs, too many disk images, and any possible combination th...

 
9:47 PM
On code review I was told this: If you didn't know, your code is not cross platform. This is as msvcrt is MS Windows only. To allow use on Linux and OSX you should use sys, tty and termios, as shown in this SO answer. Doing this will allow more users to use your program. — D.C 56 secs ago
 
0
Q: Basic Server/Client Model built around ASIO

XiremaFor this project, I'm using the non-Boost version of the ASIO library. The basic idea is that it is a relatively simple stand-alone class capable of functioning either as a server or client depending on its needs. It performs all networking in an asynchronous paradigm, and as best as I'm able to...

 
monking
 
possible answer invalidation by DontForgetTheSemiColon on question by DontForgetTheSemiColon: codereview.stackexchange.com/posts/120269/revisions
 
hmmm
probably too late to add more code
 
00:00 - 22:0022:00 - 00:00

« first day (1019 days earlier)      last day (2984 days later) »