« first day (945 days earlier)      last day (2276 days later) » 

12:00 AM
Using double, integers exceeding 2^53 cannot be represented exactly, as is well known. However, it seems to be true in general that they are represented as integers (check mod(1e100,1)), even if not the correct integers (check 1e100==1e100-1).
That seems to make sense in terms of the internal representation as exponent and mantissa. But is it documented anywhere?
 
I'm pretty sure everything about doubles is documented
 
@LuisMendo Not all integers can be represented exactly, but some can. There can only be 53 significant bits. Take 2^54+2^53 for example.
It's epsilon, just like numbers with fractional parts, it's just that epsilon is an integer now.
 
@beaker But that's an integer (albeit not the correct one), that's my point
>> mod(2^54+2^53,1)
ans =
     0
I was trying to find some "big integer expression", like say 1e100+1e50, that produces a non-integer when represented as double, but I can't find any. All give mod(...,1) equal to 0
 
mmm... i'm still not sure what you're getting at
 
(OP now significantly changing the question, grrr!)
 
12:10 AM
log2(1e100) = 332, log2(1e50) = 155. 332 - 155 >> 53.
therefore the 1e100+1e50 == 1e100 after conversion, right?
 
I was expecting to ramdomly type things liks 234234234234234346465 and get a non-integer as its double representation. But all are integers, in the sense that they don't have fractional part
@beaker Yes, exactly
 
for large numbers like that, they can't have a fractional part, because epsilon > 1
 
and because that epsilon is an integer
 
exactly
 
The mantissa just doesn't have enough precision to go "beyond" the number of figures dictated by the exponent
 
12:16 AM
right, you've got a sliding window of 53 bits, and once that sliding window goes to the left of the radix point, your number can only be an integer. there's not enough precision to put any bits to the right of the radix point.
 
(and no reason)
even if it were possible, entering a literal integer would probably still give you a (possibly different) integer
the additional info now is that you can't represent large non-integers even if you wanted to, right?
 
there are some large integers you can't represent like 2^100-1 because the 1 is outside the 53-bit precision window
oops, gotta run to dinner... be back later
 
have a good one :)
 
@AndrasDeak Yes, that's news to me, although it totally makes sense
 
if you want large integers, use python :PP
 
12:20 AM
This OP is getting me on my nerves by changing the question completely after I answered
 
>>> 9259325923538559238532859
9259325923538559238532859
@LuisMendo roll back and point to the chameleon question meta? :P
 
I'm trying to make them reason
and no luck, it seems
 
> inf is a symbolic operator
I rolled back and left a comment
@LuisMendo you don't have to edit your post, I'd stand your ground
16k rep user should learn sometime
 
Sometime in the past
sigh
 
yup :/
 
12:26 AM
Ok. Note in my answer removed
 
let me know if they re-edit/undo the rollback, and I'll mod flag
 
Awesome, thanks. I appreciate it. Not that I really care about the rep at this point, but I hate that my answer is made to look dumb by a later edit to the answer
I can't see why they refuse to ask the symbolic thing (which is also interesting) in a different question
OP is apparently ok with your edit
 
@AndrasDeak ok please clean the comments. — 0x90 57 secs ago
:D
 
They first :-P
 
I don't mind if they ask the new question anew
 
 
9 hours later…
9:59 AM
0
Q: how to login to my facebook account by java or matlab programming code?

bagher I created a game in MATLAB. When a user wins the game I give him my username and password secretly. So that the user can connect to my Facebook account and download a file and then I remove the user from my account. But now how can I connect user to my Facebook account by JAVA or MATLAB. So t...

BEST. IDEA. EVER
It will revolutionize the gaming industry
 
@AndrasDeak OP finally agreed no maintain the original question. Q&A are clean now
 
10:49 AM
@AnderBiguri I mean as long as he's distributing his password "secretly" it should be fine right? At least he's using MATLAB for it's native purpose, as a game dev platform
 
disp('This is the pass: XXXXXX')
:/
everything it that post is a train-wreck, and its 4 lines of text XD
 
Sam
hello
 
Sam
Hi mate
 
This is quite easy in Matlab. Does someone want to taka a stab at it?
 
10:56 AM
Pretty pictures <3
 
That was the main motivation, haha
 
I am stuck with something else so I'll pass for now
 
