« first day (1398 days earlier)      last day (2917 days later) » 
00:00 - 18:0018:00 - 00:00

00:00
RELOAD! There are 3506 unanswered questions (91.6785% answered)
00:24
0
Q: Quadratic equation solver in Ruby

Dmitry KudriavtsevI wrote a simple quadratic equation solver with Ruby to help me solve quadratic equations. Please tell me what I did right or wrong, and what I can do to improve it. #!/usr/bin/ruby if ARGV.length != 3 STDERR << "Usage: #{$0} <a> <b> <c>\n" exit 1 end a = ARGV[0].to_i b = ARGV[...

 
1 hour later…
01:45
may be appropriate to post in codereview exchange site? — Rao 26 secs ago
02:12
I think someone may have DDoS one of our servers, all users are getting "maximum sessions exceeded" when trying to log in...
o_O
Right?
ye
03:10
possible answer invalidation by Jamal on question by jeremy radcliff: codereview.stackexchange.com/posts/156661/revisions
03:40
0
Q: Proper multithreaded computation

idempotenceThis question is related to my previous question on the brute-force search for a solution to an unsolved mathematical inequality. I thought that since this question pertains more to the use of multithreading, it should be a separate question. The following code, tested on Ubuntu 16.04, compiles...

 
1 hour later…
04:48
0
Q: Find all differences between 2 strings

CominternI pulled this out of my code bucket and dusted it off earlier today in response to a post over on SO that made me cringe. This was originally written to highlight changes in Excel cells in real time via Worksheet_Change, so it is designed with an eye toward raw speed to avoid blocking the UI. Be...

05:14
@Riker they reboot the server and it cleared the issue... shrug
possible answer invalidation by codetoshare on question by codetoshare: codereview.stackexchange.com/posts/156606/revisions
1
Q: Excel to JSON parser with http download

CodingoI've been working on a project (link) to download a spreadsheet of known ransomware and properties and turn it into json so I can better consume the information within early detection projects. I'm new to python - what can I be doing better? The destination json I'm converting can be found here....

05:35
@DanPantry I'm reading about how ES6 symbols work, but I’m feeling pretty unclear about when/why one would want to use them. Do you have any insight to offer?
06:06
0
Q: Creating an infix class to evaluate an expression

ConfusedCoder2020I'm currently working on the following assignment for my CS class. We are supposed to create an infix class for this assignment but I am not completely sure on which functions I should need and how to code it. Programming Problem 6 (Modified) Consider simple infix expressions that consist o...

06:20
Monking
Monking
0
Q: JAVA and PMD: warns me too many fields in class entity

Rady Archuleta// - PMD let me separate classes but I don't want SeatEntity extends SeatFeatures because it doesn't make sense // - How can I can have all fields from class SeatFeatures in SeatEntity? @Table(name = "seats") public class SeatEntity { @Column(name = "seat_id") private String seatId; } p...

By the way - your code doesn't insert any space at the end of the line. What is your problem? Do you want a code review? — mpiatek 39 secs ago
This is better suited to the Code Review site. — tadman 33 secs ago
06:44
0
Q: Java rest-assured automated test script

comradeI am working in a rest-assured tool to automate API's. I am using java language. I did a sample API automation. I want to improve. So I want to know the best practice for rest-assured API automation. Here is my code. package com.restapi.test; import com.jayway.restassured.RestAssured; ...

