« first day (71 days earlier)      last day (3164 days later) » 

12:07 AM
posted on September 09, 2015 by Yair Altman

Using anonymous functions in Matlab callbacks can be very painful for performance. Today's article explains how this can be avoided. Related posts:Controlling callback re-entrancy Callback reentrancy is a major problem for frequently-fired events. Luckily, it can easily be solved....Continuous slider callback Matlab slider uicontrols do not enable a continuous-motion callback by default. This a

 
 
6 hours later…
5:50 AM
0
Q: Use MATLAB function handles to reference original matrix

James TaylorI often have to manipulate a lot of matrices row by row using MATLAB. Instead of having to type: m(x, :); every time I want to reference a particular row, I created an anonymous MATLAB function: row = @(x) m(x, :); allowing me to call row(x) and get the correct row back. But it seems that...

this question
why on earth would you want that
oh, the OP's comment on that >.< How is MORE typing cleaner than LESS typing
 
 
2 hours later…
7:35 AM
@rayryeng ur suggestions on that ?
 
 
2 hours later…
9:25 AM
This research is AMAZING: arxiv.org/pdf/…
They use AI to learn art styles and make an algorithm that takes an image and repaints it as if it was different artists
 
9:57 AM
 
hello
@AnderBiguri i read the newstons method and gauss newton one what i cud understand is that Gauss newton is used to solve sum of least square problems
and it has most applications is minimizing error
such as robotics,SLAM
what role does this hessian matrix plays in it? i cudnt get it
 
Mmmm yeah more or less. But definetly it has way more applications
If you understand the simple Newton Raphson method, then youll get it ;)
In the NR method, (which is not for minimization, but root finding) you need the Jacobian, the first derivative, to choose the direction of the iteration step
if, instead of root finding you want minimization then you can find the root of the first derivative, wich is the minimum (this should be easy to understand with basic maths knowledge)
 
what role has taylor series got to do with this
 
Therefore instead of the Jacobian to choose the direction, you need the first derivative of the function to mimimize. In this case your function to minimize is the first therivative of the function, thus, the derivative of the first derivativo -> second derivative (or HEssian)
Haha sorry ninja, but its just too complex to explain in a chat.
I gave a 1h lesson to my PhD coleagues about it
 
10:13 AM
Brr, I had a full course on that
and another one the coming months :(
 
Yeah. If you understand it, its very powerful. But takes some reading and playing.
However, I am glad @ninja that you got that far
 
@AnderBiguri r u a post doc
 
Basically Taylor is because the Newton method for optimization is just an approximation of the real optimization fucntion near the solution, and aproximations in maths are generally performed with taylor series
Nope, im a PhD.
(student)
 
what is ur specialization ?
image processing?
 
I am doing X-ray image reconstruction algorithms
 
10:15 AM
where? University?
 
Which mainly is solving Ax=b problems
Yeah in a university. AFAIK only a university can give PhD titles :P
 
lol
i mean which university
haha
 
You can figure it out with very little research ;)
 
wavelets is best approach to parse images
 
University of Bath
 
10:16 AM
?
 
What do you mean "parse images"?
 
england
grt
 
i think process images could fit it more
virtual university is my best source of knowledge, idfc about certificates
 
"To process an image" covers everything you can do to an image
Virtual university of Pakistan?
nah, thats just the first google search ;)
I am not doing a PhD to get a certificate. I just love doing this stuff
 
@AnderBiguri yes (denoising,edge detection,compression,...)
 
10:22 AM
Well then teh answer is no
wavelets are specific tool for specific things
wavelets, for exmaple, are brilliant for image fusion
 
@AnderBiguri i understood wavelets in theorical side (each time i code it in matlab i just use built in functions)
like dwt()
 
however for edge detection, I would use other techniques
 
derivative technique ?
 
yeah. Canny edge detector is teh msot famous one
 
hmm i have less experience with it
 
10:25 AM
But the only thing you can generalize in image processing is: No technique can be generalized
Images are too complex/different by nature
somethign works amazing here, works bad there
 
