« first day (1151 days earlier)      last day (2852 days later) » 

12:00 AM
RELOAD! There are 2484 unanswered questions (92.9614% answered)
 
12:19 AM
Wow, just managed to get my Wii working
 
12:30 AM
-1
Q: Count Inversions Issue - Python

Sandeep I am not what is wrong with this algorithm to count the number of inversions. Please can someone look at this and point the issue def count_inv(nums): l_inv, r_inv = 0, 0 if len(nums) == 1: #print('Noting to do with', nums) return 0 else: mid = len(nums) /...

 
@Phrancis I have to fix the USB Loader on mine that stack errors for whatever reason
 
0
Q: Countdown Timer for Tests

AppleCrazyI created this countdown timer as a tool to count down the remaining time on a test a few months ago. However, I looked at the code today and it looks like it needs some improvement, but I'm not sure what to fix. Some problems I've already identified: It makes a call to a macOS-specific comman...

 
12:46 AM
@Matt Sounds pretty strange, though not exactly surprising
I didn't even realize the Wii had USB
 
1:17 AM
not natively.
Anyone know where I should look to get started if I wanted to make a chat bot for StackExchange..... I wanted to montior all 100 HNQ from SE and report on all link related to a specific site. Should not be to hard to get the logic for that down however I have no idea on how the bots like Duga, CO and others work.
 
I'm voting to close this question as off-topic because this question belongs to another site codereview.stackexchange.com — Thamilan 32 secs ago
 
1:33 AM
I should check meta.cr first
 
@Matt depends what language you want to write the bot in
There's a few chat libraries out there in Python, C#, JS, etc
 
@Matt FYI, CO is not a bot, merely a RSS feed
Duga is a true bot though
 
How did you change the feed name? By default one I made is just called StackExchange
 
Duga's code is here if you are interested
 