@chillworld tell me if there is a problem in my code or tell me if my program outputs a space at the end of line don't sound like a question at all so I answered the latter but asked what is the exact problem. If there are no problems then maybe this post is better suited for codereview.stackexchange.commpiatek 13 secs ago
07:10
Monking!
I'm voting to close this question as off-topic because it should be posted to codereview.stackexchange.com — JB Nizet 42 secs ago
Monking @Mast. :)
How's your sensors doing?
Well. :)
See:
12 hours ago, by EBrown
user image
I need to fix up this graph refreshing, but it shouldn't be hard.
Right now it deletes the entire graph then reloads the whole thing, which causes it to be slightly graphically weird sometimes.
You may put this up in @CodeReview of stackexchange to get reply from them about #cleancode and #rightwaytodoit — Smit 50 secs ago
This question is more suitable on codereview.stackexchange.com. Maybe it can be migrated. — insertusernamehere 17 secs ago
07:21
Heh, fixed. :)
Monking
As already said, your question is better suited on codereview.stackexchange.com. Your code also seems incomplete. Is there no text for an li-element or source for each image? How is this content stored? Do you have a loop of some kind or are your really creating only one element? — insertusernamehere 10 secs ago
If it is happening in only 0.5% of the builds the line of code (or then combination of circumstances) may be very rare and hard to find by exercising the code. Sometimes a code review can do more to find these kinds of issues. — Jon Rose 52 secs ago
@Mast @Phrancis @ThomasWard @EthanBierlein ^^ Is it pretty? No, but the data there can easily be made pretty. :)
Graphs refresh every 5 seconds, those timers refresh every second.
07:31
Pretty damn cool
07:45
SUCH WEIRD BUGS
WTF JavaScript
Oh, I may be suffering from a global object syndrome
Simple chatroom app, have 3 tabs connected to the server... I make one user /join another room, and suddenly all users are in that other room
But only after subsequent users' room joins to first new room
And... first user's messages are not visible to anyone
WTF
So, so weird. Behavior is pretty unpredictable, it's as if different users pass a baton of being able to do stuff... sounds like a global scope bug maybe?
Sounds like whatever user is last in memory is probably the one being able to do things.
08:01
Hm I think I found the bug
This function is not working
  /**
   * Allow clicking of a room name in room list to join said room.
   */
  const allowClickingRoomNameToJoin = () => {
    $roomList.find('div').click(() => {
      chatApp.processCommand('/join ' + $(this).text())
      $sendMessage.focus()
    })
  }
If I manually use /join foo it works, but if I click the existing foo room it breaks things
Probably need to just fix the jQuery :|
0
Q: nesting elements with appendChild

Ahmed ALgraiI want to make a nav that look like this <nav class="socialmediaicons"> <ul> <li> <a> <img> </a> </li> </ul> </nav> using appendChild() method and this is what I've done: the myNode is the nav tag which has already been created via HTML. var myNode = docume...

0
Q: two ways of random shuffle cards

Lin MaHere is my code of two ways to random shuffle cards, I write in Python 2.7. The first method (shuffle) is trying to select a random card, then put it in the front; The second method (shuffle_v2) is assume if i-1 cards are shuffled well, try to randomly swap card i with any card from 0 to i-1. ...

08:19
OK, now I get it. The above function makes the user join a room named "" (empty string) when clicking, doing /join does the same
Fixed...
  const allowClickingRoomNameToJoin = () => {
    $roomList.find('div').click(function() {
      chatApp.processCommand('/join ' + $(this).text())
      $sendMessage.focus()
    })
  }
Still a bit confused about scope of this with arrow functions, but looks like that was the bug here
@Phrancis that evil function()...
Looks like the arrow function was inheriting this from the upper function, of which was nothing, which got then interpreted as an empty string, possibly because of the concat, otherwise would probably have been undefined
just wanted to share some improvements on my answer from code reviewQuickbeam2k1 43 secs ago
@EBrown Assuming the room those sensors are in is left alone (no doors opening and the like), only the 3rd graph looks reasonable.
@Mast They're near a window but not directly in it, so they're getting mixed data.
08:34
Unless you're close to a radiator and your thermostat is nuts.
@EBrown An open window or a closed window? How hard is the wind outside?
@Mast Barely open, wind is periodic.
That will definitely reflect in your measurements, so that could be partly to blame.
Oh well.
@EBrown Might want to benchmark your sensors in a somewhat controlled room in the near future.
A wooden cube with a lid would be nice.
@Mast Gonna close that window over night and see how they do for a few hours in this room.
It's very well environmentally controlled.
@rolfl Without experience, it's hard to figure out whether you're doing the 'right' thing. Imposter syndrome is strong with just-graduated employees.
@Mast ^^
Reset all the sensors a while ago, building (parts of) UI.
Everything on this page is asynchronously handled.
08:50
const timeTo = doWhat => {
  return "Time to " + doWhat.toString()
}
console.log(timeTo("go to bed"))
-2
Q: My Java Task , Its Complex , Help me solve it