thats the common worst pit we are thrown toward geneally (generalizing)
i had troubles before combining between practical use of dwt and mathematical ters
im still having em
but who cares, the practical use is more important
 
why problems?
 
lol too maths :series and integrals etc, i dont know how does it relate
 
haha
 
i just listen to the course with a big fake smile
 
10:30 AM
the biggest problem I always have is: Once I understand a mathematical concept, algorithm, method
coding it
The step betwen theory -> code, that is hard to make sometimes
 
yes
 
whenever I really want to understand something I code it
takes me lots of time, but once done it, thats it. I do REALLY get it
 
fourrier is much simpler to understand (in rapport with the algorithm)
@AnderBiguri did it happen that you were obligated to understand a code that someone else did ?
some one switches off feed curtains for gods sake
 
11:25 AM
@Agawa001 Sometimes its easyer to rewrite code than to understand someone elses.
Very relevant link in understanding other peoples code: abstrusegoose.com/432
 
@AnderBiguri That is so true
so terribly true
even writing code in conjunction with others is a hell for me
 
Haha never had to do that. To be honest I am curious. I am tired of using Git jsut by myself :P
 
Well it can be interesting if you think the project with those guys imo
And if you agree to take the same coding norms of course
 
in broad projects, sure. But Ive had to do this just for 5 hour exercises at undergrad level
we always ended up with me pooping out the code in 30 minutes and my partner writing the report
 
aaaaah hehe. My experience is that in those cases , 1 person writes code, others look :P
 
11:36 AM
Ho yeah not same things
Yeah you're right, it always end up this way
 
I always wanted to contribute to some opensource library, e.g. a python one
but I feel like everything is already done
unless you do something that is VERY specific
 
which then nobody uses :P
 
exactly
and nobody contributes to it
 
yeah it feels like you could "import DancingDucks" and it still would work hahaha
 
haha
you know you can "import antigravity" rigth?
 
11:39 AM
srsly? haha
 
that sounds like something you'd order at your local chinese restaurant @HamtaroWarrior
 
try it! You can indeed
 
12:00 PM
wow, I try to help someone who didnt even supply a MCVE and I get the question whether I didnt accidentally answer the wrong question o.0
 
12:17 PM
@AnderBiguri have you ever wondered about that ? brain structures are so manifoldly different even among all humanity gathered up from stone-age, maybe somehow matched but it s a genetic imprint that distinguishes someone from another
 
You say that people is different due to genetics?
 
understanding another coders code, is like patching another imprint in your own brain
 
I believe otherwise, it think we are mainly molded, not born.
Haha yeah. Usually is due to bad programming practize
All programers hate documentation!
 
not all people understand things in a specific way
 
The op here says it's not an implementation issue. Does that mean it's an off-topic (recommendation) question?
 
12:21 PM
as a programmer, i understood run length encoding as illustrated in potato way
 
Indeed. Actually that is, i believe, the hardest part of being a teacher/teaching someone.
Explainign someone something, when people dont understand things as one does, its a big challenge
potato way? LOL
 
teaching's an art
 
@Adriaan I have no idea what OP wants there. I read it once and I udnerstood that he wanted euclidean distance.
 
that's what I provided in my comments, I think
he basically wants Euclidian distance, but not in a 2D space, but on a sphere
 
I didnt really get that. If its in an sphere, then its not the euclidean distance, its the distance he mentions (and link to). But he says he doesnt want that
Sometimes I just dont bother trying to understand the questions
 
12:25 PM
I provided him with a guideline but all he does is complain it's inefficient ...
 
@AnderBiguri yes potatos and Zucchinis, 1 and 0
:D
 
Im going to spend the rest of the day on solving PDEs I guess
 
Haahaha brilliant. I have a friend who is CS, and I am E&Eeng. When we try to solve maths related problems (e.g. TV denoising) he first understands the code, and with that, he understands the math
I am completely oposite. First maths and then code
Our barins wrok very differently
 
me too i must get the maths before
but not in all cases
 
