« first day (1441 days earlier)      last day (2872 days later) » 

00:00
RELOAD! There are 3759 unanswered questions (91.3537% answered)
I'm voting to close this question as off-topic because it belongs on another Stack Exchange site: codereview.stackexchange.com — Daniel Storm 54 secs ago
00:42
0
Q: Markov Chain Text Generator Python 2.7.12

Sean ValdiviaCodecademy's final Python project is to build a Markov chain text generator--with someone else's module. I wanted to build my own; although I understand the concept I'm having trouble implementing it in Python. I followed a YouTube video, Poetry in Python: Markov Chains, which has an amazing simp...

01:00
Is this question: codereview.stackexchange.com/questions/160675/… off-topic or not?
Do you guys believe this is actual production code, or is it simplified and as such off-topic?
01:14
Let me check
@holroy Looks very example-like
Doesn't it? Should we vote to close it, then?
I cast a VTC on it
It's going down... :-/
Nice to see you again btw, been a while :)
Yeah, thanks for remembering me!
01:18
If the OP edit or respond to your comment we will see from there
Been up to anything fun?
I've been busy in other areas, but I'm hoping to make a little comeback now.
Been playing a lot of Minecraft Pocket Edition, and participated in various forums related to that.
Good old Minecraft
So it has been great fun, but I kind of miss doing something a little more challenging intellectual wise, if you get my drift
01:20
0
Q: List of options to change in a game menu using a list

Funlamb So I have two sliders that I can select using my keyboard. The black bar shows what currently is selected. It looks for current_position_in_option_buttons and positions itself as needed. When selected on either the sound or music option you can use the left and right arrows to change the settin...

I see you've changed your username a little. Hoping to trigger a SQL fault somewhere? :-D
It looks like @Graipher zoomed past 10k a few days ago and we hadn't really noticed. Congratulations!
2
Congrats!
I'm voting to close this question as off-topic because it seems more appropriate for codereview.stackexchange.comCory Petosky 26 secs ago
01:38
@holroy Can't be real code. Case 1 is missing a semicolon.
Well spotted...
Does the code you show work? Do you just want a code review? — Some programmer dude 27 secs ago
@holroy That was my April 1 joke :)
OK... Did someone fall for it?
I do know people who have actually broken some databases using stuff like that. Kind of sad when production code allows for code insertion...
I'm voting to close this question as off-topic because it's a request for code review, which is better on codereview.stackexchange.comSome programmer dude 17 secs ago
01:48
@holroy If it actually broke something I would blame Nick Craver
HeHe... He was the one who gave you the idea?
@holroy Yeah good old PHP/MySQL vulnerability because people don't use prepared statements
@holroy No, he's one of the dev team leads at SE
Hmm... I wonder why my browser is making all this noise each time I'm mentioned. It didn't use to do that before...
The sound settings had changed, it seems.
Please don't try to remove the user database of Stack Exchange... I don't think that is a good idea... :-D
Anyways, I'm off to bed, but I'll return in the not so distant future!
If it seems to be working and you are wondering if it is good/ bad practice, code review would be the better place for this question. — Evan Carslake 9 secs ago
Code is actually broken, and as such is not a good candidate for Code Review. It'll break if trying to remove an element not found in the list. — holroy 58 secs ago
@holroy Click the little speaker icon just above where it says "The 2nd Monitor" on the right to change the sound notification setting
01:57
Thanks, and good night!
0
Q: Bare minimum neural network, random weight update etc

mertyildiranI'm trying to understand that how a simple neural network works. The program below (that I wrote to test my understanding) aims to train a network that will eventually be able to distinguish whether given elements of input are bigger than 0.5 or not. Its input size is 4 and output size is 2. It ...

0
Q: A decoding "guessing game"

Obinna NwakwueSo, I have decided to make a little "guessing game" where the user tries to decode what the encoded piece of text prompted. I'm sure it works. However, I know that there are places where I can improve. I am open to any constructive criticism about this. This program was done in HTML + JavaScript....

0
Q: Neural Network Backpropagation Java