user1324221)There are only two person involved in combat.We willdenote this as Person A and Person B . 2)At the start of a round , both person A and Person B rolls the dice each.They add the result of their respective dice to their Skill value to get final score. 3)Determine who has the higher score. ...

0
Q: JAVA - Update a variable from different class than it was created in.

HarshvardhanSharmaI made an AVL tree with four classes as shown in the code below. I am having problem after rotation to balance the tree, when actually the root may change after rotation, in my case it never changes. Its continues to be the value that I first inserted at root. Because of this I am never able to i...

09:07
@EBrown Did you indeed move the sensor 25ft down or is the sensor simply that inaccurate?
@CaptainObvious HAMMERTIME
@Mast It's because I haven't configured sea-level properly.
lol
I think wind is also negatively affecting that.
Could be, since it's probably measuring air pressure.
Bad weather could influence it as well.
Monking
09:25
0
Q: quick select improvement for worst case

Lin MaTrying to use shuffle to improve worse case scenario of quick select (e.g. every time, selected pivot value is the largest, so each iteration, only one elements could be removed from judgement). My solution to this problem is to use shuffle, but I am not sure if using shuffle still have small ch...

@Mast Calibrated for sea-level, looks like that is giving the right altitude.
My sea level pressure might have been really far off.
0
Q: Designing asynchronous communication using OGR Api

andre ahmedI'm using OGR API for creating geographic areas and sending/receiving data using that API. I have created a blocking synchronous communication for creating features add them to the queue, send them over the network. What I want to know about, is how would one design an async communication usi...

@EBrown Are you on a plane?
09:43
@skiwi A plane flying at 900 ft?
@Mast I may have read that as 9000 ft, which still would be low I think, but more likely
9000 ft is cruising height for short-distance traffic, so nothing wrong with that.
But 900 is a tad low.
Air lines are among other heights on 3km and 10km.
And one feet is 30cm or so IIRC.
feet, foot, whatever
Monking
09:59
Hi sparta93: not sure if you ever get involved in Code Review but I've posted the above code over on that site - if you have 10mins spare I'd really appreciate any general pointers that you might have? codereview.stackexchange.com/questions/156560/…whytheq 7 secs ago
10:10
hrngh ... installing a really old printer is a nightmare with windows. ..
it's been downloading drivers for ages now :/
i fixed it. sorry. my programming ability is like alchemy: i cannot fix anything without also fucking something else up
@Kaz Hope to see you soon.
10:50
This looks like something for codereview.stackexchange.comBo Persson 57 secs ago
You wouldn't show a colleague a simplified version of the code for review, then deploy something else to production. You shouldn't do that here on Code Review either. — 200_success ♦ 15 hours ago
4
0
Q: Converting std::chrono::time_point to/from std::string

VahagnConsider these functions that allow to convert std::chrono::time_point to/from std::string with a predefined date-time format. constexpr size_t log10(size_t xx) { return xx == 1 ? 0 : 1 + log10(xx/10); } template < typename Double, size_t Precision = std::numeric_limits<Double>::digits10, typen...

