« first day (2137 days earlier)      last day (1895 days later) » 

12:00 AM
RELOAD! There are 5857 unanswered questions (89.9514% answered)
Probably one for [code review](codereview.stackexchange.com) — James 15 secs ago
 
12:33 AM
0
Q: Can I dynamically generate unit tests

Batmankind of new to .NET and I'm trying to figure out if there's a better way for me to create my tests. I'm writing an API that returns an object and I need to test that the return values match the expected results. Looks like this essentially: Test files using partial to spread each input/result...

 
12:59 AM
If the code works but could just be improved, it should be on Code Review. This site is primarily for fixing broken code. — Carcigenicate 11 secs ago
 
1:11 AM
0
Q: Python checking end of file before last iteration

mKalitai have this loop processing a csv i get to the last line and i get an error because it tries to read empty line and kills program how would i check here for that ? while True: if in_file.closed: break lines = line.strip() if len(lines) > 0: print (line ,"line1") ...

0
Q: A Java program which accepts grades and prints grade distribution

Ammir BarakatI'm doing the MOOC Java course, this is the problem: This is a link to the problem in detail if you'd prefer that, CTRL+F "distribution" The input of the program is a set of exam scores of a course. Each score is an integer. When -1 is entered, the program stops asking for further input. ...

 
1:49 AM
0
Q: Creating a count down clock in typescript

ZoinkyJust of the code is, you give it a date, it will start counting down how many days, hours, minutes and seconds left by emitting an event 'countDown' and once 0 is reached 'expired' event is emitted. How can this code be improved? class CountDownValues { days: number; hours: number; ...

 
 
1 hour later…
2:52 AM
ugh... it's 4 AM again ... I should really fix my sleep cycle
 
@Vogel612 Have kids. I woke up at 6:30 to getting peed on. It makes sleeping in vanish.
 
The sleeping in is just the symptom
 
yes. I have had bouts of insomnia.
 
That does sound rather unpleasant, too. And I'd first need to find a suitable and willing partner to raise said kids...
 
But being forced up early and forced to stay awake all day tends to counter it a bit
@Vogel612 it is, and minor triviality
 
3:03 AM
That didn't make much sense through my brainfog. High time to sleep. Night!
 
gnight
 
 
1 hour later…
4:10 AM
@Vogel612 I've been trying to do that for so long, I just gave up on it.
Monking all
 
 
2 hours later…
5:51 AM
Monking
 
6:30 AM
possible answer invalidation by 200_success on question by Victoria: codereview.stackexchange.com/posts/215104/revisions
 
0
Q: Database connection with PHP classes (mysqli)

moodyI am trying to improve my db connection via php classes. I've found few nice solution here on this site and implemented them to my Code. I use PHP as Backend and trying to implement a clean code for every action as a logged in Admin. But first, i would like to login. Why is it not working and wou...

 
7:05 AM
Monking
 
I'm not really sure how you reason GetImageFilenameFromArray(myArray,1) is clearer that just writing myArray[1] but I did want to point out that StackOverflow isn't for peer review of working code, it's for help with broken code. This question probably belongs on codereview.stackexhange.com — Caius Jard 8 secs ago
I'm voting to close this question as off-topic because I believe it is a better fit for codereview.stackexchange.com (but that site isn't presented in the offtopic/migration option list [on a mobile]) — Caius Jard 43 secs ago
 
0
Q: A JavaFX for generating beeping sound on Windows via JNI

coderoddeThis is my practice program: a simple dialog box using which a user may specify a frequency of a sinus audio signal, and play it via pressing a button. It contains a GUI: App.java package net.coderodde.fun; import javafx.application.Application; import javafx.event.EventHandler; import javafx....

 
@CaiusJard as this code isn't complete (it's only "a representation of [..] code"), it's off-topic on CR. Please see codereview.meta.stackexchange.com/questions/5777/…. — Zeta 43 secs ago
@CaiusJard Code Review only accepts complete and working code, not ... nonsense or palceholders. — Zeta 5 secs ago
 