nah, sometimes I just dont bother. I kind of get it, usit, dump it
depends how relevant it is
 
12:31 PM
@AnderBiguri i like the picture showin a tiny wall and ladder in the meme you linked
maybe the poor-versed guy hasnt enough long legs to skip over
 
"what is this structure?"
 
yes
cursed curtains >(
how can i switch off this stuff
 
?
What curtains? the Feed of the Matlab questions?
 
yes
 
IDK. I just accumulate and dismiss
 
12:36 PM
i saw in my university some people who dont want to share their codes
 
Lots of people is shy about codes
 
the problem is , they downloaded it and change some variables name and "own" it
 
yeah, taht happens a lot also
 
thats so greedy
 
It is, but in the end, that goes wrong for them.
If you want to be aprogramer/work programming, or you know or you dont
 
12:39 PM
i coded thousands of things since i was 14, i didnt hide any thing i do
 
and that is obvious after a couple of weeks of work
at 14 I didnt know what a computer was (I did, but just that)
 
well, depends which year you were born
 
nah, its just I didnt have any scientific background around me
im from 1989 so I could have had programmed. Its just no one around me knew what programming was, so I didnt actually learned until University
 
but tbh, i wasnt misusing my computer while the others were spending important time gaming and chating
 
I think its great that you learned that soon. I wish I had, I would have loved it
 
12:42 PM
people still think internet is facebook, and computer is games, thats sad as we are in third millinium
thing i regret is, i learned assembly far later (arround 18 yo), kindof learning how to drive a car before riding bicycle
 
mmmmmmmm Yes and no
 
how ?
 
I think assembly is better later. Starting with assembly.... Its like building a car without knowing what it is used for
 
lol
 
I am not a programmer, and I say - assembly later
 
12:49 PM
haha. I learned assembly in microcontrolers, so I learned computer hardware+asembly. That helped me lots. But without any programming background I would go crazy.
 
of course one must rather know what does adding and subtracting do
@AnderBiguri i saw things like (aimless bridges, meaningless comments, a useless ladder) in many many reviewed codes hahaha
 
Yeah. I think the only codes that tend to be very clean/optimized are comunity coded libraries
 
^ and they are still under development
no such thing as (least compexily) or (most optimised) algorithm
 
even my code is a big mess often
Research code: big pile of crap that does the job
somehow
 
you understand the mess you did because you committed it
while others dont
 
1:02 PM
Haha I used to work on some code with a couple of friends... And sometimes somebody would get an idea on how to rewrite a specific piece of code to be better in some sense, and so they would leave the old code as a comment (usually with no mention of why it was kept there)
....and sometimes you would move methods around to group them in a way that makes more sense, and so you would be left with chunks of commented-out codes that do things that seemingly already work.... and so it became very strange. At one point I decided that if I see commented out code -> it just gets deleted... This is what version control is for!
 
Indeed! Git for president!
 
I prefer hg ;)
 
Mercurial
I just like the ui better
 
ooohhh, never used it. Haha I guess. I am trying to do everything from command line in git bash, so my CS friends respect me more :P
 
1:08 PM
Yeah, doing it all on the shell always look badass :P
 
The first time I did ipconfig -all I felt like the god of computers
 
Yeah, when I want to impress non-IT people I just go at the root and type "tree" haha
 
1:40 PM
Hey, how can I upload a gif to SO? and if its bigger than 2Mb, is there a way I can add it anyway? hosting it externaly for example
 
imgur?
 
nah I solved it
But If the image is bigger than 2Mb , I cannot post it as a gif
plus I had ridiculous amount of problems uploading things to imgur outside of stackoverflow
and I dont know why. I feel like if I was my mum triying to configure a VPN every time I try it: I have no idea whats going on
0
A: Matlab 2D wave equation using FDM

Ander BiguriI guess that the variable dx is the relevant here. But you are never using it. Look at the next piece of code dx=0.001; % spatial increment dt=dx/(c0); % time increment cons=c0*dt/dx; % constant term of electric and magnetic field equations You will fastly realize that cons=1 alway...

