« first day (1305 days earlier)      last day (2715 days later) » 
00:00 - 19:0019:00 - 00:00

7:02 PM
@Mast Oh no, I don't mind :). I'm trying hard to be very good at what I do too, and I realized two or three days ago that reviewing code may help a lot. CodeReview looks great so far.
 
I believe I can also optimize quite a lot of my ADD statements in Assembly I just realized that they can take operands from memory
> $ hello-world.exe
Hello World!
:D
 
@DanLyons Are they for real?
 
Hmmm... After adding these optimizations the Mandelbrot program stopped working
 
Programs stopping to work is not an optimization.
7
 
7:18 PM
Does anybody feel like verifying my optimized Mandelbrot AST, or verifying the ASM code to find the infinite loop?
No? Cool. Neither do I.
 
Monking!
 
Monking
 
Monking
 
Monking
 
At least the good news about Mandelbrot is that it doesn't print anything at all, so it didn't stop in the middle of the program
The bad news is that the first output happens on line 5048 of the AST...
 
7:23 PM
Have fun debugging.
 
I did just spot a loop at the start that just increases the memory pointer by 9... Though it stops as soon as it reads a cell that is zero, but I have a feeling that it is not intended
Actually the old code was already doing that, I don't know why, but it was
 
7:35 PM
Maybe this is the right moment to make my code debuggable, but I'm not quite ready yet to give up
 
possible answer invalidation by Evus on question by Evus: codereview.stackexchange.com/posts/148422/revisions
 
@Duga no invalidation happened.
 
Hmm... to optimize a loop I store a value into a register, and then base my next actions on that value
Now if I optimize a loop nested inside a loop then for the outer loop I store that value in a register, then in the inner loop I store a value in the register and use it, and then in the outer loop I use that value again
But it's not the same anymore
 
Did something else touch it?
 
Except I think I explicitly forbid this from happening :/
 
7:46 PM
At risk of stating the obvious: that's not what it looks like.
 
I don't think this is the issue, looks like this is correctly forbidden
 
Here is an example of how I improved the performance of a PHP code to run like hundreds of times faster. I hope it gives you some ideas codereview.stackexchange.com/questions/62233/…Havenard 28 secs ago
 
Just checked and this case is handled well
Now I don't know what's worse, infinite loops or undefined behavior
Actually, a BF self-interpreter is also broken, so that's some good news
 
@Phrancis Got an auto-email from SO last night: position filled. (After a month or something of waiting.)
 
Fibonacci, FizzBuzz and Hello World are not broken though :/
Mandelbrot never ends and the self-interpreter doesn't do anything, so I'm guessing something is off-by-one
 
8:01 PM
> Two most difficult things for a programmer: 0: naming things; 1: cache invalidation; 2: off-by-one errors.
2
 
@EBrown You've got an off-by-one error there.
And interestingly enough, off-by-one errors aren't that hard to avoid.
 
possible answer invalidation by Jamal on question by Evus: codereview.stackexchange.com/posts/148422/revisions
 
finding them may be difficult sometimes
 
@Vogel612 Yup.
Especially when converting between VB's 1-based indexing and C#'s 0-based indexing.
I caught a bunch of those when I was working on RD.
Like the time three points of a selection (start line/column and end line/column) were adjusted, but the fourth wasn't.
That caused a bunch of "bugs" until I traced it to the source.
 
LUA is also 1-based, threw me off a couple of times.
3
 
8:14 PM
2
A: Can I force Lua's table indexing from zero?

gwellI think that that Lua already has the feature that you need to make it 0-based. Unfortunately the feature that I refer to is Lua's open source license. I was unable to find a patch or fork of Lua that changed the 1-based nature of the language. Unfortunately forking Lua to change it to 0-based ...

 
SQL is 1-based, I'm not a big fan of it
 
From lua.org:
> You can start an array at index 0, 1, or any other value
5
 
Oh, right, that made it even worse.
 
I basically stopped reading right there.
 
yea vba can do that too...
2
redim preserve (array from 20 to 2005)
so the first index where there's an element is at 20 ...
3
 
