« first day (1559 days earlier)      last day (2753 days later) » 

00:00
RELOAD! There are 4241 unanswered questions (90.8522% answered)
00:12
0
Q: A simple cipher that uses the sums of previous characters

PlesleronTepryosI'm fairly happy with the code itself, but I'd like you to tear it apart. def sumcipher(inpt, o=0, encrypt=True): if not isinstance(inpt, str): raise TypeError("Input nust be a string") if encrypt: return ''.join([chr(((sum([ord(i) - 32 for i in inpt[j::-1]]) + (o % 96)) ...

00:25
possible answer invalidation by PlesleronTepryos on question by PlesleronTepryos: codereview.stackexchange.com/posts/172516/revisions
0
Q: File's encryption tool in terminal

TopinFrassiI've created a wrapper for the SimpleCrypt library that allows to easily encrypt/decrypt a string. The application is used this : //To encrypt python encryptor.py file_name -e //To decrypt python encryptor.py file_name -d Basically, to encrypt, I read the file, encrypt it and create a new fi...

Not that it's something I would bring up in a code review unless I had something specific in mind... — zzxyz 14 secs ago
00:44
0
Q: Unit test for restful api function

Joedown vote favorite I'm about to begin developing a huge project, and before I write all the API I want to get some professional feedback and redo things correctly. So right now I try to keep my functions as small as possible "create" "delete" etc. But each function has a bunch of logic inside of...

 
1 hour later…
01:53
0
Q: Packaging with autotools for Ubuntu

Dj DacI've developed a C application for Ubuntu and created the installer. The file structure is ├── autom4te.cache ├── build-aux ├── contrib ├── debian │   └── source ├── doc ├── gnulib │   ├── lib │   └── m4 ├── man ├── po ├── src └── tests configure.ac dnl Process this file with autoconf to prod...

02:12
This question is less about how do I solve a problem, and more about how can I make my code better... there is a stack exchange forum for that: codereview.stackexchange.com The nuance is subtle, though. — E. Ducateme 48 secs ago
02:29
0
Q: Doubly Linked List Implementation ---- C++

user146276Does anyone have suggestions on how to improve this? Specifically: Am I passing and returning references correctly to prevent unnecessary copying? Am I using destructors and the delete keyword correctly to prevent memory leaks? Am I throwing exceptions correctly? Also, just wondering whethe...

02:43
0
Q: Is there anyway to make my Rspec unit test cleaner?

Thorpe ObazeeI know how to write simple RSpec tests and unit tests but I just want to know of this is good enough or is there any improvements I can do. #Factories FactoryGirl.define do factory :task do name Faker::Lorem.sentence(2) end end FactoryGirl.define do factory :task_user_reference do ...

03:03
0
Q: Roll The Dice Game

c0d3rin0Introduce Hello, i'm currently begin learning javascript (actually begin learn programming) at Freecodecamp. I have learn variable, function, expression and control flow. This is my first game written in javascript, please help me review my code. Thanks you very much. Content bellow is pretty l...

 
1 hour later…
04:05
0
Q: Controlling Finances with Web Development

Vedvart1Purpose First, let me explain the title: I previously had managed my finances like an old fashioned company might, and it worked wonders for making financial decisions (at least for me). I wanted my friends and family to try but it took too much explaining of Excel to show them how. I thought no...

04:20
Monking
0
Q: Recursive function, traversing grid

theblindprophetI am building game where where a player must build a path from the bottom of the grid to the top. When a grid square is changed I check to see if they have completed the path (won). Because the check happens a lot, and the server is doing the check, I need it to be efficient. I am using basic ...

04:36
0
Q: Playing Card and Deck Class in Python

Throwaway25663579348I have recently started to learn python. My goal is to create a simple text based blackjack game. Anyways here is my code: import random class Card(): def __init__(self, value, suit): self.value = value self.suit = suit def show_card(self): print(str(self.valu...

 
1 hour later…
05:54
Monking!
0
Q: Side effects of function calls in if statement

Gilad GreenI'm new to C which I'm learning in university now, and I'm not sure if the following is considered in C good practices or not. For an assignment in a simple Classification problem I wrote the following code: Sample *sample = NULL; for(int i = 0; i < m && getline(&line, &len, file) != -1 && !st...

06:13
I'm voting to close this question as off-topic because it should have been posted on codereview.stackexchange.comNeil Lunn 56 secs ago
06:35
0
Q: Checking the same thing twice in a method, bad design?

SirI've been writing some code for my unity project where i am connecting players to a game and adding them to dictionary which is in a Database class. I have a simple method which is adding them to the database and if successful it then instantiates relevant game objects into the game. The thing ...

Monking
06:56
Wonderful ... I'm using my "legit" tabs to subsection the codereview tabs I haven't been able to get to by date...
@Vogel612 As long as it works :-)
well ... for whatever reason chrome decided to start bogging my PC after 28 tabs this morning ...
and now I have something like 40 open without the slightest hitch ...
gotta love IntelliJ, spotify and a CLI
I guess it might be related to some gradle daemons not being reused, but for now it seems I just have to regularly restart :/
0
Q: How to create a stream request for Transaction history by client id on Braintree vault. NODEJS EXPRESSJS

JonoDI have been trying to create a transaction history request from Braintree using a client ID on Braintree vault, and it took far too long to figure out how, so here is the code on server that I eventually used. Let me know if it can be improved. Nodejs server side : exports.transaction_histr...

07:20
possible answer invalidation by pun_intended on question by pun_intended: codereview.stackexchange.com/posts/172263/revisions
@Duga rolled back
@Vogel612 Wat, my Firefox doesn't even care till 100 tabs.
I'm pretty sure that my chrome doesn't either.
0
Q: Make one method with continue and return operators?

StepUpThe same code pieces in five methods are: fooFunction(data: any, path: string): Number { let result = 0; let decimalCount = 0; if (data.hasOwnProperty('length')) { for (let i = 0; i < data.length; i++) { let curItem = data[i]; let curVal = this.getData...

I had similar problems since quite a while and after changing some stuff about the VirtualMem settings in my kernel it went quiet around that...
FWIW it's not the RAM that's the problem, but disk hits. I might need to put some more cache pressure, reduce the dirty bytes and reduce swappiness...
07:24
Monking
is there an environment variable on Linux for user id ?
og $UID
0
Q: Python code to execute commands on remote host as a super user via ssh using subprocess

kinde gutemaI want to write python code that automates execution of commands as a supper user on vm virtualbox. How could I include sudo su password or able to prompt the user the password without interrupting the execution of the command. I tried the below script but the command fails because it can only be...

07:40
@MrGrj so there's whoami, who and users
Monking
0
Q: Solution for SVG Chart Tooltips for all platforms

AngelI have created a dynamic SVG Temperature Chart and the boss wants tootips CSS hover works fine on a desktop but fails miserably using mobiles and tablets. The latter is expected to be the larger market. <svg> ... ... <g transform="translate(50,50)" font-size="25"> <rect id="tRct" x="25%" ...

0
Q: Python htpasswd changing the username password if exist

Tara Prasad GurungCODE: with htpasswd.Basic("somefile.txt") as userdb: try: userdb.add(username,password) #htaccess is created after userpass file is created self.__sethtaccess(filepath, passfilename,username) except htpasswd.basic.U...

08:02
@CaptainObvious NB regulars: deleted answer involving spam by user named Jelly
I believe both the op and the answerer are the same. The code of the question is found here sitepoint.com/community/t/… as well
I think this question will get better answers at codereview.stackexchange.comOfer Sadan 13 secs ago
@Heslacher An offsite mod has already notified one of our mods...
soo ... yes, you're most probably correct :)
@Vogel612 like most of the time ;-)
I'm voting to close this question as off-topic because questions asking to review working code belong on codereview.stackexchange.com — GhostCat 9 secs ago
08:34
This would probably be better suited to Code Review as the code works. But, you'd be better using FIND rather than looking at each cell: msdn.microsoft.com/en-us/vba/excel-vba/articles/…Darren Bartrup-Cook 46 secs ago
I love Replace All.
Hooray for users invalidating parts of answers with code edits \o/ /s
Stack Overflow is not about code review, perhaps you should ask on codereview.stackexchange.comRichard 37 secs ago
@Mast just be sure to not tick "Regex matching" :)
3
@Vogel612 lol
Yea, that would be bad.
08:43
I should be sleeping, but instead I'm salty over this bad question edit. Xkcd applies well here
@Justin Which question edit is "this"?
next time drop by sooner
I didn't notice it was edited again until the user pinged me a few minutes ago
Ty though
oh... somehow it must've slipped by Duga, too then
well. Another thing is to not answer questions with pseudocode in them :/
08:50
Doesn't look like pseudocode, though. And I misunderstood what the user had meant about abbreviating the code
@Vogel612 does Duga notice when the edit is by rejecting a suggested edit after the suggested edit is approved? Because that might be why Duga didn't notice
Jul 6 at 10:25, by Duga
possible answer invalidation by stimulate on question by stimulate: https://codereview.stackexchange.com/posts/167416/revisions
Duga noticed
@Justin good question ..
@Heslacher Nice. Good bot, Duga
Well, gn. I can sleep now this is resolved. Ty all
Thank's... for your answer. Actually i want to hear someone's opinion about my code implementation to write code where i can quite easy and quickly change technology i am using...So this is more about design not code review. — user2214626 32 secs ago
DVLR
14 hours until new votes and 15 posts left of today until now ...
09:12
0
Q: Using inheritance to define generic code

BillyJeanBased on input by the user, I want my program to execute different chain of commands. Since these different chains share some similarities, I will make them derived classes of a base class that defines the similarities. This way I only have to implement them once. The commands that do differ I t...

0
Q: Custom C# Dapper ORM wrapper

jura87I am i C#.net developer for a few years now... Last couple of months i have started to study design patterns and enterprise software architecture principles so that i will be able to use those principles in my code... Well here is actual example what i need. Right now i am developing asp.net web ...

09:40
If you've written the code and you're asking about efficiency you probably want codereview.stackexchange.comJon Stirling 40 secs ago
0
Q: In DRY Python code, when should I catch/raise exceptions?

user2761030Given python's principle of duck-typing, when is it best to raise exceptions? In a simplified case below, say I want to code a couple functions to return booleans based on an input object product. Rather than catching an exception if an unexpected object was entered, I'm splitting functionality ...

@Peilonrayz What would be the appropriate way of making variables synonym of each other?
I got a device with a lot of channels. Those channels are pointed at using integers. The first bus (let's call it B) is channel 0 up till including 7. The first 4 of those can be used as ADC.
@Mast Is this on a class, cause if not, I don't think you can make a transparent synonym...
So I got two lists, B[0, 1, 2, 3, 4, 5, 6, 7] and ADC[0, 1, 2, 3], where all ADC channels can also be pointed at as B.
@Peilonrayz No(t yet).
@Mast Ooh, carry on explaining, there may be a way, :)
09:47
A second bus (let's call it D), would be formed like this D[8, 9, 10, 11, 12, 13, 14, 15].
It's only the integer inside it that matters really.
But you want to call them by name.
D[2] is channel 10.
So B 0-3 is the same as ADC 0-3.
But code gets messy fast if you use both interchangeably.
All lists are pseudo-const by the way.
By psudo-const, you mean D[0] = ... is possible?
Huh, wat?
No, it means the programmer should never touch them again after creation or face dire consequences.
10:11
@Mast as in something like:
def default_none(val, default):
    if val is None:
        return default
    return val

class ListProxy(object):
    def __init__(self, list, slice):
        self._list = list
        self._slice = slice
        self._start = default_none(slice.start, 0)
        self._stop = default_none(slice.stop, len(self._list))
        self._step = default_none(slice.step, 1)
        self._len = (self._stop - self._start) // self._step

    def __len__(self):
        return self._len

    def __getitem__(self, index):
Oh ... isn't valid in Python 2... :/ Just remove that and it should work
10:28
0
Q: Implementing a "Roll Table" data structure

B. KovacI am trying to implement a helper program for a paper RPG game. In this game, there are a lot of "roll tables". Basically, those are tables which associates the result of a dice roll to a concrete result. For example, you could have something like that: 1 | Roll is 1 2 - 5 | Roll is between...

10:45
-1
Q: adding multiple clickable images using grid layout in a single frame in java

AwaisI need to add 4 images in a single frame using grid layout and all those images must be clickable and of same size (it can be a single image used for all four of them). I mean to say that by clicking any of them, it must refer me to a new window. the code is to provided in java

0
Q: small template metaprogramming list library

hoffmaleSo, time to explore the scary depths of template metaprogramming (well, scary for me, anyways). This library basically provides 2 different lists, a list of types and a list of sizes. Both lists support: Contains: check whether an element is in the list IndexOf: retrieve the index of an eleme...

MOnking
MonKing
better move this question to code review stack — madalin ivascu 58 secs ago
11:15
0
Q: Longest plateau

I just want to codeProblem statement:Longest plateau. Given an array of integers, compose a program that finds the length and location of the longest contiguous sequence of equal values where the values of the elements just before and just after this sequence are smaller. This is a naive solution. Teaching myself ...

0
Q: Why did I end up with o(n^3) while writing implementation of insertion sort?

HireshI just read the concept of insertion sort from CLRS and before proceeding to the pseudo code I tried to implement insertion sort myself : public static void main(String[] args) { int[] arr = { 7, 6, 5, 4, 3, 2, 1, 32 }; for (int i = 1; i < arr.length; i++) { int key = arr[i...

@Peilonrayz Eh, that looks like a lot of code for what I had in mind. I'll see if I can figure out what you build :-)
0
Q: Better way to make an asynchronous REST POST?

gringogordoI am logging entries into a website form using Spring4 & Java8 (originally Java 7). I was using the slf4j logging framework firstly to write to file as a PoC and then directly to db as a mistaken final implementation. Mistaken as it shouldn't talk to the db directly. So I now have a very simpl...

11:44
0
Q: adding multiple clickable images

AwaisAs an exercise I want to have a single window application (in eclipse (JAVA) on windows) with 4 views, each controlled by an independent view controller and have their own new appearing window. I have working code, but I feel I've done it the wrong way, so the question is have I used a bad design...

0
Q: Revision 2: Mailsending application

J.DhaikThis is a fictional email sending program for a e-store I've done for practice purposes. EmailSenderProgram is a program sending emails to customers. Currently it sends two types of email: "welcome" and "please come back" email. It's supposed to run daily and write a debug log each day if it work...

12:01
0
Q: Simple MVC CRUD with JDBC

ReviewCodyI would like to review my simple piece of code. I am beginner (I learn java for 1 year) and I would like to find out whether I am on good way. I have created simple MVC CRUD java app "ProductManager". This app should allow user manage products that are stored in database. I am using JDBC with De...

0
Q: Rewriting clumsy code that gets the value of a nested property in JS object

K48I have an API that returns JSON, where the value that I need is stored in either one of the two object properties: data.d.GetContextWebInformation.FormDigestValue or data.value.GetContextWebInformation.FormDigestValue The code that I'm using is pretty clumsy. At first, I used something li...

possible answer invalidation by Gilad Green on question by Gilad Green: codereview.stackexchange.com/posts/172537/revisions
@Duga seems acceptable
12:30
0
Q: Python process pool locking

Ashish KurianI have a python code to parse pcap files and process the data. As I have a lot of packets and I have to check for each packet and then do some set of processing for each of them, sequential execution is not an appropriate approach. So I have used pool as instructed by other users from stack excha...

0
Q: VBA - Generate a list of the last 100 modified folders

Notts90This is a subroutine I have written as a part of a Excel VBA script. I usually write vb.net or Python but I need the final results for this project in Excel so I'm using VBA. My initial task is to get the latest 5-100 folders by date last modified (user selects the number of folders). Looking at...

12:45
0
Q: Practicing Java servlets, MySQL and JSON - follow-up

coderodde(See the previous iteration.) What's new I have incorporated all the points of Dmytro Maslenko's answer. My code seems a little bit tidier. Code AddPersonController.java package net.coderodde.web.db.fun.controllers; import java.io.IOException; import java.io.PrintWriter; import javax.servle...

13:01
1
Q: Comparing reports in different file formats

DCzoThis is an app that loads an .xlsx list of report names, compares two instances of each report, prints the result (green - for a match, red - no match, blue - both files empty, yellow - some problem) and differences if any. I used XMLUnit, Apache POI and OpenCSV for accessing the files. It is my ...

13:17
sooo much captain ...
13:38
If you want to add the time_t you have to do it like here: codereview.stackexchange.com/a/5101. Use the mktime() function to adjust the values in the structure because the seconds may be out of range. — Andre Kampling 10 secs ago
13:48
0
Q: Simple Photo Gallery Image Formatting Tool

Matt BeaudinI created a little tool to help me take a folder of images and convert them into a properly formatted structure for a photo gallery I'm working on. This includes keeping the original high res photo, and making a smaller version for previewing. A gallery with 260 images takes 11,631ms on my lapto...

Greetings, Programs.
14:27
0
Q: Binary Search, using .remove

Carl FujinamiI'm aware that a function in the standard library exists. Please give me feedback regarding good coding conventions and standards. fun main(arg: Array<String>) { //create mutable list val mlist = mutableListOf<Int>(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) println("Enter a valid number:") ...

If your code does work it would be better suited for Code Review. — Mibac 43 secs ago
14:54
If it's crashing you should be able to track down the issue based on the error it's reporting. Solve that and you probably won't need a command to stop the execution of a particular bit of code. If it's just taking a really long time to execute, put in some sort of status update so you know it's still working, then take your working code to Code Review for help making it run faster. — FreeMan 26 secs ago
0
Q: Creating a nested treeview Rails

beckahI have a dataset that looks something like this: { "project":{ "components":[ { "name":"1", "description":"1" }, { "name":"1-subitem1", "description":"1A" }, { "name":"1-subitem2", ...

Is there a problem with the code? If it works as intended but it's slow, repetitive or otherwise inefficient, consider presenting your code on Code Review; Stack Overflow is about specific programming issues... which I'm still not seeing in this post :( — Mat's Mug 35 secs ago
2 checkmarks in 2 days!
15:15
0
Q: Finding the running median with 2 heaps

AarishI am trying to solve running median problem in hackerrank https://www.hackerrank.com/challenges/ctci-find-the-running-median and below is my code public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); ...

0
Q: How to simplify json data serialization?

Gowtham SI'm doing some data assignment work, I want to simplify this javascript code in a more efficient and simple way.They keys from server and client are different, so is there any possible ways to simplify this steps in ES6/ES5? var j_Utils = { getValueOf: function(json) { return function(...

@Malachi Reminding me to make sure that I check mark the best answer on questions I have asked.
@Donald.McLean I don't think I have answered any of your questions :(
lol
@Malachi Do you know Scala?
does it have Semi-Colons? I might be able to wing it?
I BS my way through Java....lol
like this one, codereview.stackexchange.com/a/172602/18427 but I think someone should check my work there....My mind isn't all the way in the game, I need to get some work done...lol
15:40
you might want to check out the codereview.stackexchange.com SE — chiliNUT 45 secs ago
@Alexander My last post was misplaced, it was looking for suggestions on how to more elegant approach the problem I had. I have since moved it to codereview but now I do have a problem that. Maybe my title was misleading, it is not to exactly delete dicts but to take the information from a dict inside a dict and move it to another dict inside that dict and then delete the unneeded dict in a dict. I ended up making a copy of the dict and adding what I need to it, so no deleting was necessary, but maybe it might be in order to fix the issue? — Jake 52 secs ago
15:55
Perhaps a bit advanced VBA stuff (involves classes, module attributes, default instances and factory methods), but an actual reusable, flexible, cancellable and good-looking progress indicator form is totally feasible in VBA; see here. — Mat's Mug 15 secs ago
possible answer invalidation by Jake on question by Jake: codereview.stackexchange.com/posts/172507/revisions
@Malachi Wat even
@Mast you don't know the Mask?
@Malachi Sounds familiar, when I do Java I just wing it and somehow get crap done.
Bloody verbose though.
3
2
Q: Any Suggestions to my Game?

JJ_G4M3RAs title says, anything to help simply or improve the code? I have just started coding and I don't know how to make the ball collide with paddle, just bounce off the wall directly behind the paddle. If guys could teach me how to do that would be great. This is fully finished and ready to play. ...

0
Q: Will this game loop work for a turn-based game?

user146350Im making a JRPG style combat system and it is going to be a simple text game. The combat should be the same like in the Final Fanstasy games but without realtime animations or anything. Here I got a loop Im working on and I want to get some feedback if it's going to work at all, if I insert rea...

@Vogel612 I know the comic, didn't know they made a movie out of it.
Ah, it was a Jim Carrey movie, that explains it.
Sorry, not a fan.
16:16
1
Q: Longest Collatz sequence using Dynamic Programming (Java)

Abhinav KushagraI'm not getting where else should I optimize it. Is there any way to optimize this code any further. Just give me hints. Simply, hints would be appreciated. import java.io.*; import java.util.*; public class Solution { static int[] countarray = new int[5000000]; //for memotization stat...

16:27
I think this would be more suited over at codereview.stackexchange.comQBrute 30 secs ago
possible answer invalidation by Jake on question by Jake: codereview.stackexchange.com/posts/172507/revisions
The asker is seeking code review — Adel Boutros 44 secs ago
16:42
@Mast isn't that how every language works??
3
Kind of.
nobody knows what it means, but it's provacative.
My use case involved some detailed parsing of html, trying to find the last element in this html table. Code looked like last_row = list(reversed(parsed_html_rows[-2:-1])) In code review we realized i had a number of these 'magic ranges' in the code for plucking out various stuff. Giving a name to them makes it easier for me and the reviewer.. ``` last_row_indices = slice(-2, -1) rows = parsed_html.find_all('tr') last_row = list(reversed(rows[last_row_indices])) # no more wtf'ing about why -2:-1```` — chill_turner 14 secs ago
17:05
possible answer invalidation by Jake on question by Jake: codereview.stackexchange.com/posts/172507/revisions
17:15
TACO TRUCK LUNCH!
@Malachi Actually, while semi-colons can be used, they are optional and discouraged.
DISCOURAGED!???!?!?!?!?!!!!?!?!??!
EOL is just fine as a statement terminator. (~cough cough)
what is the opposite of a star in here?
0
Q: Capture Min() And Max() Of Numbers Input

BobI have two text boxes where a user inputs a start and a end, that is how it is supposed to work at least. Rather than throwing an error if end < start, I was thinking I could use the built in functions Min() & Max() to capture which value is actually which. Is this the most efficient way of cap...

a flag... but don't you dare
17:18
lol
Scala fans try not to clutter up the code with stuff that doesn't add value. Sometimes people take that too far, and you get incomprehensible overloaded operators.
Unlike C++, where you can only overload existing operators, Scala makes it possible to create operators out of all sorts of character sequences.
possible answer invalidation by Jake on question by Jake: codereview.stackexchange.com/posts/172507/revisions
17:35
0
Q: Javascript reducing an array of arrays to a single array with concat or push

GuyWhich is more efficient? (Both memory usage and speed.) arrayOfArrays.reduce((acc, innerArray) => { acc.push(...innerArray); return acc; }, []); Or arrayOfArrays.reduce((acc, innerArray) => acc.concat(innerArray), []);

17:45
@Malachi un-starring
0
Q: Daily email sending application

JsonDorkThis is a fictional email sending program for a e-store I've done for practice purposes. EmailSenderProgram is a program sending emails to customers. Currently it sends two types of email: "welcome" and "please come back" email. It's supposed to run daily and write a debug log each day if it work...

Ugh, I'm doing this all wrong, simply because I have no idea of proper data constructs.
Unrelated:
Please note that it's insensitive to refer to a terminal as "dumb". All terminals deserve to have an equal opportunity to provide quality information technology services. It would be better to refer to the terminals that you speak of as "terminals that express formatting in alternative manners". — Robert Columbia yesterday
lol
2
18:03
0
Q: Mini Hangman Game

HenryI am currently making a hangman mini game as a project for my programming class. Here is my code: import java.util.Scanner; public class Hangman_2 { public static void main (String[] args) { String secretWord = "computer"; Scanner kbReader = new Scanner(Syst...

@CaptainObvious Broken.
why do we tell @CaptainObvious it's broken? He can't fix it!
@Malachi Do you want a serious answer on that?
it might be funnier with real answers... idk lol
We're not telling Captain it's broken. We're telling the room the question Captain pointed at is broken.
We're passing a pointer by reference.
5
18:23
@Mast Yeah but there's no implicit garbage collection, so when the object the pointer points to is freed, the pointer is left dangling. ;)
3
700 lines of code Seriously? You should visit codereview.stackexchange.com ;) — Jonas w 11 secs ago
@EBrown No, the pointer will still point to the history of the object.
2
Funny enough, the object is only freed after garbage collection.
Either the mods cleaned up or the one leaving the garbage behind :-)
0
Q: How do I handle URLError Exception for both py2 and py3

Knox RootI read about urllib.error.URLErrorexception. I found that it is no longer available on python2.x. And I have the following code that I want to make it py2 and py3 compatible. Here is the original code: def userpage(userid): try: #some code except urllib.error.URLError: print_fail("P...

18:53
1
Q: Class for Conway's Game of Life in C#

Aric FowlerI have a class which takes a string representing a grid from Conway's game of life (along with its size, only accepting square grids) and returns the next grid in string format. Can it be improved? Please note that this purely does the computation, and none of the displaying or editing. Also, it...

0
Q: React higher-order component: withHigherHandlers

mpenI'm trying to create a helper method just like recompose's withHandlers, but I need to pass my handlers an extra argument. Here's the code: import {Component} from 'react' import {createEagerFactory, wrapDisplayName} from 'recompose'; import {mapValues} from './util'; import {resolveValue} from...

19:26
0
Q: Algorithm optimisation to get first parent with specific kind of class

iOSGeekI am writing an extension for UIViewController to search all the parents and return a specific parent which is a kind of specific class. here is my try : extension UIViewController { var rootViewController : RootViewController? { var parentController: UIViewController? = parent ...

19:36
@Mast Not necessarily, if the object gets deleted the pointer will point to a section of memory you may or may not have the ability to access, and give a SEG_FAULT possibly.
20:05
possible answer invalidation by J.Dhaik on question by J.Dhaik: codereview.stackexchange.com/posts/172433/revisions
Monking!
without proper lab procedures, unattended DNA will eventually creates new JavaScript frameworks
@Phrancis It is said a movie is truly bad when it has more plotholes than JavaScript has frameworks.
@Duga Rolled back. Second offense.
0
Q: Python + selenium scraper to grab results using reverse search

ShahinI've written some code in python in combination with selenium to scrape populated result from a website after performing a reverse search. My scraper opens that site clicks on the "search by address" button and then takes the street number and address from the "original.csv" file and then put it ...

20:34
0
Q: Implementation of callback in database request

MaxI am a complete beginner in JavaScript / Node.js / Express, but have some experience with php. I'm trying to get data from a SQLite database into an object. The object appeared to be empty, so I tried to get my head around callbacks and I'm verifying with console.log to get stuff done in the righ...

Anyone have ideas for a machine learning logo? My team is looking to make shirts and I'm trying to draw ideas
@syb0rg A computer with data being dumped in it? Maybe give it a brain? I dunno just spitballing.
21:16
@EBrown Hm, possibly... but I gotta keep it simple too
21:30
This is a general advice question that’s better suited to discussion forums like Quora, or Reddit’s /r/programming. Stack Overflow is specifically about programming-related questions as they pertain to actual code. For code-review questions, see the Code Review site. — tadman 35 secs ago
In this answer I solve exactly the same problem as above (with 0s and 1s reversed) using lookup tables. You have to skip down to the section "Bitmaps FTW" since the first part is looking at a different algorithm. The size of the lookup table is fairly limited because of the repetitive nature of the streams, you only need at most P byte-wise "jump ins" for a pattern of period P. — BeeOnRope 40 secs ago
0
Q: (Begginer) Prints ANSCII table

Anonymous3.1415Just starting, wrote simple program off the very basic knowledge I have learned today. Is this a correct way of implementing this? Any improvement tips? //Print out the ASCII chart with its corresponding code #include <iostream> #include <string> void printChart(char symbol, int code) { std...

I try pretty much all these optimizations and more in this answer which seems to be solving almost exactly the same problem. The OP doesn't make it clear if they'll be processing several streams with different periods at the same time, but I'm guessing yes, so the "wrap around" becomes important to do branch-free since otherwise it is unpredictable. — BeeOnRope 39 secs ago
21:55
possible answer invalidation by Jake on question by Jake: codereview.stackexchange.com/posts/172507/revisions
22:09
Monking, :)
possible answer invalidation by Jake on question by Jake: codereview.stackexchange.com/posts/172507/revisions
@Peilonrayz Monking
Yo, how's things?
22:36
Please either write up a proper answer or, probably better given the nature of the issue, just delete the question. Again, once you have the code tested and working, consider Code Review. — jonrsharpe 21 secs ago
@Peilonrayz Dreary
@syb0rg Oh that sucks, what's up?
23:00
@Peilonrayz Just lack of excitement, that's all
23:25
possible answer invalidation by DarkMatterMatt on question by DarkMatterMatt: codereview.stackexchange.com/posts/159869/revisions
23:37
@Duga rolled back
0
Q: Tax Calculator using Java 8 and BigDecimal

Chris Danson I am learning Java8 and BigDecimal. The following exercise involved writing a Tax Calculator that took a salary and calculated the tax payable based on the tax band into which the salary falls. The test passes as the code stands but if I remove the call to setScale(0, BigDecimal.RO...


« first day (1559 days earlier)      last day (2753 days later) »