« first day (275 days earlier)      last day (2937 days later) » 

 
7 hours later…
8:13 AM
LMAO Unikong
 
 
2 hours later…
9:47 AM
@rayryeng Great link, thanks!
 
 
3 hours later…
12:45 PM
0
Q: find subsequences and their weight matlab

irene ireneI have a cell array A={'11' '32' '' '';'29' '7' '11' '2';'2' '11' '2' '11';'29' '39' '29' '';'29' '37' '29' '';'29' '33' '2' '11';'29' '33' '11' '1';'33' '11' '2' '11';'29' '1' '2' '16';'29' '' '' '';'29' '' '' ''} I have found all the subsequence present in A and the frequence associated to t...

what...
 
1:09 PM
posted on April 01, 2016 by Sean de Wolski

Sean's pick this week is the Brocumentation Toolbox by Dan Seal. Most bros don’t know too much about MATLAB since they’re usually busy working out, surfing, or just plain chillaxing... read more >>

 
Mornings maylabs
 
@ballBreaker MAAAYBEEEEEE
 
MAYLABS and JUNTAVE
@Adriaan I give you permission to hate me, I've been listening to Tiesto all morning so far
 
@ballBreaker like I need your permission for that
 
To my defence though, this album is amazing, so. Whatever. Man.
 
1:11 PM
oh my god
that pick of the week is amazing
 
> The Brocumentation ToolBrox
@excaza The video is like.. I'm chuckling, and I want to laugh harder at it
But I dunno haha
 
watches snooker
 
@Adriaan That's code word for vagina right
you're watching porn?
 
@ballBreaker at work, with the boss
those guys can wield their cues!
stroking and shoving at the balls with ease
one quick thrust and it's in!
 
You know how to turn a man on, Adriaan
Your boss that is
 
1:34 PM
posted on April 01, 2016 by Loren Shure

Good news for those of you who speak (and spell) the Queen's English instead of the US dialect. We are working night and day to make MATLAB use equally satisfying for the entire world's English speaking population!... read more >>

 
TMW is on fire today
 
@Feeds WHHHHOOOOOOOOOOOOTTTT
 
they do this every year
 
> You can expect, in upcoming releases, to create a colorbar or a colourbar. To ensure happy code collaborations, you won't even have to choose which dialect to install.
 
I liked the bro-documentation :)
 
1:46 PM
I do want that trusty colourbar :(
 
colourbar = @colorbar
done :)
 
I don't remember their stuff last year being this good
 
 
1 hour later…
3:09 PM
huh... everybody must be playing Unikong
 
@beaker or watching snooker
 
yes, because that would be... more... boring :/
 
@beaker exactly!
Had a very good nap during the first three frames of the afternoon session
 
Ah! Have a pint and put your feet up sort of thing.
 
not a full pint, delicious nontheless
brewery sells it for €2.50 on tap o.0
If you're ever in Amsterdam, I'd definitely recommend visiting them
 
3:17 PM
I've only been to Amsterdam once... we had intended to do a brewery tour but ran out of time :(
trying to figure out how to use interp3
 
3:33 PM
't IJ doesn't offer tours, but at least it's good and cheap beer, as opposed to the piss Heineken squirts in bottles. Too much tourists there as well
 
@Adriaan Mmmm piss squirt
 