8:18 PM
It's refactoring like any other. Any time you have an inflection point like that it makes the JSX that much harder to read. For trivial stuff, like in this case, as long as it's limited only to the expression involved, I might let it through a code review, but only if other duplication is removed. — Dave Newton 31 secs ago
 
actually the syntax is redim preserve array(20 to 2005), anotherArray(-12 to 2)
that's why you iterate from LBound(array) to UBound(array)
be glad vba designers didn't have the mad idea to allow setting step size ...
3
 
@Vogel612 So, the 19 elements in front of it are undefined?
 
no... there are none
 
Making the 20th the 0th in effect but not in code?
 
8:24 PM
@Vogel612 Thanks for the idea.
VBF
4
 
@Mast actually the other way round
 
Why would anyone want that :/
Cool, I've rewritten my code and now even Hello World doesn't work anymore
2
 
0
Q: python script to store nd array into images

user288609I am trying to write a generic python script that do the following types of tasks 1) load npy file (the npy file is of shape (m_samples, channels, row, column), which corrspond to m_samples images, and here the channels are always 1 2) check whether a given path exists 3) Iterate against the n...

0
Q: Pokemon battle simulator

fudgeHey I learned Python and Pygame and now have coded a few games. For the last few months I have been working on this "luck free" pokemon battle simulator. I feel my program runs well in the current state and at the same time is being semi spaghetti-coded because as I try to improve the game I find...

0
Q: Only using randint, create a random list of uniq numbers.

SimonThere are many sorting algorithms, how about unsorting algorithms? I made this up with : def get_un_sorted(limit): numbers = list(range(limit)) shuffled = [0] * limit for i in range(limit): index = randint(0, len(numbers) - 1) shuffled[i] = numbers[index] num...

 
I fixed Hello World! And now Mandelbrot is back in an infinite loop again
I think I did fix a very obscure bug by this partial rewrite though
 
8:31 PM
@Vogel612 yet Option Base 20 is illegal ;-)
monking!
 
Monking.
 
Monking
@Mat'sMug what's the latest SE stance on you retiring as mod? When will there be an announcement on meta?
 
no feedback whatsoever
 
Are you retiring? :o
 
0
Q: Should we stay opt-in for Winter Bash 2016?

JamalIt's that time of year again! This year's event will run from December 19th to January 8th. More information on this and individual hat-earning progress will eventually be posted here. Once again, this is an opt-in year, meaning that we don't have to do anything if the community agrees on part...

 
8:39 PM
I pulled a prank on my girlfriend. I said "I resigned". We're buying a house, just got the financing approved. Her face went white. Then I said "as a moderator on Code Review". She hit me. I guess I earned it. but yeah, ..I need to slow down SE activity and focus on my dayjob and my family.
2
 
@StackExchange YES!
I thought you were married.
And serves you right :)
 
@Hosch250 don't tell her, but I'm planning to fix that :)
5
 
@Mat'sMug Wow, sounds like she wasn't too happy with that :P
 
Just hope she isn't like rolfl's wife and watches you here.
That would be funny.
 
Maybe she's already a CR user
 
8:42 PM
no chance
 
@Mat'sMug so don't pin this message?
 
lol
 
@StackExchange That time of year again? Nope, not time to review the contact data for my domains...
 
resigning?
 
@Mat'sMug @SimonForsberg Either of you want to hammer this answer? codereview.stackexchange.com/a/148456/34073
Ready, set, go!
 
8:45 PM
@Hosch250 Nope.
It's community wiki.
 
Oh.
OK.
 
I don't see a reason to remove it.
@200_success made it CW after the last flag.
 
@Mast I actually tested the issue with register overwriting again, this time by creating a copy of the ASM code and manually replacing the push and pop of the stack in it, and still bugged
 
OK. Anybody want to re-review this? codereview.stackexchange.com/a/148397/34073
 
I did maybe find something else though
 
8:46 PM
can a moderator change that answer to a new question?
not much there though
 
@Malachi Nope. And there's no reason to do so either.
 
@SimonForsberg agreed
 
It isn't really a new question, but it just seems to be NAA to me.
 
I'm pretty sure I optimized an overflow/underflow away in my program
 