Nathan WoodI am trying to create a Neural Network class with backpropagation so I can learn about how it works. I am following this tutorial about how to do this in Python, but trying to make it work in java with any size When trying to train the NN, it hovers around 0.5. It goes up and down but not in a d...

0
Q: Is this code safe and good practice? (linked list, C++)

AnarelleThe following code seems to work ok to remove a node from a linked list: bool remove(node * & head, int toBeRemoved) { if (head == nullptr) //empty list return false; else { node * temp = head; //the first node needs to be removed if (head->data == toBeRemo...

@CaptainObvious Code is broken, and has better answer on SO. This is the one I commented upon a little earlier here...
Hmmm... I'm disagreeing with myself. The code doesn't work for the specific case of an element not found, but does that qualify as broken code?
It does compile, and it does do the job most of the time, but some rand-cases will trigger an exception. Does that qualify as broken code?
Even though there is answer below I'd recommend going to code review anyway. Indentation aside it would be much cleaner with single if and for loop. It would be easier to spot errors as well. — Maciej Piechotka 14 secs ago
@holroy If it fails only on certain edge cases it's sometimes OK still, it's really a judgement call
02:31
-1
Q: What is the error in this code

ISURU UDAYANKA BANDARAnamespace WindowsFormsApplication2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } public object Documents { get; private set; } private void button1_Click(object sender, EventArgs e) { progressBar1.Minimum = 0; ...

 
2 hours later…
04:23
04:36
They mean it is going to be like jumping on a big trampoline?
05:25
-1
Q: invalid character value for cast error when inserting values in a Access Database using Ucanaccess

returnNULLI have looked into this code lots of times now. I can't figure it out. I was practicing this at home when this error popped up. The program when shown to us in class, ran perfectly. Please Help. Below is both the code and the error. Thanks. import java.io.*; import java.sql.*; class DBTest { s...

Hi, could you give a little more detail on what you are trying to accomplish. What's exactly wrong with your code? If it's are review you are seeking maybe you should seek help at codereviewRemy J 29 secs ago
0
Q: Plot president's approval rating of president with lowest approval rating by day of presidency

jss367I was curious which U.S. president had the lowest approval rating for each day in their presidency. For example, which president had the lowest approval rating on day 42, and what was the rating. I downloaded the data from http://www.presidency.ucsb.edu/data/popularity.php and built this code to ...

 
1 hour later…
07:18
0
Q: android codes to get the distance from map and show

AnkitI have a URL but unable to get the codes to get the distance between two places and show it in textview on the activity. I am novice in android and unable to link the textview to show the distance. Please help me.

07:45
This belongs on code review. But for starters, you could use Counter object. Also, don't call .keys() to iterate over dictionary keys, e.g. for mechanics in count.keys():, iterating over a dictionary already does that: for mechanics in count:juanpa.arrivillaga 43 secs ago
0
Q: How could I prevent an XSS Attack in an Application which use Spring MVC?

Fabio Lo CurtoI have inserted the Spring Method isHtml on my project's utility class, and then I included a check for each resultSet that comes out from the database. In my controller class, I added a try catch each time a call is made to the persistence layer in order to handle the exception. My question no...

-1
Q: Can anyone help me to solve this

asphaltThere are n circular organisms with radii r0,r1,..rn-1 . During each second, two organisms with radii ri and rj and (chosen randomly and equiprobably) collide to form a new, bigger organism with radius ri+rj. Given the radii for n creatures and an integer,k, print a single floating-point numbe...

I'll move my question on codereview then. Sorry for the off-topic. — 19lorenz88 31 secs ago
08:14
1
Q: How to remove undesired points from a mesh in an efficient way in MATLAB?

19lorenz88I have a 3D data set made of a certain number of points (x,y,z) that cover a certain region of space. Using the scatteredInterpolant object I can interpolate this data set over a grid to produce a rectangular mesh. Note that the mesh may extend to regions that are not defined by the data set; in ...

09:14
0
Q: Ruby case integer evaluation

Flynn84I have no idea why this piece of code doesn't work as I expect. For any kind of number I input I'm getting the else part of the case-statement. On the other hand it works like magic when the same statement is a method that I call with an argument. I'm learning Ruby as my first programming languag...

09:24
Is there a limit to the size, or any restriction regarding the nature of code that can be posted here for review and/or improvement suggestions?
I'm voting to close this question as off-topic because I think it belongs on codereview.stackexchange.comAlex 44 secs ago
I don't think there is, but I haven't been here that long and am mostly learning myself. Can't say I have seen anything above 200 lines of code on the site so far
codereview.stackexchange.com — Randy 11 secs ago
I posted the function in [Code Review],(codereview.stackexchange.com/q/160022/36067), in case you want to have a look at it. Thanks for your help! — Llopis 47 secs ago
09:51
0
Q: Mars Rover in Python, TDD

geostockerI saw a post a few weeks ago regarding a Python solution to the Mars Rover problem as outlined HERE. Basically we are tasked with developing a software to handle a squad of Mars Rovers based on user input: First input is the size of a Mars plateu. After Mars surface has been set the user is pr...

10:30
0
Q: JS code to bypass Cloudflare

MohammadThe following JS code to bypass Cloudflare, I found it in the net. Please explain how the performance of this code? <script type="text/javascript"> //<![CDATA[ (function(){ var a = function() {try{return !!window.addEventListener} catch(e) {return !1} }, b = function(b, c) {a() ? do...

Heyho holroy
Ah I see the clique has found me again. Enjoy that DV. — Tim Consolazio 32 secs ago
Would anyone here mind if I bugged them with a few general question about trees again ^^' ?
10:47
Not a whole lot of guys around, and it could possible be better to ask such question in the Nth room?
And Hi to you too!
Ah! Another room where it seems more appropriate to ask! Thanks, last couple of times I tried I immediately found somebody that was willing to answer, which helped with the particular problem, but not necessarily with the fact that I'm a beginner with not enough places to ask for help ^^' (If only it was easier to gain points in stackoverflow v.v), shall ask there
At least in the past, when there was more people around here, and someone asked a question on some topic, and got redirected to that room if there was other talk going on. And if someone in this room felt like it was something they could contribute with, they jumped over for a while.
This helped keeping this room free for discussing directly Code Review related issues, and not becoming a support desk for coders. :-)
11:20
@SatwikPasani @Isofruit There is a limit, it's not posted and unless your code runs over 1000 lines you won't approach it. The probability that someone has the time to review over 200 lines of code is rather small. If you have a lot of code, you can post the part you really want reviewed in the question and have a link to a github repository or other online location for the rest.
@pacmaninbw Thanks for the clarification!
This is probably a better question for Code ReviewCoryKramer 21 secs ago
You should probably ask in Code Review — James 1 min ago
11:44
1
Q: How can I improve this code and make it more object oriented?

