« first day (161 days earlier)      last day (3066 days later) » 
00:00 - 20:0020:00 - 00:00

8:00 PM
Hahaha yeah, I think I remember that, I'm just fuckin' with you
you're a python guy right?
 
@Ballbreaker well, you're trying:P
@Ballbreaker I'm migrating from matlab to python, but I'm a programmer of neither. For research I use fortran, but I'm a physicist.
 
Yeah my girls say the same thing
 
@Ballbreaker "is it in yet?"
 
"At least you're trying, that counts for something!"
@AndrasDeak No they say that for other reasons
 
12
Q: Catalan Numbers

quartataThe Catalan numbers (OEIS) are a sequence of natural numbers often appearing in combinatorics. The nth Catalan number is the number of Dyck words (balanced strings of parenthesis or brackets such as [[][]]; formally defined as a string using two characters a and b such that any substring starti...

MATL: 12 bytes
itt2*wXnw1+/
 
8:07 PM
:D
 
Can probably be improved
 
@LuisMendo I just came back to the code and ran some more benchmarks... Looks like for numEl=200 there's a speedup of x3600 over my initial version :D
 
@Dev-iL Matrix operations for the win! :-)
 
@LuisMendo that four bytes is plain cheating :P
 
@LuisMendo confirmed;)
 
8:10 PM
I wonder what happens when gpuArray...
 
@Adriaan Yes :-(
@AndrasDeak Thanks!!
 
@LuisMendo looks like you need to include more unicode chars in the language
 
@Dev-iL But those count as more than one byte
In fact, I've asked Dennis about that
I think his answer may be 9 bytes, not 4 bytes
 
@LuisMendo that's really good to hear:)
all those crazy greek letters and stuff...would be cheating
 
Different version, just for fun
it2*:t2/Y]/pw1+/
i       % input
t       % duplicate
2       % number literal
*       % array product (element-wise, singleton expansion)
:       % vector of equally spaced values
t       % duplicate
2       % number literal
/       % array right division (element-wise, singleton expansion)
Y]      % round towards infinity
/       % array right division (element-wise, singleton expansion)
p       % product of elements
w       % swap elements in stack
1       % number literal
+       % addition (element-wise, singleton expansion)
 
8:28 PM
Damn, I don't think I will be able to post the Q&A today because I seem to have crashed the remote desktop I was working on :P :D
It needs to be manually restarted
 
@LuisMendo Jelly uses its own, custom encoding default, where each character is a single byte. With UTF-8, the source code is indeed 9 bytes long. — Dennis ♦ 12 mins ago
 
Cheating.... plain and simple....
 
@LuisMendo still works:)
 
@LuisMendo Here's my version:
f =@(n) prod(((a=[2:n])+n)./a)
still haven't figured out how to do that in MATL ;)
 
@beaker This only works in Octave, not in matlab. You cannot make assignments in anonymous functions.
 
8:33 PM
@beaker My second MATL version seems similar to that
But I can't run yours in Matlab
 
@flawr yeah @beaker keep your filthy Octave out of here...oh wait, this is the MATLAB & Octave room, nevermind:P
 
okay,
 
@AndrasDeak :-D
 
who needs free software anyway
 
it's just pushing on the stack for MATL ;)
 
8:34 PM
Yeah! :-)
 
or a duplicate
 
Looks like you need to round at the end
 
> Using opencv is there any possibility to convert matlab code into an android?
> AN ANDROID
 
@LuisMendo they should all be integers, right?
they have to be because you're only dividing by a factor of the numerator
 
@flawr oh that would be awesome
@beaker [are you planning to be able/do you want to get] to use matlab again in the future?
 
8:37 PM
I think I might need a "Welcome to computers floating point" button to go along with my RTFM button
 
I like this guy. Especially his last statement :P
 
@AndrasDeak if I have a compelling reason to, as in I need to do it for work... so far it's all just code golf for me :)
 
@excaza it's so cute how people get amazed by floating-point arithmetic
@beaker I see:)
For some reason I thought you had access but it went away
 
@AndrasDeak I did... I changed graduated and changed computers and lost my license :)
 
@Adriaan oh, matlab2tikz, that's nice
@beaker aaaah, that's right, you wrote that you lost access!
at least I'm not utterly confused:) Thanks
@Adriaan it's a bit interesting how he only has 167 rep on tex.SE
I guess he's more matlab than tikz in matlab2tikz:P
 
8:41 PM
@beaker Yes, but numerical errors
>> a=[2:n]; prod((a+n)./a)
ans =
  41.999999999999993
