« first day (142 days earlier)      last day (3101 days later) » 
08:00 - 16:0016:00 - 00:00

8:58 AM
Hi!
 
9:34 AM
@BillBokeey Hello!
 
Hey :) I was afraid my new favorite procrastination place would be empty the whole day!
 
9:52 AM
Nah, it's just that the day starts at different hours for people.... Also for some Friday isn't a workday
And obviously there's no point in coming here unless you're getting paid for doing something else ;)
 
@Dev-iL with "some" you mean you :P
then again, I never work on Fridays either, but that seems normal for a student
 
@Adriaan not necessarily - it's like that for most Hebrew speakers in this channel ;)
 
@Dev-iL wait, there are more of those? o.0
 
@Adriaan not that I know of ;)
You could say that "1 out of 1" constitutes a majority, no?
 
@Dev-iL something, something, statistics
 
9:55 AM
just like lim(8->9)sqrt(8) == 3 (for large values of 8)
 
Do you know this site about statistics? tylervigen.com/spurious-correlations
I find it hilarious
 
10:33 AM
Hey by the way, do you know if it's possible to customize data tips shown in the code? I know it's possible to do this for graphs, but can't find sources about showing custom data tips in code
 
Yes it is.
Which MATLAB version are you using?
2
Q: How to programatically update histogram contents and datatip location? (MATLAB hg2)

Dev-iLI am trying to make an animation where several datasets are being cycled through in a histogram plot, and a datatip follows the highest bar in every frame, as demonstrated below:                            Here's a code which achieves the desired result using a bar graph: %% // Initiali...

1
Q: How to properly display TeX strings in axes' datatips? (MATLAB hg2)

Dev-iLI have recently tried to run an old piece of code (written on hg1) on a new version of MATLAB (2015a) that has hg2. I used to be able to do the following (according to the "gnovice-Amro" method): function output_txt = customDatatip(~,event_obj) % Display the position of the data cursor % obj ...

 
I'm on 2014b
DOesn't it only apply to figures? I might have expressed myself poorly. I have a pretty big piece of code and enabled the "enable datatips in edit mode" option. And i'd like to customize these to show the comments i made on the variables
(I've got to go but i'll be right back in around an hour, thanks anyways for the help!)
 
Could you maybe upload some diagram of what you're trying to do? I find it a bit hard to understand
 
11:12 AM
Yes sorry, i'll do it as soon as i come back from lunch (it's not really a big deal nor that important for me to solve bit that would be really nice ^^)
Oh, just found an old mathworks posts that suggests overriding datatipinfo
 
11:36 AM
Hey, i'm back
It's these data tips i want to customize
I'd like to go fetch some comments about each variable to be displayed along with the informations already shown by MATLAB
 
@BillBokeey hey hey hey, I see you're not procrastinating. Shame on you, coming here and trying to do work:P
 
It's actually close from procrastinating :) Buuuut it would help me go faster on the code review afterwards, so i'll juste call it "procrastinating efficiently", or "how to spend a whole afternoon doing something that would make me gain 10 seconds averytime i need it ^^"
 
@BillBokeey related:
 
Graph shows i can spend between 5 days and 4 weeks on it. Gladly realizing i can do this until christmas :D
 
Cool, good luck then!:D
the graph is linear, so probably 10 days
 
11:46 AM
@BillBokeey well, the easiest solution I can think of involves accessing some global variable in your customDatatip to fetch the info you need then format it whichever way you like and display that in the datatip along with
 
@AndrasDeak speaking about routine tasks: I automated mine to perfection, according to my boss, so I automated myself out of a job. Back to full-time student it is!
 
I was thinking about storing all the comment into text files, as there are a huuuge lot of variables
 
@Adriaan - you fool!
 
@Adriaan to struggle of being too good ^^
the*
 
You should've let your boss think you're doing it manually each time
 
11:48 AM
@Adriaan whuuuut?
Did they fire you?
 
Not exactly. I was hired to do a single coding project (gridding and classifying LAS data), which I finished
 
@Adriaan ah. Bad move, then. I'm sorry:(
 
obviously I had by long forgotten it was a single project, because I had been doing photogrammetry on the side for some time
 
and doesn't the boss need you on that?
 
@AndrasDeak Nope. Now I can finally start on solving that damnable fourth order derivative I got handed to me two months back :P
@AndrasDeak I suck on it and it's brainlessly clicking in a black-box software at this point. So, if they want to progress on that, they need someone with experience on that, which is not me
 
