« first day (2024 days earlier)      last day (1993 days later) » 

12:00 AM
RELOAD! There are 5831 unanswered questions (89.6818% answered)
I think that question would better be answered on CodeReview. — Louys Patrice Bessette 42 secs ago
 
 
1 hour later…
1:10 AM
0
Q: Optimizing the graph path

RohitAlgorithm: Two input files are given The first contains |N| ratios in the form of two labels and a ratio: USD, GBP, 0.69 Meter, Yard, 1.09 YEN, EUR, 0.0077 GBP, YEN, 167.75 Horsepower, Watt, 745.7 Each line A, B, C means that C is a conversion factor from A to B. In other words, mu...

 
What do you mean by "efficient" in this context? If your code works, consider posting on codereview.stackexchange.com. My only remark is: warning: initialization of 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion] struct member person1={"", "", 0};ggorlen 33 secs ago
 
1:25 AM
0
Q: Are there any further optimizations or better ways to structure a Trie?

Luke XuPracticing hacker rank questions and would love some feedback on how I could perform optimizations on a Trie. This code will add a bunch of names into a trie and then when asked will turn how many names belong to a partial match. eg. jenn, jennifer, george, jenny partial => jen return => 3 u...

 
 
2 hours later…
3:26 AM
1
Q: Format travelers with correct data

Brandon BenefieldI have a test that I've already turned in but would like some outside review on where I could improve. Spent most of the day today trying my best to keep this O(n) complexity. Any help is very much appreciated. If it's a bit difficult to read here feel free to check out the repository Example o...

 
3:41 AM
-1
Q: Counting digits

TJ BeachI need the input a value then count the number of zeros, odds and evens. Im stuck on separating the numbers of the inputted value into individual digits so I can put the in an if statement. Any suggestions?

 
4:13 AM
0
Q: Roll the dice and reach a position then sum the position

user184984 In a turn-based manner, allow the player to roll a dice (1-6) to travel to the next location. For simplicity, we assume each number represents travelling across 1 location and that there are 10 locations in the game, with the last location (location 10) belonging to the lair of the bos...

 
 
1 hour later…
5:29 AM
0
Q: Trying to Perform A* Search on 4x4 Board - Works on Small Cases but Runtime is horrible on Large Cases

Kubietl;dr: would appreciate comments on how to improve time complexity of program that implements A* search. Bottom line: I am trying to improve the time complexity of my A* search algorithm and I have tried approaching this from every which way I believe is possible. I believe I may be doing someth...

0
Q: Bist-o-yek: a Card Game Similar to Blackjack

ChubakBidpaaBist-o-yek (21) is a Persian card game very similar to blackjack, except it doesn't have things like double down and split. I did, though, change it a little. For example, added dealer dealing to 17. First, there's a class called Cards that carries each card's name and score. Then, some function...

 
5:45 AM
If this works, you can also post this on CodeReview. — AJD 59 secs ago
 
5:59 AM
0
Q: How to reduce run time of my code to solve Cycle race practice problem from geeksforgeeks

user2940110I am referring to this problem https://practice.geeksforgeeks.org/problems/cycle-race/0. I have written following code for this problem which gives me time out when I am submitting. How can I improve my solution? Please help me. Thanks in advance. #include <iostream> using namespace std; bool...

 
6:14 AM
0
Q: Speed up VBA Macro: Open/Close Several Workbooks To Sort Data

ahhnI have written a macro to process all excel files within a user-chosen folder and then save the processed files as a new file in a new folder ("FINAL"). The macro I have works, but is slow. Do you have any suggestions as to how I can improve the speed? Sub PreProcessing() Application.Calculati...

 
6:44 AM
0
Q: Using a static method in C# for fetching client context