Sam
@AnderBiguri what's getting you down pal
 
This
5
Q: How to compute the gradient of the function on a triangular mesh

Ander BiguriGiven an arbitrary (lets say 2D) triangular mesh, with known $(x_i,y_i)$ locations of points, and numerical values of a function $f$ on them (either in the nodes, or in the centroids of the triangles, doesn't matter) like this random example, how can I obtain a numerical approximation of the dire...

 
LaTeX in math.SE looks great. Pity there's not such thing in SO
 
11:00 AM
There was a meta about it I think. Something like the computational cost no being worth the amount of posts
 
Yes, admittedly it's more essential in math.SE than here
 
11:17 AM
@Wolfie " reliable" -> " relable"?
 
11:33 AM
Whoops, I meant "relabel"
 
@LuisMendo cheers, spotted this before you realised your own typo ;) autocorrect stung me
@LuisMendo I will soon if I get time :)
 
@LuisMendo how did you came up with this idea? Also those "frames" inside the spiral are very interesting, any idea what property of the primes is making such structured results?
 
12:09 PM
@flawr for a plane, your answer is the only one giving solid, consistent results
for z=ax+by+c
unless, I fucked up implementing the other one, I need to double check
 
12:28 PM
ffs typhoid MATLAB >.< I wrote a code to do Luis' challenge step 1, works fine when I input a single number, but as soon as I encapsulate it in a loop to check for all numbers it goes into infinity mode, inside the original 1-number code
without it having any reason to do this
 
there must be a reason :P
 
None that I can find
 
I'd say the weak point in that logic is in "I can find" :P
 
especially since for single numbers it works great, and then when I save that as a function and use a separate function where I call the first one in a loop, the inner function goes into infinity mode
not the outer one
even though I pass the inner function only single numbers
fucking MATLAB doesn't do primes correctly imo
I encounter problems at 1 and 2
I had to explicitly kick those two out, otherwise it borked. Stupid program
 
but isprime(2)
 
12:38 PM
if isprime(idxnew) || idxnew == 1 || idxnew == 0
    break
end
that's messing up everything
Now my code is no longer going infinite, but the output is wrong as well
 
but 0 and 1 are not prime :P
nah, IDK your problem, just messing with you
 
finally, got step 1 working
function [count] = PrimeSpiral(n)
for ii = n:-1:2
    count(ii) = 0;
    if ~isprime(ii)
        idxnew = numel(primes(ii));
        while 1
            count(ii) = count(ii)+1;
            if isprime(idxnew) || idxnew == 1 || idxnew == 0
                break
            end
            idxnew = numel(primes(idxnew));

        end
    end
end
end
Now for the matrix-building
 
@AnderBiguri which one? :)
@AnderBiguri false, im pretty sure all primes are odd, and if there are exceptions it will be just a few..
@formula: do you mean the one with the angles as weights?
 
12:57 PM
@flawr you're joking again, right? :P
I can never tell with math people
 
1:25 PM
@AndrasDeak i mean how many even primes have you seen? 9 is odd 11 is odd 13 is odd 15 is odd...
100000000000006660000000000001 is odd...
 
@flawr yes
The user John Hughes aparently decided to get angry at the question
not that he is wrong, just unhelpful
 
1:46 PM
\o/ Solved @LuisMendo's challenge. Just very, very non-golfed
 
@flawr I'll take that as a "yes"
(nice 50% prime rate there)
 
2:04 PM
0
A: Can square tree rings be generated from primes?

Adriaan197 bytes N=301;H=F(N^2);O=spiral(N);O=H(O);imagesc(O) where F function [c]=F(n) for a=n:-1:2 c(a)=0; if ~isprime(a) b=numel(primes(a)); while 1 c(a)=c(a)+1; if isprime(b)||b==1 break end b=numel(primes(b)); end end end The script is 41 bytes, the function 156, so a combined total of 197 by...

I suck at golfing :D
 
spiral(N)
 
I assume you can indent that code, no?
 
no, indentation is bytes
 
imshow uses the wrong colormap?
 
2:06 PM
MATLAB didn't like me putting all the for, while and if things on one line, hence the lines
 
O=spiral(N);O=H(O);imagesc(O) -> imagesc(H(spiral(N))) ?
 
@Adriaan need commas for that
 