DIzzyDizaI would like to implement a higher level design pattern here but I am a bit stumped, how can I improve this code and make it cleaner? import __builtin__ import logging import requests import json import datetime from string import Template from resource_helpers.abort_logger import AbortLogger C...

0
Q: Simple java program

mizzyI have completed a simple java program. Here everything is doing fine except for one silly logical mistake which I couldn't figure out. When the user enter 0 as account number it should 1) Display "No account has been processed." Only I have attached the code and details of the program. Any...

11:59
What precisely are you asking? If this is working code that you think could be improved, you may be better off at Code Review. If it's not working as expected, please clarify with a Minimal, Complete, and Verifiable example. — jonrsharpe 56 secs ago
Maybe this question should be migrated to Code Review ? — Martin Verjans 59 secs ago
12:16
0
Q: Needed suggestions on a infinite monkey theorem

Pratik GhagThis was the assignment: Here’s a self check that really covers everything so far. You may have heard of the infinite monkey theorem? The theorem states that a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will almost surely type a given text, suc...

0
Q: Leap year check in Haskell. Which version is better?

Matthias WimmerOne of the first Haskell puzzles on http://exersicm.io/ is to implement a leap year check. I've done this twice. Using pattern matching: isLeapYear :: Integer -> Bool isLeapYear year | year `mod` 400 == 0 = True | year `mod` 100 == 0 = False | year `mod` 4 == 0 = True | otherwise ...

