« first day (932 days earlier)      last day (3071 days later) » 
00:00 - 18:0018:00 - 00:00

6:05 PM
> Is it possible to reduce space complexity from O(n)? If so, how?
Uhm, to what?
 
0
Q: Scrolling with an easing function

BenI wanted to write a function that when invoked, will scroll the page downwards in a smooth fashion. Comments and criticism welcome. I don't like, for example that determining whether it is done is not based on the scroll position. var EASING = BezierEasing(0, .1, .1, 1); // Example values. var ...

 
@Mast To anything less, really.
 
@TheCoffeeCup Well, sure, you can pre-calculate everything and dump it in a lookup table, but that's not the point of Game of Life.
 
@TheCoffeeCup the step below O(n) would be O(log n), or O(1), both of which are unrealistic for Game of Life.
 
@SimonForsberg Ok.
 
6:12 PM
@Mast the time it would take to create that table would be.... ugh.
 
@SimonForsberg Yup, but it would fit the requirement. It's not sensible to even try, but hey.
O(n) is actually quite good for most operations.
 
@TheCoffeeCup - the O(n) on the generation is largely dependent on the 'n'....
is the n the number of generations, or the number of cells?
 
@rolfl Number of cells.
 
Note that the nextGeneration call does not need to worry about much of what it does, because you have a defensive copy on the Generation constructor anyway.... so, you're going to have two complete 2D arrays for each nextGeneration.
 
@rolfl Oh right....
 
6:16 PM
Code reviews belong to another stack exchange site. — 101010 28 secs ago
 
Many GoL systems use a ping-pong type buffer for cell state, instead of immutable Cell arrays.
 
That makes each generation O(1) in terms of space, but overall you have O(n) space for the problem because you need a 2D grid at some point.
 
@Duga Flagging season today.
 
I'm voting to close this question as off-topic because it belongs to codereview.stackexchange.comvsoftco 59 secs ago
Note that asking for help on how to overload an operator will be an auto-close on code review - the code needs to work before it's on-topic over there. — rolfl 29 secs ago
@Mast Sorry, I may not know the exact rules of codereview. Can you briefly tell me why? — vsoftco 22 secs ago
Hi. There's a SE website for code review which is more appropriate for this type of question: codereview.stackexchange.comdietbacon 13 secs ago
 
6:20 PM
Monking @Duga and others ;)
 
@vsoftco If you don't know the rules of Code Review I'm baffled you're even recommending the site. It has nothing to do with the CR rules though. You vote to close because it's off-topic here, not because it may or may not be on-topic somewhere else. — Mast 51 secs ago
 
0
Q: Singly Linked List in C++

AntithesisI've written a singly linked list in C++. Would appreciate reviews on code efficiency and best practices. Also need help writing the assignment operator overload. #ifndef SLIST_HPP #define SLIST_HPP #include <stdexcept> template <typename T> struct node{ node(T data):data(data),next(nullpt...

 
@CaptainObvious Directed here from SO, not necessarily on-topic. Not going to touch it.
 
The part about "Also need help writing the assignment operator overload." would be off-topic for Code Review, as the code for that is not written yet. If you wish for a review of the working code you have so far, it would be best to remove that part. You're welcome to post a separate question once you get your operator overload working, though. — Phrancis 9 secs ago
 
6:35 PM
-2
Q: Improving speed of my code

IwkoI wrote some code in Python: from __future__ import division from numpy import arctan, sin, absolute, log10 from mpmath import * import time imax = 1000001 x = mpf(0) y = mpf(0) z = mpf(0) t = mpf(0) u = mpf(0) i = 1 mp.prec = 128 start_time = time.time() while i < 1000001: i += 1 x = mp...

 
@CaptainObvious Good grief, just as I was typing the response back :|
 
@dietbacon and OP, this would not be well-received on Code Review, as there is nothing in the title and question that gives any kind of explanation what this code is doing. Also, just like on Stack Overflow, " is this language better than this other language?" would of course be very opinion-based. — Phrancis 46 secs ago
 
user image
2
Weird place where HTML meets personal development.
 
@Phrancis Looks like it doesn't want you to look for HTML and drops that part.
 
Thank you, I will correct my code. — szabolcsx 37 mins ago
There's 1 VTC and 6-8 comments, still not clear if on- or off-topic...
 
6:52 PM
Maybe it considers HTML a synonym of "soil fertilizer"
which would make sense
Because it's shit
 
@Mast If the same developers wrote the source of the google page, and the search algorithm, that would make sense (hint, look at the source code of google.com)
 
@Phrancis Blame regex.
 