It took me zero effort to solve it, but an animated GIF! :D :D :D
If plotting is involved, then its a nice question! hehe
 
1:56 PM
After much hard work I finally got my employer to host a gitlab server for me... and I can't test it because I'm locked out of my work machine
 
Ouch!
 
definitely a sad trombone moment
 
2:18 PM
This is probably a slam dunk regex if anyone has a linux MATLAB install: stackoverflow.com/questions/32503569/…
 
I have one, no idea what I have to do with that one though
besides, it's a 32 bits machine, so Im running R2012a
 
I don't think that will matter. You should only need to use unix commands and some string parsing, I just don't know what the linux output of ls looks like
 
in a terminal?
I'll fire up my machine, not connected to internet though
 
In MATLAB, but the output would be the same. You can pipe linux commands from MATLAB using unix or system, which will return the output to a string
With windows, for example, I get this:
`[~, test] = system('dir /AL temp*');`
test =

 Volume in drive C has no label.  Volume Serial Number is 9C35-8878   Directory of C:\  09/10/2015  10:05 AM    <JUNCTION>     temp2 [C:\temp]                0 File(s)              0 bytes                1 Dir(s)  413,218,836,480 bytes free
 
I'd have to hand copy all text than :P
gimme a few minutes, my machine is getting a bit slow in his old age
oh tits
past the licencing limit
and cant register here, barf
sorry
 
2:30 PM
haha no worries
 
my appartmentcomplex has internet on a PPPoE system, which allows only ONE connection per hardwired wall socket, with required registration through your uni-email
I could circumvent it by buying a router, but I use my machine only for field trips (eee-pc that runs 9h/battery)
my laptop that is* Ive got a desktop for the rest
 
I run into that occasionally at hotels when I'm traveling
I ended up just buying a little travel router so I didn't have to do the stupid user portal every time I switched devices
For a quick implementation in Windows you could do a regex to see if <JUNCTION> is present and use isempty on the return as a logical check, I'd imagine the process is pretty much the same with linux but I don't like putting up answers I can't test.
 
well, good thing is that Ive got 100Mbit internet both ways without restrictions on content or bandwidth usage, and whenever my netbook complains about updates I just ignore it :p
can imagine
 
bit or byte?
bit is like smoke signal bandwidth :p
 
bits, so I peak around 10 Mbyte/s
my little brother just got a 300Mbit cable installed and he keeps nagging me about that :P
 
2:35 PM
I can only dream about speeds that fast :(
 
living on campus isn't so bad in that aspect
I pay just 10 quid a month to hitchhike on the campus cable
 
2:50 PM
Damn you Scandinavians and your Internet lol.
If you're going into research so that you DON'T share results, you're in the wrong field.
The point of research is to share. How the hell can mankind advance if you don't?
I found this rather hilarious post in Academia SE
 
I'm in Boston and I can't even get higher than 7 MB/s in my neighborhood apparently
for $40 a month
 
24
Q: Research adviser is trying to give my thesis to another student. What to do?

GradSoonGoing to sound dramatic, but something just isn't right about research adviser and now she is trying to give my research to another student. I don't know the student at all, but she is attempting to force me into a "partnership" with the guy. He has zero research accomplished in my research are...

This student is pissed because he has to "teach" his project to another student and doesn't want to do it.
Idiot doesn't realize that the supervisor wants the other student to LEARN this guy's project so that the other student can continue the work.
 
lol
he's getting slammed
 
yeah read the comments. Everyone is pissed off at the OP lol
 
read that, enjoyed it.
 
2:56 PM
It was a very good read lol.
 
@rayryeng @rayryeng Im not a Scandinavian alas, this is my regular old Dutch internet. Luleå had 500MBit to my room :D
 
@excaza - I can't even get that. I'm at 35 MBit/s down, 3 MBit/s up for $52 a month :( Canada is one of the worst countries for Internet to Money value.
same with mobile phones.
 
Sweden's got the right to internet in their constitution. Not sure if it is fibre though
 
LOL
 

« first day (71 days earlier)      last day (3164 days later) »