0
Q: C++ remove from singly linked list

AnarelleI asked a similar question (C++ linked list) but I'd like to have this similar code reviewed. It's not the same code, just slightly different and with bugs fixed. The code takes the head pointer of a singly linked list and an int element to find and remove from the list: void removeFromList(node*

12:39
Probably want to post this to codereview.stackoverflow.com — Chris 23 secs ago
12:58
Look I will remove it from code reviewer. Just as soon as someone gives me some input. I will work on using these platforms correctly however I want help not criticism. Hobby not my job settle down. — John Shiveley 55 secs ago
This question actually belongs on codereview.stackexchange.comJens 16 secs ago
0
Q: SetFilter, or just query?

WimI am using a QSqlRelationalTableModel model_contacts to populate a view that shows all necessary data from the contacts of the user. Today, I need to add a QPushButton that generates a list of all contacts that do not have an emailaddress. I try to applicate the Model-View approach as much as p...

13:24
@200_success Thanks! I actually liked this moment more:
user image
3
@holroy Thanks a lot :)
13:59
0
Q: overload class args to kwargs python with optional args and pass arg to other class

GeoStoneMartenI have build class to pass ordering arguments and (key value) arguments. instance of class return all arguments pass to __ init __ as attributs class Person(object): """ Init Person with ordering values or keys values""" _attrs = ["name", "firstname", "email", "address"] _ops_attrs ...

14:12
0
Q: Simple C++ wrapper over libYAML

spectrasFor a personal project, I need to parse YAML file. I chose to use C-based libYAML instead of yaml-cpp, because: I try to keep my dependencies to what's commonly installed and Debian statistics show 45% installs already have libYAML, vs 0.5% for yaml-cpp. I don't need variant node types, as the ...

0
Q: Unity3D like component system

