« first day (2006 days earlier)      last day (2309 days later) » 

00:00
RELOAD! There are 5779 unanswered questions (89.7131% answered)
00:14
0
Q: Rolling sum of all values associated with the ids from two columns

Chipmunkafydf: id1 id2 value1 value2 ----------------------------------- a b 10 5 c a 5 10 b c 0 0 c d 2 1 d a 10 20 a c ...

00:43
0
Q: find the fisrt non recurring character in string

A.LeeI wrote a solution to first-unique-character-in-a-string: Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. If there is better way for me to build the dictionary seems? and find the first key when value is 1 and index is lowe...

 
2 hours later…
02:36
@neilfws thanks. yes, the dataset is a few MBs only.thanks for the code review comment. — svk 54 secs ago
02:57
0
Q: Wrote a floodfill visualizer in React

Luke XuFirst time using React. Here is a demo: https://ostralyan.github.io/flood-fill/ Game Component import React from 'react'; import Board from './Board'; import Options from './Options'; export default class Game extends React.Component { constructor(props) { super(props); this.state ...

Not sure what event is, and the 2 and 1 seem a bit like magic numbers. Regardless, SO generally isn't the place for possibly opinion-based code review — CertainPerformance 19 secs ago
03:27
0
Q: Finding the nth term in a Fibonacci sequence using for loops

user183488For an assignment, I need to specifically use for loops to find the nth term in a Fibonacci sequence. I tried to make it so that the main method tells method generateFibonnaci the nth term to find and assign it as the limit of the second for loop, which will find the nth term recursively up until...

 
2 hours later…
05:08
Monking
0
Q: This code is written to print the pattern /\

Nisan AbeywickramaThis the code i wrote k = 20 p = 20 for i in range(10): for j in range(k): print(end = ' ') k = k - 1 print("#",end = '') for t in range(p): print(end = ' ') p = p + 1 print("#") The output looked like this # # ...

05:35
There's a lot of room for improvement in this code. Perhaps you could post it on codereview.stackexchange — Kerndog73 54 secs ago
Agree. Knock out a few more bugs with debugging (use the debugger!) and this is a good candidate for Code Review. — user4581301 5 secs ago
05:51
Does it work, to the best of your knowledge? Then please ask at codereview.stackexchange.com. Otherwise, please ask a specific question other than "what do you think". — deceze ♦ 17 secs ago
@user4581301 I said “quick-and-dirty” for that reason. I wanted to leave all the other problems for a code review — Kerndog73 43 secs ago
 
1 hour later…
06:58
0
Q: Delegates in C#

ChintuYadavSaraI am new to C# and going through Delegates and I am having trouble understanding Why are Delegates declared as an abstract class?

07:40
Actually, I don't think your question is suited to stackoverflow. You are basically looking for review of your code, in which case codereview.stackexchange.com might be a better place to post it. I also notice that you are calling several functions which are not included in your post. If it is possible to make a proper MWE (minimal working example), then your question might be suitable. — DNF 45 secs ago
0
Q: selecting item stock count with respect to different shop

