« first day (1769 days earlier)      last day (2258 days later) » 

12:00 AM
RELOAD! There are 5132 unanswered questions (90.0289% answered)
 
12:25 AM
possible answer invalidation by this on question by this: codereview.stackexchange.com/posts/180459/revisions
 
 
1 hour later…
1:38 AM
-1
Q: How to optimise the solution and insert code? for exam timetabling

Guldana IsmailovaHow to optimise the solution and insert code? for exam timetabling ? 'to solve the problem make a random starting solution ReDim sol(1 To numSlots, 1 To numRooms) As Integer makeInitialSolution sol, numSlots, numRooms, numExams 'Now, evaluate this initial solution solCost = cost(sol, nu...

-1
Q: How to answer this program using if and switch statements.

Arvin QuintanaCreate a program that will accept three numbers and an operation based on the given legends below. Your program should display the computed value. Enter first number: 20 Enter second number: 30 Enter third number: 10 MENU OF OPERATION [1] SUM [2] AVERAGE [3] PRODUCT Enter your choice: 2 ...

 
 
1 hour later…
2:48 AM
@Duga Rolled back.
 
3:22 AM
0
Q: Quick Sort on C++ vector

Jarrett JohnsonI've seen other implementations around, but they seem pretty complicated. This seems to work for me, but is there anything I'm missing? Also, any tips on how I can approve the quality of the code is appreciated. #include <iostream> #include <vector> template<typename Iter> void quickSort(std::v...

 
3:57 AM
0
Q: conditionally replacing values based on two unequal files in python

VLVMIdeal Scenario : I have one test file like this: 0.000000 3.810000 type_a 3.810000 3.910923 type_b 3.910923 5.429000 unknown 5.429000 7.060000 type_d 7.060000 8.411000 type_a 8.411000 8.971000 type_c 8.971000 13.40600 type_r 13.40600 13.82700 type_...

 
4:17 AM
0
Q: I've run into a snag while parsing a string to a double

Marty DixonI'm creating a simple calculator program and that's all well and good. It's coming along smoothly except for the problem I have with parsing this string to double. public class DoubleParseWithAsterisk { public static void main(String[] args){ String str = "*2.3"; char c = str.charAt(0)...

 
4:30 AM
> I've run into a snag when posting broken code
 
5:10 AM
possible answer invalidation by Raystafarian on question by thumbtackthief: codereview.stackexchange.com/posts/189082/revisions
 
5:20 AM
Monking
@Duga seems ok
 
0
Q: static declaration concept

Ravi Singh LodhiWhere can we declare static variables? I have learnt that it should be declared in the class level but are there other fields where we can declare them or just in class.

 
@CaptainObvious no code no glory
 
6:16 AM
0
Q: Minimum number of steps to move from one city to another

Ravi Singh LodhiQuestion: A country X consists of N cities numbered 0 to N-1 . The map of this country can be represented as a cycle — for each valid i, city i has exactly two neighboring cities (i+1)%N and (i-1+N)%N. The cities in the country are broadly categorized into different types. For each valid i, the ...

 
6:47 AM
Integrating gerrit with bit-bucket is a good idea? when bit-bucket provide own code review feature. Can we used gerrit as a code hosting server? — Ranvijay Sachan 40 secs ago
 
7:08 AM
0
Q: Understanding static concept

Ravi Singh LodhiWhy is the output of the following code i=10 j=0 Why doesn't j gets initialised to 10? class MyClass{ static int j=func1(); static int i=10; static int func1(){ return i; } public static void main(String[] args){ System.out.println("i="+i); System.out.println("j="+j); } }

 
7:42 AM
0
Q: Word combinatorics

Marko MackicOk, so here is the problem state : At input you have two integers : n representing the number of chars at input, and k , and after that n chars of string. Something like this : 6 0 ban?na Task is to find number of these strings when we replace the ? that fits the condition abs(number_of_vowe...

 
Monking
 
8:20 AM
1
Q: Optimising information gathering on large file

SamI have a working example of a piece of code which opens up a file, gathers information about the contents, and outputs a map which contains the information. The file The file type is an in-house creation, called an Xsam file. For those interested, it's based on the sam file, which is used commo...

 
8:37 AM
0
Q: Getting the input of a char array in c

pro neonFor the last couple of hours I am struggling with char pointers in c. I am trying to get the user input as characters and store the characters as array members and I want to allocate memory for the array using malloc. Here is my code: #include<stdio.h> #include<stdlib.h> int main() { char* a...

 
possible answer invalidation by Sam on question by Sam: codereview.stackexchange.com/posts/189115/revisions
 
9:05 AM
possible answer invalidation by Sam on question by Sam: codereview.stackexchange.com/posts/189115/revisions
 
9:18 AM
@Duga Rolled back.
 
10:04 AM
1
Q: Correct user typos in a C source file using Perl 6 grammar

Håkon HæglandTo learn about Perl 6 grammars, I created a simple parser for C source files. Note that this is a constructed example motivated by this question. The point is to parse a C source file and correct user typos in argument lists. #! /usr/bin/env perl6 # # Correct user typos in a C source file accord...

-1
Q: select query to count total number of row and multiply each count with 15

pramodi need query to count column total number of rows of column A,B And C and multiply this count column A by 15,B by 6,C by 8.

 
 
1 hour later…
11:30 AM
custom html helpers is one possible solution. Have a look at this post: codereview.stackexchange.com/questions/52016/…Vegar just now
If it's already working as you expect, you can post it to Code Review. — user202729 just now
 
11:48 AM
-3
Q: Mapping XML to an object but not deserializing it

DhanashreeI have an application that communicates with various third-parties. They communicate in XML format. The application gets the XML data, puts it into a known object and then forwards it to data layer to save it in the database. The problem is, all the third parties have different XML formats. Ever...

-2
Q: Generate bitcoin address from secret exponent?

jhnoyhow to generate specify secret exponent i have all program have random function here is the code trying to edit https://github.com/weex/addrgen/blob/master/addrgen.py def generate(self, secret=None): if secret: self.prikey = secret priv_key = ssl.BN_bin2bn(secret, 32, ssl.BN...

 
12:11 PM
You should go to codereview.stackexchange.com and ask there for refractoring help. — PedroFaria99 44 secs ago
 
12:40 PM
-1
Q: Split a string in to substrings of n length in Haskell

Daniel WoottonI am trying to write my own function to split a String into many substrings of a given length in Haskell. For example, "split 5 "abcdefghijklmnopqr" " would return a list of strings ["abcde","fghij","klmno","pqr"]. I have gotten as far as writing the type signature "size :: Int -> [Char] -> [[Cha...

 
12:58 PM
0
Q: Empty the buckets

sahil mehtaI am given N buckets each filled with f[i] units of water (where i is for ith bucket). I need to find the minimum amount of water(in units) say X that can be taken out of a bucket in each hour so that all buckets are empty in H hours. Suppose I take X units of water per hour. Each hour, I will ch...

 
I'm voting to close this question as off-topic because it would be better suited on codereview.stackexchange.comArcher 38 secs ago
 
1:16 PM
0
Q: Javascript Promise: How to chain it correct?

mrksI'm learning to use Promises and have now this working method for my Vue component: addCrypto() { let title = this.newcrypto && this.newcrypto.trim(); let amount = this.cryptoAmount && this.cryptoAmount.trim(); let date = this.cryptoDate; let currency = this.cryptoCurrency; // Get pur...

 
1:59 PM
Greetings, Programs.
 
Hi!
 
2:28 PM
0
Q: Getting parameter from angular activeRoute - can i do it better?

OmtechguyI think that what i'm doing here is kind of overkill and there is better and clean approach to do it. ngOnInit() { this.activatedRoute.paramMap.switchMap( (params: ParamMap) => { return of(params); }).do((params) => { if (params.has('opportunityGuid')) { this.opportunityGuid = new Gui...

0
Q: Parse custom configuration file in C

SvtyrosI have to parse a custom configuration file with these structure: # Begin with core containers. ID = 0 # STX container Name = "" # No name is necessary for a STX container. Flags = {STX} Attributes = {Status=0} So I've written the following code in order to remove those...

 
3:18 PM
@Edward One of my favorite fictional characters is named Edward.
 
@Donald.McLean Is it me?
I'd hope someone would tell me if I'm actually fictional.
 
@Edward Are you an assassin who specializes in killing werewolves, vampires, and other preternatural creatures?
 
No, I'm more of a lover than a fighter.
 
@Edward I was pretty sure you weren't him. Except for the movie Stranger Than Fiction, fictional characters rarely know that they are fictional characters.
 
@Donald.McLean So I suppose I may still be fictional, but just not that particular fictional character.
 
3:24 PM
Monking.
 
Code "Speed Up" Question should be asked on Code ReviewScott Craner 27 secs ago
 
@Edward There was a theory in Heinlein's Number of the Beast that every fictional story exists in some parallel universe. So there's no reason why the reverse couldn't also be true - that we're in a fictional story written somewhere out in the multi-verse.
 
That's either disturbing or comforting, depending on one's philosophical bent.
 
I guess less of a theory than an observation. They traveled to Oz and several other "fictional" universes.
 
And I thought Once Upon A Time was mental...
 
3:27 PM
@Donald.McLean that's basically the entire premise of the "Tintenherz" trilogy
 
Well, it was late-life Heinlein, after his work had gotten very weird.
 
and highly skilled readers can change the reality in those fictional universes
@Donald.McLean e.G.: Deadpool. Pretty sure he knows he's fictional, what with all the fourth wall breaks
 
I'll just throw in two other references: Inkheart and Libriomancer
 
I wasn't sure whether they had translated the title that literally, but... "Tintenherz" == "Inkheart"
 
@Vogel612 Whatever you say, Bird612.
 
3:32 PM
@Vogel612 One of my daughters is a big fan of the Inkheart books.
 
she might have needed to wait for the books to be written to the end... I think I was just able to lend them all at once from our local library.
I may or may not have finished all of them in less than a week
 
@Vogel612 Germans translate everything literally.
At least that's my experience with books, movies and other types of fiction.
 
Libriomancer is a modern fantasy novel in which some mages have the ability to reach into novels and pull things out.
 
@Mast the series is a German original
 
Oh.
 
3:38 PM
0
Q: Merging and refactoring two variants of the same function with different behaviours

HiD3fI'm not a dev, more like a designer. I have a calendar on two different pages, and it should behave differently one these two pages. So I modified the code a bit for it to happen, and it did when I tested it. BUT now I have to integrate both these variants together and of course gulp can't compil...

0
Q: Convert a custom object to a query string

James_ParsonsI wrote an extension method that takes a custom object and converts its properties to a query string for use in a URL. You can specify what properties you want included by using a [QueryString] attribute. For example: class Thing { [QueryString] public int Id {get; set;} [QueryStrin...

 
4:14 PM
0
Q: pattern matching and fmt::Display on recursive Rc<enum> in rust

tangentstormThis works, and does what I want, but it feels ugly and clunky to me. How can I make it better? It's just constructing a basic lisp-style list and pretty-printing it. // simple example of pattern matching on Rc<enum> use std::rc::Rc; use std::fmt; type Cell = Rc<RawCell>; #[derive(Debug, Clo...

1
Q: Miller-Rabin Primality Test Using C++ and GMP

D. SenackI'm currently writing a Miller-Rabin primality test using C++ and the GNU MP Bignum Library (GMP). As I've only started learning C++ about a day ago, I'm sure this code is riddled with errors and inefficiencies. I'm looking for several things (in order of importance): Make the code as fast as p...

 
4:31 PM
0
Q: generates start,end,label ranges based on sequence of predictions

DJ_Stuffy_KMy code reads a sequence of predictions and converts them into [start,end,label] based on majority %age(>60) as follows: Sample_predictions = [0,0,0,0,0,0,1,1,1,1,1,0,1,0,1,1,1,1,1,0,0,0,0] actual prediction are here: https://text-share.com/view/e44e215e#K1um5uWHnOrvQo7I0FhFPqqsecFjXMZQ Code...

 
4:47 PM
-2
Q: C# how to change color of bouncing ball?

SurenI need to change color of ball When the ball collides on the edges of the form,From each collision its color should become random,and this color should be maintained until the second clash has occurred. Who can help me please? public partial class Form1 : Form { Graphics g; int x = 150; ...

 
@CaptainObvious With a hammer.
 
Monking
 
@Mast 🔨'd it home!
 
5:36 PM
for the first part of your question you may be better off asking it at codereview.stackexchange.comAmr Draz 28 secs ago
 
0
Q: Dijkstra's Algorithm implementation in C++

coderAfter applying suggestions from here about Bellman Ford Algorithm. Help me to improve this program. #include <iostream> #include <vector> #include <map> #include <limits> #include <list> #include <queue> class Graph { enum Color {WHITE, BLACK}; struct Vertex { std::size_t i...

 
6:04 PM
Problematic closure based on the "Lacks concrete context" reason, in my opinion:
-1
Q: Javascript Promise: How to chain it correct?

mrksI'm learning to use Promises and have now this working method for my Vue component: addCrypto() { let title = this.newcrypto && this.newcrypto.trim(); let amount = this.cryptoAmount && this.cryptoAmount.trim(); let date = this.cryptoDate; let currency = this.cryptoCurrency; // Get pur...

 
@200_success I just noticed that "Unclear what you're asking" is seldomly used as close reason, but it would fit that question.
 
code review may be a better site for this. — gms0ulman 56 secs ago
 
6:43 PM
@Zeta I agree. "Unclear" would be a lot less accusatory than "Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices" for that question.
 
Without code, I think this questions is a poor fit for SO. With code (working code), I think it might be a better fit for the Code Review site. Either way it's kinda off topic. I'd suggest one question each on Java and Python with example code on Code Review, ask for critiques there. — markspace 6 secs ago
 
@200_success Toby included the link to "Questions should include a description of what the code does" (albeit with an extra subdomain) .... take for example getPriceForTimestamp() - presumably it returns a promise but it would be helpful to know more than that....
that is perhaps why that reason was chosen
 
0
Q: Multiple Choice Questionnaire Code Structure

Keegan FargherI'm new to C# and for my assignment I have to design a multiple choice questionnaire where the student can login and take the test, view the memo, etc. I'm not very concerned about the GUI, but rather the structure of my classes and code. I will be using the StudentController class to interact wi...

 
7:09 PM
Monkevening!
Any ideas on what SE site I could ask a question about the...architecture/logic of an application that I wanna build? ^__^
Hmm, found it
 
that was my guess- I should start sharing that post
 
7:45 PM
-1
Q: Haskell way to populate a list with user input?

Armando H.I am trying to learn me some Haskell because I found it to be an interesting language. Right now, I am trying to implement a C++ function in Haskell to get acquainted with the language. The function just prints the elements of a vector of strings, gets user input, and adds the input to the approp...

 
8:01 PM
-2
Q: How do I add more balls to this

user162681import javax.swing.*; import java.awt.*; public class BouncingBalls extends JPanel { // Box height and width int width; int height; // Ball Size float radius = 40; float diameter = radius * 2; // Center of Call float X = radius + 50; float Y = radius + 20; ...

0
Q: Print all nodes at k distance from the root in a binary tree iteratively

ExploringI am solving this interesting coding challenge of printing all nodes at K distance from the root of a binary tree in a iterative fashion. Will be great to get review regarding how this code can be improved in a better way. public class NodesAtKDistanceFromRoot { private final static Node EMPTY...

-1
Q: List of lists exercise in C

Julio Sánchez CampoamorThis is from an exercise I've done: Define a data structure that contains information about the list of processes and threads prepared for the execution of a system. Each process will be composed of a set of threads. The processes are stored in order of arrival, while the threads of each process...

 
Is it working and you want a review? Then it should go to codereview.stackexchange.comEugene Sh. 28 secs ago
I'm voting to close this question as off-topic because, assuming this code works, it is more appropriate for codereview.stackexchange.com. — lurker 30 secs ago
 
8:16 PM
@CaptainObvious clone the balls!
 
Oh well, let's hope this is enough info
0
Q: Speech to text - action - text to speech: architecture/logic. Is there a better way to build my robo-player?

яүυкI have decided to start a personal project using Python since I have used it for several years now and I would like to know if the approach that I have considered is good or not. Description It's really simple if you know Alexa / Siri / etc. I have a device which will interact with it's owner...

 
@яүυк Wrong chat mate, that's Software Engineering. We're Code Review.
 
@Mast lol, I know.
 
8:32 PM
@Mast yeah see this earlier missage
 
8:45 PM
possible answer invalidation by Sam Onela on question by Kate Herasimenak: codereview.stackexchange.com/posts/188878/revisions
 
@Duga negatory
 
9:35 PM
@яүυк If there's a limited vocabulary (as there might be with a domain-specific application), I'd recommend checking CMUSphinx.
 
9:46 PM
1
Q: Exersize in C - find how many times str1 is in str2

Ariel ArielI'm self-learning C now, and I want to find out if my code is good and clean or kinda messy. For this exercise, the program tells if the text which was inserted has the keyword "asd", without string.h . if so, it returns how many times it was found. it's not a big code, but I want to make sure it...

0
Q: C++ Random Number Generation

Ioan ThomasI am making a few wrapper classes for the C++ standard library and was wondering if the following code is good practice. #pragma once #include <random> namespace LibraryName { class RandomBase { protected: RandomBase() : m_RandomGenerator(m_RandomDevice()) {} ...

 
@CaptainObvious Hmm I wonder if the OP chose that avatar after watching that program in C video or there was another reason...
 
@Edward thanks, I'll have a look there!
 
@SamOnela looks like a snip from this artist's work based on disney
pintrest sucks, because apparently I can't open an artist page without being logged in?
 
@Vogel612 is there a modal panel that appears above the rest of the content of the page?
i.e. with a mask behind it
 
yeap
 
9:58 PM
can you use your browser console to remove such elements?
 
sure I could... but that's waaayy too much of a hassle to possibly just end up on a server-side check.
for a reverse image search ....
 
Factorio :D
My outpost is fully supplied :) 14/14 item types
 
10:13 PM
@Vogel612 I right clicked on the image in Google Chrome and selected "Search Google for image"- the first result was a youtube video, showing how some guy digitally created that photo - see his homepage
 
oohhhh. I should've checked for a deviantart profile...
 
@Vogel612 hehe
 
@skiwi I do assume you're not loading the coal there, right?
cuz that'd be terrible for throughput to shove it all through some drones...
 
I'm voting to close this question as off-topic because asking for a code review isn't suitable for Stack Overflow — Jeremiah Gowdy 32 secs ago
@JeremiahGowdy It is okay to recommend the OP post on CR (like gms0ulman did) but in the future, please don't use Code Review as a reason to close a question. Evaluate the request and use a reason like too broad, primarily opinion-based, etc. Please see the section What you should not do in this answer to A guide to Code Review for Stack Overflow usersSam Onela 1 min ago
 
10:32 PM
@Vogel612 Oh no, the coal goes into the coal train that's outside the screenshot
 
If this is code you're actually using, and you'd like a review of all aspects of the code, and you've read this article and this one, this might be on topic for Code Review. But do read those and make sure before posting there. — Mike McCaughan 21 secs ago
possible answer invalidation by P_P on question by P_P: codereview.stackexchange.com/posts/189083/revisions
I do see that the program takes several seconds to close when you hit the X button after you have started the game but closes instantly if you have not yet started the game. It is likely the game is doing a lot of things and processing information before it reaches the destroy() event. You may need to optimize your code a bit to improve on the speed. Try asking your question on Code Review. — Mike - SMT 58 secs ago
 
10:59 PM
@skiwi Looks like fun, but I'm very reluctant to run unknown code on my machine.
It's the price of paranoia, I suppose. :)
 
@Edward How do you mean?
 
@skiwi I run almost exclusively open source code, so running pre-compiled code is something of a leap of faith.
A quick scan of the binary reveals that it includes some potentially dangerous system calls, such as unlink and various network-related things.
 
@Edward You might be a bit paranoid indeed :p
You won't be able to spot viruses though if they've been developed well enough ;)
Or hiding in hardware...
 
I've done some antivirus work in the distant past, but generally, you're right.
That's one of many reasons I like open source.
 
I assume that the paranoia isn't directly related to the threat of viruses?
@Edward I wonder what the exceptions are. Proprietary drivers?
 
11:07 PM
Viruses, malware, or even just really terrible but otherwise innocent code are all threats.
The sole exceptions: Bitscope software (a software-assisted oscilloscope) and Maple (a math package).
These days, I don't even have Maple installed anymore, and if there were an open source equivalent to Bitscope, I'd use it in an instant.
 
0
Q: Battle-based snake game in tkinter

ChrisDisclaimer: This code is fair from complete, I am aware of issues regarding my standards of naming, my lack of comments and readable, however I am encountering a large issue which is preventing me from editing, testing and completing the game. If you would like a more detailed explaination, this ...

0
Q: Simulating surname convergence in a population

DriseI was curious a few weeks ago about how surnames come and go (mostly on the go). I wanted to know how quickly surnames die out, because (in my simplified simulation world) once the last person with a surname dies, it's gone forever. I started writing a small simulation to see this happen in "real...

 
11:32 PM
0
Q: c# implementation of NZ

Vexen CrabtreeThere's loads of questions on SO about what the c# equivalent is of the useful VBA/Access "NZ" function. It accepts a parameter, and returns an alternate value if the parameter is null. It saves having to CONSTANTLY do "??" AND "==System.DBNull.Value" checks. In other words, those hundreds of li...

 
11:49 PM
0
Q: Most dynamic FizzBuzz possible in Java

NaNI was trying to come up with the most dynamic fizzbuzz answer I could.. and well, this is what I came up with: public static void main(String[] args) { ultraFizzBuzz((Integer arg) -> { String retVal = ""; if(arg % 3 == 0) { retVal += "fizz"; } if(arg % 5 == 0) { retV...

 

« first day (1769 days earlier)      last day (2258 days later) »