I don't think Codereview is the right place for this question. That board is more concerned with programming style. This is really an issue of how to correctly use numpy, which is meat-and-potatoes for SO numpy questions. — hpaulj 46 secs ago
 
OH EMM GEE @DUGA - THAT IS RARE
 
optimizing code is ontopic though
thankfully, CR is not just about programming style
 
6:57 PM
-3
Q: Improving speed of my code

IwkoI wrote some code in Python: from __future__ import division from numpy import arctan, sin, absolute, log10 from mpmath import * import time imax = 1000001 x = mpf(0) y = mpf(0) z = mpf(0) t = mpf(0) u = mpf(0) i = 1 mp.prec = 128 start_time = time.time() while i < 1000001: i += 1 x = mp...

 
Isn't FORTRAN much more "closer to the metal" than Python/Numpy? Wouldn't it make it almost automatically faster for math calculations than a language with a whole bunch of abstraction and such (at least in theory)?
 
@Phrancis No, the implementation must be completely different.
He's just doing something terribly inefficient.
 
Ah
What's this mpf(n) operation (s)he keeps doing?
 
@Phrancis Transform to mpf
 
> The mpf type is analogous to Python’s built-in float. It holds a real number or one of the special values inf (positive infinity), -inf (negative infinity) and nan (not-a-number, indicating an indeterminate result). You can create mpf instances from strings, integers, floats, and other mpf instances:
 
7:02 PM
Transforming all those numbers is probably very time consuming.
 
I've got 99 problems but floating-point math ain't 1.00000000041.
 
I mean, he's doing 5 e^6 transformations.
 
I guess using plain old native floating point numbers without always converting them to mpf would be much faster eh
 
meh. fortran uses software-based 128-bit precision floating points, so there's that
 
Not transforming versus transforming will always win.
@Phrancis If that would still work it would be way faster.
 
7:17 PM
@Mast LOL
I changed everything to just use the built-in math library and regular floats...
--- 1.2177855968475342 seconds ---
However, at the end, u ends up as nan which may not be expected
Wait, nevermind
 
0
Q: Synonym Request: [smtp] -> [email]

rgchrisI have a review request that pertains specifically to SMTP behaviour and would like it tagged as such so as to be unambiguous and searchable. However I have no objection to such a tag deferring to [email] as the predominant descriptor.

 
If this is working code that you think could be improved, consider Code Review. — jonrsharpe 36 secs ago
Is this real code? It appears that it could be demo/play code, which would be off-topic for Code Review. — Phrancis 50 secs ago
 
Hm, OP pinged my answer saying they needed 128-bit precision, but then deleted the comment (I only saw the push notification on my phone). I guess if that's the case, FORTRAN will be at a definite advantage, no matter how you cut it, if the only way to get this precision is by converting everything
 
@Phrancis If you want to benchmark such weird stuff, you shouldn't do it in Python anyway.
 
Yeah makes sense
 
8:01 PM
If this is working code that you'd like feedback on, see Code Review. If not, what is the problem with it? — jonrsharpe 5 secs ago
 
Everyone behaving themselves?
Microsoft Word 2016 bug prehaps --> ►►► superuser.com/q/1004038/162960
 
Hello.
 
hello
 
Zero-upvote accepted answer:
0
A: Find word in two dimentional array of char

TheCoffeeCupTo expand on @Caridorc's answer: The method suggested is indeed the fastest way to do this type of question. First, you create a method with a two-dimensional char array and a String to look for: public static boolean contains(char[][] grid, String word) { } Then, you implement the pseudocod...

Being robo-santa right now :)
For myself.
 
@Malachi Hey how are ya buddy?
 
8:07 PM
MS Outlook Bug: Right-click file and Mail To... frequently crashes the File Explorer, making the screen go black for a second and reload.
@Malachi Page breaks are working fine for me.
 
This is probably more suitable for Code Review: codereview.stackexchange.com. This kind of question is off-topic here. — rayryeng 55 secs ago
 
0
Q: Basic prime summation

OgoughI wrote basic Python code for the summation of n primes. It works but I wanted to find out how I could improve it and what shortcuts I missed. """ So this program is designed to add up the first 'b' primes ==> Prime number is defined as a number only divisible by itself or 1""" def is_...

 
If your code works it might be more suitable at http://codereview.stackexchange.com/ but make sure to read their How to Ask page so you know what the site there is about. — user3100115 51 secs ago
 
8:27 PM
@Phrancis still waiting for my phone call....lol I will hear from them tomorrow, I have faith
@Hosch250 I restarted word even, and it still doesn't work right
 
@Malachi Good, hope things will go well!
 
me too
 