muXXmit2XI am currently working on my own little game engine and thought about implementing a simplified version of Unitys component system where you can attach objects of derived Components to an GameObject. Later you can request specific Components to use their functionality. Below is a stripped down (b...

14:30
0
Q: Generating ssh keys from asp.net core

SJCI have started to create a console app, which I am testing locally on my mac. The idea is to generate an ssh key and structure the storage of these keys within the .ssh folder. My thought behind this is for my digital ocean ssh keys, and so I am using a folder structure dictated by the droplet n...

We are not here for code review. Please post your code on codereview.stackexchange.com if you want people to critique it. — Remolten 55 secs ago
14:44
0
Q: Fixing the endlessly loading devices and printers tray

13aalI work for a service desk in a Windows 7 environment. Recently we have had an issue where (do to an update) when users are attempting to map printers to themselves they are not able to open the devices and printers tray, it just loads endlessly. I've figured out a solution for this via the follow...

15:04
-1
Q: Collision Detection algorithm code

sa baThis is the algorithm that I'm trying to solve: There are n circular organisms with radii r0,r1,..rn-1 . During each second, two organisms with radii ri and rj and (chosen randomly and equiprobably) collide to form a new, bigger organism with radius ri+rj. enter image description here Given the...

0
Q: Functions in Javacript

XavierXanthusWrite a function called longest which will take a string of space-separated words and will return the longest one. my code function longest(str) { var words = arguments.split(" "); var words_count = words.length; var longest_word_length = 0; for(var i = 0; i < words_count; i++){ if(...

0
Q: A function that debits a virtual wallet and calls an API to disburse to a real account

temiloluwa adesinaHi I am trying to know if there is a better way to handle reversals for this function, currently how it works is this: A user inputs in amount, bank, and account number this would be used to debit his virtual wallet like so: models.sequelize.transaction(function(t){ Q.fcall(function(){ ...

15:37
those are a lot of Edits....
Monking
16:04
@Malachi ...you must actually be back.
2
Monking
16:45
@takendarkk: That would be a good question for code review. This here is the StackOverflow free coding service. — squint 46 secs ago
Monking @Zeta
@EBrown kind of....lol
17:02
-1
Q: Is this an example of a functional class?

PSGuyI just started learning about functional programming, and thought I would have a look at writing a simple object comparer as the basis for my implementation. Below is my result. My assumption (in writing) is that functional code is intended to not modify external state, and not have side effects...

17:21
If anyone has any thoughts on below, much appreciated:
0
Q: What is the most secure way to restrict / clamp a cryptographically-secure random number generator to a defined window?

EBrownFor a project I have one of the requirements is to generate cryptographically-secure random numbers from 0 through 9 (so 10 total possibilities). It's a .NET project so my first thought is to use the RNGCryptoServiceProvider class provided by the framework, the only problem is that the class does...

0
Q: A GUI program for a Buzzer system using arduino

Satwik PasaniAt the outset, I am a beginner at python, having started out about 2 weeks back. Aim- To create a GUI program, that can adequately work as a buzzer-management system. A buzzer, like those used in quizzes, should display who pressed the switch first, and also, who is currently pressing their swi...

@Zeta I have now.
In that case, I think I can probably pull eight bytes in (a basic long) then % 10 it to eliminate potential bias.
17:43
It's still slightly biased towards 0-5.
My current algorithm has no predictable bias right now.
Over three runs it has shown a very slight bias against 6 and 8 when generating 1 million digits.
And the fourth run eliminated that.
Though it still has a very slight bias towards 4.
And the fifth run eliminated that as well.
And by very slight I mean that the values are at worst 9.95% of the generated numbers, and at best 10.05%. So out of 1 million numbers I'm generating a uniform distribution in [0, 9] within 0.05%.
As long as the bias keeps shifting (which it is) then there's no real bias there.
18:03
1) You might want to check out Code Review 2) You could always utilize short circuiting. var scrollPage = checkSex || checkWeight || .... After one of them returns true, the following ones won't execute. — Mike C 9 secs ago
18:20
So this website accepts .jpg but not .jpeg.
@Ðаn: If you wanted to be super cheeky and obscure, you could hex_encode your string (up to 4 chars), and then pass it to a templated decode function. It would be standard compliant, but hopefully be laughed out of any code review: demoAndyG 17 secs ago
But it accepts .wma?
what
TIL wtf .wma is
18:24
Old Windows média format that unfortunately is still around
It accepts .doc, .docx, .pdf, .rtf, .txt, .wma, .jpg, .gif and .wpd.
No idea
word perfect document, I think
Happy Easter everyone. TTQWAGH
18:35
-1
Q: When I need a class object within an other class

user136360So I am making a checkers for my intro to c++ final project. I design a the project to have three classes Champ, Board, and Game. The Game class declares three objects. Now the every time a try to run this declare a game object in main just to make sure everything is in place, I get an error sayi...

18:48
I can't close Edge
Clicked the X like 20 times but it's still there
0
Q: check for wins in a connect4 variant

TweakimpMe and my friend are trying to build a connect4 game with a twist. The twist requires us to have a 7*7 board and to be always able to check all possibilites for a win for both players after each move. Currently, we are just filling the board with a random distribution of 0,1 and 2 (in the final ...

0
Q: Small program to download wikipedia articles to pdf

MattI made a small app to download wikipedia articles (and optionally those that it links to) as PDFs to take on the go. I'd eventually like to do a text-to-speech option and save the article as an mp3, though that's the next step. Any thoughts would be helpful. import wikipedia import pdfkit impo...

19:02
I wrote 2.5k lines of code today, ouch, my fingers
1
Q: WPF "Glowing" button user control. Is there a better way?

LawManI have created a "wrapper" for a button that "pulses" until the user presses the button. The implementation that I came up with is below, but I'm sure there's a better approach. <UserControl x:Class="Foundation.Common.Controls.Wpf.FoundationGlowButtonWrapper" xmlns="http://schemas.mi...

19:24
-3
Q: Beginners problem with functions in Javascipt

nicholas kelvinWrite a function called longest which will take a string of space-separated words and will return the longest one. my code function longest() { var words = arguments.split(" "); var words_count = words.length; var longest_word_length = 0; for(var i = 0; i < words_count; i++){ if(lon...

19:43
@DanPantry That's probably more than I have written the last month.
Some of my coworkers probably have deleted more lines of that than that in the past month
As a total of codes written and deleted
-2
Q: Need optimized solution for Zero One Game

chirag shahMy Code fails after test case 4. Need help in improving solution. Question: Alice and Bob are playing the following game: The game starts with a sequence of zeros and ones. Alice and Bob take alternating turns, and Alice always moves first. During each turn, a player removes one element from t...

19:59
0
Q: Is violating SOLID principles hurting my Unit Testing?

Louisa BickleyI had hard time writing unit test for my really small example. Can you review it and explain if it violates SOLID principles? public class Cell { public int X { get; set; } public int Y { get; set; } public string Value { get; set; } } public class Table { private Cell[,] Cells...

I saw you doing code reviews in different threads and was quietly hoping that you would do here as well. Very much appreciated! This looks so much better than the code I posted... — stiopa 32 secs ago
20:18
-2
Q: Paycheck salary plus commission when I try to print to test it says function for grossPaycheck with a hexi number

John Newburn''' Write a python program that computes the take home pay of a commissioned sales person. Prompt the user to input the employees's name, base salary and gross sales for the pay period. Make sure to use the appropriate data types. When parsing the keyboard input, use exception handling to detect ...

20:40
Stack exchange has a code review site that might be a better fit for this question — Rufus L 22 secs ago
Private members is the way you do encapsulation, what problem are you having with your code? If you're just looking for comments on the design, CodeReview.stackexchange.com is the appropriate place. — Barmar 26 secs ago
20:59
0
Q: Style for describing matrices in Python

René GIs this good style? I've never seen people format it like this, but I think it's really clean. import numpy as np letters = [chr(i) for i in range(65,65+26)] numbers = ['ZERO', 'ONE', 'TWO', 'THREE', 'FOUR', 'FIVE', 'SIX', ...

21:26
@SimonForsberg It's been a busy day :(
0
Q: Gpu (and Cpu) templated matrix classes

TrauerI'm learning "Cuda C++" (and C++). Can you guys give me some feedback on my "basic templated matrix" implementation? A brief explanation of my decisions: First things first: I can't use STL classes / functions in cuda code. I can't use C++ 14 (or newer) features. I'm using templates to give su...

22:05
This would be better served on codereview.stackexchange.comSam Onela just now
Please edit your question to include the JSON and the code you are using now to deserialize it. Without being able so see what you're doing, all we can do is guess, which isn't going to be helpful to anyone. See How to Ask. If you're really asking for a code review, try asking at codereview.stackexchange.comBrian Rogers 15 secs ago
I'm voting to close this question as off-topic because it's more suited to CodeReview.stackexchange.com — Barmar 16 secs ago
22:20
Once you have finished this warming up project, I suggest you take it to CodeReview so there's a big nice place for people to guide you on idioms and style :) — Quentin 23 secs ago
23:04
Played with GitHub API yesterday, expect one-boxing for GitHub links of all varieties in the Stack Overflow chat sy… https://twitter.com/i/web/status/852881232845299712
I asked him if this will also roll out to non-SO chats
23:20
I've been mentoring someone fresh out of training today (and will be for next 4 weeks) hadn't realized there was so much to know until now having to teach someone else
23:34
0
Q: Refactoring Javascript

Darren PlaceI'm new to javascript, and wrote this little animation in canvas. I'm wondering if anyone has any suggestions as for how to improve it. Here's me code: //render the canvas at 2x dpi var canvas = document.getElementById('myCanvas'); canvas.width = 1920; canvas.height = 816; canvas.style.width = ...


« first day (1441 days earlier)      last day (2872 days later) »