@Adriaan well now i have to cancel my trip :(
 
@beaker wot? Just drop the Heineken tour and go to 't IJ :P
They do have a brewery cafe
I go there quite often, as it's around the corner where my girlfriend lives
 
 
1 hour later…
5:10 PM
No unicorn rides for you...
61
Q: Can I ride the unicorn? If not, can I kill the unicorn?

skullyI'd like to ride the unicorn as pictured both in the ad on the right as well as in the game main menu: The unicorn seems to be an unkillable monster and I am unable to defeat it; I have to either dodge or use the photon blaster to set him back a few inches. I tried goomba stomping it, tried c...

 
5:53 PM
Anybody here love regex?
 
doesn't everyone?
 
Haha I like it from time to time
I'm bashing my head against the wall with regexprep though
Basically I want it to only perform replacement on the 2:N matches
wait, sorry more like 1:end-1
So I'm working on shortening this
0
A: Make this code explanation pretty again

SueverMATLAB, 270 bytes function d=f(I,s);S=@sprintf;R=@regexprep;m=regexp(I,S('\\s*%s',s));L=max([m{:}])+4;a=@(x)S('%-*s%s',L,x,s);b=@(x)R(R(x,S('(.{1,%d}(\\s|$))',93-L),S('$1\n%*s ',L+1,s)),S('\\n\\s*\\%s $',s),'');c=R(I,S('(.*?)\\s*\\%s\\s*(.*$)',s),'${a($1)} ${b($2)}');d=S('%s\n',c{:});end The p...

and would really like to get rid of the nested regexprep call
 
hmm
 
Basically I find all the chunks that fit on a line
and then append a \n % or whatever to them
but obviously the last line gets an extra one
and because the regexp for breaking it into pieces is .{1,width}\s+
If for example the comment is z = input
then that regex will only match z =
since input is the end and therefore doesn't match
Maybe I should just use recursion or something
 
6:16 PM
you guys seem to like these programming puzzles, here's one I answered:
0
A: How can I improve perfomace of Hilbert scan of image?

AmroDoing a quick search online, you can find a post about Hilbert curves on Steve Eddins blog. Here is his implementation to generate the curve: function [x,y] = hilbert_curve(order) A = zeros(0,2); B = zeros(0,2); C = zeros(0,2); D = zeros(0,2); north = [ 0 1]; east = [ ...

its about Hilbert curves, I took the implementation from here
A Hilbert curve (also known as a Hilbert space-filling curve) is a continuous fractal space-filling curve first described by the German mathematician David Hilbert in 1891, as a variant of the space-filling Peano curves discovered by Giuseppe Peano in 1890. Because it is space-filling, its Hausdorff dimension is (precisely, its image is the unit square, whose dimension is 2 in any definition of dimension; its graph is a compact set homeomorphic to the closed unit interval, with Hausdorff dimension 2). is the th approximation to the limiting curve. The Euclidean length of is , i.e., it grows...
can you think of a faster implementation? or maybe shorter :)
 
@Amro there have been a couple of challenges on code golf...
 
haha I figured.. this is the sort of challenges they create :D
 
^^ yes, I actually used that implementation in my asnwer :)
see the link above
 
@Amro Oh! I thought you were saying you took it from Wikipedia... my mistake :D
 
6:21 PM
Did you test out the complex number one?
 
yes, but you had to play with the scale of numbers to get them into integer indices.. I went with the easier one :)
 
Yea I agree. I tried the complex one here in MATL
3
A: Hilbert-Curvify a Matrix

SueverMATL, 86 85 bytes This solution is based upon Jonas Lundgren's File Exchange entry which utilizes complex numbers to generate the Hilbert curve. These complex numbers are then converted to index values to retrieve the elements of the matrix that fall along the curve. nZl2/1XLJQXH1J-XI0,1L:"XJJZ...

albiet poorly
 
ah thanks for the link
 
Steve's is pretty easy. Especially if you change the cumsum at the end to start at [1 1]
 
interestingly, MuPAD has this stuff out of the box, very nice
you can even animate as you increase the number of generations
you know how I like a good animation ;)
 