I need to get a question with a punny title written to post the first day of WB.
 
8:48 PM
Consider a cell with value 255, loop mask is [3, -1, 3], that will be optimized to adding 3 * 255 to the cells to the left and right
 
I need just a little over 400 rep to get to 15k.
 
Normally it would add 3 255 times, now it first multiplies 3 * 255 and then adds that to the current value
Now I only need to be prove that I'm correct in being wrong
4
 
@skiwi Mathematically, that should be the same.
 
@Hosch250 Trying to figure that out if it's also the case in Assembly
@Hosch250 Looks like you are correct :/
So that's neither the bug then
 
-1
Q: How to advance in programming?

user7227568What are good ways to advance in programming? I'm familiar with object oriented programming. I know the difference between value type and reference type. I know the basics of how to rewrite my code so it is easy understandable and readable. But i don't know how i can advance from here the best no...

 
8:55 PM
@CaptainObvious Off topic.
 
How about reviewing other people's code, right here on this site? — Mat's Mug ♦ 6 secs ago
 
Wait! I see something very obvious now
So the number I multiply with can be negative, but I'm doing unsigned arithmic
 
0
A: Should we stay opt-in for Winter Bash 2016?

Hosch250Playing Devil's Advocate here. We shouldn't wear the hats because it reduces the quality of contributions to the site, encourages gaming activity, and generally increases fun and reduces seriousness on the site.

I'll be surprised if I get a single +1.
:O I got it.
 
Kaz
@Hosch250 be surprised ^^
 
@Kaz You don't like WB?
 
Kaz
8:58 PM
@Hosch250 I love it. Doesn't make your points any less valid.
 
> encourages gaming activity, and generally increases fun and reduces seriousness on the site.
it's kinda the point
although, lesson learned on "gaming" from last year
 
@Mat'sMug What happened last year?
 
@Hosch250 10K+ link
 
Oh, lol.
 
whether I have a diamond or not this year, that ain't happening again
 
9:04 PM
They won't have that one again.
 
I'm an idiot
#!/bin/sh
# Kinda hacky since this relies on this website being up!
# $1 is a destination file for the dump.
curl fuzzwork.co.uk/dump/postgres-latest.dmp.bz2 >> $1.bz2
if [ $? -ne 0 ]
then
  echo "didn't download the postgres dump for some reason. inspect output and retry" >&2
  return 1
fi

bunzip2 $1.bz2
rm $1.bz2
I was wondering why this wasn't working. bunzip2 does the rm for you
=.=
...carry on
 
This is getting even better... I'm potentially working with negative numbers, but changing MUL to IMUL did not change anything... Now I realize that the sign bit is always the MSB, MUL/IMUL doesn't store the result in the AL register (8-bits), but in the AX register (16-bits), but I'm always using only the AL register, so I completely dropped the sign bit there
 
some more assembly required
5
 
comes with a hex key
4
 
The puns are real ;)
 
9:16 PM
Easy fix: HOL the BRK with a couple of HYPS and you can avoid it altogether
 
the hardest part is finding a parking spot. right?
 
@JeroenVannevel I read the upper case acronyms like the swedish chef from muppets :/
what do you call a VM with a GUI? Nearly headless nix. (ty @ARedHerring_)
someone liked my pun >.>
 
LOL, I get that even if I don't HP.
This guy needs encouragement:
Thank yout for the useful advices,i'm studying java by myself so it's very difficult to avoid certain bad practices when i don't know what is good or bad.I posted only the server side because the client code is very similar.I probably thought that it wasn't that bad also because i'm able to send and receive messages from and to multiple clients.I've been studying java for a year now,maybe it's not something i should do. — TomCa 7 mins ago
 
0
Q: (D3D11) SetConstantBuffers wrapper

Alkis LekakisI've been structuring my low-level renderer for my little d3d11 framework. Here is how I plan on setting constantbuffers, can you see if I am doing something wrong here? This is part of a stateless renderer. void Graphics::SetConstantBuffers(uint32_t inStartSlot, const std::vector<ConstantBuffer...

 
9:25 PM
0
Q: How to do the opposite of sign extend from a 16-bit register to a 8-bit register?