@Matt You have to be a mod
the login libraries are basically this workflow (do all this with the same cookie):
- Grab the login page's HTML and find the fkey element
- Login to a site (the chat domain's parent) using credentials and grabbed FKEY
- Grab the chat page's HTML and find fkey
- POST the fkey to chat to "join yourself to a room" which returns a WebSockets URL
- Use said WS url to handle incoming chat messages
All the chatbots aren't really based off "official docs" because there aren't any. We just looked at the network POST and GET requests in our browsers' dev consoles
 
1:43 AM
@Thamilan No, this question is on-topic for Stack Overflow and would be off-topic for Code Review, since it contains code that does not work as intended. Please see A Guide to Code Review for Stack Overflow Users to avoid making inappropriate referrals. Furthermore, even if it were off-topic for Stack Overflow, you would need to provide a bona fide reason for closing it; "belongs on another site" is not a valid justification. — 200_success 35 secs ago
 
Well this request certainly looks involved for me. Thanks for the info. I have some reading to do.
 
There's another kind of chatbot that uses a browser script and just adds text to the textbox and presses the send button
that's pretty easy to do
 
2:00 AM
I would be curious of all options but don't want to take the easy way out....
Wonder if I could host as a Google Web App. That I have at least minor knowledge of.
It is what I have for monitoring the 30q HNQ Feed
 
2:20 AM
0
Q: Invoicing Program Python

Tommy#Invoice Entering Program Ebay print("Ebay Invoice Program\n") while True: file = input("Enter 0 to Quit. Enter S to Search The File. Press ENTER to Input new Entries *Case Sensitive*: " ) if file == "0": print("Exiting Program...") break elif file=="S": key...

 
Just finished the C# 2 section in C# In Depth. Learned alot, but also knew a lot.
 
@Hosch250 I should really read that. Have the pdf somewhere. (sorry jon, but I can't buy that in turkey)
 
CodeReview.stackexchange.com would be a great place for this. — Qix 24 secs ago
 
I have the book. Have yet to crack the cover. I want to code c# but have no functional reason to do so. Making a small game for CR but it is taking a while as I prefer procrastination 1.0
3
 
2:38 AM
I should start a college and teach Procrastination 101, Procrastination 201, &c.
Anyway, time to wash the dishes. BBL.
 
@Hosch250 So you plan on working out the details later?
 
3:17 AM
0
Q: optimizing code that writes byte array image to disk

Toby DerrumI have the following code that that writes large images to disk. My application server is running out of memory and I'm wondering if I could somehow optimize the following: public void writeImgToDisk(byte[] base64AttachmentInBytes, String dmxi){ String destinationAndFileName = ""; ...

 
3:47 AM
@Matt What details?
Oh, on procrastination?
I'd already procrastinated by about an hour.
 
3:58 AM
0
Q: Parsing remote text file and inserting into database table

StevenMplsI did run this code through StyleCop. Goal was to optimize the reading, parsing and inserting of a file on the web and write the rows to a database table using a stored procedure. Contrast this (roughly) to my most previous code review here: C# helper class - mailto Different code but I feel like...

 
 
2 hours later…
5:31 AM
Monking
 
5:55 AM
0
Q: A CNN in Python WITHOUT frameworks

Shiva""" Convolutional Neural Network """ import numpy as np import sklearn.datasets import random import math from skimage.measure import block_reduce from scipy.signal import convolve import time def reLU(z): # activation function return z * (z > 0) """ ----------------------------...

 
6:43 AM
Monking
 
@Captain have you tried writing a title WITHOUT al lcaps
 
0
Q: Basic C++ lin-alg class - conditional jump depends on uninitialized values

C. FoeI am currently working on a small project in C++ to help me learn the language, but I am running into a bit of trouble unfortunately. I have written code for basic vector operations, and I want to make sure there are no memory leaks. When I run the test file through Valgrind, I am getting sever...

0
Q: Saving a list of ids in database sql

Syed Zainul AbedinI am working on an App where client can shortlist a person.I am using flask framework with sqlalchemy.I have add a column where shortlisted person names are appended to the columns. Here's the code for the shortlisted column. shortlisted=db.Column(db.String(2000)) When ever user shortlist ...

 
6:58 AM
i think this question belongs to code review. You can get good recommendations there. — Ev. Kounis 13 secs ago
Stack overflow is probably not the right platform for this question and you can check it on [Code Review Forum][1] by Stack Exchange. [1]: codereview.stackexchange.comPrerna Jain 8 secs ago
 
7:12 AM
0
Q: Optimisation Check Tool for YII 2

Prerna JainI have started working on Yii2. I want to ensure my code is appropriate and efficient and optimised as per the Yii coding standards. Is there any automated code review and optimization check tool for YII 2 and if yes, please suggest?

0
Q: Automated codeReview tool for YII 2?

Rohit GoyaniI have started working on Yii2. I want to ensure my code is appropriate and efficient as per the Yii coding standards. Is there any automated code review tool for YII 2 and if yes, please suggest? Please also suggest me if you know anything related it.

 
@CaptainObvious Two questions, with very similar titles.
And ideas.
 
And now I see how it happened.
 
@PrernaJain This question is not appropriate for Code Review. — EBrown 23 secs ago
 
@Duga Updated comment.
 
7:30 AM
Monking
 
Monking :)
 
I feel gross.
I have been sweating at work all day (11 hours) and now I need a shower.
 
I've just got to work and I already feel gross, it's quite humid here
 
@DanPantry I've been drinking again, shall we see how entertaining we can make this conversation?
 
7:45 AM
@EBrown Haha, I'd love to say yes but I do actually need to do quite a bit of work today.
 
@DanPantry Bummer.
 
Yeah, I have a deadline by Thursday and there's still a crap tonne to do. I'll probably have to go into overtime.
 
I opened the question in code review — David Michael Gang 39 secs ago
I'm voting to close this question as off-topic because it is a cross-site duplicate of codereview.stackexchange.com/questions/133260/…tripleee 9 secs ago
 
0
Q: Clustering nodes with Hamming distance < 3

David Michael GangI want to speed up the following code, which is from an algorithm class. I get a list of 200000 nodes where every node is a tuple of the length of 24 where every item is either a 1 or 0. These items represent a graph where the distance between them is the hamming distance(number of bits that t...

1
Q: Merging two sets of logic into one

Uri PopovRecently I had to add 2 different sets of logic for moving my player around the board. One lets the player pick a location and move him there while the other uses a dice. I'm reusing code for both cases and would like to "merge" them into one thing. Any help and suggestions would be greatly appre...

posted on June 28, 2016 by j4053

Question: Write a Java program to list out all possible even numbers that exists in between 1000 to 9999 and the digits exit in each of the even numbers shall not be repeated. Sample of output:- List of even without repeated digit 1024 1026 1028 1032 1034 1036 1038 1042 ... ... ... 9874 9876 Requirement:- i)Coding ii)

 
8:00 AM
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Hash Matrix performs Gaussian elimination
 
8:21 AM
@skiwi eh, no, not really. responsive websites are pretty easy these days.
I couldn't compare them to WPF/Windows Forms as I haven't used them, but if you know CSS and media queries you can make a responsive website.
 
Zak
Monking @all
 
I am dealing with async for the first time. I have an code review in few hours :D and am stuck with this async issue :P Going through callback info but as of now it is going over my head lol. — John Seen 35 secs ago
 