6:32 PM
@Suever I always cumsum at the end
....
lol (sorry I couldn't help it)
 
lol
this would be an interesting package to implement in MATLAB
Turtle graphics is a term in computer graphics vector graphics using a relative cursor (the "turtle") upon a Cartesian plane. Turtle graphics is a key feature of the Logo programming language. == Overview == The turtle has three attributes: a location an orientation a pen, itself having attributes such as color, width, and up versus down. The turtle moves with commands that are relative to its own position, such as "move forward 10 spaces" and "turn left 90 degrees". The pen carried by the turtle can also be controlled, by enabling it, setting its color, or setting its width. A student c...
 
 
2 hours later…
8:50 PM
yikes, you only get 3 choices for the PPCG moderator election?
 
9:26 PM
@beaker I know... well I already chose Martin and Dennis... they're non-negotiable.
The third one I was having a tough time.
What's funny is that it says that FOUR positions are available... but we only can choose three?
 
@rayryeng Exactly... Doorknob is good too, but I'd like Digital Trauma to get a chance
 
@beaker Me too... it was really hard.
Do I choose someone who's been in the system for a while... or do I give someone new a chance?
 
on the other hand, I think we can safely assume that Martin and Dennis are in...
 
hahaha that's true.
but the thing is though... if you use those votes for other people, they may simply be wasted votes lol
Martin and Dennis are most likely going in... a couple of votes not given by you or me won't make a difference I think.
Of course we can change our votes for the time being
 
@rayryeng That's what I'm saying... my vote for Martin is not going to be the deciding vote... but it might be for someone else
 
9:31 PM
@beaker hmm... that is true.
I'll have to think about that one.
@beaker how are you doing this Friday?
I'm finalizing the last assignment for my students.. It's k-means and dimensionality reduction
 
ooooh, sounds like fun :D
i'm getting ready to head down to Austin for the weekend
 
sweet! what's going on there?
 
my mom's birthday was last weekend, but I couldn't make it, so we're going to celebrate this weekend
uhoh... "with variable name as index and subindex"... that sounds like a problem
 
9:48 PM
@rayryeng actually SE elections use a voting system called STV
The single transferable vote (STV) is a voting system designed to achieve proportional representation through ranked voting in multi-seat constituencies (voting districts). Under STV, an elector (voter) has a single vote that is initially allocated to their most preferred candidate and, as the count proceeds and candidates are either elected or eliminated, is transferred to other candidates according to the voter's stated preferences, in proportion to any surplus or discarded votes. The exact method of reapportioning votes can vary (see Counting methods). The system provides approximately p...
 
oh?
interesting... so first, second and third choice have some sort of weighting.
 
the software used is OpenSTV
I dont know too much about this, but:
> ... transferred to other candidates according to the voter's stated preferences, in proportion to any surplus or discarded votes
 
hmm... that I'm unclear about.
 
199
Q: How are moderator election votes counted, in plain English?

PopsThe election pages' sidebars state that Stack Exchange elections use the Meek STV vote-counting method: After m days, the final voting results will be freely downloadable from this page forever, and we will calculate the n winners using OpenSTV with the Meek STV method. How does that work? ...

you're not alone :)
so apparently excess vote is not wasted, but redistributed down to next choices..
 
Hey all!
 
10:03 PM
hola
 
Hey @LuisMendo :)
@Amro I'm still confused so I'm just going to vote for the underdogs :)
 
I guess you should vote in the order you think is deserved
 
Just voting in an election gets you a silver badge. Weird
 
dont change it because you think someone has enough votes to win without you
if a candidate has enough votes to fullfilll the quota, your votes will be redistributed to your next choice and so on ..
 
@Amro The problem is that there are 4 slots and you get 3 votes
I've got someone I want to pick for each of the 4 positions
 
10:10 PM
think of the number of choices as not really three, but just one fractional vote
you simply assign the weights
 
@Suever Pity the Lucas number question was closed. You can save a byte with 20t_h for [20 -20]
Also, z instead of ~a I think
 
@LuisMendo Thanks!
 
Anytime!
 
Oh well it was a relatively straightforward thing to get the feet wet
I have a MATLAB solution for the related one
 
The requirement "don't compute all smaller Lucas numbers" was strange though. I think it's best to leave that decision to the answer
 
10:14 PM
So someone on here was saying that in octave you can do {'a','b','c'}{2}, right?
If so this answer may be better suited as an octave answer
 
I think so. Let me check
Yup!
 
yes
 
I knew it worked with (). It's only natural it works with {} too
Nice
 
Yea because it looks bad in MATLAB
 @(n)subsref({'Pippi','Lucas','Ness','Travis'},substruct('{}',{sum(1:2.*any(~rem(real(sqrt(5*n^2+[-20 -4; 20 4])),1)))+1}))
 
Hahaha
subsref
 
10:16 PM
shudder
 
It always reminds me of Gnovice's remark: "ugly, but possible"
:-)
245
A: How can I index a MATLAB array returned by a function without first assigning it to a local variable?

gnoviceIt actually is possible to do what you want, but only if you use the functional form of the indexing operator. When you perform an indexing operation using (), you are actually making a call to the SUBSREF function. So, even though you can't do this: value = magic(5)(3,3); You can do this: va...

 
haha yea
sadly it still comes out shorter than defining a function
 