Vignesh SubramanianI have the below method for fetching the SharePoint clientcontext public static ClientContext GetContext() { try { using (var ctx = new ClientContext(SiteUrl)) { SetCertificate(); if (ctx.Has...

 
6:59 AM
0
Q: Unexpected error while coding:

Hifsa SaleemI have written the following code for bubble sorting. #include<iostream> using namespace std; main() { int j; int array[j]; int temp; for(int i=0;i<6;i++) { cin>>array[j]; } for(int i=0;i<6;i++) { for(int j=6;j>0;j--) { if (array[j]>array[j+1]) { ...

0
Q: Buggy Rock, Paper, Scissors in javaScript

LegalizedPotatoThis is my first "game" I am creating in this language, and it works about 70% of the time. For example, its random, you click rock, the computer gives a random choice back, but sometimes it doesn't and you would have to click the button again. (Sorry, my explanation is bad, so I will give you t...

 
7:20 AM
possible answer invalidation by t3chb0t on question by Luke Xu: codereview.stackexchange.com/posts/207888/revisions
 
0
Q: One-to-many output - Kinesis Firehouse Delivery Stream Transformation

efreezyIt is evident in the AWS documentation that each record in the transformed output of a fire hose data transformation must match on a recordId corresponding to an input record. Can multiple output records point to the same input recordId? For example, suppose 10 records enter with unique ids, e...

 
 
1 hour later…
8:55 AM
This code might be more suitable on codereviewTorxed 46 secs ago
 
9:24 AM
Questions about optimizing working code might bei asked on codereview.stackexchange.combummi 31 secs ago
 
9:46 AM
-1
Q: Password Matching in Python

Amatul KarimI need help with creating a python code to do this: 1) When the program is run, it asks the user to enter their name 2)Asks users to enter the password- which is "admin" 3)If correct then display "Welcome (+ the name of the user) to the game) 4)If incorrect then it asks to enter the password agai...

 
10:10 AM
If there's an error in your code the SO is the place to ask. For code improvement, Code Review is the go to place. — Mark Fitzgerald 22 secs ago
 
10:30 AM
possible answer invalidation by Jonas on question by Jonas: codereview.stackexchange.com/posts/207867/revisions
 
-1
Q: PhoneBook Application using C++ File Handling

Vimal KumawatI made a phone book application using C++ and adding file handling as an Assignment. I am having certain problems as I have yet not studied file handling in detail and is noob when it comes to programming. I am having problem here with file handling. The code is incomplete for group creation, how...

 
 
1 hour later…
11:47 AM
0
Q: Simple Java OOP Calculator with GUI

MurDaDI'm learning Java (again) and I've tried to write my own calculator with GUi based on this post. Here is the repo: https://github.com/MurDaD/java-calculator Could someone check my code and tell me how to improve it? The main problem I thing is in the Mediator class - it's huge, but I don't know...

 
12:32 PM
-2
Q: Python if statements

F.AhmedI am trying to write some code in python where you enter a password. If you enter the correct password then it will display success and will close after 5 seconds, however I keep getting syntax errors. inputed_password = str(input("Enter password")) correct_password = ("password123") if inputed_...

0
Q: code that does a 5 round dice game. it starts at rounf o but i want it to start at round 1 or at least when its round 0 both players have 0 points

duhaimport random def authorise(): correctusers = ["duha", "evan","mr.dad"] correctpassword = ("7") user = input("Please enter name ") while user not in correctusers: user = input("Please enter name valid username ") password = input("Please enter password ") while pa...

 
12:47 PM
posted on November 18, 2018 by Jonathan Komar

When I create an enum data type, I know that the numbering order normally corresponds to the placement order of the elements in the list and is zero-indexed. Here, in the pacman.c code for Arch Linux, there is an enum data type. My question is two-fold: What are the sequential numbering assignments? PM_OP_REMOVE = 2, PM_OP_UPGRADE = 3,...? Where is the name of the

 
1:17 PM
0
Q: Advice on a pseudo-truly random number generator

connectyourchargerI am creating what strives to be a truly random number generator. As of right now, the implementation uses a mix of mainly nonsense system data and some pseudo-random numbers to generate numbers that are different and use the last half of the number (which, statistically, I believe is sufficientl...

 
1:46 PM
Questions about how to optimize or refactor working code are better suited on codereview.stackexchange.com. This site focuses on code that doesn't work — charlietfl 52 secs ago
 
0
Q: C++ big unsigned integer class

user673679Here is a big unsigned integer type I intend to use for learning and "fun" with cryptography. It uses a std::vector for storing blocks of unsigned integers, the exact type of which can be changed with the template argument block_t. A double_block_t is used internally for the various math operati...

 
1:59 PM
This seems like it could be a case for codereview.stackexchange.com since it's about improving working code. — Mad Physicist 33 secs ago
 
0
Q: Haskell Simple Queus implementation

Michel VorwiegerIm a member of a discord channel and sometimes people post simple coding exercises for fun. This time the exercise was: I came up with this Solution: data Queue a = Empty | Value a (Queue a) deriving (Show, Eq, Read) push :: a -> Queue a -> Queue a push x Empty = Value x Empty pu...

 
2:18 PM
-1
Q: Splitting jQuery code into reusable modules

ficusI am in the middle of php app development with some addition of js. Since my JS knowledge is not particularly good, I rely on jQuery. However, I like to work with reusable code rather than spaghetti. So, there is a situation. I have two kinds of form in the app - classic ones and ajax ones. Now...

 
2:33 PM
0
Q: Fetching app lists, adding/removing apps from a list

Kar19I wrote a code that should help me fetch app lists from my database (set by different tables by their category - Microsoft Office apps, Other apps, System apps, ect'). I will add my class structure, and would like a review mainly for the architecture. I'm not sure if I'm using the interface pro...

 
2:48 PM
0
Q: Java Generics - nested foreach loops, removing code duplications

Gal SheldonWould appreciate some help. I am attempting to remove some duplication from my code and by that, further my understanding of Java Generics. The following code snippet is contained in a class of generic type: ContainerClass<S1,S2,A> In one of the functions in this class i have encountere...

 
Monking
 
3:03 PM
-2
Q: C++11 Linear/Arena Allocator implementation

Nik-LzI have implemented a C++11 compatible linear or arena allocator. The code follows. linear_allocator.hpp: #pragma once #include <cstddef> #include <cassert> #include <new> #include "aligned_mallocations.hpp" template <typename T> class LinearAllocator { public: using value_type = T; us...

-2
Q: Simpsons composite rule in python

user123In the following code I have tried to implement composite Simpson's Rule in Python. In my function am trying to do the following Integrate any function f (given as lambda function) over an interval [a,b] subdivided into 2n intervals. The following is my code I produced. I believe I am impleme...

 
3:34 PM
-1
Q: If Statements for positive and negative numerical values in google sheets

mjjFrom my researching, I found out that an 'if' statement in google sheets should follow this format. IF(logical_expression, value_if_true, value_if_false) This is my if statement : =IF(B5="(-infinity,0)","Negative" , "Positive" ) I saying if the value in cell B5 is negative, then it should prin...

 
 
1 hour later…
4:34 PM
0
Q: AI based map clororing (csp)

M-fahad Aliimport java.io.*; import java.util.*; public class CSP { public static void main(String [ ] args) throws IOException { long t1 = System.currentTimeMillis(); Calendar cal = new GregorianCalendar(); // Get the components of the time int hour = cal.get(Calend...

0
Q: Google Sheets- How to express a range of values with nested if loops

mjjThis is a nested if loop I wrote in google spreadsheets Whenever I enter a value for B5 between 0 and 1 like 0.5, it says there is "no match". I think there is something wrong with the last section of the code. I was wondering if anyone knew how to fix this? Thank you very much.

 
possible answer invalidation by russau on question by russau: codereview.stackexchange.com/posts/207877/revisions
 
5:05 PM
0
Q: Haskell, some input, some analysis, some output

Aaron HallI'm learning Haskell, and I've finally gotten around to coding up some Haskell. This code passed my tests. This code takes a line from standard in which tells it how many cases it's going to have (1 to 5), and for each case, it takes a line telling it how many pairs (max of 100) of x's and y's i...

 
5:27 PM
Thank you, @Feeds!
 
6:05 PM
0
Q: Python Blackjack Game

JonasThis is one of my first programmes in python and I really could use some feedback on how to improve. It's meant to be a multiplayer game by handing the computer to the next player at the end of each turn. import random import time import os import operator def invalid(): print('\nINVALID IN...

 
6:20 PM
0
Q: 4 Foreach'es to iterate over all pixels of an image, could I use 2?

nathan3882I was just wondering whether anyone has any thoughts on how I could optimise this, this is the only remotely repetetive piece of code in my project, and hate how it looks. This code finds the quantity of a certain "TablePart" (ie a border) in each vertical and horizontal set of pixels, allowing ...

 
6:34 PM
-1
Q: Nested Linked List Traversal

alpI have a linked list of users and every user in this linked linked list has a linked list called friends which storers their friends pointers.I need to figure out how to traverse all nodes to check if some given users are in a friend chain or not. I believe I should do it recursively but it doesn...

 
 
1 hour later…
8:00 PM
If the code works and this is more a code review question, then please visit CodeReviewtrincot 46 secs ago
 
8:20 PM
0
Q: Neural Network Classifier in Matlab

U. UserI am trying to build a neural network classifier. I have created a neural network with 1 hidden layer (25 hidden neurons) and 1 output layer (1 neuron/binary classification). The dataset I am using has the following dimensions: size(X_Train): 125973 x 122 size(Y_Train): 125973 x 1 size(X_Test):...

0
Q: DOS Header Parser in Rust

the_endianLooking for feedback mostly on the from() and printf() implementations but I included everything for context. Please do not suggest crates, this was an exercise for me to better learn the primitives in Rust. Also, please do not suggest unsafe Rust! I need the code to use only safe Rust constructs...

 
8:36 PM
-2
Q: (python treasure hunt game) Implementing a end game and leader board

J.Peggyimport random import sys import time import pickle #module used to serielize objects boardeasy=[] boardmed=[] boardhard=[] current=[0,0] treasures = [(random.randint(0,8), random.randint(0,8)) for i in range(12)] bandits = [(random.randint(0,8), random.randint(0,8)) for i in range(12)] Coins = 0 ...

 
 
2 hours later…
10:06 PM
0
Q: Wrap fused location provider listener and wifi scan broadcast reciever in coroutines

leonardkraemerIn my app I need to query location and scan wifi periodically. To conserve power I need to change the rate dynamically, depending on the distance to the target. Also I want to wait for both asynchronous calls to complete. Coroutines seemed the obvious choice, but since this is my first take at co...

0
Q: Ruby string multiplication or `.include?` weird behavior

Mathieu CAROFFI was doing a code golf (use the minimum number of characters) and I had the following working Python solution. I was trying to shorten my code by re-writing it to Ruby but my Ruby code would always print false. The code had to read two strings, to ignore the case and to tell whether it was poss...

 
10:44 PM
monking
 
 
1 hour later…
11:58 PM
I'm voting to close this question as off-topic because it may belong to CodeReview provided the question is phrased in a way consistent with its guidelines. — jpp 23 secs ago
 

« first day (2024 days earlier)      last day (1993 days later) »