@AndrasDeak I tried semicolons
@AnderBiguri oh, good point!
 
you need commas
but I presume the size of a newline and a comma is the same (1 byte)
numel() -> nnz()
and check if defining f=@(a)nnz(primes(a)); and calling it twice is less bytes
 
f=@(a)nnz(primes(a)); is 21 bytes, b=nnz(primes(a)); is 17 bytes
 
2:11 PM
:|
f=@(a)nnz(primes(a));b=f(a);b=f(b);
b=nnz(primes(a));b=nnz(primes(b));
 
so f=@(a)nnz(primes(a));b=f(a);b=f(a) is 35 bytes, instead of 34 the old way
I think
 
yup
 
I can loose all the semicolons and the backwards loop right?
It just messes up my calculation time
that'd save me 7 bytes
 
you could indent your explanation at least :P :P
 
you need something, either commas or semicolons or newlines
 
2:13 PM
but makes MATLAB sad
 
might as well go with semicolons
you still need to remove the "spiral" from your call
 
Under 180, I think I'm satisfied, sort of
 
or is spiral a builtin?
 
@AndrasDeak yes
 
wtf, it is
 
2:16 PM
that's why MATLAB's so good here :P
 
TIL
FWIW I wrote my own spiral in python in 5 minutes for Advent of Code
 
probs my function can be loads shorter, but primes doesn't eat arrays, sadly and understandibly
 
35
A: Wind me a number snake!

Luis MendoMATL, 3 bytes 1YL Try it online! Explanation Built-in... ¯\_(ツ)_/¯

2
 
lol :D
@LuisMendo you troll ----^ ;)
isprime(a)isprime(b)
f=@isprime;f(a)f(b)
 
@AnderBiguri I wanted to write a challenge about iterating the prime counting function. I tried two ideas, but the resulting sequences were in OEIS, and probably not very interesting.
I wanted to write a challenge about iterating the prime counting function. I tried two ideas, but the resulting sequences were in OEIS, and probably not very interesting.
So I tampered with the exit rule of the iteration and noticed that with the condition exit if either prime or 1 the resulting sequence had increasingly long runs of constant values. That gave me the idea that plotting it in a spiral would give a nice graph, and when seeing the graph the tree ring analogy.
The structure of those "rings" is indeed very interesting, and mysterious. As Erdős said, it will be another million years, at least, before we understand the primes
@AndrasDeak Haha
 
2:25 PM
FYI you're double posting, Luis :)
connection problems?
 
Aww
Sort of
Thanks. Deleted
 
@LuisMendo that too
 
SO question: If I flag something as "not an answer" and it gets edited by a different user, does it "reset" the flag?
 
@AnderBiguri I think so, yes
 
@AnderBiguri it gets approved directly
 
2:28 PM
:/
 
@Adriaan Can't you change function c=F(n) to no brackets?
 
you can ask for a if it's still NAA
 
Someone did a minor aesthetic edit to an answer with 4 recomended deletions
So should I mod-flag?
 
review recommend deletions or delvotes?
 
@LuisMendo of course I can, thanks.
 
2:29 PM
@AnderBiguri no, just post here asking for an NAA flag, as I said
 
I'm not accustomed to golfing ;P
 
Ah, also || can be |
 
I was frustrated trying to build the spiral, then I started searching Google and found the build-in :p
 