11:51 AM
@Adriaan so... are you fired or not?
and who the hell uses a fourth order derivative?
 
@AndrasDeak I guess you could say that, I am jobless again :D
@AndrasDeak that geothing I send you in the beginning of October is a 4th order PDE :P
 
@Adriaan wtf
Oh, OK, spatially fourth order, right?
causality stops at the second time derivative
 
@AndrasDeak If you have great thoughts about that, I propose that we procrastinate those on a terrace with coffee in hand in three weeks ;)
Hah! I am using i as a summation variable in my homework, with impunity!
 
12:07 PM
\o/
 
I would not be happy if there was French comment in my MATLAB code :(
I might be bad at MATLAB, but I'm positively worse at French
 
Haha :) Being french helps a lot with french comments ;)
You recognized it was french though
 
@BillBokeey it's quite unique
 
@BillBokeey poor sod. If you ever need a shoulder to cry on, go to András ;)
@BillBokeey well yea, French was forced down my throat for three years in Comprehensive school
 
Haha
 
12:14 PM
Yo @AndrasDeak BEHOLD, IT IS DONE. You want 8 pages of glorious PDEs?
 
What are your respective jobs by the way? The mood here looks a lot like the one in my lab
 
@BillBokeey so basically something like this? :
 
@BillBokeey as you might have read, I'm very jobless again, and I love it :D
 
@BillBokeey this means that @Adriaan is a rock-loving student:P
I'm a theoretical condensed-matter physicist
most guys are engineers/programmers
 
@Dev-il, I gave a bit more informations, it's about customizing the datatips shown in the code itself (my message of 10mins ago for example). So it's not about showing data tips in figures. Sorry you spent time on that :/
 
12:19 PM
@BillBokeey oh, ok. Anyhow don't worry - what I did was easy for me (and not very time consuming...)
 
@BillBokeey don't worry, he'll just write a self-answered question from that;))
 
@Andreas : I suppose you know that i'm googling "condensed-matter physicist" right now
 
@AndrasDeak Nerd.
 
ups
@AndrasDeak was what i meant
 
@BillBokeey it's OK:)
 
12:20 PM
@AndrasDeak I deal with condensed matter all the time, since rocks tend to be in non-gaseous form. Am I a condensed-matter physicist now? :P
 
@Adriaan no, you're a rock-fanboy
 
@AndrasDeak and I am bloody well proud of it!
 
@Adriaan you should, everyone is born special:D
Some more special than others:P
 
Oh darn condensed-matter physics seems as transparent as a rock
 
@BillBokeey it mostly refers to studying crystalline solids and the like
I'm researching metallic magnets
 
12:25 PM
@AndrasDeak Quartz, Fledspar, Biotite, magnetite... Exactly what I am playing with!
 
@Adriaan sure
 
You still doing your quantum-spin magnetics?
 
@BillBokeey what I do can be seen in the topmost pinned mesage in the room :P
 
@Adriaan both solid-state physics and magnetism are by definition quantum. But my local magnetic moments are classical:)
 
@AndrasDeak Nerd.
Well, I'm off to look at dripping taps, see you lassies!
 
12:29 PM
bye
so @BillBokeey what about you?
 
Just starting a PhD in Applied mathematics in a mechanics lab
Doing modelization
if it's called like that
^^
 
modelling?
Cool anyway!
 
@AnderBiguri which image? I don't see it ^^
 
You'll definitely need a lot of procrastination with that;)
 
12:31 PM
Oh i see, you're a ghostbuster!
(joke aside : Nice!)
 
12:46 PM
@AnderBiguri Did you reconstruct that by yourself with a collection of 2d images?
 
That is a collection of 2D images
then I reconstruct it
 
Oh you can make real 3d?
 
yes yes
thats the idea
 
That's pretty cool!
 
actually my PhD is about creating 4D
so given some 2D images taken over time, with a motion map applied to the object, create a 4D image of it
 
12:52 PM
@AnderBiguri show-off:P
 
Well i'll know who to contact if i have to do image processing :D
 
@AnderBiguri - good luck displaying 4D data on 2D media
 
@BillBokeey While i know a bit of image processing, this is not that! This is image reconstruction, wich is lots of maths, little image processing. Everything I do is to end up with an image. After, I dont care :P
 
Hehe okay
 
1:08 PM
@Dev-iL True! hardest part indeed XD
 