@Zak Monking
 
8:36 AM
@Duga kinda :\
Funnily enough he already has the code he needs, he just doesn't understand why it works the way it does
 
0
Q: Turn a vsscanf call into a sscanf call

David WohlferdI am reviewing some C code that uses inline asm. I believe there are 3 spec violations and 1 inefficiency in this code, but asm (especially inline asm) is tricky, so I could use a second opinion. For clarity, I have removed the x86 and amd #ifdefs, leaving only the x86_64 (aka x64) code. What ...

0
Q: C# - Job Pipeline

MilneyWe have a Console Application which runs to perform an Incremental load of our data warehouse staging area, with data from a number of production databases. The source database don't necessarily have a rowversion/timestamp/etc. column so we are currently using Change Data Tracking in SQL to load ...

 
this may be a question for Code Review — danjonescidtrix 10 secs ago
@danjonescidtrix Things that are Off-Topic for Code Review: Pseudo-Code, Example Code, Stub Code, Example Code. — Zak 26 secs ago
 
@DanPantry Imagine building an interactive table though, I can't imagine how to easily make one that also updates the database etc. while in an application it's straight forward
 
Better post this question to Code Reviewcomrade 51 secs ago
 
@skiwi #javascript :)
a jQuery grid plugin would do that fairly easily
 
8:50 AM
I think I'd be making both a frontend and backend for pretty much no reason if I only want an application
 
@Duga Does SO hate rust?
 
I mean, if you're okay with an embedded DB then yeah, application is fine
 
But I don't want to deal with jabbascript
2
 
jabbascript. that's amazing.
someone should make a t-shirt out of that.
 
Wth why did you do that autocorrect
 
8:52 AM
Yoobah koh ra doh ka mallo wampa mah yass ka chung kawah wookiee.
 
@skiwi you mean that wasn't on purpose?
 
0
Q: Properties Manager

user110071I'm trying to do a property manager that loads a yaml file and stores all the properties in a db. I'm not sure if this would be the right approach. Any suggestions? # -*- coding: utf-8 -*- """Properties getters. Module to obtain the application properties. """ from ..core import properties, ...

 
Monking all
 
Monking!
 
I think this question is more appropriate on Code Review.SE, since you are asking validation of a known working code. Also, SO can be slow if you don t get the attention of the cow boys looking for easy rep, or have a esoteric problem who attract specialist of the tag. — DrakaSAN 41 secs ago
 
9:04 AM
@DanPantry I don't know, still asleep or zombie right now
 
@Mat'sMug @EBrown after our conversation yesterday I've moved the e-mail literal string into a .resx and am now using string.Format instead.
Should make it easier to localise down the road too
 
9:29 AM
0
Q: Node.JS TCP Server Noob here

RepticHi so i just got in to Node.JS and am loving it but i am wondering if i am learning it the right way or using it right cause i don't want to learn it the wrong way then i'll have to re learn it so am basically making a simple server in Flash but i want to see if am doing it right handling client ...

0
Q: Animation for android ImageViews acting as game pieces

0X0nosugarMy question is about how to achieve a well-performing animation for a set of ImageViews, so that the foreground fades away and the background stays the same. Currently I'm writing a clone of "Color Lines" for android using a GridLayout as board and ImageViews with a transparent background as gam...

 
@CaptainObvious Title Noob here
 
9:46 AM
ffs
colleague pushed a change to master that altered API details, didn't mention it
now my API endpoint broke
chalk up another reason to have tests
 Value = option.Id == 0 ? "primary" : option.Id.ToString()
Id is an int. historically, we've been assuming that if Id is 0 it has a special case added to it
This change doesn't fix that, it just changes the type of Value to string and uses the word primary instead of 0
The special case is due to legacy schema we can't really fix at the moment, but whyyyyyy
This is literally why I suggested we have PRs
 
@DanPantry wat?
You do not?
 
We do
He doesn't use them
He commits directly to master
3
 
gaaah
 
Yep
Apparently PRs are too much work
I mean committing to master is fine, I guess, if you don't want to use git branch, but in that case I should really have forced him tos et up a fork
 
Do you have any large squishy objects you can use to gently convince him not to do that?
4
 
9:51 AM
Funny you mention that, yes, I do
I have a giant Poro Plush to help calm me down in these situations.
 
Your path is sealed then
 
I'm just preventing all changes without a PR now.
End of story.
 
Should not slow down the progress that much. You were soon done?
 
Zak
@DanPantry are you still getting your interview?
 