7:45 AM
@skratchi.at I totally disagree with your comment. Maybe in this simple case it is not needed, but with just little bit more complex conditions it is necessary for other programmers to understand code. Remember that when you work in company someone will read your code. Also imagine process of code review, no one will allow some long and complex if conditions to just lay around. — wdudzik 16 secs ago
i work in such a company^^ countless code reviews later, i consider comments to explain my condition, if the condition does not explain itself. as short as your function name, would be a short comment and so nobody has to lookup your function, what it really does. — skratchi.at 11 secs ago
 
8:33 AM
0
Q: Sharing File (Content) without saving it before

Lebron11So I have a listview of PrivateFile objects which contains the fileId (int), fileName (String) and the fileContent (byte []). In order to share the file, I currently save the file first and than I open it again and than I share it. In my opinion this is really semi profesional. Is there a way whe...

 
8:52 AM
1
Q: Find a best fuzzy match for a string

barciewiczI am trying to find a best match for a name within a list of names. I came up with the below code, which works, but I feel that the creation of the intermediate ratios list is not the best solution performance-wise. Could it be somehow replaced? Would reduce be a good fit here (I have tried it,...

 
9:18 AM
I'm voting to close this question as off-topic because this type of question belongs on CodeReview rather than SO — RiggsFolly 40 secs ago
So where should i post it ? where is codereview? — Mohamed Adel 22 secs ago
 
@Duga grmbl
 
BEFORE you post there, make sure you've read the How to get the best value out of Code Review - Asking Questions. This question needs some work before it's an acceptable question at Code Review. — Mast 50 secs ago
 
0
Q: My code get data from database using AJAX and return to view

user194899My code get data from database using AJAX the problem is i want to filter data by month year and quarter and the code that does that is ->where(\DB::raw('MONTH(created_at)'), Carbon::today()->month); but i can't put it in a variable for example and call it so i did this it works but l...

 
10:03 AM
Should the question for this answer be closed? codereview.stackexchange.com/a/215165/47826 Seems that the question is not thread-safe ?
 
0
Q: throwing new exception in tryparse in C#

BenI want to throw each exception while doing tryparse and then show it later. I have this kind of code. try { if (!int.TryParse(string o, out var num)) { throw new ArgumentException ("Cannot parse to integer"); } if (!double.TryParse(string m, out var somedoub)) { throw new Argu...

0
Q: Reverse string, can I make it faster?

MidosThis code will take as output any string (long, empty, with spaces...) and will return it's reverse, can I improve this algorithm so that it can be faster ? Right now it's complexity is O(n) def reverse(stri): output = '' length = len(stri) while length > 0: output += stri[...

0
Q: List elements digit difference sort

Ibrahim RahimiI am doing a code challenge of codesignal.com which ask for following things: Given an array of integers, sort its elements by the difference of their largest and smallest digits. In the case of a tie, that with the larger index in the array should come first. Example For a = [152, 23, 7, 887, ...

 
10:31 AM
@422_unprocessable_entity Code doesn't have to be working 100%. It just has to work 100% to the authors knowledge. (The only exception is if you say run the code and it errors on standard input)
 
10:53 AM
Since you want to improve working code, isn't this a question best asked at code review? — jeff6times7 8 secs ago
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.comluk2302 10 secs ago
 
Monking
 
11:23 AM
Ah .. uppercase attribute names. Ok, that was not obvious from reading the docs. Good you found that! Code reviews are better suited over at CodeReview and I'm not really familiar with wx. Your code looks quite OK, honestly. It's a bit strange to see old-style calls to parent class initializers, but the wx docs do that all over the place, so it might be related to that package ... — shmee 13 secs ago
 
0
Q: Android Java Unit Testing model class

Seto ElkahfiI'm trying to get familiar with unit testing. I never implement TDD previously, but I believe it's the best way to write software. So, here I'm trying to test my isLastTwoDates(position) method of my model class: @Test public void isLastTwoDatesReturnsTrue() { case1.generateReport(); a...

 
I will take a look on CodeReview! Many thanks. Also i will Change frame = MyForm().Show(). Have a nice day. — mk1337 38 secs ago
 
12:04 PM
0
Q: Class construction: Data loader

FChmI'm writing some code which loads a dataset and then performs some transformations on this (relatively large, ~5 GB) dataset. I need different sub-sets of this data for use with analysis code I have wrote in a Jupyter notebook. I'm approaching the problem as follows, but have been learning abou...

 
12:35 PM
possible answer invalidation by Toby Speight on question by Toby Speight: codereview.stackexchange.com/posts/208248/revisions
 
0
Q: Simple Data Entry Application in WPF xaml UI

ViniI made a simple data entry application in WPF MVVM and was just hoping for some input as I am pretty new to WPF . I have done the same application using winforms. Now I have recreated the same application using WPF. I have understood how to write wpf based application, how to use command and oth...

 
1:02 PM
0
Q: Dependent multi-select display corresponding data from JSON array in JQuery

Mithun UchilI'm building a comparison table basis the selection from a multiple-select. The multiple-select is itself dependent on a previous selection. The data array resides within the JQuery. While the comparison table and the dependent multiple-select are working fine independently, when I combine the bo...

0
Q: C# randomly pick key from dictionary weighted by the keys value

John BrownHey guys I was trying to write a function that would get a random card from a dictionary of cards in a players deck weighted by the number of cards of each type you have. I don't know if the solution I came up with is the fates way of doing something like this and this is something I'm going to b...

 
1:17 PM
It looks like this question is not coming across well without more context. I think I'll try again with significantly more code on codereview.stackexchange.com. Thank you for the feedback! — Michael Rauh 50 secs ago
 
0
Q: jQuery swap DOM elements

Mohit AroraI ran across a code snippet which is swapping the two HTML elements in a DOM. For some reason I cannot see how is this code working: Fiddle The statement elem.before(this) in this code looks the same to me as compared to $(document.createTextNode('')).insertBefore(this).before(elem.before(this)...

 
reminds me of old times to read all the posts that Captain puts here and do stuff with them ...
 
1:41 PM
0
Q: CSS Browser Support Validator using 'mdn/browser-compat-data'

Vera PerroneThis is a simple tool that parses CSS and checks every property for browser support based on a browserscope. The thing is, there is a huge amount of data, we are talking about CSS files with more than 20.000 lines of code. The parser I am using is 'csstree' and the object it returns is even bigge...

 
2:10 PM
 
@RMunroe I have no idea what I'm looking at.
I understand the categories, but afar from that...
 
it's about what size qualifiers can go with which words and how they overlap
 
It's English, we'll stick anything to anything.
I think I'm simply missing too many of the references.
At least I learn things now. No idea there was such a thing as great pox, turns out to be an alias for Syphilis.
puts it in the corner of his mind with the rest of the information he'll never, ever use again
3
 
@zeta I don't think what codereviews rules are affect whether this question is a good fit for SO or not, but thanks for the feedback — Caius Jard 47 secs ago
 
Although, honestly, I once won a trivia quiz by being able to cite the maximum warp speed of an Intrepid class starship. So, there's that.
Or was that the question before that...
 
Meta-trivial information?
@DerKommissar Why the f* would anyone want to do that...
 
Exactly...
 
He has no idea what he's talking about, has he?
And the answers aren't much better.
 
Because no one answering knows a friggin thing about cars...
 
Just use a proper jumpstaring device.
Charge it with the solar panels for all I care, but use something built to handle the 100A you'll want to jump your car with.
 
2:26 PM
It sounds like they want to run loads off the car...
So, Solar -> Car -> Load
Like, WTF?
 
It sounds like they want to put 10A though a piece of aluminum can called a sigaret lighter holder.
Which is going to light a whole lot more than just sigarets all of a sudden.
 
Yeah, 10A solar input -> Car -> laptop output
Here's the thing, my laptop uses 1.25A at 120V, so 12.5A at 12V...
You can't run my laptop off of that car outlet
 
Hah, mine uses 6.32A at 19V, so that's about exactly 10A.
But that's excluding transformer losses, and those are somewhat hefty still.
 
I mean, it takes 2A at 100V or so, so there's almost 80W loss. That's about half.
Not good.
 
2:32 PM
Yeah, I haven't measured what mine actually draws at 120V, just going off of the rough calculations.
 
It's rated a bit odd I just realized...
 
0
A: Solar Charging Car Battery through Cigarette Lighter Outlet?

Der KommissarThere's a lot in your question, so let's look at it in parts: My vehicle's cigarette lighter outlet is limited to 10 amps output. If charging were limited to less than 10 amps, would solar panel -> charge controller -> cigarette lighter outlet work for charging a car battery. Technically, y...

 
I just realized he's using the car battery as a buffer for when there's no sun.
The whole point of a laptop is that it's batteries-included.
If you're lacking battery storage, GET A BIGGER BATTERY FOR YOUR LAPTOP!
 
Yes
Just looked at my charging adapter: 19.5V @ 6.7A
This is a 130W one, but that's nifty.
I guess technically the one for my laptop is 240W, so it's probably 12.31A.
And that 130W one takes 2.5A input at 100V, so it's 52% efficient...lmao
That would mean our biggest laptop size could be 62.4W. That's tiny.
 
3:02 PM
Also, I'd like to know what "shorter" means in this context. What in particular was pointed out that might not be "one thing" and that you might want to factor out of this method? This question might be better suited to the SO's sister site Code Review. — markspace 40 secs ago
No, the code is needed, otherwise the question isn't specific enough and is off-topic. Since the code is workable, it may be off-topic any way and a question for codereview.stackexchange.comestus 59 secs ago
 
3:14 PM
@Mast LMAO got a downvote for some reason.
 
0
Q: Simple Go Linux Daemon

Walt ByersI'm currently working on a linux daemon and would like some feedback. The program is a simple unix socket server that sends around gob encoded messages. I'm still getting the hang of concurrency in go and I'm not terribly confidant the socket server is passing around messages properly especially ...

0
Q: I have a class which contains a large dictionary, should it be stored another way?

HoboProberI have a class which contains a large dictionary. The number of keys is actually quite small (~100) but the values are lists of tuples which are quite long. e.g. bonds_dict = {'ace': [(0, 1), (1, 2), ...], 'ala': [(0, 1), (0, 2), ...], ... } The class...

 
3:31 PM
@DerKommissar There's no pleasing some people.
 
0
Q: A Go program which parses the dblp (computer science bibliography) xml and outputs sums of publications grouped by year and type

orestisfThe following Go program parses a gzipped xml file (available here) which contains bibliographic information on computer science publications and has the following indicative structure: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE dblp SYSTEM "dblp.dtd"> <dblp> <article mdate="2017-...

 
3:49 PM
@CaptainObvious reopened.
 
4:01 PM
I'm happy to announce that today's commitstrip will be presented by yours truly was suggested by yours truly
5
 
@SimonForsberg This one?
 
@Mast Yup, that's the one
 
@IanYates82 @davidfowl Hmm: 1. Defined an "ILogger" with: - void Log(LoggerLevel, string) - void Log<T>(LoggerLevel, T) 2. Defined a "BaseLogger" 3. Called each 10k times: - Direct = BaseLogger.Log(...) - Injection = ((ILogger)BaseLogger).Log(...) - Callback = pass .Log(...) 4. Obj = new Guid()
@Hosch250 ^^^ You might be curious about that...
 
posted on March 11, 2019 by CommitStrip

 
All the "program to interfaces" suggestions should actually be "program to function callbacks."
 
4:08 PM
@CommitStrip Look who got properly ninja'd.
 
in Coding Projects and Vue.js Heaven :), Feb 23 at 20:07, by Dair
@SimonForsberg But most importantly you want to use the force :P
^^ the inspiration
 
@DerKommissar That's functional programming though :O
 
@SimonForsberg As Solo said, "It's not my fault"
 
@Hosch250 But in this case, it's more dynamic than the interface programming.
 
That's what I did with my checkers game to support variants. I programmed to function callbacks and chose which one to call based on the variant.
I like it, but O NOES! FUNCTIONAL PROGRAMMING!
I mean, that's how most of the industry sees it.
 
4:12 PM
Functioning code is good code.
 
@Mast But... Job security...
 
Well David Fowler (MSFT) was discussing all the ILogger implementations out there, and how to use AutoFac or something you have a SomePackage.AutoFac, etc. One suggestion was "I wonder if callbacks would be usable", I demonstrated that not only are they more usable than interfaces, they're actually a little faster.
 
I love callbacks when they make sense.
And I actually am becoming to dislike interfaces.
 
That would also eliminate the whole issue: instead of implementing an AutoFacLogger : ILogger, you can just inject a (level, msg) => ... instead.
So now, no need to implement an ILogger for every freaking thing.
And it also lets me work more dynamically. If I want to use a single logger in one place, I just inject the Action<LoggerLevel, string>, instead of creating a whole new class.
 
LOL, WT*...
 
4:15 PM
@Hosch250 I love code that makes sense.
 
So, just got a ticket about a process failing on Mondays and first of the month.
 
@Hosch250 Off-by-one error?
 
It's a report subscription, and we special-case mondays and 1st of month to send weekly/monthly reports.
 
Ah
 
Everything looks innocuous.
But when we try to send the weekly/monthly ones, turns out we are disposing our DB context.
So, it crashes "OBTW, you can't access this anymore".
 
4:17 PM
So, kind of an issue.
 
So we try to log the exception message:
> String.Format("Report Subscription Processor Failed. Error: {1}", e.Message)
Spot the error :)
 
{1} -> {0}.
 
Yes!
 
Definitely.
 
So, it crashes again while trying to create that.
And now we aren't getting the error logged either!
 
4:18 PM
It's always an "off-by-one" error
 
So it was an off-by-one error, but not exactly what I had in mind.
 
@SimonForsberg That was a good one, actually.
 
@DerKommissar Somebody is going to come up with a 2-indexed array just to screw with developers.
 
I should totally do that
 
Make 0 and 1 special positions.
 
4:19 PM
But indexes 0 and 1 will have meaning: [0] == whole array, [1] == length
I was literally typing lmao
 
Or a reference to something that may or may not make sense, like the location of the previous element.
I can see an arcane system doing exactly that, you know. [0] => location previous node, [1] => location next node.
Now I'm wondering whether it doesn't actually exist already.
Worldbuilding has a rule. If you can think of something crazy, Biology has probably already done it already.
With the current ecosystem, I wonder whether software has a similar rule.
Somewhere, somehow, a developer has already done it.
mumble mumble COBOL mumble mumble for shits and giggles mumble mumble
2
 
4:38 PM
@CaiusJard I never said that it's on-topic on SO, only that a migration in its current state is not appropriate :). It's certainly off-topic here and should get closed as primary opinion. One can still point out in the comments that another site might be appropriate if the question is heavily edited. However, as mentioned in the link above, you should point out why it's off-topic here, not why it might be on-topic somewhere else. Re migration list: short fun fact: Code Review will never be on the migration list. — Zeta 26 secs ago
 
@Mast I don't know about software in general, but JS certainly does.
 
There's a npm package for that.
6
However, it will, through some dependency, depend on leftpad.
Or it will be outdated two weeks after you learned every aspect of it.
 
@Zeta If not two weeks before...
 
Right.
 
4:53 PM
0
Q: Efficiently/pythonically calculating new Dataframe rows

JoshuaI'm new to Pandas, and slightly new to Python as well (but not development in general). I've got a chunk of code that works, but it feels like I'm missing out on the Pandas/Python way of doing something, and would love some feedback. In short, I'm doing calculations over a fixed period of time (...

 
@DerKommissar Replace whole array with actual type, and you're almost at vectors in dynamic languages, I guess.
 
5:14 PM
Monking
 
Monking
How do I know If i'm a bad developer or an OK one?
 
you seriously consider the question, you're most likely an OK if not good dev
at least that's what Dunning-Kruger suggests
 
@DerKommissar You sound surprised!
 
TBCH most Commit Strip comics suck IMO.
 
harsh :D
 
5:23 PM
Yep
I don't think they're that funny
This one was humorous, though.
 
@DerKommissar I find most of them quite funny, but some of them are a bit... "too obvious"
@DerKommissar Thank you :)
 
I have a somewhat dry and limited sense of humour, so most of them are just "meh" to me.
This one cracked me up because every time I --force I literally think that exact same thing in my head.
 
@Mast In math: The rule is things are usually named after the second person who discovered them, because Euler probably discovered it first.
 
@Dair Haha
@422_unprocessable_entity Read up on the imposter syndrome. Many developers think they're bad developers. At the end of the day, it's hard to actually know.
Just keep practising and don't worry too much.
5
@DerKommissar Yes, this is what a force push looks like.
 
Probably true.
 
5:36 PM
@Mast Also, try your best to prioritize the kind of practice you should be doing.
however, that's hard to do... still worth keeping in mind.
 
@Dair Usually the kind of practice that has to be done to get the job done.
 
@DerKommissar Then you should have suggested it :)
 
@SimonForsberg Haha I don't ever think about that stuff until it's too late.
 
@DerKommissar You mean until someone else suggests it?
 
0
Q: Time complexity of radix sort

Balkrishan NagpalI read time complexity of radix sort is O(wn) or O(n log n), if all n numbers are distinct. After implementation it look to me as if I have implemented radix sort which has time complexity of O(n ^2). Please take a look at my implementation and suggest, if there is some implementation problem or ...

 
5:54 PM
@SimonForsberg Yeah, or whatever other "bring it to public light" they do. If I pushed my ideas more I'd have sniped like 4 patents...lmao
 
6:10 PM
0
Q: Three stage Sudoku puzzle generator

HamBone41801This was my first time attempting a project like this, so I figured it would improve readability, and would also just be nice If I allowed each stage to be visualized. Also, this only generates them, I haven't done any solving code, so it can't know if a puzzle has multiple solutions. I didn't f...

 
6:24 PM
@CaptainObvious You've come to the right place. Have an upvote.
 
Probably better asked on the Code Review site. — DonBoitnott 14 secs ago
 
0
Q: Multi-line text reader (x64 ASM)

Kittoes0124Building upon my previous question, I have come up with a method that'll search through a buffer and return a pointer to the end of the line. The primary purpose of the function to extract rows from a csv file using the logic specified in RFC4180; the third parameter isQuotedSequence can be used ...

 
7:00 PM
possible answer invalidation by Kittoes0124 on question by Kittoes0124: codereview.stackexchange.com/posts/215209/revisions
To ask about improvement of already working code you might be better off asking at SE Code Review. — πάντα ῥεῖ 44 secs ago
This question is better suited for CodeReview.SE. Note though that you shouldn't be using locals() like that; rather, store your commands as a dict. — Daniel Roseman 29 secs ago
 
0
Q: Optimize color picking part of code for Minesweeper game in Windows forms app

Stijn HendriksI am making a minesweeper for school in c# windows forms app. The problem that i have is that i can't find a way to optimize my code. The program works. I just need some help with optimizing the code. This is code I currently have: This part is used to determine which buttons get what color. I s...

 
@Duga Post was edited at 18:55Z and answer posted at 18:59Z, that doesn't make it an invalidation...
 
7:27 PM
First: this kind of question is off-topic here. You might want to try at codereview.stackexchange.com If you want to post there be sure to read their help pages to make it on topic there. Second: the answer is: "It depends". For a generic advice I see no notable problem. It's ok. — bolov 19 secs ago
 
-1
Q: Database design for Surveys

userx13134I need to design a system for displaying survey questions and recording user responses. Any feedback or suggestions will be great. I will bold some points I really want feedback on, but any discussion will be helpful. I'm not sure exactly what I need to support, so it's important that my design ...

 
7:46 PM
0
Q: JavaScript Spiral Matrix Coding Challenge

Sean ValdiviaA whiteboarding challenge: Given a 2D array (matrix) inputMatrix of integers, create a function spiralCopy that copies inputMatrix’s values into a 1D array in a clockwise spiral order. Your function then should return that array. inputMatrix = [ [1, 2, 3, 4, 5, 6], [7, 8, 9, 10, 11, 12], [...

 
 
1 hour later…
9:03 PM
-2
Q: How to refactor method to return String instead of println

Janac MeenaI have this Scala code which prints out all permutations of a string: def permuteRecursively(perm: String, word: String): Unit ={ if (word.isEmpty) println(perm + word) else { for (i <- 0 to word.length -1){ permuteRecursively( perm + word.charAt(i), w...

0
Q: Optimizations to Python Google Sheets Project

TommyThe purpose of this program is that I have a class where we have to keep track of some stocks that we bought in a game and every week we must list the closing prices of each stock in a google sheet. I thought since i had a lot of different investments to keep track of I would write a quick script...

 
9:24 PM
This is a little off-topic and more 'code review', but for future reference you can put "\n" (without quotes) at the start or end of your parameters for Console.WriteLine() to get the extra lines, and cut down on clutter. — Dortimer 43 secs ago
 
9:35 PM
possible answer invalidation by 200_success on question by Batman: codereview.stackexchange.com/posts/71346/revisions
 
10:01 PM
0
Q: Is it good idea to create a tooltip component using React hooks and ref?

Dan ZawadzkiCould I ask you for suggestion or a code review, please? What I'm trying to create is a generic tooltip component that I can use anywhere. I decided on a stateless component and the use of hooks and ref. Explanation 💡 Hook, because I wanted to have a flag for hover and ref to get element width...

0
Q: AVL tree implementation segmentation fault C++

maneelIf I compile and run program, there are no errors, but it does not work, nothing is printed after insert() and program ends. Debugger says it is segmentation fault. It seems like insert() method does not work. avl.h #ifndef AVL_H #define AVL_H #include <iostream> using namespace std; class AV...

 
@CaptainObvious is it java or C++?
 
@CaptainObvious It's broken.
So... Both?
 
@Zeta maybe thats why
 
Nah. Classic *0. The memory for the node(s) never gets allocated.
 
10:38 PM
@user11187608 I'm describing a real-world situation based on my own experience with application states (not necessary Redux or React). I assume you don't have enough experience with the subject, this seems to be the only explanation why you don't see what's wrong with it and why it can't work in a big app. You didn't even try to come up with complex real example (Todo application or so) how it could work and replace Redux. If you're interested in feedback and not pointless debates, consider writing one and posting it at codereview.stackexchange.comestus 24 secs ago
 
10:49 PM
@z-khullah in the link provided, the "Optional to ignore plugin Git clones" is given because sometimes we change the code in them, so can't ignore all the files. Ideally, we can ignore, but there are online suggestions due to the issues in plugins, esp as a newbie to cordova it will help. the package-lock changes 10s or 20s of lines each time some plugin installatoin changes, so this is also something we dont want to code review, also by igoring lock file we din't have any issues till now, it gets generated from package.json. Hope that helps in giving our perspective. — Manohar Reddy Poreddy 29 secs ago
 
11:04 PM
I have a problem with this answer. The code is an almost carbon-copy of an answer already provided. Why did you feel it was necessary to post this anyway? — Mast 11 hours ago
Gurkenglas answer is wrong, @Mast (syntax-wise and logically). That's probably why zarcode posted a new version.
 
11:18 PM
0
Q: Hopcrof Karp algorithm does not work [python3]

ИванКарамазовCan some of you check what's wrong in my implementation of Hopcroft Karp algorithm to find maximum matching in a bipartite graph? I implemented it as a method of my Graph() class, the method input consists in two lists or set of nodes (representing the two sets of nodes of a bipartite graph). It...

 

« first day (2137 days earlier)      last day (1895 days later) »