Hmm I think one can't even describe a situation where ndims(data)-ndims(media)>1 ... Like trying to draw/represent a 3D box using a single line :\
 
If some of you guys are interested in what i asked earlier about editing the code data tips, i'm approaching a solution ^^
 
@BillBokeey - I suggest you write a Q&A (@AnderBiguri could agree hehe) ;)
 
yep indeed :P
@Dev-iL well I can just draw lots of them XD
lots of 2D slices of the 3D images in different time
or somethinf liek that
 
Yeah I can't even visualize that (ahem interstellar ahem)
 
1:15 PM
hahahhahahahaha
 
Does it say anywhere that permute removes trailing singleton dimensions?
 
this is related to a question i had in the past
it doesnt remove anything, because any MATLAB variable has infinite trailing singelton dimensions
 
@AnderBiguri size(permute(cell(13,1,96),[3,1,2])) => [96,13]
 
actually it is 96x13x1x1x1x1x1x1x1x1x1x1x1x.......................................
 
@Dev-iL It works way too well! There must be a mistake somewhere :S
 
1:21 PM
Yeah, I understand what you mean, it's just that one might expect the result to be [96,13,1], which corresponds to the amount of "declared" dimensions in the original object
 
but if you go to the original variable
and do size(var, 56)
the result is 1
so inside Matlab " all dimension are declared"
 
@AnderBiguri that's somewhat scary!
 
>size(cell(13,1,96))

ans =

13 1 96
 
size(cell(13,1,96),4)
 
dude irrelevant!
The strangeness can be summarized like this: before and after calling permute you may get different lengths for the size vector !!
 
1:26 PM
@Dev-iL when you suggested writing a Q&A, was it a joke? If not, where should i post it ^^?
 
@BillBokeey - A "Q&A" is the term used on SO for when people ask a question and answer it themselves
 
Oh i see :)
 
"I had this and that problem and this is how I solved it, now I'm sharing it with everybody because: I'm a nice person / I want to get rep / I genuinely think somebody else might find it useful / if I don't write it down now I might lose or forget the solution should I need it later"
 
Hmm but that would mean i'm nice...Gotta think about it :D
 
@BillBokeey - see additional reasons in my edit
 
1:30 PM
Haha how do you know me so well?!
 
Haha I don't, this is just what makes sense to me :)
 
@Dev-iL yes an no. If you call [size(vec,1),size(vec,2),size(vec,3)] before and anfter
youll get the sizes you expect
I dont like this about MATLAB, but its the way it is XD
 
@AnderBiguri Yeah because such is the standard use case for size() obviously :) :P
 
yeah. The thing is, permute does not delete trailing singeltons
its MATLAB variable functionality. Permute gives exactly what you expect, its just MATLAB only considers non-singelton dimensions as the size of a variable
@BillBokeey so you do a phd on modelling?
modelling what?
 
Gear dynamics in a mechanics lab
 
1:43 PM
oh nice
 
For now i got handled a veeeery big uncommented piece of code ^^
That's why i'm seeking ways to improve the time i spend understanding the code and which variable means what
 
I had that. It took me less time to rewrite it all than to understand it all xD
 
just rewrite from scratch using classes
@AnderBiguri hehe you beat me to it :P
 
Yeah but as i'm not proficient in dynamics, i'll have to understand the code first :/
 
DEPEDNIGN ON HOW GOOD /BAD THE CODE IS
opps caps
but depending, it may be easier to rewrite
It took me less time to understan the theory and wirte code than to understand code
and my code runs faster/more robustly
 
1:49 PM
Okay
For now, i just got the imprssion that i'm digging a huge pile of dump, and the more i dig, the more crap there is ^^
 
yes XD
I know what you mean
my code had undocumented code that looked like this for ~100 line
 z1 = (((v*ones(S).*T(3,1,:) - T(2,1,:))./(T(2,2,:) - v*ones(S).*T(3,2,:))) - ((u*ones(S).*T(3,1,:) - T(1,1,:))./(T(1,2,:) - u*ones(S).*T(3,2,:)))).*x;
 
The main problem, especially with MATLAB code, is that people do not write it to be usable by others (it's a low priority if one at all)
For various reasons.... The main of which (at least in my field) is that people have no background in software engineering
 
Exactly! It's sometimes not even usable by the same person 2 years later ^^
 
... nor OOP
 
the code I get around here generally has statemetns as if 1==2 for code they want to enable/disable
 
1:55 PM
hehe
I came across gems like

if i==1
if i==2

Some stuff

end
end
 
2:10 PM
Hmm do i have the right to post a whole Matlab function on SO? It's not built in but it comes with the software
 
like which one?
@BillBokeey to post a Q&A typoe of thing
post a question, then an answer. not everything in the same post ;)
 