He is not wrong, but that answer does not attempt to answer at all, jsut call me ou tin my math illiteracy :(. Also its his 3rd answer
 
2:31 PM
@AnderBiguri urf, I hate people answering more than once on a given question. It feels like repwfarming to the max :s
 
@Adriaan Haha, I thought it was well known in MAtlab
 
@Adriaan 2 of his answers are "you are mathematically wrong" :/. Again, he is not wrong in saying that. He is just being unhelpful
 
reflagged it @Ander
also left a comment for the editor
 
and that specific answer does not attempt at all to answer me :/ . I tried to understand what he wants, or how to formulate it, but he just basically tells me "aaaah you havent defined your prooobleeeem"
 
55k rep NAA multi-answerer, 25k rep cosmetic editor to said NAA. Wow, I'd hate math.SE.
 
2:33 PM
@AnderBiguri should've put that as two paragraphs one a single answer imo. I personally think there shouldn't be an option to answer a question twice; just use two headings with "APPROACH 1" and "APPROACH 2"
 
meh, meta is pretty much divided on this subject
 
@Adriaan Also, in code golf input needs to be taken from some standard means, not defined in a variable. So maybe replace N=301 by N=input('')
 
@Adriaan Yes, the information per se is not bad
 
@LuisMendo ah, I didn't know that. Lemme see
 
Can't you integrate everything into the function? That would spare the input statement
 
2:35 PM
Don't sweat it, @AndrasDeak. I'm going to delete it anyhow. Although it's the only form of the "question" here that's actually answerable, it's certainly not an answer. It might be an answer to the question that OP probably should have asked (i.e., "How do I formulate a question about computing gradients of real-valued functions interpolated from values at mesh vertices?"), and OP now perhaps understands that, so it's served its purpose. — John Hughes 25 secs ago
 
@AndrasDeak interestingly, he started actually attempting to be helpful.
 
@Adriaan Yes it can be integrated: something like this (removing indentation and newline/semicolon
function F(n)
for a=2:n^2
    c(a)=0;
    if ~isprime(a)
        b=nnz(primes(a));
        while 1
            c(a)=c(a)+1;
            if isprime(b)||b==1
                break
            end
            b=nnz(primes(b));
        end
    end
end
imagesc(c(spiral(n)))
 
@AndrasDeak ultimatelly, he did not answer any of my comments :( e.g.:
I honestly say this without any hostility: I have no idea how much of this answer/comments is you being mathematically anal about my words/problem and how much it is really relevant for the numerical problem at hand. I do understand what you mean, however I am in the same point as in my first comment: Yes, you are right, and at the same time we can find (with some constrains, for sure) robust numerical approximations for e.g. images. — Ander Biguri 2 hours ago
Which I did indeed ask genuinelly
 
"mathematically anal"?
 
anal about the maths
yes, bat phrasing
 
2:40 PM
I think he doesn't understand what you're asking and doesn't understand why you don't understand him, and he's just giving up
@AnderBiguri not very good as a conversation starter
 
Anal != bad word
 
But Anal ≈ bad word
 
but I think it was understood in context, no?
 
anal != bad word, anal = anal-retentive = strongly pejorative of other people
as in "why do you have a stick up your ass"
you can say "I'm pretty anal about my math". You can't say "you're being pretty anal about my math" if you want to have a constructive discussion
 
:/ my bad then
(however, the answer itself was being anal about my maths, as does, again, not attempt to really solve it )
but I did not mean at all to be rude with that
 
2:43 PM
yes, it could've easily been, but if you want to be diplomatic and discuss you don't say this outright :P
"I'm saying this without hostility: you're being anal about this" definitely sits wrong :D Just FYI
 
:/ had no idea
 
well, not definitely, because I'm not a native either
anyway I don't think your guy was offended, so it's fine
 
Still, no idea what I am doing :D
 
@Adriaan I think you can also replace b==1 by b<2, as b can never go below 1. (Sorry for so many small things; maybe more to come... this is fun!)
 
2:50 PM
@LuisMendo that works, yes
 
@Ander I read his answers. I think his point is that your set of (xi,yi,f(xi,yi)) values don't specify a function a priori. Infinitely many smooth functions can be fit to those points, and the gradients are undefined. What he means is that when you do this for an image, you work with implicit assumptions as to the behaviour of the underlying function to make the answer unique. You have to try and figure out what implicit assumptions are made in the image case.
 
@AndrasDeak which I commented :( But he kept saying the same
I do understand what he says
no matter if he says it 50 times
I have no idea what to do with that information though.
 
what did you comment?
 
@Adriaan But it should be 2, not 1. The lines if ~isprime(a) and b=nnz(primes(a)); are similar to other two lines later on. Can't those lines be merged by initiallizing b to a os somthing?
 
42 mins ago, by Andras Deak
f=@(a)nnz(primes(a));b=f(a);b=f(b);
b=nnz(primes(a));b=nnz(primes(b));
 
2:54 PM
@AndrasDeak that I am happy with the assumptions taken in an image. And that I do not know how to phrase those assumptions
 
well yes, his point is that you need to figure this out yourself
 
Hey Ander, can you help me find the lab page of some professor from ehu.eus? The people directory is unfortunately not translated to English....
 
@AndrasDeak :/ what do I need math.se for, then
@Dev-iL sure
 
@AnderBiguri just think of the same situation on SO :D "You need to figure out how you want to design your problem." Would you do that for OP?
 
@AnderBiguri - Raúl B. Pérez Sáez (raul.perez-AT-ehu.es)
 
2:56 PM
@Dev-iL it's raining from the top-right on that name?
 
:)
 
:-D
 
@Dev-iL he ded?
 
no idea, hope not
 
2:59 PM
Hmm... Looks like I'm not getting data from him anytime soon
 
he does look like the same guy
 
48 anos is way too young
 
@AnderBiguri Any way to find who is the head of the lab now?
 
which lab?
 
3:01 PM
The lab he was the head of, I believe
 
:/
Department head of Física de la Materia Condensada
@AndrasDeak is it the same case?
 
@AnderBiguri Here's a long shot - do you happen to know a guy by the name of Telmo Echániz Ariceta?
 
@AnderBiguri sound like my peeps
 
@AndrasDeak yup
 
@AnderBiguri he seems to think so, as far as I can tell
 
3:05 PM
@Dev-iL know no one in EHU
@AndrasDeak yes, I know he thinks so :(
 
@AnderBiguri ok, no worries
 
Some postdoc in chemistry, perhaps
 
@AnderBiguri I honestly can't tell what's up, and what really matters is that he thinks so and will refuse to try answering further :P
 
@AndrasDeak as I would say in Spanish: "I am as lost as octopus in a garage" with this gradient stuff
yeah, I realised
 
:D
I'd try looking at basic derivations of gradients for images or 2d functions. See how the Taylor series is being applied and whether there are any clear assumptions being made.
 
3:09 PM
I'll try :/ Fact is, for now whatever simple stuff may solve the problem. I need to do some tests in flawrs answer (and the other one), but flawrs seems best, fit some initial data... I need to sit down and read a lot of maths
 
@AnderBiguri If I may believe Inspector Morse, you need a thinking pint of British real ale ;)
 
I may indeed
 
Oh well, I just golfed my day away
 
I didn't mean to interrupt your inner dialogue :-P — Luis Mendo 16 mins ago
 
I had never seen someone suggesting a golfing improvement to himself. And then correcting himself 2 minutes later
 
3:21 PM
@LuisMendo a friend of mine is helping me, but he's never used MATLAB :D
 
@AnderBiguri Is Basque known to have some influences from Arabic? Just noticed the word "Eskerrak" which has a very similar Arabic word with the same meaning
 
Basque is known not to have any known ties with other languages :-) A sort of isolated language
Of course, some recent words are loaned
 
@LuisMendo This I know... Perhaps they escaped from Atlantis ;)
 
@Adriaan never used Matlab, and saved 14 bytes? :-)
 