Your approach In MATL. It can probably be golfed further
>> matl Hitbw2$:t6B$+w/p
> 5
42
 
@AndrasDeak I guess you understand more about this dude's question:
1
Q: Warning: Rank Deficient Rank = 242 tot = -2.246357e-12

Jesu Kiran SpurgenI am solving a linear equation x = A\Bin MATLAB. The dimensions of A is 244 X 3089987 and B is 244 X 1. The result for x is all zeroes. Why is that? What could this warning mean in my case? Please need your help!

 
neat
 
@LuisMendo oh well... it's got a set of pesky parentheses that are causing it to be longer than the other solution anyway
 
@excaza 8TB of array, nice!
 
8:44 PM
I wonder if it's higher now, the table is for R2007a
So largely 32 bit
 
@Adriaan fat matrix? Is that a thing?:D
 
@excaza I think not, since the post is from september 2013
@AndrasDeak that's how our teacher explained it :P
 
Please, Obi Wan, I need your help!
 
fat = more columns than rows, skinny = more rows than columns
skinny = good, fat = American
 
@Adriaan what a troll
 
8:45 PM
uhh, bad
 
@Adriaan read the title of the table
and really the entire paragraph before it
 
@LuisMendo I like how that returns 42;)
 
@excaza Well, I still still think that it's fairly accurate. I doubt MATLAB can do anything about maximum array size beyond hardware, so I guess the last line (64 bits Windows/Linux/Solaris MATLAB R2007b or later) still applies
it's just that the rest of the table is rather obsolete by now
 
@AndrasDeak but it's not for 6x9
 
@beaker yeah, I suspected that...
 
8:58 PM
@AndrasDeak Haha. Of course!
@beaker I removed 3 bytes from your approach
>> matl -er it2w2$:tb+w/p

    i      % input
    t      % duplicate
    2      % number literal
    w      % swap elements in stack
    2      % number literal
    $      % input specification
    :      % vector of equally spaced values
    t      % duplicate
    b      % bubble up element in stack
    +      % addition (element-wise, singleton expansion)
    w      % swap elements in stack
    /      % array right division (element-wise, singleton expansion)
    p      % product of elements
@Adriaan His profile used to contain an explanation as to why he does that:
 
@LuisMendo couldn't you do it backwards and use right division?
 
Hello!!!
 
wouldn't that remove the swaps?
 
How are you? @TroyHaskin @AndrasDeak @AndrasDeak @Dev-iL
 
@evinda we're code golfing with MATL
 
9:08 PM
@beaker But that's Y\. So two bytes anyway
 
Really? How can this be done? @beaker
 
@LuisMendo page instantly shows "saving page" and then becomes empty... I had to take a screen shot in a split second to be able to read it :p
 
Gotta go, dinner's ready. See you later!
 
@evinda see Luis' code above... trying to generate Catalan numbers with the shortest code
later @LuisMendo
 
@Adriaan Same here. Weird!
 
9:10 PM
@LuisMendo his explanation is very solid though. I'll upload an imgur of it
 
@beaker Ok, I will look at it later...
 
@evinda I'm good... Just writing some horribly long Q&A about the importance of vectorization ;)
 
Aha... @Dev-iL
 
it a very good reason to downvote eval answers in my opinion. Was he called out on meta or so for this, that he removed it?
 
9:12 PM
@Adriaan In which semester are you?
 
@AndrasDeak You into stews?
 
@evinda autumn semester currently
 
I think I'm going to get into stews. Stews are great
 
and now off to bed
 
I'm looking into Hungarian beef paprika stew right now
 
9:12 PM
g'nite @Adriaan
 
or Marha Porkolt (sans the cool letters)
@Adriaan Cheers mate
 
@Adriaan I meant how many semesters have you done so far..
 
@Ballbreaker I'll ask András to make it :p
 
@evinda thanks, very snowed-in. Gotta grade a buttload of mid-terms
 
@Adriaan Ok... Good night!!!
@AndrasDeak Oh, I thought you wouldn't teach.. Do you?
 
9:13 PM
@Ballbreaker we have a kind of stew called pörkölt, that's pretty yummy
I'm unfamiliar with other kinds of stews
Oh, you're just reading into that
I can only support that:)
Is ground red paprika available there? That's an essential ingredient
@evinda I do. Research and teaching go hand-in-hand at university:)
 
@AndrasDeak What subject?
 
But these are not my students, I just grade the mid-terms for practical reasons
 
