« first day (1605 days earlier)      last day (2710 days later) » 

00:00
RELOAD! There are 4400 unanswered questions (90.7540% answered)
 
1 hour later…
01:24
0
Q: string io and parsing

JonTo learn Rust, I tried to write a function that takes string input and then converts it to integers for a time calculation for a delay. Is this approach ok? Have I made any mistakes? I kind of struggled with needing to do two separate error checks for the string. First for the parse result and s...

02:05
0
Q: Two approaches to print all permutations - returning versus passing through the “result” list

code4funI have noticed many of the backtracking problems have two ways of solving. One is to return "whatever's the required list", vs passing-through the "result" to every call and appending to it. What is the downside of returning (is it less memory/time efficient)? Example - To print all possible per...

02:51
If you're primarily looking for a review of your code, you may want to try posting this question on the CODE REVIEW website instead. — Louis Langholtz 58 secs ago
 
1 hour later…
03:57
looks safe, this really belongs on code review — rtfm 39 secs ago
04:46
Monking
0
Q: Is it the corrent way of MVVM Pattern in Xamarin form?

SirajIs question is purposely posted for review the code. Please anyone let me know if the MVVM pattern I followed in this is correct or not. Here is the code for ViewModel public class LoginViewModel { public string Email { get; set; } = ""; public string Password { get; set; } = ""; ...

Monking
05:03
0
Q: Regular expression to identify java funtion

g_pI am trying to identify a java function block addition in a diff file( new line start with + in diff). For that I am using regular expression. It is working fine, however I need to identify all(if not , at least maximum) possible combination of keyword used in java method declaration. Here is ...

05:20
@Astrobleme An array can decay to a pointer.
0
Q: Implementation of linked list in scala

natbelow is my implementation of linked list in scala language.It is very basic implementation to understand generics and use of Option in scala. please let me how can i make it better and implement it more effectively. class LinkedList[A] { val element: A = element.asInstanceOf[A] var head: ...

05:41
0
Q: Recursive max int in array

the_endianI would like a review for this simple recursive algorithm which returns the largest int in an array of integers. I would like feedback on the transfer of state via the third parameter specifically. Please also note 2 things: It must be recursive This is not for production usage, but rather recu...

06:07
David Fullerton on September 25, 2017

As Joel often says, “developers are writing the script for the future,” and that is definitely the case when it comes to AI. The knowledge shared on Stack Overflow includes an ever-growing pool on AI and related topics such as machine learning, natural language processing and deep learning. From C to Lisp to Java to Python, professional developers and those learning the craft are eager to learn, share and build their careers around this important programming field.

So when Microsoft showed us how they were bringing AI to every developer through their platforms and tools, and asked if they could …

07:06
Actually, this is a CodeReview. — Gert Arnold 45 secs ago
0
Q: Count maximum number of thieves that can be caught

ManyaThe question goes like this : There is a N * N grid. 1) Each cell of the grid can have either a police denoted by P or a thief denoted by T. 2) A police can catch a thief only if they are in a same row. 3) A police can catch only one thief. 4) A police cannot catch a thief who is more than K u...

07:30
This style of questions and answers fits better to codereview.stackexchange.comastef 40 secs ago
@Mast if you hover on the "human readable time" you get a UTC timestamp across the network
Monking btw.
07:52
0
Q: Export datagridview to excel template with limited rows

