« first day (1313 days earlier)      last day (2697 days later) » 

8:00 PM
on hold
 
0
Q: Optimize matlab for loop

floraI have a large matrix and i want to do an exhaustive recherche, but the look took a lot of time. I can't figure out how to optimise it? for k=4963:0.00001:4031 for T=100:0.00001:5000 for phi=0:0.00001:2*pi for IB=1:nb_bloc_total n...

0
Q: Using promises to read an variable length array of npm modules

1252748I'm reading an array (of unknown length) of modules package.json files in order to extract the "style" property and store it in an array of its own: var gulp = require('gulp') , path = require('path') , Promise = require('bluebird') , fs = Promise.promisifyAll(require('fs-extra')); let c...

0
Q: Joint excel/word reporting macro

bdpolinskyI have a functional macro that draws information laid out in a spreadsheet, feeds it into a bookmarked word document, and then prints it out. The versions are excel 2010 and word 2010. The spreadsheet looks like this: Basically laid out in the above manner. The following code which is pointe...

0
Q: Is this a good example of the revealing module pattern when using jQuery?

Antonio OrtizRecently I have been getting into the habit of leveraging the revealing module pattern for all my code \0/. Think the days of writing spaghetti, code are behind me! I used this guide for inspiration but it feels much more elegant. var styleGuide = (function styleGuideHandler() { 'use s...

 
    @Override
    public OptimizeStrategyResult processNode(final ASTNode node, final boolean isLastNode) {
        Expression expression = node.getExpression();

        if (!(expression instanceof MemoryLoopExpression)) {
            return OptimizeStrategyResult.notAccepted();
        }
        else {
            try {
                return OptimizeStrategyResult.finished(createNewNodes(node));
            } catch (UnsupportedOperationException ex) {
                return OptimizeStrategyResult.notAccepted();
Horribly failed while trying to optimize the loop? Just pretend we cannot optimize it!
I should've made a test that checked the output AST of an optimized hello world or something... Now I've got no clue whether it optimized everything
I may have a tab open for it
 
8:23 PM
@JustinTime Thanks :) I deleted the question because it was more a code review for coding style (but code review closed the topic to anyway). — Mathieu Van Nevel 18 secs ago
 
in Cardshifter and other projects, 37 secs ago, by Duga
Refactored the IntermediateCodeOptimizer class to now allow for different optimization strategies instead of them being hardcoded.

Note: There is still an issue with the order of the optimizers, for example: MemoryValueChange and MemoryPointerChange optimizers are not run when a MemoryLoop is being optimized.
It's biiig and I like it
 
Monkernoon
 
Monkermonk
 
Noon? It is already 2:30 here.
 
8:41 PM
@Hosch250, do you live in middle Asia?
 
@Incomputable Middle Asia?
No, I live in middle North America.
Opposite side of the world.
 
@Hosch250 it's 2:45 am in my city
 
It's 2:45 pm in my city.
 
@Hosch250 that's somewhat funny
 
It's close to 16h here so it's afternoon monkernoon =)
 
8:48 PM
I have a whole page written on security in Exchange 2013.
I suppose I can just say etc.
Well, I can't exactly leave out auditing and IRM.
OK, two more paragraphs.
And then I need to write another page or so on compliance.
 
It's 9.50pm here :D
 
And then I need to write about two paragraphs on clients and another two on deployment/migration.
And another two on project specs.
 
@skiwi is it 8th or 7th December in your city?
 
8th or 7th?
Oh, I see.
 
7 December
 
8:51 PM
?
We have three days going on at once?
 
Whoops, typo
I'm trying to read my old pastebin.com/XEC1aAtU NN output, planning to make a new one tomorrow
 
@Hosch250 that would really be strange
 
Aw, I misread the Populist badge. Heslacher is still one vote away because it needs to have >2x.
 
how many bytes you would put as minimum for user space memory block if the header itself is 24 bytes? I've left another 24 bytes
 
8:54 PM
@Hosch250 the furthest apart two time zones can be is 12 hours, so it's not possible to have 3 different days going on at once
 
@Phrancis I know that much.
I was asking skiwi that.
 
Oh sry
 
I'm being an altruistic benefactor by getting votes on that post.
 
@Phrancis Not true.
UTC+14:00 is an identifier for a +14 hour time offset from UTC. This is the highest time zone, meaning that areas in this zone are the first to see a new day, and therefore the first to celebrate a New Year. UTC+14 stretches as far as 30° east of the 180° longitude line and creates a large fold in the International Date Line. == As standard time (all year round) == === Oceania === Kiribati Line Islands - including Kiritimati (Christmas Island) The IANA time zone database zone identifier is Pacific/Kiritimati. == As daylight saving time (Southern Hemisphere summer) == === Oceania ===...
 
@Phrancis depends on your definition of "days" and what your time zones are. if you're on Venus, 1 day is 116 Earth days and 18 hours, so it's technically possible to have 3 different days going on at once. you need to be more specific. "on Earth".
oh dear, I'm wrong
 
8:56 PM
Uh, that's, um, new.
Wait, isn't +14 the same as -10?
 
Yes, but with a different date.
 
@Hosch250 no. Direction matters
 
Peculiar.
 
These kinds of questions should be posted on codereview, not SO. — Kayaman 51 secs ago
 
by the way I saw an unregistered user popping up old question to the active pane. Did anyone see him as well?
 
8:59 PM
@Incomputable Approved edit, most likely.
 
is it possible to use desktop pc as a cloud service? My laptop is too slow to write something serious
 
0
Q: k means clustering algorithm

shalini import csv import numpy as np k=2 def kmeans(data, k): clusters = [[] for i in range(k)] centroids = [] centroids = randomize_centroids(data, centroids, k) old_centroids = [[] for i in range(k)] iterations = 0 while not (has_converged(centroids, old_centroids, iteration...

 
@CaptainObvious Jamalized
 
Oh dear, Heslacher won't get his Populist if no one upvotes him.
 
@Incomputable Use a Remote Desktop session
 
9:13 PM
@skiwi university internet has high ping, so I guess it will be less comfortable experience that it was before :P
so bad that there is no supercomputer to which we can just connect and draw horsepower. Having a subscription and a client machine would be much better than carrying laptop
 
Nice :)
Two populists rewarded today. That's a record.
Although, it has been rewarded twice in July 15 in two separate years.
That's one thing we can't have three of at the same time.
 
IIRC only one populist badge wasn't helped with chat-votes
 
Out of all 20?
I'm nowhere near that one.
 
hmm maybe not. I guess my data is outdated :)
 
BTW, can someone describe Tenacious to me? I just don't understand the rules for that one.
 
9:24 PM
wow, we got 20 of those awarded?!
 
Just 3 tenacious.
And 1 unsung.
 
[badge:tenacious] is [very] poor man's [badge:unsung-hero]. i.e. not sure we'll see many of those around here.
 
Tell it to the judge ;-) You need to use Code Review for this codereview.stackexchange.comKitson88 55 secs ago
 
20 Populists.
@Mat'sMug I know. I just want to know the rules.
 
Quick question for infosec guys from here: let's suppose we have four strings and they're somehow related (but we don't know how). Is there a way of finding the algorithm that was used to get 'em ? ^^
 
9:25 PM
it's what the description says..
 
One of the people from my work was found deceased in their home today. Sad day.
 
@EBrown ouch
my sympathies
 
The description is contradictory.
 
He was a cool guy, old as snot but cool.
 
It says "0 score accepted answers", which means 0.
 
9:26 PM
make that 0-score answers with a checkmark
 
Then it says more than five answers posted and less than 20% of posted answers.
 
@Mat'sMug Thanks.
 
So, 0 answers with a checkmark.
 
Anyway, everyone have a nice day.
 
So, anyone with five answers and none accepted?
Oh, no.
0 score means unvoted.
 
9:27 PM
if you posted 100 answers, and have less than 20 with a checkmark and 0 score, you get the badge
minimum 5 answers posted
 
So, 5 unvoted, accepted answers, and 25 posted?
 
"less than 20%" might be misleading
I suspect it's actually "less than or equal to"
 
> Zero score accepted answers: more than 5 and 20% of total
That is equal.
 
ah
so you must have more than 5 answers with a checkmark and +0 score, and these 5 answers must be at least 20% of your total number of answers
 
2 mins ago, by Hosch250
So, anyone with five answers and none accepted?
 
9:29 PM
whatever. you're not getting it anytime soon
 
Nope.
I'm not sure I want it.
If I get it, I might as well quit the site.
 
you want it as much as a tumbleweed
 
I think it would be hard to get it even with multiple accounts.
At this stage in the site, anyway.
 
depends
I earned [badge:tenacious] on SO a while back
 
SO doesn't vote.
 
9:34 PM
lurk in tags nobody looks at
 
And if they do, they vote down.
 
or to close
 
@Mat'sMug Like Clojure? That would be the surest way to not get it because they are such old zombies.
 
IDK.. IMO you're right, it's near-impossible to get it on CR.
 
Last two were rewarded in '13. That ought to tell you something.
SO has 6 Unsung rewarded in the last 24 hours.
And 13 Tenacious.
 
9:39 PM
1
Q: From a string of 3 numbers to 3 integers

LudI solve some puzzles to learn Rust. A problematic I faced is to turn a string of 3 integers into 3 integers. I succeeded with the following example: fn main() { let mut it = " 455 123 42 ".split_whitespace(); let (a, b, c) = match (it.next(), it.next(), it.next()) { (Some(...

-1
Q: Pregenerated sample code

DaImToI am generating sample code to go along with the Google .NET client library. I would appropriate some feedback on the code that my application has generated. I will be releasing the sample code on Github once it's stable. Ideally, this code should be best practice type of thing. A lot of what is ...

 
This is not a regular question, it is a press release. codereview is not a good place for it either. If the only question you really have is "What should I improve" and you've only added it "To make this a question", it's going to be too broad for any StackExchange site. — Don't Panic 37 secs ago
 
@Hosch250 and >10,000,000 questions
 
@200_success I stand corrected, merci =)
 
I suppose @Don'tPanic is right. Dumping your code on Code Review would most likely have the same response as SO. For CodeReview, you could technically ask users to look at various elements of your code if you feel it could be improved. But as for marketing your Framework, I'm afraid this would need to be done elsewhere. — Kitson88 32 secs ago
 
9:50 PM
0
Q: Determine if a string is permutation of another string

denisI've made a short program to determine if a string is permutation of another string private static void Main() { string a = Console.ReadLine(); string b = Console.ReadLine(); Console.WriteLine(IsPermutation(a, b)); Console.ReadKey(); ...

0
Q: Loop combinations of byte for poker simulator

PaparazziThis is going to need some explanation. In (this) poker you have 2 hole cards and they are combined with 5 shared cards on the board. Each player makes the best 5 card hand from the seven. Believe it or not that is over 2 billion runs to do them all. Trying to create statistics for 2 known h...

 
going to try emacs. Rip clion
 
@Incomputable does clion have a community edition ?
 
@Dex'ter, yes. I strongly recommend forgetting about it and never recalling back
 
Just got my 57th C# answer in. 23 answers and 69 votes away from a silver badge.
 
even Microsoft Visual Studio is much better
 
10:00 PM
gcc and g++ is all I need
^^
 
@JeroenVannevel But I'm not even a junior yet
 
@Dex'ter I've thought that way as well, but you encounter CLion you will change your mind
 
@skiwi me neither
 
@JeroenVannevel I don't have a degree yet
 
@skiwi I think I'm the "competent" level, and I've never held a position.
@Incomputable Me either, but I'll get mine next May.
 
10:01 PM
technically I'm grad but my boss is pitching me as the future teamlead of the future platform team
which he and I will set up in a few months
 
Nice.
 
@Hosch250 I have 7 more semesters to go
 
It'll come :)
 
@JeroenVannevel Wow that's very nice
 
@Incomputable I don't get it. First you said to forget about CLion and then you said: but you encounter CLion you will change your mind
 
10:02 PM
I'm hoping to get closer to securing my first job tomorrow :0
 
BTW, @JeroenVannevel, what's a "novice" who doesn't follow any rules because they don't know there are any to be followed?
 
I interpret that as a person who just has never coded or only at a very basic level
 
@Dex'ter, I meant the message when you said you need only gcc and g++
without automatized build system compiling anything is hell
 
@skiwi yeah it is. I've been working my ass off though -- shitload of tools written, people mentored and other activities on top of my day-to-day tasks
 
so, I should use CLion ?
 
10:05 PM
Singlehandedly wrote the entire telemetry platform which the entire company will now start relying on for monitoring of all our apps
 
@Dex'ter no
 
stuff like that gets you noticed
 
@Incomputable That's the answer I was looking for ^^
 
@Dex'ter I used it, I liked it. I liked it more than PyCharm for sure
 
@Peilonrayz it gets useless when you'll start using some metaprogramming, complicated boost stuff aside
 
10:06 PM
@JeroenVannevel I'd hope so ;)
 
@Peilonrayz hmm did you also start looking into C/C++ ? Niiiceee, I feel dumber now
 
@Incomputable And those are just words to me, ;P
@Dex'ter Yeah, I still need to pick it up, but I have 2 linked list questions, :P I'm in no way good at them
 
@Dex'ter use it if you have no idea about C++. If you want something more serious, you will need to get to the dark side
 
@Peilonrayz Hey, you have me beat. I don't have any linked list questions.
 
@Incomputable Let's say I've got the basic stuff covered. I'll just have to dig into the OOP world of C++
 
10:08 PM
@Hosch250 They're quite cool, kinda like binary trees, but without the binary, XD
 
@Dex'ter OOP is the smallest part of the C++
 
I know what they are, but I've never written one.
 
Ah sorry, ):
 
I think that linked list is a step back. Contiguous containers are much better: easier to write, easier to understand, easier for compilers/CPU to optimize. And linked list is like none of those
 
@Hosch250 Linked lists were just a pretext for teachers to give us more meaningless homeworks
 
10:12 PM
Linked lists are very useful for O(n)-performance
 
linked list is stuck between being a tree and being a container, and ended up being nothing
 
it's a pretty good queue with unlimited size...
 
@skiwi if the measurements say so, why not. But the thing is that when using, for example std::vector, it will take the same time to write
and it happens to be faster most of the time due to fragmentation
 
@Incomputable Huh?
 
@skiwi I never consider algorithmic complexity to be meaningful enough claim about performance of the whole system. If it is an algorithm, then probably yes
 
10:14 PM
I like circular doubly-linked lists.
They are kind of like infinite loops.
The OP seems to disagree with this: codereview.stackexchange.com/a/149247/34073
Anyone want to vet my answer?
 
@Incomputable Your whole system consists of algorithms
 
@skiwi asymptotic complexity abstracts away modern computer, on which those algorithms are actually run
 
@Incomputable No, it's always relevant
 
if you want to argue more, we can move to another room. I really want to prove that asymptotic complexity is useless after some extent
 
but you can argue here
 
10:18 PM
But in some specific cases (where certain sizes don't hit certain thresholds), a say O(n^3) algorithms can be faster than a O(n^2 log n)
 
@skiwi that stupid big-O complexity resulted in people using LinkedList over the whole mess of that stupid Java program I was asigned to work on.
and it's horrendously slow as heck
@skiwi for large enough constant factor that's exactly the problem of big-O
 
@skiwi, it's not about algorithmic complexity at all. I'm saying about algorithms that have the same complexity but tremendous difference in performance. Big O is useless on really fast software
 
I've always heard that big-O stuff typically doesn't work like that IRL.
It really depends on the system, such as how caching works, where data is stored, etc.
 
@Incomputable You seem to not understand Big O then
 
@Vogel612 Is the LinkedList used because you need to add/remove items in the list? Yes? Probably a good design, but still debatable. No? I don't see how it would be a good decision in any case
 
10:19 PM
@Hosch250 algorithmically it's usually a halfway acceptable measure
 
@Vogel612 Algorithmically, yes, but you have to test it before saying it is actually faster.
 
@skiwi LinkedList used for everything
even number crunching
 
@Hosch250 As far as I'm aware on last year of uni there was a trend of new algorithms that take cache sizes etc. into account
 
@Hosch250 some algos can't be improved beyond a certain threshold
 
@Vogel612 Of course.
A simple iteration algorithm can't get faster than O(N).
But depending on the size of the list and how the system handles lists and the type of storage structure being used (array, list, linkedlist, whatever), things can wildly vary.
 
10:22 PM
@JeroenVannevel I don't think you have encountered such situations then. Try to watch this, and you'll understand what I'm talking about
I'm not claiming that you should write assembly. Just write more CPU friendly code
@Hosch250 actually linear search can get faster sometimes, but slower in others.
 
Your code can be as CPU friendly as you want, you won't cut it with an O(n^3) algorithm
 
@Incomputable That's exactly the worst idea you could possibly argue for, you first need to choose the fastest algorithmic way, and then only when you get performance issues or spot critical sections that can be optimized a lot then you start to look at the actual runtime
 
@JeroenVannevel I'm not saying big O is entirely useless. It is useless after some extent
 
what extent?
Can you back any of this up with actual specifics?
 
@JeroenVannevel, measured extent
 
10:25 PM
This is what I mean
 
@JeroenVannevel, what specifics you want?
 
You're spewing bullshit fancy terms
 
ok man, if you don't want to listen, don't
 
You're not saying anything, there's nothing to listen to
linking a 1h youtube video is not "backing up your point"
 
@JeroenVannevel, tell me what citation or reference you want then
 
10:28 PM
Give me an example where you had an O(n^2) or worse algorithm under heavy load (give load specifics) that was improved by introducing cache locality
 
@Incomputable It's not about citation or reference. It's about facts. Sustainable facts
 
@JeroenVannevel I'll write it up and post it when I'll finish with it. It's going to be answer for my old unanswered matrix class. I'll ping you when I'll finish
 
I'll tell you right now: you don't have one, because you've never been in that situation yet. Instead, you are extrapolating an entirely artificial assumption out of a talk at a conference that most likely did not intend what you thought it did
lol
your matrix class is not "heavy load"
 
ok, let it end here. I give up
 
I've seen pages on our website drop in performance during peak moments when we have 100k requests per second coming in and investigation sometimes revealed nested loops
cache locality does not solve that
A better Big-O value does
 
Big-O is an indication of how well a piece of code performs when it's put under stress. The kind of optimization you refer to is a micro-optimization in comparison to a better Big-O complexity
 
10:49 PM
Down to three sections of my paper, and the diagrams.
6 pages done, probably about 2-3 to go.
 
@JeroenVannevel, can you recommend any books on discrete mathematics? I guess that I need it for proper analysis
 
@JeroenVannevel please watch your tone a little.
sidenote: what big-O is this?
    for (int i = 0; i < samples; i += buffer.length) {
        for (int j = 0; j < 20; j++) { // generate 10 waves into buffer
            sign *= -1;
            // fill from the jth wave-half to the j+1th wave-half with volume
            Arrays.fill(buffer, waveHalf * j, waveHalf * (j+1), (byte) (volume * sign));
        }
        dataLine.write(buffer, 0, buffer.length); //
    }
(assume buffer.length = 20 * waveHalf)
counting loops is an incorrect approach for O notation
 
Especially if those loops have the potential to break early.
 
also the comparison of LinkedList vs. ArrayList is not even remotely related to Big-O notation. The much more stressing issues with these two data-structures are cache-locality and maybe a usability factor for certain purposes
 
Maybe the worst-case scenario is slightly worse than needs be, but the average case scenario is much better.
 
10:58 PM
it's more complicated to write an efficient queue with an array(list) than it is with a linked list. the benefits to doing so come from cache locality though.
 
I still want to write an ASM sieve exploiting cache locality
I wonder if it really matters there
So looping over the whole range at once vs looping over cache sized blocks
 
Kaz
@skiwi I would say that the purpose of stars is to highlight things that you think other people in the room would want to see and/or to denote things that you think deserve to be, upvoted, for lack of a better term. In here, that's often things that are meant to amuse, but occasionally also inform and to lend weight to a sentiment.
9
A: My God, it's full of stars

Adam LearWhoops, yeah. The limit was temporarily lifted the day after the US election and we intended to put it back... and then evidently forgot. I'm "putting that thing back where it came from" as we speak. Thanks for the report!

So, the star limit has been gone for a month and it took me until now to notice...
 
11:15 PM
In other words, it was to help Clinton fans feel better. Just like cancelled midterms, etc.
 
@Hosch250 like curved grades!
 
</politics>???
 
Can someone please check my big-O calculation here: codereview.stackexchange.com/a/149247/34073? I'm kind of confused :/
 
@Hosch250 seems right .. count is linear search, so you got N^2
 
Yeah, I accidentally had 2N + 1 at first.
 
Kaz
11:24 PM
@Hosch250 looks good.
 
Are you asking for a solution to a problem, or are you asking for a code review? — Taplar 1 min ago
I'm voting to close this question as off-topic because the user appears to be asking for a code review and as such is more apt for codereview.stackexchange.comTaplar 36 secs ago
 
11:41 PM
Can I cancel a flagged answer from mobile?
 
you should be able to. not from the app tho
 
Ok, btw
0
A: Why filter() after flatMap() is "not completely" lazy in Java streams?

user3380739I agree with other people this is a bug opened at JDK-8075939. And since it's still not fixed more than one year later. I would like to recommend you: AbacusUtil N.println("Result: " + Stream.of(1, 2, 3).peek(N::println).first().get()); N.println("-----------"); N.println("Result: " + Stream.o...

Check that user, I think the spam flag was wrong... but isn't he kind of spamming?
(It's SO)
 
disclosed affiliation ... not sure what the problem is ..
 
He's spamming his tool on all questions he can find, that's my problem with him
 
11:50 PM
Somehow this annoys me, Rubberduck answers don't annoy me in the slightest though
 
Wingdings is a wicked font :/
 
Kaz
@skiwi It could do with being a bit more fleshed out.But I'd put it under "Not the way I'd d it, but not breaking the rules"
 
@Hosch250 Wow that's so far-fetched... lol
 
Two pages of promotions for AbacusUtil and a couple other things he's done.
 

« first day (1313 days earlier)      last day (2697 days later) »