Yes that's what i'm doing
Already posted the question, now i'm writing the answer
 
ah ok ;)
 
The datatipinfo function
it's not built in
though it come with MATLAB
 
2:20 PM
coms*
 
It's built in, just not documented
 
oh, maybe I just followed a bad link
 
Yes it is that one
I thought built in function were the one that were not editable
like fft and such
 
nope. built-in -> matlab has it
 
2:22 PM
Okay
 
some of them are editable some oethers not
if they are ditable, you can post the code
because it means that MATLAB allows the users to read what the function does
 
(and see how ridiculously some are written)
 
posted on November 20, 2015 by Loren Shure

Today's guest pick of the week from Loren is GISMO. GISMO is one of the success stories for community developed tools. Currently maintained by Glenn Thompson, it is a toolbox widely used throughout the research community of seismologists. ... read more >>

 
like gplot, aka the function Mathworks forgot about
 
@AnderBiguri but an enhancement request has been submitted!
 
2:25 PM
o didnt know that!
-1
Q: How to read Frames from a video MATLAB?

usman I have to read video frames one by one from image and store each frame in an array which i can futher use. I guess there must be some loop which can do this work. I am using video=VideoReader('sample.avi') frm = read(video) % to get frame but MATLAB gives error on read command and close automa...

RTFM
 
Though I only put in for the documentation to accurately explain the output behavior
Who knows when it'll make it in, I'm sure they have tons of other things to work on
 
I posted the answer as well, feel free to help me improve it :)
 
share link
 
1
A: Customizing data tips in editor

BillBokeeyWe will need to do some preprocessing in order for this to work, i.e. : 1) Create a data file linking the variable names to their description (This is the boring part, although i already had to do it in order to understand the code. Just add a line everytime you come across a new variable) I ch...

 
number of bananas +1 just for that
 
2:35 PM
I forgot to put "the answer to everything"
Damn me
 
so, this works, but you overwrite the builting, rigth?
meaning, if someone else has another toolbox that uses the same variable names
things may get confusing
 
Hmm the boring part is that you need to have 1 data file per application
And you edit the path in the function
I'm not even sure if it will help people, it just helps me quite a lot ^^
 
I think its great actually
I mde a toolbox for my stuff
having that for "default" variables that are created
its great
 
Oh well that's cool if it's helping!
 
yeah, actually I am quite omresed that you made it
(because I never though of that, not because you suck :P)
 
2:41 PM
Haha
You just have to be lazy enough to think about this kind of stuff xD
It really came from "damn it's so boring to have to scroll up to where the variable is commented everytime, i might aswell code something" :D
 
didn't Bill gates sayd something about lazy people ? ;)
“I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.”
 
Haha
 
I wonder what the caller for datatipinfo is, it could be possible to hop around the stack to get a structure of data info local to your function rather than needing an external file
I can't get it to fire the debugger though :(
 
Yeah that would be really great! Although i think it's beyong my knowledge in MATLAB
beyond*
In a perfect world, it would be automatically taking the comment line over the variable declaration ^^
 
That would be pretty difficult to parse
 
2:54 PM
Yeah i think so aswell
But i find it pretty damn exciting ^^
Anyways tell me if you find a way to do what you proposed! It's true that it would be a lot faster/classier
 
If I could get it to fire in the debugger I totally would haha
 
Are you using dbstack?
 
no, I can't get it to stop in the debugger
 
I put a dbstack in the function and now when i hover on stuff it says
Dunnow if it helps though i never used that before
Oh well never mind i'm stupid ^^
 
nah
You totally inspired me to figure it out though
I just used keyboard :p
Silly me
 
3:07 PM
Haha nice!
So what's this so well hidden caller?
 
There isn't one, it's just called from the base/function workspace
 
Okay (Not sure I see all the implications of this information though)
How would you define which coment is relative with which variable @excaza by the way if not by using text files?
 
I was thinking of using it as a field reference
 
Oh i see
 
Set mydatatips.myvar = 'Some string' and then seeing if mydatatips.myvar exists
 