shabzoI have a template that has 30rows. how do i export datagridview to the template and the balance as page 2 private void button1_Click_1(object sender, EventArgs e) { Excel.Application xlApp; Excel.Workbook xlWorkBook; Excel.Worksheet xlWorkSheet; object mis...

@Vogel612 Either I never knew that, or I'd forgotten all about it. Thanks.
Also, monking!
wow German poilitics is gonna be complicated in the new term
second largest party is forcing the largest party into a difficult coalition and one of the leaders of the third largest party announced to not enter the faction of her own party...
08:09
@Vogel612 You'll get used to it, formations have been going rough here since parties started explicitly excluding each other a while back.
I'm sure I will. I'm also pretty sure that this is actually going to start making politics interesting again
Probably. Next elections will be interesting as well, since it's not a given Merkel will win again.
Monking
@CaptainObvious Re-opened.
08:17
@Mast pretty sure if she keeps her current policies up, she'll not. Then again she hesitated to run this election ...
@Peilonrayz hmm ... I'd think that OP can verify and then self-close
@Vogel612 It doesn't look like they want to self close, and it looks like they didn't like my answer to the dupe
hmm ...
aigthy then
08:33
-1
Q: "Count maximum number of thieves that can be caught" question should be reopened

Sharon Ben Asherthe following question was closed as off topic Count maximum number of thieves that can be caught the code seems complete to me and the question is complete and clear. moreover, I have started to code an answer.

09:14
1
Q: Load an associate an FXML with a controller class using an interface with default methods

Johan De SchutterI created an interface (IFXMLComponent) that can be added to a FXML controller class. The FXML controller class that implements this interface will be associated with an FXML file. The interface both support custom FXML components, in that case the FXML controller class extends a JavaFX node (e...

09:45
@Blacktempel No! This is a minimized pattern, not actual code in use. We can't review this. Please take a look at the Code Review help center. — Mast 7 secs ago
weeelll ...
I would suggest for you to post this code on Code Review. There are some stylistic issues as well as a bit of Perl general knowledge you seem to lack. I believe you would greatly benefit from a proper code review. — simbabque 19 secs ago
0
Q: MS Fakes Shims. Assert "was called" (by closures)

SerGIs it a good or bad practice to use closures for asserting the method was called in such a way? The method set a shim and return an Action wich both capture local mutable variable: private static Action<bool> ShimCopy(FileInfo source, FileInfo destination) { var wasCalled = false; ShimF...

10:05
@DanPantry Fish jokes.
10:47
0
Q: Count maximum number of thieves that can be caught

Satish SrinivasI recently faced this question in an online programming contest: There is a N * N grid. 1) Each cell of the grid can have either a police denoted by P or a thief denoted by T. 2) A police can catch a thief only if they are in a same row. 3) A police can catch only one thief. 4) A police cannot c...

You need tools to check the memory dump, and code review, not checkpoints in case of memory leaks, crash and hang. — Amit 17 secs ago
Would be better suited for Code Review. — Filburt 5 secs ago
11:17
1
Q: Bug: attempt to edit another user's question results in a one-line error message

TimSparrowSteps to reproduce: Try to edit Count maximum number of thieves that can be caught Expected results An error message, if applicable, should appear in a red box Actual result An error message appears on a blank page There is a pending suggested edit in the queue. Try again in a few minutes.

11:44
Greetings, Programs.
Again technically true, but I can not think of an elegant design that would not require factory to give ownership to a caller. Not saying it is impossible, in theory, but I am not aware of a code that I would be happy to code review for production that does not give ownership to the caller. — NoSenseEtAl 17 secs ago
12:45
0
Q: Kik bot made using Flask

mamunWhat my actual bot looks like. I have excluded custom module imports and kept lists in if statements empty because they are not relevant in my problem. import os from flask import Flask, request, Response from flask import Flask, request, Response, url_for from kik import KikApi, Configuration f...

0
Q: Python2.7 Some xor fun

LudisposedAfter doing the Cryptopals challanges, which I found scrolling through codereview, and finally being able to solve set1 challenge 6. I decided to have a little xor fun, and make an automated xor encryptor/decryptor. Usage is pretty straightforward You can encrypt from a file to another file Or...

It's simple, using index you can sort your array. See this: codereview.stackexchange.com/questions/60128/… You can create filter and use that for your problem — Avnesh Shakya 1 min ago
@infiniteloop I edited my answer by adding some code review details as well as adding a short explanation at the end with regards to the comment. — Myst 34 secs ago
0
Q: A CRUD blog with a basic auth system made with the MERN stack