@LuisMendo he opened the docs, asked a few questions to me, and then voilá
 
3:35 PM
Ah, shorter function names for reusing; good idea!
 
he's a Python user, and thought to do "from module import some_fn

f = some_fn

f(123)"
@LuisMendo yes, basically that's what he said
 
@Adriaan must be a heretic, real matlab users don't use the docs. at least not here on SO
 
@flawr as I said: he doesn't use MATLAB :P
just 12 to go to beat mathematica xD
 
as I said: a heretic
XD
 
@flawr I guess that makes me an imaginary Matlab user
 
3:37 PM
@LuisMendo I was just extrapolating from what you could infer from the questions asked on SO:)
 
:-D
 
@Adriaan I think you can omit the b==1/b<2 check alltogether
if b==1 it is not prime either
 
I'm eating an avocado, and it's so ripe it's almost liquid....
 
@Dev-iL guacamole?:)
 
@flawr yes you can. thanks
 
3:51 PM
@flawr hehe pretty much...
 
@Adriaan now I think it should somehow be possible to merge the if and the while....hm...
 
@flawr Remco suggested that as well, but I get stuck in an infinite loop if I do while ~s(a)&~s(b)|b<2
 
oh right, these are two differnet checks=/
 
@Dev-iL current most serious theory says berbere, but there is just very light hints, considerably more diffuse that words sounding similar
 
@Adriaan oh and the whitespaces after if and while :)
 