@AndrasDeak It should be!
I'm reading a hilarious blog and the guy is hell-bent on stews and also History
 
@evinda I teach Experimental Physics 1 (to physicist freshmen), they're writing a mid-term tomorrow:D
 
Goes into how violent the Hungarians of olde' were and segways into your stews
 
9:16 PM
@AndrasDeak Is this related somehow to numerical analysis?
 
@Ballbreaker it hasn't changed much, just turned into verbal violence and vigorous hatred towards everybody and everything
@evinda not the least bit:)
 
this is going to be a bready question, isn't it
 
What have you studied? @AndrasDeak
 
@evinda what do you exactly mean?
 
@AndrasDeak Oh cool!
I can get down with that
Boogey with the Hungarians
 
9:18 PM
Which field did you study at university? @AndrasDeak
 
Let me just google your women to make sure I would enjoy myself there though
 
@evinda solid state physics, with focus on magnetism
@Ballbreaker I believe you would
 
@AndrasDeak Oh man, my idea of Hungary just changed
 
@AndrasDeak Interesting...
 
Although I did look up Hungarian Models
Models are typically hot no matter where they are from
@AndrasDeak pukes
I hate solid state physics
 
9:20 PM
@Ballbreaker we have a young hottie called Barbara Palvin, she's sorta cute but her mouth is always open, makes her look very dumb after 3-4 pictures
 
And this is a pretty actress of ours, for representative purposes:
 
Hmm
Maybe I should look up Hungarian Women and see if I like the average
Some place's average is better than others
 
Do you like her?
 
That's one insane jaw line haha
I don't dislike it
She's beautiful, but not exactly what I would go for
I'm guessing blonde isn't a commonly occuring gene in Hungarian national women?
That's my kryptonite
 
9:28 PM
@Ballbreaker blondes are not nonexistent
but many chicks are brown
my girlfriend happens to be blonde
(not an offer)
 
@AndrasDeak For how long are you a couple?
 
7 years
 
Really? @AndrasDeak
How did you get to know each other?
 
@evinda we were classmates in high school (but we only got together years later, at university)
 
@AndrasDeak Oh nice... Do you work also at the same place?
 
9:33 PM
@evinda almost, she's at another university, 10 minutes walk away
 
You're dating a unicorn!
Also damn, I might have to opt out of Hungary then and move to Sweden instead
Possibly the Nederlands
 
@AndrasDeak Nice...
 
@Ballbreaker Swedes are brown. Think Norway or Finland:)
 
@AndrasDeak How old were you when you became a couple?
 
@AndrasDeak Hmmm okay thanks :D
Although trading a Canadian winter for a Norwegian or Finnish winter seems like hardly a fair trade
 
9:42 PM
@evinda 21. Trick question?:P
 
@AndrasDeak :D
 
@AndrasDeak He wanted to figure out why you're 27 and still in Academia
 
@Ballbreaker and now we know why you're not: it's 28
*shots fired*
 
lmfao
Wow, I knew I was braindead today, but didn't think it was to that extent
hahahahhaa... remember kids! 1+7 = 27!
Oh god
21 + 7 = 27
wtf is wrong with me
I just spelled repair in a document as "rapier" and didn't bat an eyelash over it
 
@Ballbreaker and the spell check doesn't flag that one, does it?
rapier is a kind of sword, right?
 
9:53 PM
Yeah exactly
Have you ever seen the show "arrested development"
 
@Ballbreaker nope
heard of it, never watched
 
This scene makes me laugh still to this day
It worries me sometimes wondering what my boss would think if he stumbled on my youtube and google searches
 
Yeah I think I've heard that one
 
"arrested development analrapist"
"Hungarian models"
 
@Ballbreaker tell them you were looking for small world models
The Barabási–Albert (BA) model is an algorithm for generating random scale-free networks using a preferential attachment mechanism. Scale-free networks are widely observed in natural and human-made systems, including the Internet, the world wide web, citation networks, and some social networks. The algorithm is named for its inventors Albert-László Barabási and Réka Albert. == Concepts == Many observed networks fall into the class of scale-free networks, meaning that they have power-law (or scale-free) degree distributions, while random graph models such as the ErdÅ‘s–Rényi (ER) model and the Watts...
 
9:56 PM
@AndrasDeak I like this one a lot
@AndrasDeak =o haha cool
 
10:22 PM
@excaza why the hell did Hum disband so early, and stop making music.. like wtf is that
Their second LP Downward is Heavenward is soo goooood as well! bwah!
 
disband, lol:D
pun intended?
 