Christ, apparently the response from him after mentioning it is "you can just create another version to fix that"
Yeah, but the idea was that you use PRs for reviewing the impact of code
Once it's in master it's final.. when I then rebase my code on top of master that bug is included in my code and I have no idea where it came from
@Zak Yes, I fly out of the 5th of July
Honestly, there's just a really simple rule to abide by here
Don't change API signatures of a released product
3
At least not just on the fly like that
especially in the absence of tests
 
10:06 AM
LOL
 
Use the Poro Plush Dan, give in to the hatred.
 
so now the api sig changes from int to int | "primary"
which is just gaaaaaaaaah
I think this is why people hate plain JS development without types
They use types as a crutch to ensure they don't have to communicate their changes.
 
Hi. Busy trying to learn about code review. Seem to be doing a bad job of it. But like Zak's technique.
 
Paging @Zak ^
 
Zak
@Gareth Hi
 
10:13 AM
Interesting chat @DanPantry .. crutch to ensure they don't have to communicate their changes. ... Rule so communication isn't necessary.
:)
morning @zak
 
Zak
@Gareth What are you having trouble with?
 
@Gareth What do you mean by the last part? Not sure what you're trying to say with that :(
Welcome to 2nd, by the way. Ignore my rantings :)
2
 
I think it's meant as a corollary
@Zak conforming!
 
Zak
Being contrarian is more fun ^^
 
Monomking
 
10:21 AM
First: Which timer class are you using? I tend to use System.Timers.Timer for services. Also: Are you ever restarting your timer in the timer event handler? And most important: What problem are you facing? Is this just code review? — Thorsten Dittmar 39 secs ago
 
Now you're sounding more like a monochrome murderbear
 
@DanPantry Can you create a bot that automatically reverts direct commits to master?
 
@skiwi I can apply a rule to bitbucket that rejects any direct commits made to master
 
ohhh the bugs you could get from that
 
But I feel that would be very passive-aggressive
@Pimgd You wouldn't get any bugs at all - You'd just get my colleague going "why won't my code check in"
We don't tend to work on the same piece of code at the same time
 
10:23 AM
"detected direct-commit "revert of commit ..." by revertBot", reverting...
 
Oh yeah, reverting commits on master, that would be a bad idea
not least because it would mess up the history of master
 
and then you gotta clean up your tree
You'd be better off with commit hooks maybe?
 
again, bitbucket has that built in
 
=)
 
to reject any commits direct to master that aren't through a PR
 
10:25 AM
something that sends you mail perhaps
then again who cares 'bout mail
 
Do you want @Phrancis's inbox? That's how you get @Phrancis inbox.
2
 
yeah but you want some notification of direct commits to master, yeah?
then you can club your coworker.
I got it
you know those RC gun turrets with foam missiles
you put one near your coworkers desk
and a commit hook to detect direct commit to master
 
@Pimgd If I enabled that rule, I'd get notification of those commits by way of my colleague, who sits next to me, asking me why he has to create a PR because it's "too much work"
 
then, when the commit hook detects a direct commit to master by your coworker, it sends a message to something that'll make the turret fire
 
more like a nerf turret setup in the corner of your office... shoots someone whenever the build fails
 
This is the same person who refused to use git because it meant he might have to step outside of VS to use source control
@Quill That sounds ilke a hilarious idea, but I might get shot a few times too
 
Zak
@DanPantry Worth it.
 
@DanPantry Is there any hope left?
 
@skiwi The only hope left is to get the SQL developers to use the PR workflow
If everyone is using it except him, it only becomes a matter of time before they start asking why
 
10:28 AM
git-flow makes it easy enough, right
 
And they are. They also see the benefit of CRs
 
Microsoft released .NET Core 1.0 today, now only I need to figure out what it is
 
@skiwi cross-platform .NET
@Pimgd The entire scenario is really easy from a bitbucket point of view.
You create your branch. You work on it. You push it up. you get a url to create a PR. You paste that URL in your browser. Done.
 
@DanPantry What do you currently use?
 
@skiwi We use .NET Framework 4.5.1, but if you meant Git, we use Bitbucket.
 
10:29 AM
bitbucket point of view... blehhhh
Also,
"You work on it" and "You create your branch" both do some heavy lifting
 
git checkout -b branch-name master is heavy lifting?
 
@DanPantry Was more general but I see that you currently have to choose between .NET Framework 4.6 and .NET Core 1.0 when developing in C# if you want only Windows or cross-multi-platform
 
that's not bitbucket
that's git
 
@Pimgd No, we use Bitbucket as our integration point. EVeryone uses git on their PCs.
 
