« first day (1932 days earlier)      last day (2088 days later) » 

12:00 AM
RELOAD! There are 5492 unanswered questions (89.9733% answered)
 
12:10 AM
0
Q: Set positions in a list, keeping tied places then incrementing back to the positions

markwalker_I have a list of objects which have points and I'm looping through this list to assign the object's position in the list. If the points are tied between multiple objects they share the same position value, but then the next object with a different point value should be assigned the place as the ...

 
 
2 hours later…
2:25 AM
possible answer invalidation by Jamal on question by Greg Degruy: codereview.stackexchange.com/posts/201902/revisions
 
2:55 AM
0
Q: API design: do, then undo

AyyashI am trying to write an api point that changes the status to "suspended" which looks straight forward PATCH /api/artefacts/:id/status {"status": "SUSPENDED"} But now, unsuspending, isn't straight forward, it should check if the artifact is used elsewhere and return the new status, which might ...

 
3:55 AM
0
Q: Expression must have pointer-to-object type

Corey Robinsonvoid array_sum(items, arr_size){ long long int accumulator = 0; int items[1]; int arr_size; for(int i = 0; i < arr_size; i++){ accumulator = accumulator + items[i];} return accumulator;} So I get the error "Expression must have pointer-to-object type" with the index of Items. Just wondering...

 
 
1 hour later…
5:02 AM
@VictorFerreira This is because of the <Item /> component.You must make sure that the <Item /> component renders its children which were passed as a prop childrend. const Item = props => (<div className="item-container">{props.children}</div>).@Hemadri Dasari has provided you an elegant solution for your problem.He did it with proper way how to update state based on the state.If you want to use the add logic in the <List /> component you can pass the logic through the props.I think that the best idea how to improve your code would be to show all of it here or on code review.Cheers! — Jan Ciołek 57 secs ago
 
 
1 hour later…
6:02 AM
I'd use instaparse for that. Yet what exactly is the question here? Do you face a problem or are you looking for advice to do that in a better fashion? Without the actual code it's hard to tell, but SO is about programming problems, so you might be better off asking this on codereview once the code is there? — cfrick 53 secs ago
 
6:56 AM
0
Q: Global Map Holder

wBaczGlobal Map Holder - I want to make it more SOLID and DRY There are 2 aims of the packages: First is to provide easy access to 3 csv files: * currencies fix rates (nbp) * programming languages list (tiobe) * area list of polish locations and second one is to get web data and save it as csv for: ...

 
Monking
 
7:26 AM
0
Q: Show past 6 hours weather reort with current time

ShaktiI want to show the weather report of current time and past 6 hours of current time. So, Is it possible?

 
7:41 AM
0
Q: How to vectroize with slice and hstack?

Ray TayekIs there a way to vetorize this with slice and hstack? def expand(X): X_expanded = np.zeros((X.shape[0], 6)) for i in range(X.shape[0]): X_expanded[i,0]=X[i,0] X_expanded[i,1]=X[i,1] X_expanded[i,2]=X[i,0]**2 X_expanded[i,3]=X[i,1]**2 X_expanded[i,...

 
 
1 hour later…
8:41 AM
0
Q: Is there a better way to write my quote rotator quote?

Black JesusOn my website, I created like this banner that rotates quotes from an array I made. var myarray = [] myarray[0] = "\"To a contrarian like me, constant advice not to do something almost always starts me quickly down the risky, unpopular path.\" <br> <strong> Micheal Bloomberg.</strong>"; myarra...

0
Q: Set input field value inside an external iframe using jquery or javascript

Mahfuz MorshedI am strongly facing iframe problem.I need to set value in other web side's input field.I post my code. already i am checking contentDocument (which return null) and contentWindow not work(which catch error) any one help me. I was following https://www.w3schools.com/jsref/prop_frame_contentwin...

 
 
2 hours later…
10:11 AM
0
Q: TypeWriter Javascript Effect. Better way to implement?

Ains ClarkI have implemented a Javascript TypeWriter effect for my website (shown below). I had big problems in setting a timeout for the individual functions because each time I did the speed would double. At the moment my code is very linear and not very dynamic. Can anyone suggest some edits to make t...

0
Q: Endless stream: stream a range and return default value if the range is exhausted

IncomputableIntroduction: Motivation Sometimes there is a need to merge N > 1 ranges, and they don't have equal length, but there is a value which can be used in case the range is already exhausted. It is especially apparent in this question, in which most of the complexity comes from handling the nullness...

 
 
1 hour later…
11:41 AM
-1
Q: How to code shuffle-left algorithm?

Hope LessI am new to programming so this really confuses me. My prof wants us to code this to c. Help me.

 
Monking
 
12:00 PM
As this code works, but can be improved, this question may better be asked on Code Review. — N. Wouda 1 min ago
 
12:26 PM
-2
Q: How to fetch value from a field on website

Chopped ArtisanI need to fetch a value from a field from a website which itself needs a username and password for logging in. The website is internetaccount.orange.mu. The value is for 'remaining volume bank'. I was hoping this can be done with macrodroid (!) or Tasker. After some research I believe http get ...

0
Q: Arkanoid/Breakout clone with ThreeJS

nasser-shHere's my attempt at an Arkanoid/Breakout clone using JavaScript with ThreeJS. Let me have it! <!DOCTYPE html> <html> <head> <title>Arkanoid</title> <style> body { padding: 0px; margin: 0px; overflow: hidden; ...

 
12:41 PM
0
Q: Deleting a node in Linked list

neha jainFor deleting a node in linked list I used 3 steps: 1)Finding the previous node of the node to be deleted. 2)Changing the next of the previous node.(to know what is next see my code it's fully explained). 3)Freeing up memory of deleted node. But in place of data to be deleted ,0 is coming.I don't ...

 
1:30 PM
this may be more appropriate for codereview.stackexchange.comnha 59 secs ago
 
1:56 PM
0
Q: Is gathering namespace functions into a map via a macros idiomatic Clojure?

art-solopovI'm learning Clojure via a pet project. The project would consist of several workers that would be called from other functions. Each worker is defined in their own namespace as a set of functions (currently two: get-data for gathering data and write-data for writing the gathered data into a file...

 
2:11 PM
0
Q: Python 2.7 Powerball Game

Okafor EkeneThis game allows one to either pick their own lottery numbers or have them generated and checks them with the most recent numbers, jackpot, and multiplier. I use concepts such as random, for loops, raw_input, and logic. I would it appreciated if it were reviewed by someone more experienced. ...

 
 
2 hours later…
3:57 PM
0
Q: Crawler help needed

user313188If I have a form built on my website. How can I get that form 1 to plugin results into another websites form 2 and extract information to display on my website? For example, if I wanted to create a form like cartagz.com for registration fees on my website romarinsurance.com so that my customers c...

 
4:27 PM
0
Q: Finding center of graph/tree

RandomDudeGiven graph/network of nodes without any loops/circuits. I'm trying to find the center: the node from which i can reach all other nodes the fastest. Imagine if i want to spread the word about something and the information traveling from one node to the next takes 1. My solution removes nodes fro...

 
I think this question would work better on Code Review Stack Exchange, given that the code you posted is already working and functional, at some good level. — Tim Biegeleisen 57 secs ago
 
5:32 PM
Can you clarify your question? We have a dedicated site for code review. If you want something immediately I'd start by introducing error handling, input validation, properly handling the new lines and introducing constants. Then you can think of a way of speeding it up (e.g. reducing the calls to cin). — Margaret Bloom 29 secs ago
 
5:48 PM
This would be best asked at Code Review. — Thomas Matthews 9 secs ago
 
6:16 PM
That while loop will run forever right now because total can never be less than or equal to 0, so you really need a bigger-picture refactor to get this working. iinventory[ingredient_name] += number is the correct syntax for adding items to iinventory, iinventory.append(number)) needs to be removed. Once you've experimented a little bit, I'd recommend posting your code on codereview.stackexchange.com — chris 14 secs ago
 
 
2 hours later…
7:58 PM
0
Q: Can someone look at my Python code and tell me why it is slower than MATLAB and C# version?