Hahaha unintended
 
maybe they got hoarse from all that humming
 
As that's the literal word for it hahaha
Disband:
(of an organized group) break up or cause to break up and stop functioning
@AndrasDeak They probably got horse from it
Anyways, I'm off for the night, have a good one Andras!
 
@Ballbreaker thanks, good night
@Ballbreaker that's much less funny then...
 
11:02 PM
Can anyone shed some light onto this?
Why are *global variables* considered bad practice, and *nested functions* good practice? A nested function B can access all variables from the parent function A, potentially causing a lot of trouble. If instead you use a non-nested function B that shares say two global variables with function A, you *explicity* declare what is shared (just those two variables). How can that be worse?
 
There are people who would say that nested functions are not necessarily good practice either...
But one argument for them that I can see is visibility of naming...
 
So the "correct" approach would be to pass everything in and out? Even if they are large variables?
 
It's quite obvious from the called function what the global variables are
It is not always so obvious from the calling function.
There, you run into problems with workspace variables possibly interfering.
 
With globals you have control as to what is shared: only variables explicitly declared as such
I'd say that's better
 
If you use nested functions, all of the variables used are self-contained in the same file.
 
11:08 PM
By "global variables" I mean global between subfunctions of the same file
 
As I said, that's from the called function. How do you know, if you want to use funcXYZ(...) that you're supposed to set a global variable first?
 
Because it's a subfunction
(in my setting)
 
mmmm... subfunction but not nested function?
 
Yes, exactly
I need a subfunction to have access to two variables of the main function
 
i'm not sure what that looks like, to be honest :)
 
11:09 PM
@beaker function ... function ... end end
no?
 
@AndrasDeak That nested
 
@AndrasDeak that looks nested to me
 
subfunction is function ... end; function ... end
 
Subfunction is: function end function end
 
11:10 PM
completely unrelated, just on the same path
 
okay, got it
 
Exactly
 
I think it's because of the possible automagical changing of variables, why globals are frowned upon
 
and the reason you're not passing these two variables as arguments?
 
and yes, I wouldn't use nested ones either, because I have problems comprehending scope
but again I'm not a programmer:P
 
11:11 PM
@AndrasDeak But nested functions can automagically change all variables of the parent!
 
side-effects is definitely one problem, but it's used in other scenarios
 
@LuisMendo yeah that's why I wouldn't use them either
I'd go for passing explciitly...
 
My point is: the two options have potential problems. But the nested option has more problems. Still, global variables are frowned upon, nested functions not so much
@AndrasDeak Can't that be slow if the passed variables are large?
 
MATLAB doesn't copy until you modify the variable
but yes, if you're modifying a large matrix and passing it back, it could be time-consuming
 
So I'm left with making the variable global and share it with the subfunction, or promoting the subfunction to nested function and letting it wreak havoc everything
I think the first option is better
 
11:14 PM
:D
you can always break rules in the right circumstances
 
All this comes because I'm using two global variables in the MATL compiler :-D
I need to justify that :-P
 
I'm glad I don't write big programs so this doesn't really matter to me :P
 
I just replaced the two global variables for a nested function and I think it's worse. Less clean, more potential problems
 
@LuisMendo you're changing state information or something?
 
I'm rolling back
 
11:16 PM
@LuisMendo Tada!
0
Q: Vectorizing the solution of a linear equation system in MATLAB

Dev-iLSummary: This question deals with the improvement of an algorithm for the computation of linear regression. I have a 3D (dlMAT) array representing monochrome photographs of the same scene taken at different exposure times (the vector IT) . Mathematically, every vector along the 3rd dimension o...

 
@beaker Yes, one of the global variables is changed from the subfunction, and the main function needs to see the changes
@Dev-iL What?!
Huge amount of work, man!!
 
Hehe... It's gotta be useful, right? :)
 
D'oh... jsut ran into another Octave-only fix :/
 
@Dev-iL Sure it will!
 
Alright gentlemen, looks like I'll call it a night. Thanks again for your input @LuisMendo !!
 
11:22 PM
@Dev-iL good night
 
good night @Dev-iL
 
CW, @Dev-iL you little boyscout;)
 
For an overdetermined problem, the qr decomposition gives the least-square solution
at least, gives a system that is easy to solve to get the least squares solution
 
@Dev-iL Glad I could help! :-)
Good night!
 
I'm off too, good night:)
 
11:36 PM
g'nite @AndrasDeak
 
00:00 - 20:0020:00 - 00:00

« first day (161 days earlier)      last day (3066 days later) »