I've never used it, but I think you can try Octave here
Also in ideone
But functions don't work there
 
that syntax creates an ambiguity...
take this function:
function x = f(n)
    if nargin == 0, n=3; end
    x = magic(n);
end
what do you expect f(4) to be?
 
magic(4) ?
 
10:19 PM
or f()(4) ?
 
Oh, I see
Very true
So how does Octave resolve that?
 
i guess the least surprising way
what you said
 
You can use f()(4) for the other
 
yes
here's another edge case
[mx,idx] = max(magic(3))
this is straightforward right?
now what about this:
[mx,idx] = max(magic(3))(4)
 
10:24 PM
Indexing error?
 
do you have octave open? can you answer it without typing it :)
 
That was my answer since I assume the two element array value is attempted to be indexed by 4, which isn't cool beans.
Three element.
 
@Amro In that case I would say (4) is ruled out as an index?
 
ok, but which output do you index?
mx only? both of them?
what if the outputs were of different lenghts
 
That's what I mean. I can't be an index
 
10:26 PM
I thought the cascade happens prior to the assignment
 
maybe 4 was a bad example, use 2 instead
 
So even if a valid index was used, I'd also expect a too many output argument error.
 
@Amro Oh, I get what you mean now
But still, it's different
 
> error: element number 2 undefined in return list
 
You would be indexing into the left-hand side, not the right-hand side. In a way
 
10:28 PM
Curious error message, but I think I was semantically correct. :)
Odd that it assigns the first output before the hard fail though.
That's rather nice of the implementation.
 
...and not the second. Yes
 
this is only a guess, but I think that's why MATLAB does not allow this sort of indexing.. it's not always clear
 
Though Matlab (not sure about Octave) does allow this syntax:
packageName.(module).(objectName)(varargin{:});
Which I really find delicious.
 
isnt that just the fully qualified name?
not like indexing into a result
 
Yeah. It's using the package referencing mechanism.
Not indexing.
 
10:33 PM
oh you mean dynamic names, where module and objname are variables?
 
Indeed.
 
@Amro That's a good point, yes
 
@Amro I love the dynamic name system in Matlab for calling package functions and dynamically calling class methods.
 
yes it's neat. better than eval'ing stuff
 
I actually found a bug in R2014b where dynamic package references in a nested function led to a core dump of Matlab ... not sure if they fixed it yet.
 
10:41 PM
cool. I too once found a way to crash MATLAB with one line of code ;)
 
^^
9
Q: Possible bug in `toc` function in Matlab R2015b

Luis MendoUsually calling a Matlab function with an empty comma-separated list is the same as calling it without arguments. For example, in={}; spy(in{:}); is the same as spy %// call without inputs However, I'm getting strange behviour for the 1-output version of toc: this works as expected tic; t=...

 
nice!
let me try it :D
 
Hahaha
 
@LuisMendo So z is nnz but ~a is basically checking if there are any zeros
 
@LuisMendo here's one that will crash R2014a: S = setfield(struct(), {}, 'g', {}, 0)
it's fixed in R2015b as far as I can tell
the tic/toc thing did crash my R2015b
 
10:48 PM
@Suever Oh, true. I thought it was a~
@Amro Yes, here it just gives an error
 
yea I think it has to be any(~) or ~all()
But I got it one byte shorter thanks to you!
 
@Suever Yes, I got confused with that :-)
 
Ah much better
0
A: Trump needs your help to stop the Starman!