skiwiI'm working with x86 Assembly and I've come accross the need to use the MUL instruction. My code fragment used to be this: mov al, <some_number> mul bl add al, [edi] mov [edi], al Where the <some_number> is a constant defined outside this Assembly fragment, it can be positive or negative. The...

 
Kaz
@Mat'sMug Not 10k, but I'm guessing the meta monkey?
 
yep
 
Apparently I'm wrong there, anyways gotta go afk, that means the bug is still there :|
 
9:51 PM
Seems like I'm storing a signed number while all my code will assume it's unsigned
 
Hmm, I think I've reached the fastest 7k views ever with this
 
the abbreviated, auto-scaling sha-1 feature is neat
 
10:12 PM
cool, thanks @arda :D
I would like the PS1 that the gifs have on that page.
 
10:24 PM
> so the odds of it happening in 8 consecutive years (starting with this year) are 1 in 2^160.
does that account for "this year" being almost over?
 
I mean, you can do math
 
0
Q: Edit a Label on a double click

PlotTwistvar oriVal; $(".test").on('dblclick', 'label', function () { oriVal = $(this).text(); $(this).text(""); $("<input type='text'>").appendTo(this).focus(); }); $(".test").on('focusout', 'label > input', function () { var $this = $(this); $this.parent().text($this.val() || oriVal)...

 
Kaz
@Mat'sMug That's only ~10^16, doesn't seem big enough.
 
10:48 PM
1
Q: Linked list to manage a class

xmitzI'm working on a linked list to save the information of students. I can insert anywhere on the list, delete and sort it. Now im reviewing the code to try to simplify it somehow. I dont know if the .c's and the .h's of the project are correctly arranjed. The program complies and runs as it shoul...

 
I make a living partly from people who can't follow simple instructions.
7
 
don't we all :)
 
Brainoverflow
I'm getting to hit myself for this later on...
//TODO should also do something with the data of something else
 
11:01 PM
boolean isBelowAllNonNegative = loopChangeMask.getMask().subList(0, loopChangeMask.getBeginIndex()).stream().allMatch(i -> i >= 0);
boolean isAboveAllNonNegative = loopChangeMask.getMask().subList(loopChangeMask.getBeginIndex() + 1, loopChangeMask.getMask().size()).stream().allMatch(i -> i >= 0);
if (!(isBelowAllNonNegative && isAboveAllNonNegative)) {
    continue;
}
There, "fixed" my problem.
 
I'm applying at Balsamiq.
 
To bool or not to boolean.
6
 
I hate cramps in my hand.
 
@Luke That may, or may not, be the question ;-)
 
11:41 PM
0
Q: type compatibility with trigonometric SIMD intrinsics

A.nechiI thought that it's possible to apply SIMD variants to enhance the performance for a twiddle function, But, I 've got some errors that I did not quite understand, this is the code : void init_twiddle(int N) { int i; float Tconst; __m128 const_vec; Tconst = 2.0 * PI /(float)N; cons...

0
Q: Basic frontend code structuring

beckahI've always kind of modge-podged frontend code together and I would greatly appreciate any critiques. Before submitting, I tried to alphabetize my CSS code, use shorthand elements in my CSS, and comment the best I could. The things that I'm looking for feedback on include: CSS Readability/ va...

 
@CaptainObvious OT-broken.
 
@CaptainObvious broken or pseudocode or whatever
 
11:53 PM
0
Q: JSON schema using Java objects

mayooranI have this JSON schema: { "name":{ "first":{ "attributeValue":"firstName", "attributeType":1, "dataType":1 }, "last":{ "attributeValue":"lastName", "attributeType":1, "dataType":1 } }, "age":{ "attributeValue":"age"...

0
Q: How to prevent repetitive random numbers

Frank LeeThis is what I have so far. I want to make sure that the previous numbers would not show up again. function Randomize4() { var myVariable4 = document.forms["pick4"]["MaxValue4"].value; var max=myVariable4; var random = Math.floor((Math.random()*100)+1); document.getElementById("results4").inner...

 
00:00 - 19:0019:00 - 00:00

« first day (1305 days earlier)      last day (2715 days later) »