OmidI implemented k-armed bandit problem in C#, MATLAB and Python. C# and Matlab code run fairly fast (With same settings of T = 2000 and nRun = 1000 the elapsed time is about 6sec). However, the python version is ten times slower and takes about 60 seconds to complete. I am a beginner in python but ...

 
What's wrong with that code? Why do you think it's slow? Did you measure it? If so, how? Also, this question might be more appropriate on Code Review instead of StackOverflow. — Zabuza 37 secs ago
@Zabuza: This question shouldn't go to Code Review. Please don't suggest it as a potential candidate until you've thoroughly familiarized yourself with its migration policies. — Makoto just now
 
8:59 PM
Anyway, if you have working code and you want suggestions for improvements, that's off-topic for Stack Overflow, but it may be a great question for Code Review. But make sure to read their help first, rather than trusting the guess of some guy who only has a few dozen points on that site, of course. — abarnert 9 secs ago
 
9:13 PM
0
Q: Remove extra spaces from a string - C programming

Kenan HatibovićThe task is to remove all the extra spaces in the string, just to leave one space between every word, for example if the input string is volim OR the output should be volim OR My code is : #include <stdio.h> char *IzbaciViskaRazmake (char *Str) { int i,j; for(i=0;...

0
Q: C++ - Graph implementation for data types other than int

skr_roboI am learning graphs and most of the implementations that I see are meant for int. So, I decided to code an example that can take other data types such as char or float. I did see this prior to posting my example (but not prior to coding my example). The example in the link is similar to creating...

 
9:28 PM
0
Q: List of Dictionary, Linq Lambda, Manipulation Trouble

Kelly Kleinknechtvoid Main() { List<Dictionary<string, string>> SSRList = new List<Dictionary<string, string>>(); Dictionary<string, string> SSR = new Dictionary<string, string>(); SSRList = Util.Cache(() => { foreach (string line in File.ReadAllLines(@"I:\Mfg\Test Development Workstation...

 
9:58 PM
0
Q: Support the parity of the path length / Checking bipartiteness online

ironmanI am trying to learn to check for bipartiteness online using Disjoint Set Union. I found one tutorial . But the implementation of code and tutorial in section "Support the parity of the path length / Checking bipartiteness online" is not clear to me. Would anyone explain the following code wit...

 
 
2 hours later…
11:59 PM
0
Q: count number of lines provided to Python script before and after task

αԋɱҽԃ αмєяιcαηInput: {"case":"0901","emailed":"yes","vote":1,"accepted":"no"}, {"case":"0908","emailed":"yes","vote":8,1"accepted":"yes"}, {"case":"0911","emailed":"no","vote":10,1"accepted":"yes"}, {"case":"0090","emailed":"yes","vote":3,1"accepted":"no"}, Script Written to accept the input even if it's li...

 

« first day (1932 days earlier)      last day (2088 days later) »