0
Q: Optimizing over 7 constants in R using the apply function

user3678028Hello Code Review, this is a follow up: to: Optimization over 7 constants, running a function 10,000,000 times And my data can be downloaded at: http://we.tl/J0qBfgnPUY Thanks to a very helpful post by Joshua Ulrich, the function percentcorrect function is now running much, much faster. I am...

 
they will call me tomorrow and ask me when I can start, or they will tell me when training starts (if they decide I need training, which I might, it is something that I haven't done before but know I would be good at)
someone already voted to close that SU question???? why?
 
possible answer invalidation by Deduplicator on question by Antithesis: codereview.stackexchange.com/posts/111515/revisions
 
8:41 PM
@Malachi If the training sounds good, take it.
Even if you could start without. If it's still on the table in that case, try to get it.
Training is good.
 
8:59 PM
0
Q: Using operators in if statement in Python

sabivI need to check for the existence of 10-15 strings in one dict that I'm getting from a list of dict objects (json file). I could implement a working solution, but since I'm just learning Python it's not sure that it works the same way as I think when I'm looping through 5000 obj's. I would really...

0
Q: Binary Search tree deletion optimization

Himanshu VermaI have just started implementing Binary Search tree on my own without using any tutorials online. Please have a look and suggest how can I make code less cluttered and more faster. Right now I am using lots of if-else loops and want to remove them as much as I can. boolean deleteNode(int data, T...

 
@Malachi Works fine here.
 
@CaptainObvious Looks like stub code or perhaps example code....
 
0
Q: C++ parsing CSV file that contains only floating points

ABCtomHi I coded little CSV parser. Well it doesn't work as I expected. I print can out floats but values are incorrect CSV_Parser.h file #include <iostream> #include <fstream> #include <sstream> #include <vector> #include <string> class CSV_Parser { public: CSV_Parser(): vec{} {}; ~CSV_Parser() ...

0
Q: Min Heap Sort using Generics

fox.joshHere is my working code for a min-heap sort using an Array-List. I would like any input as to areas that need additional refining and any areas that are against proper formatting/usage. Although not defined, I was attempting to use an array implementation instead of the Array-List collection as t...

 
go instead to the Code Review SE (I would link you but Im on ny phone), they can probably help a lot more — R Nar just now
This question could be suitable for Code Review, as long as (a) your code works as intended, (b) your code is real code, rather than example code, and (c) your code is included in the body of the question. If you wish for a peer review to improve all aspects of your code, please post it on Code Review. — Phrancis just now
 
9:18 PM
0
Q: How to handle passing two player objects to class

Daniel LeeI am a Pygame newbie and am learning as I go. I would like to become familiar with normal Pygame conventions. I would like you Pygame experts go over my code and let me know if there are any places I should modify my code to follow best practice. The point of the game is to collect as many pill...

 
9:48 PM
Afternoon
 
it's always monking...
 
And it's always the afternoon
 
@EthanBierlein No.
 
Somewhere
 
It's always afternoon somewhere, but it's always monking everywhere.
2
 
9:56 PM
Mast you got a minute?
I am confused about one assignment for university...
 
0
A: Calculating set difference of lists with or without intermediate variables

BrythanI'd prefer public void checkRetrievedIds( List<Integer> expectedIds, List<Integer> retrievedIds ) { Set<Integer> difference = Sets.difference( new HashSet<>( expectedIds ), new HashSet<>( retrievedIds ) ); createInvalidationEvents( difference ); } You're right tha...

 
Zak
user image
4
 
dammit I overwhelmed wolfram-alpha with my text input.
> 10 times 10 to the negative six Volt meters cubed divided by 8 point 854 times ten to the negative 12 Ampere seconds
 
Zak
@Vogel612 Needs clarifying braces, IMO
 
10:07 PM
interestingly when I input the numbers as proper numbers it can tell me what kind of thing this is...
> inverse electric volume capacitance
 
0
Q: Sokoban solving methods

sokobanI am at moment working on a sokoban solver, and trying to plan on how it should work. I have implemented parts of it, but haven't put things together, as I want some feedback on the method, and thereby see if this method would work, or has some major pitfalls. My solver method consist of these e...

 
@Zak 19 tabs is nothing.
When I restore a Firefox session, it opens 10 windows with 20 tabs each.
Eat that Chrome!
 
how...
how do you manage that many things
that would drive me mad
 
Chrome doesn't "restore sessions" because it doesn't crash
 
@EthanBierlein Sort them.
 
10:15 PM
~cough
 
@Vogel612 cough Bullsh!t cough
My tabs are sorted per topic.
One with chats and SE from those chats, one with one project, one with a second project, one with e-mails, like that.
 
@EthanBierlein meh.. there's worse... 5 different terminals simultaneously, 2 IDEs, 3 separate servers running different versions of the same app, plus troubleshooting relevant tabs in chrome (on the order of 15 to 20 tabs) and something like at least 9 open files in the IDE
 
16 windows at the moment.
 
@Vogel612 Fun
I'd jump out the window at that point
 
5 xterms, one putty, 1 notepad++ with who knows how many tabs...
When you got the RAM, use it.
 
10:17 PM
that was "yet another workday" back when the login of our app mixed sessions..
 
@Mast I'm not even sure if my 16GB laptop would be enough to handle what @Vogel612 just described...
 
12GB tower... should be good
 
@EthanBierlein I'm running 8 and mine handles it just fine.
 
and it was less noisy than my colleague's windows machine
 
3 instances of VS13 are heavier than all the FF tabs.
 
10:18 PM
I have 8GB, and my laptop can handle almost anything I can throw at it.
 
@Hosch250 Can it handle a rock?
 
@Hosch250 go render a video somewhen
 
3+ instances of VS and Office application or two, and a browser; video rendering (Premiere Elements) photo editing (Photoshop elements), a browser, Paint...
Oh, and put my Music application into both those scenarios.
 
@EthanBierlein Mine can, once.
 
The only thing that slows it down is Premiere Elements animation.
 
10:21 PM
If your code is already working correctly but you are seeking tips to improve it, you can also ask on Code Review. — 5gon12eder 32 secs ago
 
@Mast wot
 
I may have mixed up the units somewhere...
or do Volt square meters per coulomb become something useful?
 
@Vogel612 Volt square meters can be useful, but per coulomb?...
Are you trying to calculate electric fields by chance?
 
yea... but I seem to have messed up...
 
Those go in Volt per meter.
So you must have messed something up.
Are you following the same course as @skiwi by chance?
 
10:27 PM
we're at different universities, but possible, yes...
it's called "Elektrotechnische Grundlagen" for me...
and it'll supposedly handle differential equations later this semester...
 
I still have a book about those somewhere. Like most things math, it's a matter of exercise. Practice it often enough and eventually it will become clear.
 
yes, I inverted the unit of the Vacuum permittivity!
i think...
 
1
Q: Simulating gravitational attraction between bodies - follow up

Ethan BierleinI've decided to revisit a chunk of code I wrote a while back, and see what I could do to make some changes. As a result, I know have slow, but working piece of code which is able to simulate gravitational attractions between \$n\$ amount of bodies. Like usual, I'm using the formula described in N...

0
Q: Please help me write a program using Parallel Arrays

user90279Write a program that produces a sales report for a salsa maker who markets 5 types of salsa ("mild ", "medium", "sweet ", "hot ", "zesty "). The program includes total sales for all products and identifies the highest and lowest selling product (Assuming each jar is $4). It generates a report: ...

 
somebody help poor misguided user:
are you asking for something specific here? The concepts i've implemented is not an issue, is the way i want to apply them.. for my application — sokoban 5 mins ago
 
@CaptainObvious HAMMERTIME!
 
10:31 PM
@Mast the Position is a Systems Analyst Position (SCRUM Product Owner) I may or may not need training for that. my previous position was Senior Programmer/Analyst so it's not too much of a stretch really.
 
@Mast Oh wow. You scared me for a second. I thought you were talking about my question :P
 
@Hosch250 what are you running?
 
Windows 8.1 back then, Windows 10 now.
 
my laptop only has like 4 GB Memory
 
10:33 PM
8.1 was somewhat faster and more stable than 10, but 10 is getting better.
 
I like 10 so far. this is the only thing I have been having trouble with (Word 2016) so far
but I upgraded this Laptop from Windows 7
and it's an old laptop, 5 years old already....wow
 
Can those automatic updates finally be nuked in Win10?
 
I upgraded from 8.1, but I'm going to install from scratch after this semester.
 
@Mast I think there's a way to turn them to manual.
 
@Mast No, you have Automatic and Automatic + Inform for restart.
 
10:35 PM
@EthanBierlein You happen to have a link with that?
 
let me go looking
 
8.1 had Automatic as an option, but I would use Check + Let me know before you do anything.
I was a bit irked over that, but I use Automatic + Inform, and I've had no trouble.
 
@Hosch250 Well, you can always hardwire the serveradresses to return nothing useful, but that's kind of using a sledgehammer to solve a problem.
 
hmm... 40 Giga Farad seem... wrong.
 
@Vogel612 That's ridiculously wrong
 
10:37 PM
but I found the error in the units :)
 
That's like saying you have a bullet going 100x the speed of light.
4
 
now for the numbers :DD
 
Was it 40 micro F by chance instead of Giga?
 
would rather be nanos, since that's the 9 there
@EthanBierlein no it can't.
 
0
Q: k-d tree duplicate nodes

the big boIn my program the 2D points are obtained by clicking inside the PictureBox and then transformed to nodes with properties: location, left- and rightChild. If I insert 3 points in the PictureBox the resulting nodes list always contains 4 nodes instead of 3, with 1st and 3rd node always duplicating ...

 
10:38 PM
@Vogel612 40 nano is a very small capacitor, almost parasitic.
 
@Vogel612 Mine is "Applied Natural Sciences", the first week just happened to be Electric Circuits
 
@Mast I'll redo the maths from scratch
 
@CaptainObvious ?
 
@skiwi cool. I'm learning about capacitors and electrostatic and electrodynamic fields right now. I think we'll go down to transistors in two weeks or so
 
10:40 PM
@Vogel612 Week 1 stopped at capacitors, which I'm not really understanding with respect to the calculations
I understand what a capacitor does though
 
> Although the metric proposed by Alcubierre is mathematically valid (in that the proposal is consistent with the Einstein field equations), it may not be physically meaningful, in which case a drive will not be possible
 
@Vogel612 phys.tue.nl/nfcmr/natuur/collegenatuur.html those are the topics treated
(Yes, I know that website is awful)
 
@skiwi that seems to get really interesting in week 5 onwards
fluid dynamics are mathematically painful, but really interesting
 
Hmm right, going to be deep into algorithms by then though, so afraid I cannot enjoy physics too much
 
@Phrancis Thanks, I was not aware of the existence of Code Review. There are a lot of stack exchanges. — Ragnar 30 secs ago
 
10:45 PM
@Duga stackexchange.stackexchange.com
 
hmm.... one inverse too many there..
 
0
Q: Visitor Pattern in Ruby

ivanAfter reading about the Visitor pattern, I wrote this example in Ruby, loosely based on a Java implementation on the wikipedia page. The choice between modules and classes felt somewhat arbitrary for some of these components. I mostly stuck with modules, opting for classes only for the car-eleme...

 
hmm... that result is more believable. 177 piko Farad
 
0
Q: Solving a Programming Challenge: Apparatus, from Kattis

RagnarI am trying to solve apparatus problem described here. And I have a solution but it takes longer than 2 seconds which the time limit. I've tried to optimize my code for speed but can't get it with in the 2 second limit. import sys import math for line in sys.stdin: line = line.strip("\n")...

 
11:09 PM
@Mast He got you good:
How about I vote to close yours. j — user90279 7 mins ago
 
what u gonna do @Mast, he's calling u out bro
3
 
Let's delete the question.
 
poof
gone
 
that's not how this should work..
 
The school year is coming to a close!
 
11:23 PM
@Vogel612 huh?
 
just because they don't understand the SE system, we don't have to be jerks
we're not SO
deleting was a "totalitarian knee jerk" reaction.. and yes that is intended to be a hyperbole
 
Well, it's not a great question.
He was notified that it was off-topic.
And he decided to be a jerk about it.
See @SirPython's message.
I think the insta-deletion was justified.
 
I think (s)he was joking. There is an empty j at the end, which might have meant to be part of a jk.
 
or an abbreviation of a handle/name
 
0
Q: Validating an email address in C# to work with an input field in Unity3D

FilipSo I'm making an application in Unity3D, and I need an email to be verified and made sure its valid. I know there is a way of doing it using Regex, and I know that you can use a class called system.net.mail.mailaddress, however, I don't know how to code it so it links up with an "input field" tha...

 
11:44 PM
Also, please don't validate email addresses with regex......
Oh shit, even MSDN suggest validating emails with regex...
   // Return true if strIn is in valid e-mail format.
   try {
      return Regex.IsMatch(strIn,
            @"^(?("")("".+?(?<!\\)""@)|(([0-9a-z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-z])@))" +
            @"(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-z][-\w]*[0-9a-z]*\.)+[a-z0-9][\-a-z0-9]{0,22}[a-z0-9]))$",
            RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(250));
   }
   catch (RegexMatchTimeoutException) {
      return false;
   }
 
You'd figure by now someone would have come up with a library for it or something... or perhaps it's the case that validating email addresses beyond making sure it has an @ that's not the first character, and a . that's not the last one, is about as good as it will ever get
 
00:00 - 18:0018:00 - 00:00

« first day (932 days earlier)      last day (3071 days later) »