I want that statement verbatim in the help centre.
@Mast Nice one
omg new vscode is awesome
/** + tab and it autogenerates jsdoc for your methods
microsoft are really doing well with that editor
10:57
@Mast hmm ... I vtc'd 17 hours ago ..
and it's still not closed...
and today is a weekday ... wtf?
I want a code review @mpiatek — Manoj Maddy 37 secs ago
@DanPantry they do need to take care not to bog it down into the next VisualStudio though, because that's slow as hell ..
@Vogel612 Review queue was quite big when I started. Empty (for me anyway) now.
I guess there's not enough people checking the queues on CET mornings.
I went through the captain posts and voted as I saw fit ...
@DanPantry Visual Studio Code?
11:01
marker says 9, I can do 0 ...
@skiwi atom / sublime by microsoft
If it's really as good as it says it is, I'm wondering why I'd want to use VS Enterprise at work instead of VS Code
has pretty good tooling support and actually runs on linux ..
(Haven't checked it out yet, so there may be an obvious reason)
@skiwi because Resharper and other integrations
@skiwi yes
@skiwi If you're doing anything .NET use VS enterprise
otherwise I'd say VSCode
So my new spring for my nerf gun arrived..... and I thought my nerf gun was underpowered
tried out some brand new darts and actually it's pretty strong. and now I am going to put a stronger spring in it. this will be fun.
11:10
@DanPantry Looking around for C++, because we're not using an IDE yet
The (perhaps slightly outdated) argument is that they want the code to compile and run anywhere and locking into an IDE would have made that more difficult
Think about this being 10-20 years old though when Microsoft was not necessarily a big player
I'd use vscode for c++
What's somewhat interesting in that reasoning is that they are actually using Microsoft Visual C++...
oh, lol
if they're using microsoft stuff then yeah vs enterprise all the way..
@Phrancis Nope. Never used them. They're good for strings that you don't need to serialise.
Think unique identifiers. Maybe.
Don't use them in Redux.
You want to be able to serialise Redux action history, using symbols breaks that.
@DanPantry I don't now, I suppose you can use MS C++ in Code
@skiwi Yeah you could, but VS enterprise probably has first-class support for MS C++ stuff.
I don't know what completion is like in vscode for C++
11:26
@DanPantry From what I used VS Pro or Ultimate for for my personal C++17 stuff it was pretty okay
But be still want to keep the door open for Linux support
Ok, I have moved topic to codereview.stackexchange.com — shjeff 49 secs ago
0
Q: Object Oriented Fractal Tree

Master YushiI made an object oriented fractal tree in javascript using the p5 library, it consists of three files: Fraternal Tree.js branch.js flower.js Here is the github repo with the source code. All the main work is done in Fraternal Tree.js I want to know if I am following good coding practices and...

0
Q: Spring Data Redis - mapping object relationships?

emeraldjavaI'm designing an app that will process a set of social media messages which are posted by users. Each message is then scored and there is a reporting layer that will spit out a set of reports. The app is implemented with spring-boot and has to use a Redis DB. I'm more familiar with RDBM database...

0
Q: Wrapping libusb library in C++ - class design

shjeffI want to use libusb library in my C++ application. I have created classes which wraps libusb functions. You can see that libusb API is splitted to 8 sections: http://libusb.sourceforge.net/api-1.0/modules.html For me the most necessary sections are: Device handling and enumeration Synchronou...

11:45
-1
Q: Java Command Line Arguement

MOMOThis is my code for the java command line argument that I am trying to make it work however it doesn't allow me to do so. I have to write a class containing the main method and another class methods (so there are two class methods in this class). The main method calls the other class method and...

@CaptainObvious broken
@CaptainObvious 2 more VTC.
C'mon people, get those votes flowing.
> Most programmers are idiots that treat each exception as the end of the world when it's usually not a big deal and your program will NOT be in an unknown state if you actually catch the exception. The omnipresent paradigm of not catching general exceptions leads to bs like Chrome randomly crashing because one of ten open tabs has a page where some obscure javascript error or whatever causes an exception for this tab.
In other words, get it some downvotes and rude flags.
s/downvotes//
just flags should be sufficient to nuke this thing from orbit
12:13
1
Q: Implementing my own network protocol using TCP, sending images through sockets (sockets, python)

yakI would like to ask about your opinion about my code. The idea is simple: I designed my own protocol, where client asks server about the image, and the server sends the image, following the below steps: CLIENT SERVER GET\r\n --...

12:29
Janos left a comment. I'd ping him, but he hasn't been in this room for a while.
wtf, what an arrogance :
@janos thanx. Where can I turn to for help? Stackoverflow?... BTW if it were working as intended, why would I need help? — HarshvardhanSharma 6 mins ago
@chillworld Not necessarily arrogance, could simply be misguided.
Oh well.
:)
don't forget, I can nuke also and I'm here (as a ghost) but I can hear a ping
just to much work for hanging around here to chat
We need more regulars with VTD privileges...
0
Q: Corrent dequeue() in Queue implememtation that uses a circular linked list

chenzhongpuI use a circular linked list to implement a queue, and it only holds one last (note that last links to the first, not null). public class Queue<T> { private Node last; private int n; private class Node { T value; Node next; Node(T t, Node n) { va...

12:38
if you want help, just ping me ;)
@chillworld You don't have 10k rep on CR, do you? That's what I'm referring to.
oh, but I can do a close vote
@chillworld Feel free to help in the review queue every once in a while, should keep it clean.
This question has code that's so far anonymized that it no longer works.
@EBrown It's looking good! What did you have in mind for the data prettification?
-1
Q: Web API: What should be returned? NotImplemented, BadRequest or Bad Design?

meditariLet's say I have an enumeration of related information types and an enumeration of time periods. Also I have created two operations on a controller for retrieving data of those info types. Due to third party API constraints InfoA can only be retrieved with a date range and InfoB and InfoC can o...

13:07
0
Q: Exponential Moving Average using Pandas

Furqan HashimI am using the following link as a reference to pandas, so that I can calculate exponential moving average for pandas data frame. http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.ewm.html My data frame looks like as this: Price 2017-01-01 1 2017-01-02 ...

13:25
possible answer invalidation by Nik So on question by Nik So: codereview.stackexchange.com/posts/156638/revisions
You can ask these questions to codereview.stackexchange.comSamuel J Mathew 11 secs ago
It is another community like stack overflow where you will get code review suggestions. — Samuel J Mathew 58 secs ago
13:45
0
Q: Javascript if else statements

LeffSince I have a function which can be done in few ways as usual, I was wondering which way is the best to achieve the form validation where I have only one input field, and I am showing a warning on keyup if the number of characters are in between 1 and 3 as well as enabling disabling submit butto...

13:57
@Mast hmm ... I'm pretty surprised ...
1
Q: Iterate over a file multiple times

JohnOk, so I have this code: int main(int argc, char *argv[]){ ifstream answers(argv[1]); ifstream candidates(argv[2]); for (string s; getline(answers,s);){ for (string h; getline(candidates,h);){ if (!h.compare(h)){ cout << h << ":" << s << endl...

no such thing ...
@Vogel612 By what?
which is ... bad....
@Vogel612 lol
13:59
del-privileges on questions with 10k ...
because they aren't there...
@DanPantry All of JetBrains' IDEs have had that for quite a long time lol
that question is scored -7 ... I can't imagine that it's not eligible for community deletion...
@Vogel612 Isn't there a time restriction or something? Post being older than 2 days comes to mind.
As in, if it isn't, 10k can't delete it.
20k might.
yeap ... that's the restriction that's lifted at 20k.
and the number of votes, too ...
Yes because it depends on external factors like the dirpath. I suggest you post this question in codereview stackexchange — Sharjeel Ahmed 36 secs ago
@Vogel612 which question ?
I just picked the first out of "Lowest scoring" in the 10k tools
because I remembered a deletion restriction related to the question score .
@Incomputable if you'd just posted another answer and pimped it, your latest edit would've gone through just like that :)
'How powerful can a nerf gun be before we shouldn't fire it in the Riot office' is not a question any one has asked, but I now have the answer to
9
@DanPantry That sounds like your next messages goes "… in unrelated news, I'm looking for a new job."
Monking.
@CaptainObvious one cv left
random js question @DanPantry ...
// ternary:
let result = conditional ? value1 : value2;
// hack
let result = (conditional && value1) || value2;
14:17
@DanPantry What... did you do?
does that work?? or is it only the || that has a special syntax there?
@skiwi I changed the spring from stock to 5kg, changed plunger from reverse to direct and got more firm darts
@Vogel612 second one should work
if conditional && value1 is truthy then value1 will be returned
otherwise value2
I'd stick with the ternary though, if you have to label something as a hack you shouldn't use it :)
I'm not sure whether I should love or hate js for that...
The truthy coercion stuff is a bit janky
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Collect data from 4+ columns and insert data into another column
14:20
but it's no different from (conditional == true && value1) == false || value2
Which I think will work in other languages
@DanPantry I'm more interested in what you caused :p
@skiwi I haven't caused anything yet but comparing the power of what it was to what it is now, I am afraid to shoot it certainly at anyone's face.
it's easily one of the more powerful nerf guns (from being the most underpowered) now
Oh... I see
in the office
Well, I probably wouldn't be able to see anymore if you would've used it on my face
14:23
the dart travels so fast now we can't see it fly
I mean half of the time that's because the dart is jammed but that's irrelevant
@DanPantry Colleagues were not amused?
oh I actually bet they were amused ...
^^
I'd be, as long as it didn't hit me in the face.
@DanPantry Are you going to be the next LoL champion?
they seem to be a lively bunch at the riot infosec department ...
14:24
Dan, the Nerf-Man?
3
@Mast My colleague was VERY amused
@skiwi they got graves for that already ...
until he got hit by it
He was literally asking for it though, so
lol
"shoot me shoot me shoots OW don't shoot me"
14:25
Colleague has to learn to make up his mind. Now he knows.
Anyway, got to run.
@Vogel612 sorry, not really sure what you're mentioning
that "removed fluff, added beginner" edit where you completely gutted a new user's post (correctly) here
> Stripped off off topic part, added beginner tag, reduced noise.
@Vogel612 well, that's one of the essential skills of the of CRer :)
0
Q: cURL based REST client library

Mike BrantI have recently refactored a REST client library and was hoping to get review for both the class itself and the unit tests that cover it. The full library can be seen on GitHub RestClient.php <?php namespace MikeBrant\RestClientLib; /** * @desc Class for executing RESTful service calls usin...

0
Q: Flattening array in Javascript

dijamI have implemented a solution to flatten an array of multiple levels in Javascript. I am just a newbie so forgive any mistakes. Could someone give me any tips to improve the code? function streamrollArray(arr) { var copyArr = arr; var to_return = []; while (true) { if (copyA...

that guy still got a bug there ... actually there is a much bigger bug he is not seeing, but I think it could be a valid point in the answer.
14:42
go write the answer then ;)
possible answer invalidation by dijam on question by dijam: codereview.stackexchange.com/posts/156716/revisions
If there's nothing wrong with your code, but you want to know how you can improve it, then it's too opinionated for Stack Overflow. However, there is codereview.stackexchange.com which might be a better fit, though you should probably read their rules first since I'm not familiar with Code Review.SE. — g00glen00b 39 secs ago
14:58
> The library instantiate me.
lmao
@Duga seems okay enough...
ye
@Incomputable I AM ONE WITH THE LIBRARY AND THE LIBRARY IS WITH ME
6
0
Q: How to combine 2 list of objects with no duplicates?

RickyI have 2 groovy sql resultset, I need to combine the result set so that project_no should be unique and case_no can have multiple elements if there is a duplicate project_no Below are the 2 groovy sql resultset [[project_no:0-10001,case_no:00492268],[project_no:0-10160,case_no:01957580],[projec...

@Riker but that guy can't modify the constructor ... so he's divergent with himself
0
Q: Can this be refactored for proper Dependency Injection?

wxkinI am having troubles refactoring the following code to use proper Dependency injection. That is because I don't have access on the State Class constructors My main limitation now is that the inject implementation mapping is done with strings and in case of a typo there will be a nice fat excepti...

shhhh
15:04
monking
What do we do with answers that are edits?
I'd just leave a comment and flag it for deletion.
@Peilonrayz comment, flag as NAA, and let it go? I don't think the original code is modifiable, because the question already has answers, upvoted ones
0
Q: Haversine Formula in Clojure

Felipe Guerra(ns br.com.reactive-poc.calc) (def raio 6372.795477598) (defn calculate-distance "Calcula distância entre duas coordenadas geográficas" ([source to] {:pre [every? (every-pred map? #(contains? % :lgt) #(contains? % :ltd)) [source to]]} (let [delta-latitude (Math/toRadians (- (:source/ltd sou...

@Incomputable It's an edit to an answer. :) Thanks guys
15:23
effect = this.data.Statuses[id];
effect.name = effect.name || this.data.Statuses[id].name;
Okay, unless I am being dumb
isn't that second line a no-op?
what if effect.name isn't defined?
is logical or even defined for strings?
@Riker but... look it again
let me simplify
oh
e = array[id];
e.name = e.name || array[id].name;
15:25
wot
lol
@Incomputable in javascript, yes.. logical or in javascript implicitly coerces to boolean (lol)
any value that isn't 0 NaN, null, false or undefined will coerce to true
hence why it's called truthy
because js is weird
Greetings, Programs.
@Riker And annoying.
yes
15:28
an array of objects of size greater than 1000, accessed fps times per second in a draw loop results in massive fps drop in a canvas sketch that i made
can using some other data structure provide visible results?
I hate when I have to debug JS issues. Such as when I start a new iteration and have the opportunity to update 90% of the libraries I'm using.
3
in javascript
@MasterYushi pretty sure the issue is not the fact you are iterating an array.
depending on how you are iterating the array, of course...
Hard to say much without seeing how you are using the array
and its objects
I posted a question here about that
@DanPantry You want a headache? That's how you get a headache.
15:30
I (as usual) don't have a lot of time to give a review
But one of the key things you could do would be to reduce memory usage
in both Branch and Flower, you create functions like this:
function Branch() {
  this.something = function() {
    ..
  }
}
This creates new function objects with closure sfor every single branch you make
consider using the prototype instead
function Branch() {}
Branch.prototype.something = function() {
  ...
}
Or better yet using ES6 classes if you can support it.
class Branch {
  something() {}
}
That should reduce memory usage considerably
I just started out with javascript, I'll take a look at prototypes, thanks
how often do you create branches/flowers?
branches are created on mouse clicks
Are you seeing FPS issues on mouse click?
flowers are created on branches which aren't grown and when a button is clicked
When you grow over 1000 branches, fps drops, the tab hangs, animations slow down, etc
15:34
BTW, for your question: The only code to be reviewed should be in the question, so I'd remove the Github link. Additionally, reviewers are going to review every aspect of the code, not just the performance. Be aware of this.
Yeah, that sounds like at least partially due to memory to me :) Using a prototype will reduce the number of functions from (N branches * 6) + (N flowers * 4) to 10.
Okay i'll use functions prototypes! Also, what do you mean "every aspect of the code"?
Like coding practices that should be followed?
How it looks, how it's structured, best practices... not just performance
Looks as in indentation?
Any kind of review would be great at this point
well, just making sure you know that you might not necessarily get a review on performance
-1
Q: Optimized way to read local inner function

user765443#!/usr/bin/env python import argparse import sys def parse_args(argv): """parse the argument""" parser = argparse.ArgumentParser( description='This test module', epilog="this is testing module") parser.add_argument('-d', '-debug', dest=...

1
Q: UVA 100: "The 3n + 1 problem"

gaazkamI’ve solved UVA Problem 100: The 3n + 1 problem . In short, the task was to write a program that calculates a maximum of Collatz sequence lengths for any given range of starting values. My program: #ifdef ONLINE_JUDGE #define NODEBUG #endif #include <vector> #include <unordered_map> #include <...

15:41
@MasterYushi it will probably take time. CR is slower than SO, but quality tend to be greatly better
@DanPantry Oh alright, thanks for your help!
@Incomputable Yeah I have noticed that
I can just replace this.fx with functionName.prototype.fx, right? Anything else i need to take care of inside the functions?
Anyone know a way/tool with which I could quickly find/replace a certain word in multiple plain text files? (non-code methods are fine too)
Rice paddy art:
For when you have time on your hands: bbc.com/travel/story/…
Gluten-free.
@Phrancis Any IDE can do this, VS code => Ctrl+Shift+F and you serach and replace in many files
15:59
@Phrancis sed?
@MasterYushi Yes, but you also want to move the function declaration out of the constructor function.
I'm voting to close this question as off-topic because it is better suited for codereview.stackexchange.com — nickb 38 secs ago
That's ok, code review is great for that too! codereview.stackexchange.comnickb 31 secs ago
possible answer invalidation by John on question by John: codereview.stackexchange.com/posts/156712/revisions
So, should I just move my question to codereview? — magalenyo 50 secs ago
@nickb The Help Center on CodeReview says that asking for debugging help is off-topic over there - or is that page out of date? — UnholySheep 25 secs ago
16:19
@Mast ^^ Altitude doesn't change now lol
@Duga not mentioned in an answer
I wonder if you can truly make a code review consisting of multiple commits in Source Tree, the way GitHub and BitBucket do it. Basically, preview several commits as a cumulative diff. — sakovias 33 secs ago
16:42
@Roland a constructive code review would be, "your code is inefficient here. Instead of X, why not Y." That criticism explains an error and provides feedback. But saying I am "hopeless" and that I didnt learn proper R syntax is not criticism. Its an insult. Criticisms should provide more specific solutions than "you shoulda learned better." — Hutchins 26 secs ago
0
Q: Anagram check using bitset

Kushal SahareIs this code correct for anagram checking using bitwise operation. #include<iostream> #include<string> #include<bitset> using namespace std; int main(){ string base_string = "cinema"; string test_string = "dinema";//"iceman";//"cinema";//"dddddd"; unsigned char mask = 0; for(int i=0; i < bas...

possible answer invalidation by yak on question by yak: codereview.stackexchange.com/posts/156704/revisions
16:57
0
Q: Get first DateTime by given weekdays and a starttime

SerthyAt work there is an input-system where customers are able to specify weekdays and a starting time for an event. The weekdays are integers in the range from 1 (Monday) to 7 (Sunday). After the customer has given the needed input, I need to calculate the next possible DateTime for the event. If the...

0
Q: Python list dictionary items round robin mixing

Alex benzI have a list of dictionaries, which I want to make round robin sorted. sample = [{'source': 'G', '"serial"': '0'}, {'source': 'G', '"serial"': '1'}, {'source': 'G', '"serial"': '2'}, {'source': 'P', '"serial"': '30'}, {'source': 'P', '"serial"': '0'}, {'source': 'P', '"serial"': '1'}, {'source'...

@CaptainObvious Can someone check if this is on-topic
@CaptainObvious @Peilonrayz I'd say it's borderline, if OP can remove the request to add functionality then it would be mostly on-topic.
0
Q: Logging into Database with ASP.NET Core

PalmiIn the Startup.cs of my ASP.NET Core application I want to configure the LoggingFactory so that it logs into the database. Therefore I create following DBLoggerExtensions class to add a context: public static class DBLoggerExtensions { public static ILoggerFactory AddContext(this ILoggerFact...

0
Q: Dijkstra algorithm implementation

magalenyoI'm currently learning Java and in university I've been asked to code the Dijkstra algorithm to get the shortest path between two points without making any use of the Java api, but I am stuck because my algorithm doesn't seem to work and I can't figure it out why. I would also like you guys to p...

17:14
"I'd like to be able to post that code somewhere and get feedback from people who actually want to help me." That sounds like you want to ask at SE Code Review. — πάντα ῥεῖ 13 secs ago
"did I code this correctly and efficiently as possible" For the first point compile your code and debug it, for the 2nd point ask at SE Code Review. — πάντα ῥεῖ 13 secs ago
@CaptainObvious Applied VTC
lol, I haven't been around a lot lately either, maybe that is how I have gotten so much work done
17:37
0
Q: Protocol implementation, TCP, sending images through sockets (sockets, python)

yakI would like to ask about your opinion about my code. The idea is simple: I designed my own protocol, where client asks server about the image, and the server sends the image, following the below steps (this is the actual protocol I wanted to implement): CLIENT ...

0
Q: Is this a sound refactoring of an Angular Service?

ToddThis service has a lot of duplicated code and is difficult to test. Shown below in abbreviated form. I am fairly new to angular. (function(){ angular .module('MyModule') .factory('MyService', MyService); MyService.$inject = ['$http','$q']; function MyService($http,$q){ var se...

17:53
WTF
"use strict"

module.exports = class Chat { //runtime: ReferenceError: module is not defined
Hmm this is client-side, I suppose module.exports is a Node.js thing and only works on the server? @DanPantry?
0
Q: Cropping faces from images in a directory

Pankaj JainI am using the below code for cropping faces from images in a directory import cv2 import glob import os def facechop(image,imgname): facedata = "haarcascade_frontalface_default.xml" cascade = cv2.CascadeClassifier(facedata) img = cv2.imread(image) minisize = (img.shape[1],img...

0
Q: Reusable callbacks for continuously updating a text editor component

ByteSettlementI have some code that is repeating within these two event functions : CKEDITOR.instances.editor.on('instanceReady', function() { CKEDITOR.instances.editor.on('change', function() { that I think can be placed into their own function which can be called within the two events. Repeated code: ht...

00:00 - 18:0018:00 - 00:00

« first day (1398 days earlier)      last day (2917 days later) »