irsha____DI have a view to select the item stock count with respect to different shops. The view was created sometimes ago by another developer. CREATE VIEW [dbo].[vwInquiryShopStock] AS SELECT ShopId, ItemId, convert(numeric(18,3), ...

I don't think you have a bad implementation, other than what has been said in comments. It can be a valid choice to keep subroutines nested. Note that there is also codereview.SE for getting comments on code style in a particular language. The answers below, just giving some valid implementations, are less valuable than the comments on the question in my opinion. — Maxim just now
 
1 hour later…
08:57
0
Q: Better way to create multiple files for testing?

BigAl1992I have a function that simply counts the number of files in a directory. To test this function I am using temporary files which are great in the respect that they are deleted upon creating. However, when I want to test my function to count multiple file it can become quite tedious. The below code...

09:12
0
Q: organize the code in oop style

ApperThere is a task to obtain data about a person and calculate days before a birthday using classes and constructors using a get, a set. class Persona { constructor(first, last, day, month, year) { this.name = { first, last }; this.Birthday = { day, month, ...

09:27
0
Q: Removing code duplications

Ira ReI'm struggling with the elimination of code duplications in the following method: public String createElasticQuery(SearchRequest searchRequest, String query) { DocumentContext documentContext = JsonPath.parse(query); searchRequest.getFilters(FilterState.INCLUDED).stream() .ma...

09:57
0
Q: How to refactor member functions to reduce the size of C++ Code which has unmodifyable function names?

Ganesh Kamath - 'Code Frenzy'I have a class in c++ which has functions defined in the following format: vector<CFirst> getFirstInstance(IClient* client, int ins_num) { CFirst::iterator iter = CFirst::enumFirst(client); return getInstance<CFirst>(iter, ins_num); } vector<CSecond> getSecondInstance(IClient* clien...

@CaptainObvious Lacking context.
@CaptainObvious If you don't know whether it works and you don't know what you're doing, you're not ready for a review.
> help please correctly write everything down
Not how it works.
0
Q: Python Selenium webscraper incredibly slow

LunalightI'm a newbie getting into web scrapers. I've made something that works, but it takes hours and hours to get everything I need. I read something about using parallel processes to process the URLs but I have no clue how to go about it and incorporate it in what I already have. Help is much apprecia...

0
Q: Generic Dictionary Equality Comparer

JohnLBevanI created the below comparer to allow me to use a generic dictionary as a key to another generic dictionary. My GetHashCode implementation creates a hash based on all keys and their values; but I suspect its distribution could be improved? Also my Equals method returns true only if the two argu...

10:56
1
Q: Binary Space Partitioning algorithm for creating an RPG Dungeon map

LudisposedIntro I am building a rogue like RPG, currently it is still a work in progress, but I would like to get an intermediate review of my Procedural map generation code. I've chosen to use the Binary Space Partitioning algo, because it would make my life easier in the future when I will add corridor...

0
Q: Is there is any way either in Obj c or swift, to alter the background so nicely that one could feel the person must be in the image

kanuI just want to know is it possible..to alter the background image so nicely that one could feel the person must be in the picture..if yes then please let me know any tutorial regarding this..or any kind of help. both obj c or swift language code will be helpfull..thanks in advance

11:11
0
Q: Angle is off in dynamic Torus Mesh Generation

derHugoI have a code for dynamically generating a Torus Segment depending on an angle (which I basically took from ProceduralPrimitives and made some changes to use the input angle instead of creating a complete torus): public class DynamicTorusSegment : MonoBehaviour { [Range(0, 360)] public float...

11:41
0
Q: How can i implement async to load in background in my method?

adamprivate void lvPodLista_SelectedIndexChanged(object sender, EventArgs e) { try { cbAvsnitt.Items.Clear(); rssData = getRssData(lvPodLista.SelectedItems[0].SubItems[3].Text); for (int i = 0; i < rssData.GetLength(0); i++) { if ...

11:56
0
Q: Exception while program take to much time to run

user183525Managed Debugging Assistant 'ContextSwitchDeadlock' : 'The CLR has been unable to transition from COM context 0x10597d8 to COM context 0x1059720 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running ...

This belongs on codereview.stackexchange.com, not here — ggdx 20 secs ago
12:12
You'll have better chances on Code Review... — Peter Schneider 7 secs ago
12:24
If you want to improve working code you'd better post your question on CodeReviewAndersson 41 secs ago
12:40
@CaptainObvious Closed.
12:53
What is a COLLECTION? I have not heard of one of them before, also thank you peter on the suggestion, i have posted at code review now also. — Karl Hardy 38 secs ago
0
Q: Powershell Newcomer, Help to tidy up this code

Karl Hardyi am pretty new to powershell and im not great at coding, but i have managed to cobble together code from around the net to help save time when removing old students accounts in AD. Code currently does the following; Takes leavers from .csv file moves the leavers to leavers OU, Disables Accoun...

Assuming this all works out, the image in this tweet is also a valid ZIP archive, containing a multipart RAR archive, containing the complete works of Shakespeare. This technique also survives twitter's thumbnailer :P
I'm just gonna leave that there.
13:16
I believe this question belong to CodeReview rather than StackOverflow, please, head there and post your question there so you get a better response, there are some issues in this code that can be addressed with a review. — Oscar Guillamon 51 secs ago
@202_accepted Is that going to be the new work-around to get more than 140 characters in a tweet?
@Mast 280 but yeah
@202_accepted Haven't used it in ages.
@Mast The point is we can now start attaching ZIP files to Tweets...lol
13:40
-1
Q: Arduino and Oscilloscope

John AllenI am a HS student looking into programming when I graduate. I have this practice problem that I can not figure out and was hoping someone could give me a hand with. The instruction are below. I know how to create tasks and timers, but I'm getting a bit confused as I wasn't exposed to much program...

0
Q: Geting data between two specific dates in golang?

ShinChainI have an api which call a function and that function first will check that in the url if there is a query string value then it will take it and check the if conditions if the month and year both of them having any value then if condition will works either else will works. In if conditions I conv...

Greetings, Programs.
What's up Don
Writing the code. Creating a Docker stack for our push towards a CI/CD development approach.
This question is badly suited to StackOverflow, as it is to a large extent based on opinion (see 'pythonic'.) I'd recommend posting this instead on: codereview.stackexchange.comAJFarmar 14 secs ago
This is a better fit for code review. Inefficiencies you can see right away are the continued slicing and tail recursion. — timgeb 58 secs ago
13:58
@Donald.McLean Nifty. We're (were) doing something similar.
@202_accepted Somebody is going to abuse that.
Twitter will find a way to filter it at some point.
@202_accepted they should be stripping exif metadata anyways...
Why? Twitter makes a living off that data.
They use it to do all the "location" features and such.
They'll never do that across-the-board.
Can't sell it in that case.
14:10
0
Q: Python Implementation of Quicksort Using List Comprehensions

Bret FontecchioI wrote an implementation of quicksort that I think is pythonic. I based it off of a common Haskell implementation. Here is the Haskell: quicksort :: (Ord a) => [a] -> [a] quicksort [] = [] quicksort (x:xs) = let smallerSorted = quicksort [a | a <- xs, a <= x] biggerSorted =...

0
Q: select a day from a period - reccurrence

Teodora MalecI am trying to implement a recurrence pattern for my Calendar Application. I want it to work the same way Outlook does when you set an appointment with reccurrence. public async Task<ValidationResponse<ReccurrenceModel>> ApplyReccurrencePeriod (string userName, ReccurrenceModel value) ...

ya... true
upload to SE's imgur and then upload to twitter :D
@Vogel612 Imgur didn't strip it either...lol
imgur themselves, maybe. but the SE upload does
@David3141593 Works with @imgur, too: https://imgur.com/Y6qDWPC
Ah, maybe the SE one might be custom, but standard Imgur works fine...lol
This stuff survives scaling and compression very easily, apparently.
they have their own imgur host and strip the metadata before even handing it to imgur IIUC
14:14
Yeah, I remember something about that.
@202_accepted yea, zip is a pretty resilient format
If they strip the EXIF data it's probably not going to allow it.
14:25
0
Q: Image Manipulation with PIL/Pillow - Picture effect/filter

T. CavI was curious about image manipulation and I was wondering how it was working, so I made some little functions wich are modifying the pictures passed in parameter. The graphics results are not too bad, and the execution time is quite correct (even if i thinks it can clearly be improved). So (beca...

14:41
@Vogel612 Smart.
Throw away everything you don't need, so it doesn't cost you anything either.
I do the same thing with a certain XML document we get from vendors. They always include 2-3 PDF's in it, so I strip the PDF's then database the XML...lol
15:10
0
Q: Refactoring null check before adding to Func collection with different predicates

JoeltyI'd want to refactor that if ladder but I'm not sure how to do that or whether it is even possible public async List<ComplexObject> Generate(DateTime? data1, DateTime? data2, string FirstName, string SecondName) { var ListOfPredicates = new List<Func<ComplexObject, bool>>(); if (data1.H...

This seems like it belongs on Code Review. — itsme86 6 secs ago
15:25
0
Q: Multiple games with same rpg-classes base

Maxime RecuerdaPlease, if you find a better title, tell me because I really didn't know what to put in here! I like to guess how I could implement a game, and to be sure that my perception is working, I plan to develop small games. For instance, I plan to build a FFTA-like game, a FTL-like game, a tower-defens...

15:41
am I missing something on this post? I see comments and answers mentioning but it is code and the OP doesn't mention python at all...
ఠ_ఠ
@SᴀᴍOnᴇᴌᴀ It may be because Python is pretty much just 'psudocode'
@Peilonrayz ah... okay
I presume you meant to type pseudocode...
Darn it, I'm still spelling it wrong... :(
@Peilonrayz Meh. Flagged it as obsolete. It wasn't being particularly helpful either way.
0
Q: Do-while loop issues with my Lottery code

Coulter HeibergerI created a lottery program that takes 5 ints from the user and compares them to 5 ints from the computer. My code compiles fine, and runs fine. However, the do while loop isn't working. I'm using the do-while loop to prompt if the user would like to play again. I was looking for help on what I d...

-1
Q: update sql and use it in vb6.0

the-userI need to update a table in SQL with variable column name and variable value to that but when I tried it show this error.

0
Q: Code that will FORCE autoplay audio in Chrome 66 using JavaScript 2018

Seth BCan someone tell me how to FORCE autoplay in Chrome 66 using JavaScript? I don't know if it is possible, but if it is I want to know.

0
Q: Prompting Users Using Methods - Advice Needed

Spider-ManFirst, how do I add a method that prompts the User for a maximum number between 1 and 10 and then returns that max number to the method that called it? Also using that max number to call another method to print out those numbers in brackets?? My code is down below can anyone explain what to do? M...

16:00
posted on October 31, 2018 by CommitStrip

@CaptainObvious broken
@HelloWorld help is always appreciated. I am also trying to help you any anyone looking over your solution. Your code has several problems. You use 3 magic numbers. This is a serious problem. This alone will never pass a code review. Second you use C-style cast. Not as big of a problem but still, the fix is simple: use static_cast. Thirdly you use a on-portable formula. — bolov 26 secs ago
I think (I am not sure) that this question should go to codereview stack — B001ᛦ 15 secs ago
@CaptainObvious sigh... code not implemented
@CaptainObvious not working
16:24
-1
Q: Calculating sum , and using it for if,else if statements

indestructible masterHow to calculate sum of numbers (user input numbers) and to print that numbers. BUT same that sum to use for another , if,else statements (to print something another throught that if,else statements)

@CaptainObvious not implemented
0
Q: Upload .JSON product list to MongoDB and upload image to AWS S3

DasBeastoI'm using Node/Express/Mongoose to accept a JSON file containing a list of product details. These products are looped through, the images are uploaded to AWS S3, and the product is either accepted or rejected depending on validation. In the end the accepted are uploaded to Mongo via Mongoose and ...

0
Q: Find the biggest difference in multiple dates using Java

Johnny JancosekIm trying to find the biggest difference between several dates how would that be possible? The answer to this should be 01012001-01012011. I'm trying to find the biggest date gap between two lists how would that be possible? public void Date (){ SimpleDateFormat myFormat = new SimpleDateFormat(...

16:54
0
Q: synchronization bettwen settings and main

indestructible masterI'm going to make an android app. It counts average of user inputted numbers. But i will make settings where user will rename his school subjects (this app,counts your marks average). And he will be able to add or delete subjects (it depends on how many subjects he have). Default mumber of subjec...

Monking
Useless statistic: my amount of vote-to-close has almost surpassed my amount of edits.
17:10
@Mast I'm more than halfway there
I think this question is better suited for stackexchange code review, anyway I'll totally use constants in code instead of magic numbers if this is an application in production that has potential to grow... — T J 56 secs ago
@CaptainObvious Somebody should post that to The Daily WTF.
There is so much wrong with that question. On top of that, he's developing on XP in a language that should be dead.

 VBA Rubberducking

This chat has moved to Discord: discord.gg/MYX9RECenJ
@Mast so tempted to link that in Rubberducking ...
lol
@Vogel612 I understand VBA. VBA is still useful. Why would anyone still use VB 6.0 for stand-alone programs though?
backwards compat
XP is unfortunately very much alive
17:18
It's backwards allright.
medtech and all that largely runs on custom XP builds
If it doesn't connect to the internet, sure, run your systems on 70's electronics for all I care.
But this escaped.
I think a lot of legacy systems are too fragile to risk upgrading from XP yet, things like government, hospitals, etc.
(monking)
0
Q: How Do I Return A Method

Spider-Man1) Add a method that prompts the User for a maximum number between 1 and 10 (inclusive) and then returns that max number to the method that called it. 2) Then use that max number to call another method to print out those numbers in brackets */ import java.util.Scanner; public class MethodBrack...

@Phrancis That was a somewhat valid excuse in 2015. It's 2018 now.
Bills get passed faster than that.
17:50
Monking
Should that be Spooking?
possibly for today, yea..
@Mast The dangers of "If it's not broken, don't fix it" procrastination
18:17
@CaptainObvious Spider-Man is getting angry!!
Does anybody of you use Safari on macOS? I cannot upload images anymore after the
21
Q: Editor improvements for images and links

Joe FriendWe are launching some editor improvements today. These improvements are required as a part of our responsive design efforts, but we think they are generally useful in any case. So we are making them available on all sites. So, what's being improved? Adding a link and image in your post is no lo...

Might be related to the answer by "TheLethalCoder"
@Vogel612 Indeed - likely the second of the two answers by theLethalCoder i.e. the support issue
@Vogel612 I don't think so, that is about uploading an image via link.
seems like a bug then
18:58
It has been reported now: meta.stackexchange.com/q/317596/196432.
@MartinR I can take a look tonight for you.
Do you have an example of where you are trying to upload an image? Chat? Question? Answer?
19:13
@202_accepted I tried to add an image to math.stackexchange.com/a/2979342/42969. Apparently I am not the only one with this problem: meta.stackexchange.com/q/317596/196432.
@MartinR Odd. I'll see if I have the same trouble tonight.
didnt downvote and I dont agree with the close vote, though your question is rather broad as it basically asks for a review rather than a specific problem in your code. You can try it on codereview.stackexchange.comuser463035818 24 secs ago
-1
Q: Different functions for different form fields in ReactJS

Yash KarankeBasically, I'm trying to handle different fields in form i.e. input field and select tag. I wrote two different methods for that and I think that is too much of a code. For <input> tag handleChange = e => { this.setState({ [e.target.name]: e.target.value }); }; For <select> tag han...

@user463035818 Thank you! I have opened the same post on codereview.SE (see here) and I will be closing this one. — Remi.b 12 secs ago
@202_accepted Thanks. – Interestingly, the behavior is different on different sites (perhaps caching?), but the drag&drop does not work on any site for me. I'll try it again tomorrow, perhaps the issue is fixed until then.
19:38
0
Q: How to remove by indices several elements from a vector?

Remi.bFrom a sorted vector of indices (toRemove), I would like to remove from another vector (v) the elements at these indices. An easy way to do it would be to start with the last element of toRemove and remove them sequentially. However, that would require copying elements at the end of the vector s...

20:23
0
Q: Cast a null to unknown then to HTMLElement in TypeScript 3 - JavaScript Objects

Jose APlease, correct me with anything that I say in here (The actual question is below the code). I've been quickly prototyping a project (ASP.NET Core 2.1) and haven't found the need to structure it with Webpack/Parcel/Rollup/Browserify as it's done with simple JavaScript validations per views (I do...

Fresh profile...hmmm...
20:38
-2
Q: Go code doesnt work as intended

Ricky Sterlingpackage main import ( "fmt" "strings" ) func main() { var n int fmt.Scan(&n) var i int for i = 0; i < n; i++ { var s string fmt.Scan(&s) se := strings.Fields(s) fmt.Println(se) } } In the above when i run for n=2 and s="f kjff" i get [f] [kjff] on different lines and progra...

hmm
@CaptainObvious interesting choice of wording...
20:49
I'm curious where this question should be directed to, without code and primarily opinion based it is off topic here in Stack Overflow and in Code Review, OTOH Software Engineering has just 10 questions tagged powershell. — LotPings 42 secs ago
If you have working code that you want a review of, then codereview.stackexchange.com is the place to post. — Some programmer dude 33 secs ago
21:08
0
Q: Adding date to json objects

ZBodI am working with JSON files like this: [ { "code":"??_???", "loads":62, "trucks":1, "ratio":"62.00000" }, { "code":"AB_CAL", "loads":138, "trucks":4, "ratio":"34.50000" }, { "code":"AL_BIR", "loads":1537, "trucks":54, "ratio":"28.46296" }, ] I want to add a lin...

21:23
0
Q: Instantiating object using a static factory

HoomanI am building an e-commerce website. I have an application layer server called SearchService. SearchService receives a search request from the view in: HomeSearchRequestViewModel (home page search request view model). Then it maps the request to Elasticsearch request entity object and sends the s...

Thanks a lot. Yes ICar is polymorphic, and Car is my ViewModel. I tried to avoid a long post and therefore simplified my code. I updated the question with a link to the actual code hereHooman 1 min ago
bleh...
maven is just so damn slow...
600 megs of private memory and sometimes more than a single CPU fully utilized...
but hey... just calling npm lint is taking that amount of memory, nothing possibly wrong with that
21:53
0
Q: Threads with lambdas and runnable in JAVA

coreyI learn Java and I've started write some tasks. Could you give me feedback for task below? Write a static method andThen that takes as parameters two Runnable instances and returns a Runnable that runs the first, then the second. In the main method, pass two lambda expressions into a call to an...

22:39
Just spent a couple of hours killing a zombie and tracking down a macOS bug:
0
A: Command line todo list manager

200_successYour program expects the user to refer to completed or incomplete tasks by a numeric index. However, the Markdown file contains an unnumbered bulleted list, which forces the user to count the items manually (starting from 0). That design is inhumane. I suggest that you change the Markdown to u...

23:08
0
Q: Is there a better way to parse specific data from a file in Java?

PB020I have a method dataparse which takes an input of two files, each containing data formatted as follows: 12:13:08.078067 IP 172.16.114.148.ftp > 194.27.251.21.1303: Flags [P.] And stores it into a List<String>—in the format of list.get(0) = 172.16.114.148 and list.get(1) = 194.27.251.21—which is a...

@200_success good job - appropriate for today...
@200_success now I feel downright unproductive
even though I didn't dawdle, I'm still not finding and filing bugs in widely used operating systems ...
@CaptainObvious but hey, at least I can near-instantly spot the bug in that question
Want to find a bug in a widely used OS? All you had to do was ping some Apple machines.
welp.
0
Q: Can this If statement clutter be cleaned up?

James WilsonWe have a teams database with a relationship to listings. This API call allows them to filter the listings down into categories represented by each individual if statement. This is the only way I would think of doing it besides a switch statement. There really is nothing wrong with this, it ju...

23:29
TTQW and TTGH
@CaptainObvious I'm no C# expert, but my instinct tells me that if (!isPublished == null) makes no sense?
I also suggest posting your program to Code Review once you have it working. There are numerous aspects that are non-idiomatic. — Shepmaster 30 secs ago
you are absolutely correct. unary operators should have higher precedence than binary operators
so the compiler should've flagged that as always false.
23:59
I think if(isPublished != null) was meant

« first day (2006 days earlier)      last day (2309 days later) »