Dream_CapI would like some feedback on things that maybe could've been written a lot better. I used redux for handling state. Here is the github: https://github.com/capozzic1/react-blog Here is a demo: https://reactreduxblogcc.herokuapp.com/ Here is the posts reducer for handling posts. I tried to be ...

13:29
0
Q: Script gets data and plots a scatter plot

SaqlainMy script gets data from a csv file but the problem is that after reading and plotting the for loop doesn't run. import csv import matplotlib.pyplot as plt with open("DataDotWorldBBallTeam.csv", 'r') as file: csv_reader = csv.reader(file) y = [x[1] for x in csv_reader] y = list(map(f...

13:47
0
Q: Implementing an HotelManager interface in Java

NotSureGot a mission to implement an Hotel Manager interface. I will post the interface and the attached class Reservation, and will add my code. What I am asking you is basiclly tell me if my choise of using a TreeMap seems right for you or you could improved the run time of this. The class Reservatio...

14:01
0
Q: MySQL UDF in C to return first non-empty value from list

Brian LeishmanI have a function that I wrote a while ago in PHP called ifempty, which I could pass an infinite(ish) amount of values and it would return the first one that wasn't purely white space or empty, like ifempty('', null, '\n\n\n \t', 'test') would return 'test'; That one works awesome. But then I n...

0
Q: Transform a vector with the FFI in Haskell

Stéphane LaurentIn Haskell, I want to apply a transformation to each element of a vector using the FFI. I am rather ignorant in C, I am more or less novice in Haskell and this is the first time I use storable vectors in Haskell. This is what I did, taking the transformation \x -> x+1 as an example. The C file: ...

14:26
0
Q: SHA-1 error in code (own implementation)

Mr. Hello_worldI have written an implementation of the SHA-1 algorithm which gives an incorrect hash value, I have debugged and checked the code, and I can't find the error, can you please help me out, what is the problem. Thank you in advance. P.S. I know that I can use some kind of a library but I want to wr...

0
Q: Coding JavaScript Menu - Trying to add Next & Prev button functions

dan_code89I am not someone who plays with JavaScript much unfortunately. Working on a gallery website page - have this code & have added 2 functions at the bottom giving next and previous buttons to run through the gallery items.. I am a bit lost trying to understand the basics of the code structure thoug...

Since its working for you and you are asking for more of a review of your code I would suggest asking over at codereview.stackexchange.comAndrew Lohr 33 secs ago
See codereview.stackexchange.com for a better forum for this sort of question. — Mad Physicist 19 secs ago
0
Q: Replace HTML input file element with custom styled button

LauI've been working on a solution to replace the HTML input file element with a custom styled button. jsFiddle: https://jsfiddle.net/Lau1989/4jLz04pc/5/ 1- First route the click event to the actual file input //route click event on styled button to the actual file input button.addEventListener(...

0
Q: Deploying a .aspx web site to Azure

JimHaving some issues deploying a ASP.NET web site to Azure. The site was built in Visual Studio 2013 and works fine on my local machine/server. However, when I deploy to Azure, I get the "Your App Service app has been created" page with "Go to your app's Quick Start guide in the Azure portal to get...

14:43
It's not really a question though its more of a code review no? — dave 34 secs ago
This is more of a code review than actual question — BudsNanKis just now
@BudsNanKis a code review can become a question if you append a question mark? — Luca 27 secs ago
14:57
0
Q: React component - click to edit text. (Recovering backend programmer, how am I doing?)

tim sherrattI am an experience backend programmer wanting to bring my frontend skills up to par. (My js experience up to this point is mashing things until they work rather than structured frontend applications). To that end I'm working on a React project - I'd love to get some feedback on the code below to...

