« first day (1877 days earlier)      last day (2142 days later) » 

12:00 AM
RELOAD! There are 5386 unanswered questions (89.9749% answered)
 
12:30 AM
0
Q: Pandas code is not working as expected

Steven CorreaI'm new to coding and I'm trying to figure out why a simple Pandas code isn't working as expected. The code below should read in the tab delimited file and output the top 5 rows. However, when I run the code, there is no output. Now, if I remove the header and names parameters and use print (df)...

0
Q: IndexedArray Class: Uses a Dictionary Keys to Index a 2 Dimensional Array of Values

TinManThis class encapsulates a 2D Array and a Scripting Dictionary. Values are add or returned from to the Array using a Key and a ColumnIndex, e.g. IndexedArray(Key, ColumnIndex) = Value . The Key is used to get the RowIndex of the Array. The Value is then added to the Array, e.g. Array(ColumnInde...

 
12:48 AM
0
Q: Dynamically set array names based on its contents

PistolRcksI am currently making a Tetris clone in Lua through LÖVE, and my current idea for block storage data is as follows: The block's key is a concatenation of its x and y values (for a reason I will describe later) The block's x and y values are also stored in its own dictionary Here's an example ...

 
1:05 AM
0
Q: Finding an index in an array of objects with 3 possible outcomes

GollyJercurrentUserPosts will have a post object with an id that either matches a tempId, an Id, or nothing. If there's a tempId match there won't be an id match and vice versa. This code works but there's something about it I don't like. How can it be refactored? let postIndex; postIndex = currentUse...

0
Q: Simple Bank API script

NoOrangeJuiceI would really appreciate some feedback on this code. It 100% works (as far as I have tested it). Really just looking to improve where I can. All criticisms welcome. Database Template Script: import os import sys from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy.ext.dec...

 
I'm voting to close this question as off-topic because generic requests for improvement of working code belong on Code Review, not Stack Overflow. — jwodder 47 secs ago
 
 
3 hours later…
4:29 AM
0
Q: ComponentResolver vs *ngIf

j4rey89Below I have created a dynamic component AppComponent.html <input type="button" value="One" (click)="setVal('one')"> <input type="button" value="Two" (click)="setVal('two')"> <br> <app-dynamic-component [key]="keyvalue"></app-dynamic-component> AppComponent.ts keyvalue = 'one' setVal(val) {...

 
4:58 AM
I do not know which language are you using but you can get a little bit context in java using this codereview.stackexchange.com/questions/12042/…nimi0112 25 secs ago
 
 
2 hours later…
6:42 AM
-1
Q: concept of Capacity()Method in java

DeviHow capacity() method work in java? Why we use to add default value 16 to the string length in Capacity() Method in string.

 
@CaptainObvious no code
 
6:59 AM
0
Q: Optimize Diagonal Movement Code for Python Chess Engine

Kevin HebertI'm currently in the process of building my own chess game engine and could really use some suggestions on how to make this segment of code for calculating diagonal moves more efficient. (This is obviously only for diagonals going Up-Right) As of now I'm using "Try-Except" to iterate by 1, and t...

 
7:32 AM
0
Q: refactor the cart logic to adjust with the models either

SerenityAdding the items to the cart is very crucial. I have a session based shopping cart and I need to adjust that shopping cart along with the model because I will need the cart data or cart items in the database either. Here is the models for the cart class Cart(models.Model): user = models.For...

 
8:00 AM
possible answer invalidation by coder on question by coder: codereview.stackexchange.com/posts/197076/revisions
 
8:21 AM
-1
Q: Code Error while connecting Raspberry Pi with Losant API

varul jainHey all I have just started with my university project in which I am trying to connect my Temperature sensor in with losant cloud by interfacing with Raspberry Pi After studying this documentation, I tried to modify the code of sensor SHT31 as per mentioned code to connect with losant as follows...

 
8:52 AM
@Hosch250 I doubt C# shapes will go to the same extent as C++ templates... e.g. see this ugly mess that creates a tuple of inplace char arrays with sizes according to the fibonacci numbers. I wasn't kidding when I said "ugliest functional programming language" :)
(No, I won't put this up for review, it's example code)
 
 
4 hours later…
12:49 PM
0
Q: Simple and Concise QuickSort Implementation in C++14

Carlos Martinez RomeroI'm trying to code a simple and concise quicksort implementation in C++11/C++14. I feel like the while loop part is not as nice to read as it could be and it might also have a bug? I was also thinking that it might be nicer to change the function signature to have two iterators as parameters, b...

 
An answer-invalidating mess:
0
Q: Shortest Job First Preemptive Scheduling Algorithm

coderThis code is for Shortest Job First Scheduling Algorithm(Preemptive). Please help me to improve and optimize this code. Edit: I have deleted copy constructor, copy assignment, move constructor and move assignment because no two batch of processes will have same input data. In calcWaitingTime() I...

 
1:06 PM
0
Q: Find all k-sum paths in a binary tree

CodeYogiDescription: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. Note: A leaf is a node with no children. Leetcode Code: class Solution { private List<List<Integer>> paths = new ArrayList<>(); public List<List<Integer>> pathSum(Tree...

 
1:55 PM
0
Q: Improved Android game inspired by Moon Patrol

Niklas Rosencrantz The beta test is available from the appstore https://play.google.com/store/apps/details?id=dev.android.buggy Since my previous question about the same project, I have done several improvements: Several UFO:s now Five lives and then Game Over Improved but not perfect vehicle controls Cool bo...

 
 
1 hour later…
3:03 PM
0
Q: Finding Repeat and missing numbers in an array

Prathu BaroniaProblem Statement: You are given a read-only array of n integers from 1 to n. Each integer appears exactly once except A which appears twice and B which is missing. Return A and B. Example Input:[3 1 2 5 3] Output:[3, 4] A = 3, B = 4 I wrote the following code : def repeated_number(n...

 
If your code works, and you're looking for advice about how to improve it, you'd better ask on Code Review. — ForceBru 11 secs ago
I'm voting to close this question as off-topic because it is asking for a code review — Bryan Oakley 7 secs ago
 
3:54 PM
0
Q: Making my code that reads in text files efficient

FeelingLikeAJabroniI've made some code that reads in text files (which hold quite large vectors of word frequencies), which in turn stores each index of a vector within an ArrayList for their specified team (I.E Arsenal vector to the Arsenal ArrayList, Chelsea vector the Chelsea ArrayList, ETC). It then uses a cosi...

 
4:10 PM
possible answer invalidation by GollyJer on question by GollyJer: codereview.stackexchange.com/posts/197146/revisions
 
4:27 PM
-3
Q: Bytes Changing When Receiving

user1234433222I have an application that is sending bytes to a camera over tcp as seems to work fine, however when testing to see what the camera is receiving, the bytes that its sending are not the same as its receiving I believe.First I get the int32 value and convert it to a byte array and check if it is li...

 
4:43 PM
0
Q: Adding dragging ability to a UIView using protocols

Badhan GaneshI recently published an iOS control/component called BJDraggable which basically, with a call of a method, enables us to drag a view within its superview boundary. The whole setup works using the UIKitDynamics API. (Scroll to last to see the output achieved.) These are the methods I expose to co...

 
5:33 PM
1
Q: A* Algorithm in C# for pathfinding 2D tile grid

JCoffeyI am very new programming and am trying to develop a small tycoon game as a hobby project in Unity. This algorithm executes beautifully but if 100+ agents are getting new paths simultaneously there is a significant drop in frame rate. Where should I start with optimizing? I use 4 classes for my ...

 
5:45 PM
if your code works fine and you just want a second opinion on efficiency, then Code Review is a better place for it. (See: help center) — ashleedawg 41 secs ago
 
0
Q: Implementation of Neural Network in C, Trouble with Backpropagation

Mar DevMy neural network is buggy somewhere, however the reason I am posting here and not stack overflow is because a buggy neural network can still be trained to some degree. Since my neural network is from scratch (and thus pretty long for the casual reviewer), I would like two specific functions to ...

-1
Q: cwe119.py - a semi-automated script to perform DoS attacks

LeonThis is a different script from any python script which performs DoS attacks. It's designed to practice parameters fuzzing in the requests (it's requested which parameter you have to fuzz - and after choosed, requests will be made with the selected parameter combined with a 400 random characters ...

 
6:00 PM
@CaptainObvious While this is posted correctly, I'd be wary to review a DoS script
 
6:23 PM
0
Q: Fixed Size Double linked list in Scala

Knows Not MuchI have written a double linked list in Scala. The list should be fixed in size and items are always added to the head. if the list reaches max size then the tail is dropped. This is my code. I want to review this for brevity and functional approach. sealed trait List { var prev : List v...

-1
Q: Retrieve the domain of a python Flask process

Hooloovoo13Without setting SERVER_NAME in the Flask config, url_for with _external=True retrieves the full URL. So I figured the must be a way that Flask (or Werkzeug) retrieves the domain. I dug around inside the url_for function and made this function to get the domain from within a request context. What ...

 
6:52 PM
You can easily google all of the concepts you've listed in your question and find thousands upon thousands of great learning resources. If you'd like help improving code you've written that works, I suggest posting on codereview.stackexchange.com. — Jake Miller 13 secs ago
 
0
Q: Generic Stack Data Structure Using Linked Lists

SnorrlaxxxI am a mathematician attempting to become proficient with C++. At the moment I am learning about data structures. I am now writing a stack dat structure using linked list from scratch. I have tested my class that I wrote and everything seems to be working fine but I want to see if there are any ...

 
7:35 PM
possible answer invalidation by Gregory Rut on question by Gregory Rut: codereview.stackexchange.com/posts/197129/revisions
 
8:15 PM
possible answer invalidation by David B on question by David B: codereview.stackexchange.com/posts/196731/revisions
 
8:34 PM
-2
Q: Kruskal implementation

DennisI've tried to implement Kruskal's algorithm. This is the implementation shown at out lecture: KruskalMST(EdgeWeightedGraph G){ priority_queue<Edge> pq; vector<Edge> e = G.edges(); // liefert alle Kanten von G for (int i = 0; i < e.size(); i++) pq.push(e[i]); for (int i = 0; i < G.V(); i++) mark...

 
8:48 PM
If this code works, it might be better fitted for Code Review. — Turing85 20 secs ago
 
 
1 hour later…
10:17 PM
Related but not the same: codereview.stackexchange.com/questions/196925/… 3 versions of a counting-up timer as opposed to a countdown timer. — downvote-flagger 53 secs ago
 
11:15 PM
Here's a similar question, note my answer where I point out that some objects may be incorrectly not garbage collected: codereview.stackexchange.com/questions/171862/…markspace 13 secs ago
 
11:39 PM
Whilst you can use goto statements, it's generally advised that you don't use them. If I was doing a code review and someone used a goto statement, I'd tell them to re-write it. — Alex W 52 secs ago
 
0
Q: Delphi Script Combination

Asif UllahHow to merge these two script into one.Download "HOW TO MERGE" THANKS IN ADVANCE.

 
11:56 PM
-1
Q: Tracking attempts taken for a perfect yahtzee game

fight_dragonsI'm building a little script to visualize the probability of rolling a yahtzee (five dice all the same value), and the amount of games it might take to roll a perfect game (13 yahtzee's in a row) Here is the full code before debugging: #include <iostream> #include <random> int main() { st...

 

« first day (1877 days earlier)      last day (2142 days later) »