SueverOctave, 93 bytes @(n){'Pippi','Lucas','Ness','Travis'}{(1:2)*any(~rem(real(sqrt(5*n^2+[-20,-4;20,4])),1)).'+1} This approach is similar to my MATLAB answer with the exception that Octave allows you to index directly into a fresh array: {'a', 'b', 'c'}{2} %// b

I imagine I could do something similar in MATL
 
@Suever Problem is, MATL is non-competitive for that answer
 
I hate that real() in there. Wasting so many bytes just to handle a damn 1
 
10:55 PM
Because it was released December 2015
 
yea I saw that, but wouldn't be a bad exercise
 
I've sometimes answered old questions. You only need to say it's non-competitive
 
11:08 PM
Hmmm what is an elegant way to craft [-20 -4; 20 4]?
this is obviously [-1;1] * [20 4]
1t_v[20,4]*?
 
5lhK*t_vP ?
 
the hell?
lol
 
:-D
>> matl -e 5lhK*t_vP

    5      % number literal
    l      % array of ones
    h      % horizontal concatenation
    K      % paste from clipboard K
    *      % array product (element-wise, singleton expansion)
    t      % duplicate elements
    _      % unary minus
    v      % vertical concatenation
    P      % flip the order of elements
           % (implicit) convert to string and display
 
Wow I had no idea about the -e option!
 
Actually you could use 5lh4*t_vP, no need for K
@Suever Yes, it's useful. But it right-pads with spaces. I need to change that
 
11:12 PM
Yea I always forget about those clipboards' defaults
 
I use them a lot, to separate numbers
BTW, I intend to remove the comma as a separator. There's space already.
 
Well I did happen to write a prettifier earlier
1
A: Make this code explanation pretty again

SueverMATLAB, 270 265 262 bytes function d=f(I,s);S=@sprintf;R=@regexprep;m=regexp(I,['\s*\',s]);L=max([m{:}])+4;a=@(x)S('%-*s%s',L,x,s);b=@(x)R(R(x,S('(.{1,%d}(\\s+|$))',93-L),S('$1\n%*s ',L+1,s)),['\n\s*\',s,' $'],'');c=R(I,['(.*?)\s*\',s,'\s*(.*$)'],'${a($1)} ${b($2)}');d=S('%s\n',c{:});end The p...

 
So comma can be used for something else
 
The code itself is definitely not pretty
 
^^ It' a monster! :-)
 
11:13 PM
haha yea no kidding
Comma removal makes sense.
I'm mainly a python guy so significant whitespace is my kind of thing
Excellent and I can also remove the P above because the order isn't important, just that the two 20s and 4s are in the same column
So v by default vertcats everything on the stack?
 
@Suever Yes, I changed that recently. I think it's useful
So h takes 2 inputs by default, and v takes all
 
ah ok good to know. I can just flip the order of my inputs to save a byte
this stuff is addicting
 
Oh for that literal you may need 2$v?
@Suever Yes :-)
2D languages like ><> too
 
:-D
 
11:24 PM
Yea so I was doing something like: 2^5*5lh4*t_2$v+
But if I flip the order of those, I can just make it: 5lh4*t_vi2^5*+
 
Yes, move v to the beginning, at the expense of an i
 
You'll be so proud. No clipboards here!
 
user5020521
can anyone tell me why this link is working on desktop and it is not on mobile?
http://89.97.214.162/backoffice
a blank page appears whenever you open it on your phone while it works on your desktop
 
@Suever Haha. Did you already post it?
 
there's a partly open matlab batch in the beehive
 
11:29 PM
Almost
working onthe last little bit
 
@Riccardo990 is this a matlab trick question?:P
 
user5020521
it is not I'm just a desperate man
 
user5020521
who can't open a goddamn link on his phone but it can on his desktop
 
user5020521
and it is so absurd that I've got no words
 
11:31 PM
I can only confirm that it's not a blank page on desktop
although noscript eats most of it
 
user5020521
@AndrasDeak it is not a blank page on desktop but it is on mobile
 
I know
that's why I said "confirm"
can it be some html5 thing?
not being supported on mobile?
have you tried other mobile browsers?
 
user5020521
I did
 
user5020521
safari chrome and firefox fail
 
sorry, my phone is grounded. it's not allowed to go play at strange web sites until it gets its grades up.
 
11:35 PM
yup, ^ that's why I only confirmed the desktop version
 
user5020521
what can I do
 
user5020521
desktop page is ok mobile page is down
 
user5020521
this is crazy
 
I'd take the svd and call it a day
 
@LuisMendo Do you create your explanation using -e or do you type them out?
 
11:54 PM
@Suever I usually type them from scratch. The initial idea of -e was that it could serve as a basis and avoid some typing. But since -e produces each statement in a line, it's a little tiresome. Usually it's better to write two or three statements in the same line, such as 2$v
 

« first day (275 days earlier)      last day (2937 days later) »