I'm voting to close this question as off-topic because it appears to be a request for code review. — khelwood 41 secs ago
@BudsNanKis A code review would at least have some code... — tofro 34 secs ago
@khelwood It's not code review. I just put my solution in the solution if someone wants to compare or see what I have attempted. — Pii 22 secs ago
> This is not a code review, so you can just give me your solution and not read my solution.
Yea, like that's going to go over well on SO...
If you want someone to write a completely new solution, then it's too broad. If you want someone to check your solution for you, it's a request for code review. If you were to ask about some specific problem you're having with your code, that would be a valid question. — khelwood 13 secs ago
I'm voting to close this question as off-topic because it belongs on codereview.SE — slim 53 secs ago
@slim Code Review doesn't accept pseudocode or broken code. — EJoshuaS 32 secs ago
15:30
hello
got an interview in an hour and a half, coding again!
@Malachi Good luck!
0
Q: JavaScript sidebar menu with subitems from a Json Object

GabkeI did post this question in stackoverflow, and someone suggested me to post it here, I hope some one can help me, thanks! I'm kind of new to pure javascript and I wanted to try an exercise that I saw around the web. The exercise was to build from a json object (was not included in the exercise s...

0
Q: Update dictionary in constant time in Python

PiiConsider a large list of 4 character strings. For example: ['P0BH', 'LF3J', 'MA1Y', 'STSM', '8Y74', 'JWBD'] I want to add a new string in the following precise manner: If the new string already exists in the given list, delete the old value from the list and prepend the new string to the fron...

@CaptainObvious "This is not a code review, so you can just give me your solution and not read my solution."
then why are they asking on CR lol
@ThomasWard There's this magic link thingy [help/on-topic], it's awesome in comments.
@Mast Please ignore that — Pii 15 secs ago
Ok, I'm going to walk away and pretend this didn't happen.
15:46
Curious. Why does it matter? Is this intellectual curiosity, or a situation you've experienced? If another class constructs the object, all it has access to is the static method. An editor, or static analysis, or code review should provide warning of this situation. And like others, I'm not aware of a way to achieve what you want, so I'm no help there. — Mikezx6r just now
15:58
Monking
watches the alarm panels go off as @skiwi trips the infrared beam detectors
@skiwi NOW look what you did
slowly backs out
doors slam shut and lock
you tripped the lockdown! >.<
now we have to wait for an hour
I think this question is better suited for Code ReviewXiaoy312 15 secs ago
If you want a code review, please try codereview.stackexchange.com. This site is for fixing bugs, but you state your code is working. — ADyson 53 secs ago
I'm voting to close this question as off-topic because it would be better asked on codereview.stackexchange.comADyson 22 secs ago
16:15
so I have a problem
I am trying to do a code challenge to get warmed up
super easy one too. but for some reason when I type in a number, it is getting a different number. like if I type 23, it is giving 50. if I type in 56, it thinks I typed 53.
I thought it was something on my machine, but when I ran the code on the challenge site, the same thing happens
@Malachi 50 is the char code for 2, 53 is the char code for 5...
Try int.Parse(Console.ReadLine())
I used most of the code they gave me....OMGOSH
when you said that, it dawned on me that it is a straight read and not a parse
I couldn't use string interpolation either. didn't like the $. no money for that site
It's not the nicest of things to debug, :)
no where to complain either
for all I know they did it on purpose...lol
16:38
0
Q: file to bytes representation

sherifI need to get text hash (sha 256), so i need to convert file to it's type representation public byte[] bEad(String FILENAME) { RandomAccessFile f=null; try { f=new RandomAccessFile(FILENAME, "r"); } catch (FileNotFoundException e) { e.printStackTrace(); } byt...

0
Q: SQL Temporary Table Query Re-Write