okay, so, use sourcetree and click "git-flow"
 
10:31 AM
bitbucket just hosts the "central" repo and handles integration between everyone's repos
 
all the problems are solved
maybe you can even command line it
 
I think you misunderstand. That means you have to use something other than VS. He won't like that. :)
 
hey @janos
 
@skiwi We use .NET framework because up until v recently, .NET Core was not production ready.
 
hey skiwi
monking
 
10:32 AM
Additionally, a lot of libraries are not present in .NET core that we would require - like System.ServiceModel
Hello @janos
 
hey Dan!
 
@Pimgd Even with Gitflow it would still require enforcing him to create PRs, which he won't do because it's too much work. Literally anything other than writign code and pushing it is alien to this person
 
Looks like I won't program today, there's a Visual Studio 2015 update
3
 
@DanPantry then you go to your manager and report the issue to them
in man hours
this guy won't spend 5 minutes, so I have to spend 15 minutes. This happens ~4 times a day. I'm getting frustrated by this.
 
10:34 AM
I think it's more of a culture issue as well, mind you. There's very much a culture of "get things done ASAP"
There's "no time" for code reviews
Which means a PR would, mainly, be a formality in most cases
I'd like to work to change that, but where do you start?
 
by getting everyone to jump through all the hoops in the first place
 
First step would be to find a different job :P
 
broken windows!!!
 
perhaps start by addressing the "no time" claim
it's wrong
it's a shortsighted claim
 
of course it is
there is always time for a code review
 
10:36 AM
you need to give an example that speaks to the guy
 
if you don't have time for a code review then you don't have time to fix the bugs that code will introduce in production
 
1
Q: "Big" structures and references

frlkConsider the case of a "big" structure such as one containing several BigInt variables. For example : struct BigStruct { x: BigInt, y: BigInt, z: BigInt, } My current understanding of Rust is the following : (i) I should not implement Copy on such a structure and (ii) I should manipulate...

 
they won't just take your word for it
 
^^ this doesn't belong on CR, does it?
Hypothetical code and such
 
I think it's hypothetical
 
10:38 AM
hypotetical code is off topic at Code Review — Pimgd 22 secs ago
 
there you go
 
@janos This was a prime example of why it is bad
 
> consider the case
> For example
 
I explained it to him, his reply was "You can just make another changeset and fix that bug then"
?! Yes. I can also stick needles in my eye to solve my myopia.
 
what about the release procedure of a bugfix?
 
10:39 AM
@DanPantry you should add "and then I spend 20 mins complaining about it online" in that discussion with your manager
 
@Pimgd lol, I'd rather not
 
the later you discover the bug, the more expensive to fix it
 
@janos That's actually a good one. Fixing a bug like that in production would require at least 1 days waiting time, and a change request to be raised.
And would also disrupt all users
 
exactly
 
that would be... bad.
 
10:40 AM
one of the top arguments I use, very easy to understand
 
This specific bug is not on code that is live yet but it is the principle
I mean, the change was introduced in code that IS live, but the collaborator code is not live - but is due to be finished this week
There's no guarantee it isn't affecting other things
 
I find it easier to focus arguments on one thing. So I separate the discussions for code reviews and for unit testing
but the biggest argument in favor of both is the shorter bug detection time
several studies have measured the cost of bugfixes in the function of delay, and it's intuitive anyway
other good arguments: information sharing (remove bottleneck developers), mentoring, improved quality
 
Could you please... not gamble with my PC?
2
 
why not?
 
heads for recursion, heads for recursion
 
10:49 AM
We don't do code reviews here. Your question might be on-topic for code review, but please review their faw first. — PeeHaa 38 secs ago
 
also, start doing code reviews with those who are easier to convince. It will spread to others later
 
> faw
 
this really happened at my workplace
 
@janos Unfortunately, it's just us two.
 
Zak
I need a "Hide Tables" Option ...
 
10:49 AM
@Zak DROP TABLE is a good way to hide tables.
3
YMMV.
 
@DanPantry only 2 devs? in that case, you just really need an intelligent discussion. If you cannot have an intelligent discussion where logic wins, then the best way is out
 
Right now VS is just spawned getmac.exe command prompts
 
0
Q: Prime number checker python3

Iso1234I have updated my code from the last time it got reviewed (Prime number calculator in Python 3.4.1). If anyone has some more suggestions on how I can improve this and/or make it faster it would be appreciated! def is_prime(num): '''Calculates whether num is a prime number, if it is retur...

 
user image
3
=_=
 
@Zak is that a relational schema? in 2016?
 

« first day (1151 days earlier)      last day (2852 days later) »