« first day (1537 days earlier)      last day (2774 days later) » 

00:00
RELOAD! There are 4167 unanswered questions (90.8958% answered)
00:11
@Mat'sMug Just had a La fin du Monde, not bad really. I kinda like it.
@EBrown is tipsy!
Not even close lmao
Try La Maudite if you like La Fin du Monde
If they have it I'll make sure to get some. :)
So if I'm interpreting the theory correctly, when someone reads your code, they should be able to read the source to see what it's doing, and read any comments to see why it's being done. Correct?
00:18
Yes.
I.e. n = i * 2; // Double index for offset: the n = i * 2 tells me what is going on, and the comment tells me why we're assigning i * 2 to n.
Of course, you can eliminate that comment by defining a constant: const int offset = 2; n = i * offset;
But then where does 2 come from? Well it's the sizeof(short): const int offset = sizeof(short); n = i * offset;.
So, in reality: yes. Comments should describe the why, but you can eliminate some of that requirement by writing code that explains the why.
Also, I suppose, using sizeof(short) would be more portable
Yep (I was writing pseudo-C#, but pseudo-C is more appropriate).
So, bottom line: use comments when things are non-obvious, but try to design the code such that minimal comments are required.
@LegionMammal978 Also, as @Mat'sMug said earlier I've been drinking just a smidgen so things might not be super clear.
Seems clear to me.
Oh good
To be fair: I get super above average at programming when I drink, but I lose some typing skills.
@Hosch250 Enjoying your evening?
00:46
@EBrown Fun fact: Approximately 80% of claims I make on any official SE service are incorrect, as opposed to my regular average of 65% incorrect
@LegionMammal978 My usual is ~75% incorrectness, when I drink I get to ~50% incorrectness
:D
Also, whenever C is mentioned, I always start feeling a near-irresistible urge to write a C program with very good error handling
I have no idea how to write good C
I refuse
I'm so bad at it
I can't even write C++
Sometimes when I can't think of any variable names I just name my variables as an abbreviation of their type followed by a numeric index
Lemme see if I can find a good (bad?) example of this
@LegionMammal978 That's such a bad idea lmao
00:51
in 2017 Stack Overflow Moderator Election Chat on Stack Overflow Chat, 1 min ago, by RubberDuck
No no no no no @Shog9. No more. I do JAVA now.
@EBrown Blanche is good too, had it a few times
I have (for evil reasons) in VB.NET names things _, __, ___, and so on.
@Phrancis I Like them both son tar
*so far
@RubberDuck Not Java or java?
NO. I JAVA
Ok ok ok I'm sorry don't hurt me
00:54
Lmao It looks like I'll be heading to south-east Ohio in August, you going to be about?
@LegionMammal978 I don't know what any of that does but those names hurt my feelings.
@EBrown It does networking stuff
Oh nice
I wrote a pipe once, but that was for college
if (i3 != 7 || cP1[0] != 'A' || !isdigit(cP1[1]) || !isdigit(cP1[2])
    || !isdigit(cP1[3]) || !isdigit(cP1[4]) || !isdigit(cP1[5])
    || !isdigit(cP1[6])) {
lol, C doesn't have very easy regex
01:00
@LegionMammal978 s/regex/anything/
I'm voting to close this question as off-topic because it belongs on Code reviewG5W 12 secs ago
0
Q: ES5 class to handle analytics fetching and caching

omgimanerdThis class reads a log file stored on my server, parses it, and returns it. It also caches the data so that subsequent calls to get the analytics data will not have to read from the file. The analytics files will be relatively small, so memory usage is not a concern. The callback passed to getAn...

@EBrown I'm always around. If it's a Friday around noon we can hit my office up for lunch.
@RubberDuck Hell yeah, that sounds like a plan. Do they have good food?
Monthly meeting. Chef's in the house :) #connecting https://t.co/mrfuZCnB3U
We have a Chef. =)
01:07
Wut
It's so terribly hipster, but it's good eats.
Lmao I'm no hipster man, I'm like the opposite.
Makes two of us. Actually, I have no idea how we have such a hipster culture. Most of our Craftsman are anything but.
Hah, happens man. The owner is probably mostly hipster or something, it'll be someone high-up.
I have nothing against it, just not the culture for me. I'm much more a low-key, out-of-the-way, stick-to-the-norms person.
I was hipster before it was cool. Now I'm just an old beatnik yelling at kids to get off my lawn.
01:11
Hah, if I had a yard that'd be me.
I'd literally have a video camera watching my yard 24/7.
> EDNA YOUR GRANDSON CRAPPED IN MY BUSHES AGAIN
@RubberDuck That looks like mostly fruits and...seafood? If so, I have serious allergies to seafood.
01:35
It's always different. That's also our Des Moines office, which is way nicer than our Columbus branch.
My wife and I seriously talked about it when they were asking for people to relocate to Iowa. I seriously love the folks at our office out there.
0
Q: Builder/Wizard API for immutable objects

Dmitry NoginThere are a lot of parameters I would like to configure for my Analysis object, so having some kind of composition helpers is a big thing to simplify proper use of it. Let’s say that we have only 3 parameters for the sake of clarity (there are a way more, but amount of code in C# is overwhelming)...

0
Q: Basic command line REPL calculator

Brady DeanI'm pretty confident in this code but I want to be sure I haven't missed anything to do with optimization or error handling. The program takes input in the form of {number} {operator} {number} and prints the result. If the input is invalid it prints nothing. Example input: 1.0 + 2.0 Output: 3 #...

02:15
@janos ,what is your real name? Did you send me a request on LinkedIn in the last 24 hours?
 
1 hour later…
03:18
0
Q: Computing sum of elements with mutlithreads

CroCoI'm reading about multithreads with C++. My code is to compute the sum of elements using multithread approach. The code is #include <iostream> #include <thread> #include <vector> #include <atomic> void func(std::atomic<long long>& sum, const std::vector<long long>& vec) { long long result(...

03:46
-1
Q: RxAndroidBLE - simple read and display 1 value from BLE112

user3286543I'm totally new to Android Studio. My simple goal is to read a value from my BLE112 and display it in an app. I'm using Android Studio 2.4 Preview 7. I've taken the official example code for RxAndroidBLE and cut it way down, but still can't get it to compile. Any help/suggestions would be greatly...

04:02
0
Q: A single race toy using qt and c++

ProI have an implementation of a single race (toy race) based on a dice, so that the toy go through three different states(situations) where the toy is first outsidetheboard , secondly abouttostart thirdly, gototheend so i have three different classes for that and then another class for the toystat...

04:18
According to the cable company reps who keep calling me, it's because I haven't upgraded to the XTREME GIGABAND PANAMAX FLAVOR-BLASTED PRO PACKAGE WITH HBO, which is only $5 more per month for the first 6 months and five billion dollars per month after that.
7
04:33
0
Q: Generating Bitly links in a Google Sheet

Jon BourneI have this set of functions in my Google Sheet to create a Bitly bitlink whenever data in a row is changed. While this does work, it seems really slow to me. Looking at the Execution transcript, it looks like the lag is happening when the script queries the Sheet: Spreadsheet.getRange([L6]) [9...

05:16
In that case the question belongs here: codereview.stackexchange.comJohn Zwinck 45 secs ago
@RMunroe lol
05:48
Monking
2
Q: IQueryable result different from IEnumerable

Tadija BagarićMy task is to optimize some methods and while looking at code I found this bottleneck (I apologize if the formatting seems off): // ... IEnumerable<Card> storageCards = Db.StorageCards .Where(x => x.Active && x.DocumentType == (int)DocumentType.Import); // excludeLast...

06:33
@SamvelPetrosov the results are different which implies a bug and, unfortunately, broken code is off-topic on Code Review. — Tadija Bagarić 20 secs ago
@SamvelPetrosov I disagree; the fact that this bug came up during optimization doesn't mean it's a suitable question for code review. — Rob 6 secs ago
Monking
06:57
This sounds much like a question for Code ReviewBergi 18 secs ago
0
Q: Optimization of Javascript Function swapping out images for gifs

user2647510Im working on a project where a grid of images are loaded all at once. when the mouse is on hover a certain image, a corresponding gif fades in and then fades out when the mouse moves away from the image. I was able to get a working fiddle with the code i currently have. i have about 20 images ...

07:43
Monking
Hello, I had a question.
May I ask about a piece of code
and why they are doing what they are?
I understand the code, I just understood why it is being done. It's very simple python code.
@V
@Vogel612
huh?
I mean... ask away, but I've got to catch a train in <10 minutes, soo ... I won't be of much help
08:02
You should be posting this in Stack Exchange network of Code Review. Stack Overflow is not for reviews. - codereview.stackexchange.comSudipta Mondal 42 secs ago
Kaz
Kaz
Monking @all
08:27
0
Q: Why compare number of pixels vs pixel intensity

JonathanI am looking at the following piece of code: import numpy as np import cv2 import sys def calc_sloop_change(histo, mode, tolerance): sloop = 0 for i in range(0, len(histo)): if histo[i] > max(1, tolerance): sloop = i return sloop else: sloop = i def process(inpath, ou...

Kaz
Kaz
@CaptainObvious VTC - Explanation of others' code
08:41
0
Q: Entity change tracking using javascript Proxy class (part of a wip ORM)

user1852503I am building an ORM to be used in the browser (I have control over the browser used by the user), this ORM should work nicely with redux so the API needs to be immutable. I want to support actions like undoing changes, getting all the changes so they can be used in a PUT request and later on en...

Cast the final close vote as this question has now been posted on Code Review, so it makes sense to keep the answers together in one place. If you have an answer to post, please do so over there. — Cody Gray 35 secs ago
Kaz
Kaz
@CaptainObvious VTC - No Code
0
Q: Better way of improving performance of getting data from MySQL?

Chris BeckettI'm just wondering if there is any improvements that can be made on my queries, as i've looked around and posts are saying to use UNION ALL instead of OR but with the performance times it looking like the OR condition works out better. Could anyone please give me some advise on improving my que...

08:57
@CaptainObvious @Kaz Has code now.
possible answer invalidation by u6f6o on question by u6f6o: codereview.stackexchange.com/posts/169589/revisions
What's the problem? This may be better suited to Code Review. — DCON 37 secs ago
0
Q: Shuffler with generics for C#

monsieur_hThis is something I am always asked by managers and clients : "make it random". More often than not, this isn't what they want. Comments like "I had the same element twice in a row !" and "I don't see lement X often enough !" are common, even if they are part of the "true random". I came up wi...

09:29
0
Q: Syntax highliting for Angular2+ questions

BCdotWEBWhen looking at this question, I noticed that the syntax highlighting wasn't that great, most likely due to the mix of one block with HTML and Angular2 and blocks with TypeScript. I decided to improve it by adding the necessary language hints -- <!-- language: lang-or-tag-here --> -- but looking...

10:16
Greetings, Programs.
-1
Q: Deep running example low accuracy

shchoI study the Deep Running just 2days. KK I was test bear(panada) & flower etc I want to implement to Input data (cvs.file) -> hidden layer(n-n) -> result ( various_value ) result is not 0 or 1. I saw the Deep Running has many methods(RNN, CNN, NN, ect)???? I'm not enough to know that. So, I...

10:30
possible answer invalidation by Here_2_learn on question by Here_2_learn: codereview.stackexchange.com/posts/169530/revisions
0
Q: Minimalistic template processor in Java

gil.fernandesThe Java code below is a minimalistic template processor which was created to avoid importing a full template library, like e.g: Freemarker, Mustache. I had also the situation that String.format could not handle loops. The template "language" should only support 2 elements: a variable type with ...

this should be in SE codereview — XtremeBaumer 33 secs ago
@Duga Rolled back
I'm voting to close this question as off-topic because the OP code is working fine and has no issues but needs better ways to do it. This question is better suited for codereview.stackexchange.comUma Kanth 52 secs ago
> I'm not enough to know that.
That's not what you intended to write.
11:02
0
Q: Aes encryption c#

Lolidzeplease help me to optimize the code. Task is to encrypt part of the file using aes encryption algorithm. I did public static byte[] AES_(int len, byte[] passwordBytes, byte[] saltBytes, FileStream fSin) { byte[] encryptedBytes = null; byte[] encryptedBytesAndIV ...

11:57
@XtremeBaumer : I m not looking for code review, instead another approach. But will consider reviews for future questions. Thank U. — Frontier 23 secs ago
12:33
What is the question here? This isn't a code review site. On the fact of it, this looks like a duplicate of your first question. — David Heffernan 38 secs ago
Thanks to everybody with special mention to @BiranCane . I have selected this answer in Code Review . — avikpram 33 secs ago
12:55
If your code is actually working, you might want to ask on CodeReview instead — Terry 8 secs ago
This is helping me during code reviews. This is jus convention like camel case. If you are used to it, it looks od when its not there. — PaweÅ‚ GaliÅ„ski 37 secs ago
-2
Q: Calling intent into the same activity

BlahBlahAs the title suggests, I am trying to call intent in the same activity. My project has a list of categories and when you press on a category, it should open its subcategories. Because they have the same layout, I want it to call the same activity again. And I dont want to create new activity ju...

13:17
0
Q: Number of ways to complete a plan

Sarah MI worked on a dynamic programming problem. Here is its link. I have to find the number of ways respecting the constraint that user doesn't go to the Gym for two consecutive days. public int numWays(int n) { int[] DP = new int[n + 1]; DP[0] = 0; DP[1] = 2; DP[2] = ...

@BryanOakley is correct. This kind of question belongs on Code ReviewSH7890 20 secs ago
possible answer invalidation by mkrieger1 on question by Here_2_learn: codereview.stackexchange.com/posts/169530/revisions
Thanks! I will post it on code review. — hacker 39 secs ago
13:34
0
Q: Faster solution for data grouping to determine highest frequency than iteration with for loops

kitestringThe code below allows me to determine what the most common main dish and the most common method of preparation for the most common main dish, for each US Region. It uses data obtained from 'thanksgiving-2015-poll-data.csv' which can be found here https://github.com/fivethirtyeight/data/tree/maste...

0
Q: How to properly implement Tkinter module for software development?

hackerI am new to Python software development, especially using Tkinter. I just wanted some pointers to help my code look and operate in a more clean manner. I posted this code which is a mini risk management tool for work, so that I can run some reports automatically. from tkinter import * from tkin...

@Duga It's fine, just typos and formatting.
13:48
0
Q: A small app-crawler created using python

SMth80I've written some code using python having tried to comply with OOP design for the purpose of collecting name of the app, price and developer name from i-tune site by going deeper until there is a limit [which can be toggled within my script] to stop as it has millions of links to go if that is n...

14:00
Hi, you will find better answrs on codereview.stackexchange.comChris 21 secs ago
> ValueError: Attempted relative import in non-package
WTH...
0
Q: Patience game (Klondike)

VinagyI've been working on a Patience clone in java using javaFX. It's not finished yet, there are some features not working and some bugs still there, but I'm really in need of some structural advice and I know that alot of the things I'm doing are just getting real messy. If someone has the knowled...

0
Q: Seeded array shuffle

Niet the Dark AbsolThis should be relatively simple, but I want to know if I've done the randomness bit correctly. <?php function seeded_shuffle(array &$input, int $seed) { $rand = function($max) use (&$seed, &$rand) { static $rng_a = 0x41C64E6D; static $rng_c = 0x00006073; // rng_m = 2...

@Mast Wat, wtf caused that?
@Peilonrayz Trying to import a file which apparently isn't packaged, or something.
Not exactly sure.
Oh, I still don't get the whole relative imports part of Python... :/
14:09
Matters are complicated by using this in interactive Python. Perhaps the error will magically go away from script.
Ugh, nope.
Wait, perhaps more explicit.
Nice, I Googled it, you running the code via -m? If not does it have a valid __package__?
It doesn't have a valid package, no.
Running via -m or not doesn't matter.
Importing someone else's code, always fun...
Huh, perhaps it's how the imported file handles it's imports.
from __future__ import print_function

import re
import time

from . import kvMemoConfig
from . import canlib
from . import kvmlib
from . import?
Can't remember using that before.
Yeah relative imports, :/ Is that your __main__?
No, that's the top of the file I'm trying to include.
And yes, you need the SDK and example code to replicate this behaviour.
Which is freely available, but I imagine you got better things to do :-)
0
Q: Cmd based email interface with attachment facility

A JI'm new at programming. This following code is written in Python. I was wondering if someone could help me to improve the code or suggest something better or more efficient. import os import smtplib from email.mime.multipart import MIMEMultipart from email.mime.base import MIMEBase from email.mi...

14:19
@Mast Include as in import or C&P?
possible answer invalidation by tigrou on question by tigrou: codereview.stackexchange.com/posts/169562/revisions
@Peilonrayz There's a class kvDevice in a file kvDevice.py. I import kvDevice, which should import the class from the file, IIRC.
Ah, no, it includes the file, but that's ok.
I try to use the class like device = kvDevice.kvDevice(), but the interpreter never gets there.
If you want it to work with from . import, which would be the simplest. 1. Make a package, so a sub-folder, sub with an __init__.py, and a file, such as file.py. 2. From your main file outside the package you can import from the package such as import sub.file. 3. You may instead want to use python -m sub.file, if file is your main
Otherwise you can't use relative imports as __package__ is not correct
I suspect that's going to be turtles all the way down, since the file I import is importing multiple files probably violating the packaging.
So that would include me making a lot of packages.
@Mast It looks like it's already setup for that... But IDK
14:34
And here I thought Python 2 was completely backwards compatible...
I strongly suspect this code worked pre-packaging bull, like 2.5.
@Peilonrayz Would re-writing the import statements fix anything?
I can just copy half of the file over, at least the class I need, and do the wacky imports myself.
Yes, it would quickly become a God file, but that's better than non-working code.
@Mast Relative imports came out in 2.4, 2.5 and 2.6 at the same time it seems
IIRC from the last time I looked at them, there was nothing like, syntax wise, them before hand.
@Peilonrayz I thought only 366 would be relevant here, but OK.
0
Q: Gaussian function generates the same data every time, how to optimize that?

ROS_OPENCVIn my code I have a function that generate a 2D gaussian function given sigma like so: #include <opencv2/highgui.hpp> #include <opencv2/imgproc.hpp> #include <iostream> int main(int argc, char* argv[]) { cv::Mat kernel = getGaussianKernel(rows, cols, 50, 50 ); //Then I use that kernel for s...

@Mast That looks like an addition to the spec. I tried doing that, and it errored as sub wasn't setup correctly, :/
@Mast Probably would be fine to do that, but IMO it'd be easier to get relative imports working. import sub.main should be all you need, if you've not edited anything
@Peilonrayz I don't think I can get these imports to work.
The entire reason I'm still stuck on this is because our local expert is in the hospital.
Talk about bus factor...
14:45
possible answer invalidation by bedi on question by bedi: codereview.stackexchange.com/posts/169290/revisions
@Mast Ouch, I hope all is well
@Mast Try messing with something like below:
# main.py
import mod.base as base

Test = base.Test
print(Test)

# mod/base.py
from . import other

print(__package__, __name__)
Test = other.Test

# mod/other.py
class Test:
    pass
I renamed all from . import x to import x. Poof, problem gone.
Probably not how this is supposed to be done, but it works.
@Duga rolled back
@Mast That was easier than I thought it'd be, guess there's no from ..x import ys :)
0
Q: Regular Expression Matching: Recursive and DP-based implementation

yangsuliProblem Statement: Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding element. The matching should cover the entire input string (not partial). The function prototype should be: ...

14:54
@Peilonrayz Python: easiest approach usually works.
Should've known...
Luckily the project isn't that much files.
Ah, now the calls have changed slightly it appears, but that's the easy part.
Guess this is going to work after all :-)
That's fortunate, :) Strange that the calls changed tho...
devices = kvDevice.kvDevice.allDevices()
allDevices is a method of the kvDevice class in the kvDevice file.
So I should probably import kvDevice from kvDevice instead.
Instead of simply import kvDevice.
Oh, that makes sense, I'd agree with that, :)
Yup.
Oh well, we never have time for reviews anyway, so I'll have time to fix this up later.
Odd things are still happening, but the basics appear to work.
15:47
Monking
0
Q: Weight Lifting App to calculate a One Rep Maximum

JimI'd like feedback on the main entity in the Core Data model of my "One Rep Max" weightlifting calculator. All feedback is appreciated and in particular, I'd like to know if I've done a decent job of giving the object the right responsibilities and if you see any opportunity for refactoring any of...

16:04
@Jesus: it's a valid question. I think it got downvotes (not from me) because it is a "how do I make my code better?" question, which typically belongs on codereview.stackexchange.com — inspectorG4dget 50 secs ago
@Java-people: Has anyone used the Netflix/Hystrix library?
16:21
0
Q: Keeping an updated model class and accessing it from multiple view controllers in Swift?

5AMWE5TI have a model class with user's information in it. I want to display some of that information with one view controller, update/change that information in another, and keep all of the views up-to-date with whatever is in the model class. I was told using a singleton could work but is not recomme...

0
Q: Looping through columns in two different directions consecutively

MarI have a dynamic number of columns and a dynamic number of objects to place in those columns. I wish to place each element of an array in one of the columns, when I get the last column place the next object in the last column and the go in the opposite direction, repeating forwards and back unti...

stackoverflow is specifically for technical problems (bugs, code that isn't doing what it's supposed to, etc). If you're looking for opinions on the best way to organize your code, you should try the codereview stackexchangeeiko 50 secs ago
16:50
0
Q: MySQL Schema for Tag System Works, But Can It Be Better?

MrZoramanI'm working on system that tags images. I'm going to use the xxHash (lz4) for hashing images. With hashes of size 64 bits, it looks like I won't have a 50% chance of a collision until ~4 billion images are added. At that point I think a collision would be the least of my worries. The size of my ...

@SimonForsberg No wish I could.
17:09
0
Q: Which is better: ExceptionHandling or returning

Eugene G. UstimenkoHave the following code: if (message.hasNoSequence()) { throw new IllegalArgumentException(); } ... @MessageExceptionHandler({MethodArgumentNotValidException.class, IllegalArgumentException.class}) public Message handleMethodArgumentNotValidException(Exception e) { logger.debug("ha...

0
Q: A simple game using qt and c++

ProI have an implementation of a single race (toy race) based on a dice, so that the toy go through three different states(situations) where the toy is first outsidetheboard , secondly abouttostart thirdly, gototheend so I have three different classes for that and then another class for the toystat...

17:36
0
Q: Component-based system for animals

DenisI'm making a small Zoo application, in this question I will cover only the basics - the animals. I've picked the component-based design over inheritance because the creatures can be quite complex thus I need as much extendability as possible. I've left most of my questions inside the code in th...

@Marc-Andre So at least you've heard about it?
If you have something which almost works show it, please. If it completely does what you want and you are worried about efficiency, then the code review site is probably what you want. codereview.stackexchange.comYunnosch 59 secs ago
@SimonForsberg A little bit yeah, some blogs here and there
@Marc-Andre We're gonna start using it at work.
Given the description of it, we really need that.
The documentation seems clean and useful for now! Looks like work to implement though
17:59
@SimonForsberg Is this the library they use to protect from the Chaos Monkey?
@syb0rg Chaos who?
@syb0rg Yep, sounds like it.
Isn't there some change about the chaos monkey that people didn't like?
Yeah seems like "V1" of chaos monkey is at github.com/Netflix/SimianArmy
Huh, it has nothing to do with Netflix?
18:10
possible answer invalidation by Minä on question by Minä: codereview.stackexchange.com/posts/169100/revisions
@skiwi What do you mean?
@skiwi Nope. It's just libraries that Netflix developed.
Since this question has already been reviewed, please do not make changes to the code in the question as this invalidates answers. If you have questions, feel free to explore our meta site or ask in our chat room. — syb0rg 8 secs ago
@SimonForsberg Well they do use them in production though
So it has a lot to do with Netflix
@Marc-Andre Well, yes, of course.
Can anyone remember, wasn't there some common SDK program available where you could easily setup stuff like Python, NodeJS, etc.? I think maybe even it supported Java. And it was available for several platforms.
Or was it just a dream?
18:15
It has nothing to do with the movie/series production part of the Netflix company, but it's used for the back-end and client I'm sure :)
Kaz
Kaz
Any python users around who can help with some debugging?
0
Q: Redesign for a C# API Wrapper

SharpLizardI'm creating a wrapper library for an API, and I hit a block on how to redesign it. The entire library is static, and I'd like to change it to make it more testable. There is a networking class, which makes the requests. And there is a class for each endpoint which abstracts the parameters for t...

@SimonForsberg Ah okay
18:32
0
Q: Test code for custom malloc

Dj DacI've been working on a custom malloc where the test code is the following. #include <stdlib.h> #include <stdio.h> #include <sys/types.h> #include <unistd.h> #include "../tst.h" #include "../brk.h" #include <time.h> /* returns an array of arrays of char*, all of which NULL */ char ***alloc_matri...

Kaz
Kaz
NVM. Figured out my problem. When I created my API key, I didn't actually give it any permissions.
Not quite an off-by-one error, but feels about as stupid.
18:46
I'm voting to close this question as off-topic because it has been cross posted to codereview.stackexchange.com/q/169646/127098Stephen Rauch 38 secs ago
19:13
@Kaz shout it
oh, you fixed it. Glad I could help
2
0
Q: Beautiful Number Validator

Jae BradleyProblem Adapted from this HackerRank problem. Instead of printing YES or NO, I just wanted to return a boolean. Implementation public class BeautifulNumberValidator { public static boolean isValidBeautifulNumber(String s) { if (s.length() < 2) { return false; } for (i...

Kaz
Kaz
@MrGrj ^^
19:33
@MrGrj Have you ever used hypothesis?
You might want to post this in Code ReviewJoao Delgado 16 secs ago
@syb0rg nope
19:49
@syb0rg No activity in the Java code for one year? github.com/HypothesisWorks/hypothesis-java disappointing.
The python one seems to be much more alive.
@SimonForsberg I didn't know they had a Java repo, they should develop that further since Java lacks a good property testing library IMO
My team at work uses the python library and are looking for a good Java one
@syb0rg apparently @alecxe has used it but I haven't seen him here on 2nd Monkingtor
0
Q: handling nested loops cleanly in python

codyc4321I have the following python script like: query_parser.py #!/usr/bin/env python def count_resources_per_category(resource_names): APPS_MAP = { 'billing': ["paypal", "checkout", "cart", "order-service"], 'browse': ["content", "localization", "pricing", "search",], 's...

0
Q: Numbers as objects

Alexander WeihmayerInstead of this.getValue(); I thought it would reduce duplication I had number objects such as this.value.get(); I have numbers that need min/max specified as well as other functionality and this is the most time efficient / centralized way I could come up with class Num{ constructor(v...

20:14
0
Q: Architecture for read-only API

DenaliHardtailI'm developing a web API for consumption by other applications. The API will be read-only. We do not anticipate this requirement changing to make the API read-write. The database is Oracle 12c. This cannot change. The API will be RESTful and built using ASP.NET Web API .NET 4.5. This cannot cha...

0
Q: rails method for transaction type

Sajjad MurtazaI am trying to make a rake task but after completion my code i realized i need some refactorization. How could I do refactorization of the following code? def self.transaction_type(row) if row['SENDER_BLZ'] == '00000000' and row['RECEIVER_BLZ'] == '00000000' return 'AccountTransfer' ...

possible answer invalidation by code4Me on question by code4Me: codereview.stackexchange.com/posts/169600/revisions
Kaz
Kaz
Can you tell I'm not used to coding in Python yet ^^
@Kaz For a second, I thought the vertical alignment of those "p"s was broken. Then I realized that the questions start with "Python" or "python"...
0
Q: C++ Display methos 2680 lines into a simple one

ProI have a game that consists of Four countries each has four soldiers board that has 20 places to step on. Each turn a random dice lands a solider from each team on a place(number) on the board according to the output of the dice. After the trun ends the games display the current position of ea...

@CaptainObvious Err... what's that quote doing there?
Kaz
Kaz
20:29
How on earth did anyone manage to program before the internet, google and Stack Overflow. It seems incredible.
@Kaz man pages
Dark times
@Kaz Guesswork, mostly.
@Kaz Magic. The Internet slowly made the bizzards obsolete :(
20:45
2
Q: Validator for fractional numbers

Carolina KlerI used some web resources to find how to make a web page with javascript validator for fractional numbers. What do you think about it? How it can be improved and still look like a web page? Your help will be highly apreciated. Thank you very much!! <html> <head><title> JavaScript fractional numb...

0
Q: Bash - line breaks in pipe

nathI made a tiny little bash script, that prints the current IP Address to the command line. I checked the script with ShellCheck and I get the following message: SC2026: This word is outside of quotes. Did you intend to 'nest '"'single quotes'"' instead'? What is wrong with the way I have bee...

@Kaz People actually read the help pages.
And they actually used their minds.
You've seen the questions on SO, people don't use their minds anymore.
@SimonForsberg This applies to many answers as well
I'm voting to close this question as off-topic because it belongs on Code ReviewEJoshuaS 23 secs ago
@Duga Ugh. That recursion comment just reminds me of Simon's "used their minds".
21:23
Are you just asking for a code review? Or is there an actual problem you want to ask about? What are you expecting us to do with this? Is it just an advertisement for your code? — csm_dev 57 secs ago
if you don't have a question, you should post this here: codereview.stackexchange.comtima 50 secs ago
21:46
@Claies I removed that. Maybe I need to move this question to code review instead. — CodingYoshi just now
21:58
0
Q: Avoiding repetition in my method using c++

Proi am trying to improve my current code so that its easy to read. So the current code wroks well but i want to improve it and short it, maybe if i can avoid the repetition show that would significantly reduce. I go with mutliple choices, Choices1, Choices2, Choices3, Choices4, Choices5. And as it...

22:20
@Kaz LOL. I know the feeling.
Putting BOLD emphasis on the text in your question does not mean someone is going to rush to answer it. In fact, it often has the opposite effect to the positive attention you are trying to draw. Also there is another "StackExchange" site called codereview.stackexchange.com as part of the member network. This is actually better suited to your "review my code" question. Your question should instead be posted there. — Neil Lunn 45 secs ago
0
Q: Add new variable to php file

user2177927I am messing around with a script that generates an id, first name, and last name. I am trying to add a new variable called points to give each user a point. The problem is that the php file no longer updates and edits the entries in my data base compared to the default file. I got the files fro...

Guys, I don't mean to brag often, but sometimes I do really smart stuff:
1
Q: Find nearest safe split in byte array containing UTF-8 data (C#)

Size43I want to split a large array of UTF-8 encoded data, so that decoding it into chars can be parallelized. It seems that there's no way to find out how many bytes Encoding.GetCharCount reads. I also can't use GetByteCount(GetChars(...)) since it decodes the entire array anyways, which is what I'm ...

@Hosch250 @Mat'sMug ^^
22:37
Doesn't MaxDegreesOfParallelism = 1 essentially mean "do this sequentially"?
problems then And have concurrency you
@Mat'sMug Yeah, it's for demo purposes to prove the algorithm works 100%.
So basically "here's something that works. figure out the parallel part"
Yep
Which to be fair is indeed another question altogether. +1'd
> Find nearest safe split in byte array containing UTF-8 data (C#)
I gave him code which prepares that 100% correctly, up to him to do the parallelization part. :D
@Mat'sMug Tyvm. :D
22:43
Now you know that's NOT how you do it. And in fact how we emphasize specific terms of importance. ( See what I did there ). Anyhow, moot point. Your "review my code question" belongs on "codereview". Please delete it from here and post it there instead. — Neil Lunn 57 secs ago
Probably you want to ask it here codereview.stackexchange.comIlya Bursov 38 secs ago
@EBrown fixed syntax highlighting for ya
Thanks buddy. :)
(or rather, non-highlighting of quoted output blocks)
Code Review question (regarding this) incoming soon. :)
23:01
0
Q: Two circles overlap

PaparazziDo two circles in a 2d overlap overlap (r1 + r2) * (r1 + r2) > deltaX * deltaX + deltaY * deltaY I know pretty basic but is the math correct or did I code the math wrong? Or is there a style problem? internal struct HoleInfo { public float Diameter { get; internal set; } public float...

0
Q: Mongoose / MongoDB Schemas for a Blog. Posts and authors (Efficiently)

masterjohn12I'm programming a model for a blog with authors and posts. I was following this doc: Mongoose Query Population. My thought is that at the lines 34~37 will duplicate the posts. Another option is to nest the posts in the Author, but how I will get all posts?. Should I use MySQL?. Am I doing it righ...

23:15
0
Q: Timer Application switching between multiple timers

FunlambI have created a timer based on the Pomodoro Technique. I have added questions to some code blocks that just don't feel right but since I'm not a pro I don't know if there is a better way to do them. I would like to know areas that could be improved in an OOP manner. Simple programing patterns c...

0
Q: Splitting a UTF-8 string into equal-sized byte-arrays for parallel processing

EBrownBased upon a question from Stack Overflow, I wanted to expand on the answer I wrote and define a solution that would support ordering the strings (after processing). So this starts off with a basic struct, and you can guess what it's going to do: public struct Line<T> { public int Order { g...

@CaptainObvious 9/10 sometimes I'm not a complete moron
23:32
0
Q: Project Euler Problem 5 Performance

Chase G.I'm hoping for suggestions of a concise way to write my list comprehension filter in the first solution. I would also appreciate insight on the underlying reasons for some performance differences in my solutions for Problem 5 (https://projecteuler.net/problem=5). This first solution takes aroun...

0
Q: Get the value of a variable using the text *name* of the variable in VBA

BandersnatchI'm trying to loop through a list of variables named a1, a2, etc... and construct the name of the variable on the fly, something like this: a1 = 7 For RowNum = 1 to 10 MyVar = "a" & RowNum 'use MyVar in calculation MsgBox MyVar Next RowNum The problem is I need the value of MyVar, ...

@Sven and your approach is assuming that every 3rd party library is also developed with this great care and that your tests in packages cover all unexpected changes of 3rd party dependencies as well. Try this approach in real situations where hundreds of packages are involved and every change has to be legally documented and tested - not to mention that there are hundreds of parallel branches - who tells you that some merges are not lowering versions again - this might slip through in code review/testing. — Norman M 48 secs ago
@Mat'sMug I CANNOT FOR THE LIFE OF ME GET THIS BEER OPEN WHAT KIND OF CHEAP CANADIAN BS DID YOU TELL ME TO BUY? Lmao
0
Q: Two consecutive but separate if cases

Ethan WatsonI have 2 consecutive if cases like this: if(this == test) { set a variable } else if () { set a variable to something else } else { error } if (variable set earlier is this) { do something } else { do the other thing } do some more stuff this feels wrong, to have to separate if cas...

J/k got it open - had to use my other hand.
23:49
lol
Not gonna lie, this canadian beer is at least 1.5x better than the American crap I drank.
Which one is it?
I've had one of each today, currently drinking La Fin du Monde.
BTW why is your last paragraph showing up twice? Seeing double already?
@Mat'sMug It's supposed to: one is the input one is the output.
23:53
Hmm
It just proves that I didn't bork-up the string in the process. :D
Identifying them as such would probably help clarify
There's a title above them, but it's probably misleading

« first day (1537 days earlier)      last day (2774 days later) »