MoonKnightI have the following query SELECT [u].[ActivityRecordID], [u].[ActCstID], [u].[ResCstID], SUM([u].[VolAmt]) AS VolAmt, [u].[ActCnt], SUM([u].[TotOCst]) AS TotOCst, SUM([u].[TotFCst]) AS TotCst INTO [__EpisodeCostCtp] FROM ( SELECT [...

thank you @MAst
Tetris in the Game of Life!?!??!????!?!? Wow!
17:04
@CommitStrip Don't test on production, morons.
Jess Pardue on September 25, 2017

Thanks for tuning in for Stack Overflow podcast # 116 recorded Thursday, September 21. We usually record at our Stack Overflow HQ in NYC, but today, in true remote-first fashion, we are being recorded from Florida, Utah, Washington, and NYC.

This episode is brought to you by Oracle. Stack Overflow greatly appreciates Oracle’s support for this podcast and for our community. Learn more about everything that Oracle does for open source, java, and developers like you at oracle.com/developers.

Today is full of firsts: …

@Mast even if you have a snapshotted test database, it's still not guaranteed to have the same behaviour as the prod database...
and if you test on the snapshotted database that still doesn't guarantee flawless execution in prod...
the point is: don't give a dev access to prod DB if you have a sysadmin that's more qualified to do carp like that
@Vogel612 No, but it prevents a heck of a lot of crap.
true that
@Vogel612 Definitely. Leave it to the expert.
17:15
Possibly a question more suited to the code review site. — Wolfie 36 secs ago
Questions about code that works and you'd like to see improved are better asked at codereview.stackexchange.com/help . Note that I have linked the help page and not the main landing page. This is deliberate. Probably more than any other site on the Stack Exchange, you will benefit from reading the Ask section before asking. — user4581301 59 secs ago
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.com. — Andy 42 secs ago
17:57
hi welcome to Stackoverflow, but m afraid to tell you that your post is not a question its code review which you should ask on codereview.stackexchange.com thanks — maq 27 secs ago
18:08
@maq No, this is hugely off-topic for Code Review. Please refer to their help center. — Mast 23 secs ago
0
Q: JavaScript/Jquery BlackJack

Mitchell_A.F.I am building a BlackJack howto site using Jquery/JavaScript and am looking for any and all advice for how to optimize my js file containing the game. It does run and run properly about 80% of the time with the exception of being unable to switch the value of Aces between 1 and 10 as I am unsure...

18:28
0
Q: DRY workshop. How to refactor my code for extracting value of salary from from text

W WThis was the old version: https://github.com/wojciechoblak/Workshop/tree/master/DRY/src/before and this is the new version: https://github.com/wojciechoblak/Workshop/tree/master/DRY/src/after Start with TestSalary the unit test. Any suggestions? What my code does? SalaryAlg0 is the mother clas...

18:44
0
Q: Basic CMake C++ project structure

NykakinI started working on a C++ project using Google Test framework for unit testing and header-only CImg library for internal operations. I want to use CMake build system to compile it. $ tree . ├── build ├── cmake │   └── includes.cmake ├── CMakeLists.txt ├── include │   └── soccl │   └── soccl...

18:59
0
Q: HashMap implementation in Java

Sandeep KumarCan someone review the code here for hashmap implementation in java. package Arrays; import java.util.NoSuchElementException; import java.util.Scanner; class MapNode<K, V> { private K key; private V value; private MapNode<K,V> next; public MapNode(K key, V value) { thi...

0
Q: Generic selection sort in C

Misho TekI've implemented generic selection sort in C, this is my code: void gSelectionSort(void * list, size_t listSize, size_t elemSize, int (*cmp)(const void * p1, const void * p2)){ for (int i = 0; i < elemSize; i++){ void * ...

19:45
0
Q: Web Crawler & Scrapper GoLang: Need help to understand the problem in the code

yogesh_desaieveryone, I am trying to implement web crawler and scrapper in GoLang to learn more. Please check my code here. The code works as expected, 1. Given URL it fetches the links. 2. Scrapes the required data and writes it into a CSV file. Problems: 1. It consumes too much memory, which increases as...

0
Q: Best practice to load settings to the web application

Misho TekI have to load settings to an app when it's opened (It's an Electron application and I'm loading settings from the local json file) I'm loading settings right after the page is loaded: if (document.readyState === 'complete'){ loadSettings(); } but I think this is not the right way to do ...

0
Q: Enum synced with Database

Austin_AndersonOur database has several tables that have a value that can be one of 4 things, so we made these columns instead have an id column with a foreign key to an enum table with an id and a value column to hold those 4 values. When interfacing this through an ORM, I came up with the following enum class...

The first part of your question is better suited for code review - here we deal with specific problems questions about code. — kabanus 47 secs ago
20:31
1
Q: Greatest difference between numbers in list

DouglasI found this problem today and eventually came up with a solution. I'm interested in knowing other ways to solve it. You have a list of unsorted integers, and have to compute the greatest difference between list[j] - list[i] such that i < j. Here's my code: #include <stdio.h> // remember the m...

0
Q: extracting data from meshgrid output (speeding it up)

nman84I am trying to extract data from meshgrid output where zCs is 1000 x 1000 matrix of z values which is produced from meshgrid of s using bin2mat. s is a struct which has x, y, z data. res is 1000. Based on threshold i am trying to extract logical which is then used to extract data from s whose z ...

Also, when you have code that works as intended, but looks like crap or runs like a snail, you can present it to reviewers on Code Review - with a title that describes the purpose of the code. — Mat's Mug 9 secs ago
20:48
wow thanks, didnt know about code review. — excelguy 10 secs ago
21:02
0
Q: VBA, filters, vlookups, compiles into specific format, runs slow

excelguyThis is a basic vba code i created in order to simulate a process done with the data in excel.Obviously it looks like crap and runs slow, as I just used the macro recorder. I would like it to run faster, and be one code completely. It is currently slow as it has formulas, broken down into 3 mac...

21:30
I'm voting to close this question as off-topic because the code is working. Questions about how to improve code belong on the Code Review Stack Exchange, — AJNeufeld 56 secs ago
possible answer invalidation by Douglas on question by Douglas: codereview.stackexchange.com/posts/176517/revisions
21:45
possible answer invalidation by Douglas on question by Douglas: codereview.stackexchange.com/posts/176517/revisions
I'm voting to close this question as off-topic because this is about code design, not a bug, and belongs on the Code Review Stack Exchange. — AJNeufeld 12 secs ago
22:35
0
Q: Standard cross-validation in R

enthdegreeWe would like to perform n-fold non-stratified cross-validation on a model, say an lm or glm. We have a list of quality metrics we would like to evaluate, which we wrap in a function: fn_rmse <- function(v_pred,v_true) sqrt(mean((v_true-v_pred)^2)) fn_mae <- function(v_pred,v_true) mean(abs(v_...

23:09
0
Q: Best way to map results from many to many relationship

Super Mario's YoshiI have 3 tables like this: CREATE TABLE IF NOT EXISTS blog_post ( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, title varchar(100) NOT NULL, image varchar(250), content TEXT NOT NULL, created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, edited DATETIME ON UPDATE CURRENT_TIMESTAMP )...

@AJNeufeld Please don't use Code Review as an excuse to close questions on Stack Overflow. Stick to the approved procedure, even if it is counterintuitive. The problem, in this case, is that the code here is too sketchy and incomplete to make an acceptable Code Review question. — 200_success 32 secs ago
23:48
0
Q: JS Function warning before closing browser

David BriertonI have a function that makes sure the user wants to actually leave the page. I am not a jquery expert. Is this the most efficient way to do this function? Or can it be simplified much more to run smoother? Any advice is greatly appreciated. $(document).ready(function() { formmodified=0; $(...

0
Q: this nest multiple switch statements and updated nested groups what is a better way

Darrell JohnsonI have a bunch of groups that contain a nested group. example: group "DElA 12th Grade" < currently contains group "Helena Class of 2018" group "DELA 11th Grade" < currently contains group "Helena Class of 2019" This is the case for many locations with nested groups k -12 each year on after 7-1 I...

0
Q: Optimising a Python program

Gameskiller01I'm currently in the early stages of a Python project, and the program (so far) asks the user what test they would like to take and what difficulty they would like it to be, and I'd like to know if there're any optimisations that I could make. class NotWork(Exception): pass class DoWork(Exceptio...

This question might be better asked on Code reviewG5W 28 secs ago

« first day (1605 days earlier)      last day (2710 days later) »