4:04 PM
@AnderBiguri will you be free in 2 hours from now for a game? Though I'll only have an hour...
 
@flawr thanks; I had while 1 at first, and then you can't omit the space
 
@Dev-iL yes, approximatedly
 
4:16 PM
@Adriaan Can you really omit the check with 1 in the while condition? The code should go on if ((not prime) and (not 1)).
Perhaps the only way to get to 1 is through 2, and then the prime condition already makes the code stop there
Yes, I think so. But you should explain that in the code, it's not really obvious
And that's only because a starts at 2, not 1
 
4:50 PM
@Adriaan: I have a code golf answer at 139 bytes right now. Slightly different tack than yours.
Could maybe be optimized more
 
@Adriaan I'm trying man!! haha I also stopped coming in here for a while since the mods were riding my ass for racist comments and the such
Figured I'd let things cool down for abit
 
@ballBreaker sounds like a good idea ;) You all nice and polite nowadays?
@gnovice I'm interested to see it
 
Ehhhhh sort of haha, I'm in a discord with a bunch of the problem-people so I'm trying to keep that stuff in there
I think you will appreciate this, but 2 Sundays ago I sprained my dick
literally sprained my dick
 
@ballBreaker :/ :/ :/
I am tempted to ask...*how*
 
@ballBreaker why am I not surprised?
 
4:52 PM
@Adriaan 134 bytes now. Should I post it on code golf?
 
@gnovice Go for it; I shaved loads after the first post
 
To be fair, if someone asked me years ago if I would have sprained my dick at 25 I wouldn't be surprised either
@AnderBiguri sex related injury
One of those girl-on-top-slip-out-and-crush scenarios
 
ah, yas, happens to me almost daily
 
hahahah
you poor guy
I'm out of commission for about a month according to my doctor
 
<sarcasm>
 
4:54 PM
my testosterone has never been higher
 
do some oil painting
 
o.O
 
sculputure
 
lmao some feminine arts
Might work
 
you know, non-sex related hobbies
 
4:55 PM
lool yeah
I'll be back in an hour
going to release some steam at the gym
 
@Adriaan Hmm, never mind. It works for the 5-by-5 case, but looks off for the bigger ones.
Time to tweak a little more.
 
posted on January 31, 2018 by Yair Altman

A built-in JIDE control can be used in Matlab GUI for IP-address entry/display. Related posts:FindJObj GUI – display container hierarchy – The FindJObj utility can be used to present a GUI that displays a Matlab container's internal Java components, properties and callbacks....FindJObj – find a Matlab component’s underlying Java object – The FindJObj utility can be used to a

 
5:51 PM
@Adriaan Fixed it and made it even shorter! 126 bytes!
 
@Dev-iL up for it if you want
 
let's do it.. Join "ExplosiveGaming - S1 ..."
 
@Dev-iL huh..... how? public servers?
 
yeah
 
Can't find that one
 
6:07 PM
sort by number of players
it's one of the bigger ones
you can also just access the API and find the IP address from the JSON file ;)
 
UPDATE immediately
you're like a million versions behind
oh, enable experimental builds in steam
 
its steam, it autoupdates, no?
on it
@Dev-iL in game
 
saw you
 
what game is that even?
 
6:23 PM
@biggi_ factorio
 
ah heard of it, never played it
 
@AnderBiguri I'm afraid to play that. I like optimization too much. You'd never see me again.
 
@AnderBiguri sorry about that, had an unexpected guest
 
7:03 PM
@gnovice indeed, its dangerous
 
7:15 PM
@Adriaan Since 1 is a prime No it's not! But the code never reaches 1; it stops at 2, which would be the only way to get to 1
 
@AnderBiguri @gnovice indeed...
 
7:36 PM
@LuisMendo fixed that, thanks
Why's 1 not a prime btb? It's only divisible by 1 and itself...
 
@Adriaan The most convincing explanation I found is: if 1 were a prime, the prime factorizacion of any number would not be unique. For example, 21 = 3·7 = 1·3·7
 
@LuisMendo mhm, that makes sense
though you can multiply anything by 1 and it's still the same (same as adding and subtracting 1, a trick often used in solving integrals)
 
7:58 PM
I lost track when they started muttering about language. I mean, who needs language when you've got mathematics?
 

« first day (945 days earlier)      last day (2276 days later) »