3:13 PM
Yes i see
Hmm and your "hop around the stack" would be needed to actually access the workspace's variables inside the function?
Ohhh you want to change the call to the function to add a "mydatatips" input argument right @excaza?
And use some varargin tricks inside datatipinfo function
 
Should just be able to use evalin to pull the string, I should have something to test out in a couple minutes
 
Can't you get a handle to tha datatipinfo function and use it to know when it's triggered?
the*
(don't know if it's even possible though)
 
3:33 PM
It retains all your logic
the only difference is my try block at line 17
rather than parsing the CSV file
 
Nice, trying it right now
It works!
@excaza Awesome!!
The try block is there for it not to stop on an error if the variable is not in mydatastrings?
 
Yeah, rather than add full blown error checking
 
Yes i see
Bravo
 
Feel free to edit it into your post, you did pretty much all the work!
 
You should add it as an answer as i'd never be able to do it
as i' would never have been able to do it *
Damn this will save me so much time and be so cool! I'm happy ^^
Hi @rayryeng
 
3:45 PM
@BillBokeey I haven't seen you here before. Welcome!
Venez-vous de la France? Enchanté!
 
Thanks! This place is now my favorite procrastination place :)
Although today was pretty constructive!
 
:D Anyone who comes here has their sole purpose to procrastinate :D lol
Out of all of that, we do do some very productive things here.
It was because of this room that Luis Mendo was inspired to create MATL, MATLAB's code golfed version of the language
it's still a process in making, but I'm excited about it
 
@BillBokeey shame on us, lol
 
Wow nice!
Hey @rayryeng, check this :stackoverflow.com/questions/33828551/…
 
Let me have a read.
 
3:48 PM
Thanks :)
 
well that's certainly interesting.
 
It's the first thing i do in MATLAB i feel proud of ^^
about*
 
you would probably want to make a local copy of datatipinfo in your working directory so that this doesn't get affected by other code that runs it outside of your working directory, right?
But that's a very nice hack.
 
excaza proposed a better version if you go a few messages above
Yes i will make a local copy, didn't thing too much about the possible conflicts yet
 
oh that's very smart
And it's also more portable
 
3:53 PM
Yes
 
You'd just tell people to have a custom CSV file of a particular name first.
rather than having to ship that function file with every product you make.
 
I'm starting to ask myself if this place is really about procrastinating :D
 
not all the time :D
When @beaker gets in, I frequently do code golf challenges with him
but most of the time we talk about nonsense :D
 
I don't think I have the smarts for code golf haha
 
@excaza oh you do :) You just don't know it yet
 
3:54 PM
What is code golf?
 
Code Golf is very much like playing actual golf out in the real world
except that you win by writing code that has the shortest amount of characters
 
Ohh i see, like on cody?
 
You have an objective, and the person who achieves it with the least amount of characters wins. yes exactly!
Except MATLAB Cody is broken... there are SO many hacks you can use to reduce your score lol
for example, making the output function variable equal to ans and making the final statement in your code not being assigned to something
so something like:
function [ans] = myFunction
...
...
runFinalStatementHere;
end
runFinalStatementHere gets assigned to ans, which is the output variable.
 
MATLAB isn't suited for code golfing though. There are languages on Code Golf StackExchange that were specifically designed by users there for the purposes of Gode Golfing.
Languages such as Pyth and CJam
Pyth is the Code Golfing version of Python
 
3:57 PM
Okay
Seems fun, although i'm sure i don't have the level to do that
 
like some of my best solutions would be... 30-40 characters
and Pyth has it in 4-8 lol
 
lol
 
Yeah I'm not as crazy about it as Luis Mendo or Beaker :)
but the challenges are very cool
Sometimes it isn't all about the characters you write, there are things known as "popularity contests"
where you write code to achieve an objective, and you win by having the most votes.
Here's one of my absolute favourites... if you're interesting in procrastinating :D
254
Q: Make it look like I'm working

SomeKittensOften, I find myself running a script or query that will take a significant amount of time to run. I can leave that script open and enjoy some guilt-free procrastination. Now, what if I could write a script that seems to be one of the above scripts to any onlookers, but in looks only? I could ...

It was a popularity contest where someone asked people to write code... and the output makes it look like you are actually performing work, but if you examine it closely, it's absolutely useless.
 
I'm running out of time to procrastinate, i'm almost out of work :D
 
08:00 - 16:0016:00 - 00:00

« first day (142 days earlier)      last day (3101 days later) »