« first day (109 days earlier)      last day (3136 days later) » 

7:00 PM
@Divakar those are not the best because we have to get there before you:P
 
@Divakar that's more or less out of my league :(. Most I can answer are things like "You forgot the add the loop index to your storage variable you scrub", or printing strings in a format.
 
ahaha well use the tools you know @Adriaan!
 
@AndrasDeak Troy actually used the comlex analysis-infinity:
1
Q: Strange rules for complex multiplication with Infinity

Pavel HoloborodkoIs there any explanation for following contradictory results in MATLAB? >> Inf*0 ans = NaN >> Inf*(0+1i) ans = 0 + Infi Second result seems to contradict any sensible standard/library I know. Is it a bug or is there any explanation for this?

 
@Adriaan whut?
 
read the answer you scrub. He even linked wikipedia
 
7:03 PM
Well, his point is that complex infinity can point in any direction.
But that's "duh".
 
and usefull
 
Sure. And basic:)
I have seen a bunch of nans because of this, in fortran
 
"We can't cross the real axis. Let's walk in a circle along infinity!"
 
OK, I didn't know about matlab's Infi
that's twisted.
I actually disagree with the existence of Inf + Infi, it's misleading
 
7:16 PM
Gotta go, you Andriaanas (if such a mix is possible) stay good!
 
lol, good night @Divakar:)
 
mix of names obviously!
 
@Divakar we'll mix next month ;)
 
haha whats next month??
 
good night @Divakar ! Dream about sweet bsxfun
I'm visiting Budapest with my girlfriend
and I have to bring Andras his sweater whilst there
 
7:17 PM
Then I will eventually have to confess that I'm a 55-year-old female truck driver?
 
I will go high tonight on bsxfun hopefully
 
exactly.
 
LOL I'm really hoping you're joking with that sweater:D
 
@AndrasDeak I am interested to see that lass you're naming in your thesis as "family background"
 
@Adriaan you mean the bitch?
she's fast asleep, she had a busy day
 
7:18 PM
wait , sweater and girlfriend and Andras, hmm
 
running around with my in-laws's dog;)
But my girlfriend is fine as well:D
 
ahaha is it like a double date thing?
 
@Divakar I think Adriaan plans so:P
I still have to find out:D
 
nice!
 
well, we can just ditch the girls and go get hammered in a bar :D
 
7:20 PM
@Adriaan you might get disappointed when you get here:P
I'm neither a social person, nor a getting-hammered one:D
 
and never understimate the girls, they might have more fun than dudes
 
@Divakar my girlfriend is even less social:D
 
perfecto!
 
@Adriaan still not too late to go to the Baltics:P
 
evening all
 
7:21 PM
@beaker hey
 
so where does that sweater come in?
hey beaker!
hey Ray! Heard you keeping the job? Good news! @rayryeng
 
Hey! For now yes
but I'm still going to look for another job.
 
thats a good plan
 
It's funny though... myself and the other guy in the R & D dept at work is also looking for another job.
in the end... there will be no one to do algorithm development lol
 
maybe teaching job!
 
7:25 PM
yes that's one possibility :)
There is a university in Toronto that is taking in applications. I'm going to apply
 
or join SO full-time!
kool!
 
They need someone in the Electrical Engineering department who focuses on software... machine learning, computer vision.
haha don't think they'll pay me a lot :(
 
yeah just their website is great, pay isn't ;)
 
nope lol
we will see though
I'm still gonna look around. I have nothing against the company.
This is more about making sure my future is stable.
 
or move to US! You can, right?
 
7:27 PM
I could yes... it will be difficult though
especially with a 5 month old baby
 
yeah because of family being there in Canada I guess
yup
 
The only way I would possibly move to the States is if I had a very good job... like Google :D
 
@rayryeng :)
 
you had one offer from Mathworks, right?
 
I did.
I turned them down because I got a better offer here.
 
7:28 PM
@Divakar @rayryeng if you did, please go there and fix all that nonsense:D
 
I was actually about to accept their offer. I would have been in Boston at this time.
 
go where?@AndrasDeak
 
like not being able to index rand(3)(2,1);)
 
lol.
 
and supporting eval
 
7:29 PM
@Divakar sorry, replied to your post, addressing ray
 
MathWorks was only offering me $65K
 
and allowing overwriting built-ins
 
ah ok
 
Where I work, they are paying me much more.
 
@Adriaan OH YEAH THAT TOO!!!!
 
7:29 PM
and I didn't have to move... so I said sorry MathWorks, I'm staying here lol
but imagine if I did?
 
haha well that would had been great Ray!
Ray from Mathworks on SO!? :)
 
@rayryeng imagine all the cryptic chat comments saying "sorry, can't disclose more"
 
hahhaa I know.
it wouldn't be as fun :)
 
And you couldn't have bashed the pricing policy of mathworks in your talk:D
 
:D
 
7:30 PM
Everey answer would read at the end - "Because I work at Mathworks"
 
I should have said that it's my personal opinion and doesn't reflect the quality of the product.
 
The proverbial hand that feeds you;)
 
"How do you know this!?"
"I work at MathWorks, that's why"
this question lol
0
Q: Why does the same MATLAB code run with different algorithms?

LiuHaoI'm using MATLAB to profile a simple fminunc code and I found that the profiler displays different algorithms when I profile the code once again. Why is it? The code is as below. clear; clc; alpha = 2; beta = 2; nobs = 100; start = [1;1;1]; options = optimoptions('fminunc','GradObj','off','Algor...

 
You would go - "I can Because I am MATLAB!" ;)
 
@rayryeng the duplicate vote icon would show "mathworks" gold badge instead of "matlab" for you
 
7:31 PM
The OP has different inputs and the output has different timings.
The OP is asking why it's different each time.
There are two random calls right before he calls fminunc.
@Divakar :D
 
Not actually
OP asks why the function calls are different
Not completely obvious question:)
 
Yes, it also has to deal with the random iniializations in x and u.
different initial conditions... different function calls.
 
Yeah, I still think that's the reason, but it's less obvious.
Semi-stupid question;)
 
I basically said that x and u need to stay the same each time the user calls the code.
everything has to stay the same if you want to make it so that the timings are relatively the same.
the inputs keep changing, that's why the timings and function calls are different.
ok semi-stupid :)
 
At least he/she is smart enough to use "MATLAB" correctly
the acronym that is in caps
to be technically correct about it
 
7:36 PM
:D
I've seen it spelled in many ways
MATHLAB, Matlab, MALTAB
 
haha I know the first one
 
There was this one comment I made....
 
that MALTAB one was funny
 
"It's MATLAB... not Mathlab... and definitely not Meth Lab"
 
haha meth!
 
7:37 PM
and I gave a link to Walter White's picture.
 
well it's not an acronym, is it? just an abbreviation
 
Yeah it's a combining of two words
 
yeah abbrev thanks! :)
 
like Rosatom
 
Matrix Laboratory
 
7:38 PM
@Divakar sorry wasn't trying to be a smart-ass
it's an important point
 
In my talk, I called it a "portmanteau"
 
acronyms are only valid with capitals
 
haha its all god!
 
@rayryeng that might be the most precise
 
It's all bsxfun god.
 
7:38 PM
good*
:D
 
so it doesn't mean capitals are needed, it should be based on convention
 
or gold!
 
:D
 
And I'm conventionally lazy to capitalize:)
 
me too!
 
7:39 PM
The official spelling is unfortunately all capitalized.
so I stuck with that.
 
@rayryeng that just means they're wrong.
 
unles its MATLAB, I would hate to annoy MATLAB god!
 
I never said they weren't.
 
I do admit that it's weird... to see it like MatLab.
 
7:39 PM
@Divakar MATLAB god will smite you with loops over I
@rayryeng that's the worst of all
 
It just looks... weird.... to see it like MATLAB... means that you're SHOUTING at someone... telling them about the goodness and well being that MATLAB brings to you.
 
matlab for lazyness, MATLAB for officialness
 
yeah would not want that! @AndrasDeak
 
I've seen it spelled like MatLab too :D
MatLab == weird... MATLAB == YES GIVE ME MORE
 
hehehe
and what does "matlab" say?
 
7:41 PM
yeah MATLAB is like I am the president and I am talking, so you all chaps listen carefully. matlab is like I am a question on SO, please answer me, if you have time.
 
^^^^^
@beaker there you go lol
 
lol
matlab == i'm too laid back to shift
whenever you want to answer is cool
 
;)
 
lmao
 
@beaker matlab="plebeians"?
 
7:42 PM
MATLAB == RESPECT MY AUTHORITY
 
lol
 
matlab == I am not worthy. Please don't hurt me
 
matlab=who needs you anyway? I use numpy.
 
hhaha @AndrasDeak
 
Mathlab - I don't know what the hell MATLAB is.
 
7:43 PM
Meth Lab, where am I?
 
:D
 
:P
 
@AndrasDeak matlab == somebody is paying me to convert this funky code to numpy
 
@beaker :D
 
7:44 PM
@Divakar - What's this about the guy I wrestle with? Was it Tyler? lol
I don't really see him around anymore. I think it was because most of them went nuts on him for asking questions here lol.
 
Yeah your wrestling buddy!
 
oh :)
 
@rayryeng "mathlab" == the guys who ask "how can I symbolically automagic this fiddlestick in R?"
 
nah that's Ray. I haven't seen him around recently. Busy at school I think.
 
You like to wrestle with him on weekends, so I have heard ;)
 
7:46 PM
@rayryeng oh I've been meaning to ask: do you know Ray from someplace?
 
wait Ray from someplace?
 
Never knew him until he came in here.
 
another Ray in here?
 
I met him through here.
Yeah, user name OneRaynyDay
he's actually a very nice guy. I haven't seen him around recently.
 
ohhh his name is also Ray?
 
7:47 PM
Very smart. Quick learner. Yeah that's right.
He got into UCLA for CS.
He's learning machine learning on the side, and he asks me for help from time to time.
@Divakar this is a rather interesting code golf challenge
17
Q: Make your language unusable

jimmy23013Try to write some code in your language and make it not satisfying our criteria of being a programming language any more. A language satisfies our criteria (simplified version for this challenge) of being a programming language if: It can read user input representing tuples of positive integer...

@LuisMendo see above.
Write code in your language so that at the end of it, it's not valid to be put on the code golf website lol
 
oh boy, long golf post! Can I hit that? hmm..
 
the best thing for us is to overshadow functions
make a sum variable or bsxfun variable ;)
 
yeah golfing some day maybe!
 
ok :)
 
Maybe when Luis starts python, I will get into golfing :)
 
7:52 PM
basically, the premise is that you write a piece of code in your language... then after this code executes, the programming language can no longer function.
 
so bsxfun = 1?
 
@Dev-iL would be perfect for this challenge. He manages to find ways to break MATLAB all the time
yeah!
 
and then undefined bsxfun func thereafter
its like killing bsxfun! WHY?
 
@rayryeng just call eval and you;re set
 
:D
 
7:54 PM
@rayryeng related:
 
whoever does bsxfun = 1, should die ;)
 
Jul 15 at 18:30, by Dev-iL
I think I broke matlab: builtin = @(varargin)false; clear = @(varargin)false;
@Dev-iL just brought this up a few hours ago, see on the right
 
THAT IS IT
perfect.
 
thats why one must have modules like python, keeps it safe!
numpy.bsxfun don't mess with me
 
0
Q: how does matlab compute X = 1:3 .* (1:4);

Ali NaqviThe answer comes out to be [1 2 3]. Can someone please explain how the computer works out this expression. What is the priority of each function?

 
7:56 PM
I'm trying to find a duplicate
 
some stupid Qs today
 
it's basically the same as doing X = 1 : (3*(1:4))
 
whut. Actually defining A=1:3; B=1:4; X=A.*B doesnt work
 
Yes. This is because there are multiple colons. gnovice / chappjc discussed this at one point
I'm trying to find a duplicate.
@Divakar do you know what I'm talking about?
 
not really
 
7:57 PM
The semantics of multiple colons is ambiguous. This was discussed a long time ago
 
and SO search, god luck!
 
I know. I'm trying google.
 
good luck wont be enuff
 
Found it
11
Q: behavior of colon operator (:) with matrix or vector arguments

Andreas H.We all know the matlab colon operator to create a linear sequence, i.e. 1:5 = [1 2 3 4 5] Now I found that the arguments of the colon operator can also be applied to vectors or matrices. However I do not understand the definition behind. Examples [1 2 3 4]:5 == [1 2 3 4 5] [1 2; 3 4]:3 == ...

 
Ray the Dup hammer!
 
7:59 PM
@Adriaan the end index is a vector
of which the 2:end part is ignored
 
Well gotta go, monday already here!
You guys have fun!
 
Bye @Divakar!:)
 
@Divakar Enjoy your Monday :)
 
good night @Divakar
 
lol take care buddy!
 
8:00 PM
thanks all!
 
Documentation says: If you specify nonscalar arrays, MATLAB interprets j:i:k as j(1):i(1):k(1).
 
Thanks for the upvotes, I hope I'm not lying:D
but @rayryeng this is just one colon
since the 1:4 is parenthesized
 
@AndrasDeak we'll just go serial on your other questions
 
that's why they get [1 2 3]
@Adriaan serial up or down?:P
 
There are two colons
 
8:01 PM
Huge difference:D
 
1:3 .* (1:4)?
 
@AndrasDeak depends on whether you're lying :D
 
@rayryeng 1:4 is [1 2 3 4], a vector. Then 1:3.*[1 2 3 4] is 1:[3 6 9 12]
And then you get i(1):j(1)
 
The duplicate still applies because you're applying the colon operator to arrays
 
Unless @Adriaan sees first and edits to ii
 
8:03 PM
Suffice it to say, I'm not changing it :). You still get an upvote from me.
 
@rayryeng definitely, just not the explanation;)
 
You're more than welcome to flag to reopen though.
 
@rayryeng absolutely unnecessary
I was only nit-picking your explanation:)
 
ok :)
 
Question's an obvious dupe and shows no effort anyway
 
8:04 PM
but yes, you're right. In the end, a vector is being used as arguments in the colon operator.
 
@rayryeng - in order to break MATLAB you also need to redefine builtin,clear,clearvariables
 
@Dev-iL and what about clearing the path?
 
ohhh clearing path :)
 
dunno if it's needed
...or do you mean as an alternative?
 
@Dev-iL either:)
 
8:12 PM
I think builtin and clear is enough
 
nope
 
I don't have any experience in making software useless:D
 
clearvariables too "fo show"
 
0
A: Make your language unusable

rayryengMATLAB The following piece of code makes the environment completely unusable: builtin = @(varargin)false; clear = @(varargin)false; This overrides the builtin function and the clear function with new anonymous function handles. The builtin function ensures that if there are any custom functi...

 
@AndrasDeak You have much to learn, tiny grasshopper :)
 
8:13 PM
@Dev-iL I'm going to give you credit. Do I need to add anything else?
 
Feels like throwing a murder of crows into the engines of a B-747
 
clearvariables = @(varargin)false;
 
@rayryeng and you should, that builtin thing was @Dev-iL's idea. Wasn't it?
 
certainly.
 
Yeah ok no idea how I managed to fix it with clearvars before
 
8:45 PM
is it possible to create an array greater than RAM using memmap in matlab?
 
@AbhishekBhatia based on the documentation I'd say yes, although it'd be very slow.
What I think it does, is that it creates a space on your hard drive which MATLAB can access as an array. So basically you can create an array as large as your hard disk allows, provided your file system is 64bits, otherwise it's max 2GB or 4GB, not sure.
accessing the hard drive however, takes as much time as a three month holiday compared to grabbing a coffee at the office
 
Gotta love your metaphors :D
 
I did steal this one from a CS friend of mine :P
 
@Adriaan 3.6 GB on 32bit
 
@AbhishekBhatia these are the technical docs on memory mapping in MATLAB. I'm still not very convinced of its use compared to just buying 128GB of RAM
@AndrasDeak thanks!
 
9:03 PM
I have used memmaps before python, I understand their use clearly through matlab docs. For ex: how to create a simple random array of size (1000,1000,1000)
it seems I need to create it in matlab first then write it to a file and read using memmap!
when I create in matlab first my RAM blows off.
 
@AndrasDeak read this XKCD blog about the "BEST" algorithm of sorting comments/answers based on votes
they should do that on SO as well if they havent already
 
so does memory mapping work in linux?
 
it should.
 
@Adriaan thanks, I'll read:)
 
Damn you iOS!!!!
 
9:14 PM
@Adriaan what if the data> 128 GBs?
 
then you probably need a server park instead of a homegrown desktop :D
noting your comment about first creating it in MATLAB: I have played with it cache (I think it is called) when I needed some 40GB of space to read in an array and extract 1.5GB of it, but I had the same problem: first it goes into RAM, then to disk. i.e. it blows on your RAM before it can write to disk.
Upon rereading the docs I think memmap is mainly used to provide a quick way of swapping files between separate MATLAB scripts/functions, without having to write them completely to disk using the default file I/O
So to get back to your original question: I'm not sure memmap will. Based on what you are describing I think not. Personal experience also shows MATLAB wants everything in RAM before it starts doing things.
For these kind of problems (my datasets are exceeding 250GB by now), most people use C++ in my field
 
This is really weird! I think it should be otherwise, but I can't find any docs related.
I don't know abt shifting to C++, I could do it in python. I was hoping do it here as well.
 
memmap acts like a middle road between RAM on one hand and writing to disk on the other. Say you have 2GB of RAM and create a 1.5GB array in some function. You do a couple of operations, then want to create another 1.5GB array, do operations and then get back to the first array.
Well bummer, 1.5+1.5=3GB, that's too bad. So you write the array to disk using fwrite or something. Well, go grab coffee and do your workout, because that'll take a while. memmap actually does the same as filewriting, but faster and only for immediate use in MATLAB.
 
9:30 PM
Yeah it seems that!
But ideally what it should is that the OS should write to a file and access parts only what reqd.
That's what it does in python.
0
Q: Memmap in matlab for huge arrays

Abhishek BhatiaI want to create memmap in matlab. In python I could do this by: ut = np.memmap('my_array.mmap', dtype=np.float64, mode='w+', shape=(140000,3504)) Then I use it as a normal array, the OS ensured my memory never overflowed. How to do this in matlab. From the docs it seems it wants to me : cre...

There must some workaround.
 
anyhow sisters, it's bedtime now
 
@Adriaan good night
 
Gnite
 
@AbhishekBhatia not necessarily, not in matlab anyway.
matlab is a huge beast eating memory for breakfast, lunch and dinner.
 
@AndrasDeak yea, that's buried somewhere in that monologue of mine up there ;)
 
9:35 PM
@Adriaan didn't find it, even though I read it;)
 
But honestly that defeats the purpose of memmap.
 
@AbhishekBhatia Or maybe you use it for the wrong purpose...?
 
I'm not sure I understand the challenge. What about this?

path('')
%// Insert new code here

That path causes Matlab to complain (GUI error) after typing every statement
 
> Memory-mapping is a mechanism that maps a portion of a file, or an entire file, on disk to a range of memory addresses within the MATLAB® address space. Then, MATLAB can access files on disk in the same way it accesses dynamic memory, accelerating file reading and writing. Memory-mapping allows you to work with data in a file as if it were a MATLAB array.
memmap is not for treating memory like files: it's for treating files like memory.
 
Exactly!!! any examples?
 
9:38 PM
@Divakar Wait until you see MATL taking off... It may make you want to! :-) I hope to send you guys an unfinished draft soon. I've been working on that, and I'd like to yave your opinions
 
@AndrasDeak @AbhishekBhatia - Not entirely related to your discussion, but anyhow:
0
Q: Working with binary files in MATLAB: load as-is to memory and interpret later

Dev-iLI have some binary files (obtained from a camera), in which frames are stored in some sequential order. The usual algorithm to working with such files would be something along the lines of: open file -> advance to first frame -> read frame -> advance a few bits until the next frame -> read next...

 
why the docs have fwrite everywhere I don't get.
 
@Dev-iL cool, thanks:)
@LuisMendo looking forward to it:)
Although I'm just a bystander
@Dev-iL seems very nasty business:)
 
@AndrasDeak Thanks :-)
 
But then again you probably have a very good reason to do this
 
9:41 PM
@AbhishekBhatia because you have to write the file first?
 
I want to write without loading in my RAM.
 
@AbhishekBhatia I believe those are the examples...
they produce dummy input and write them to files, for reproducibility
then they show the use of memmap...
 
@AndrasDeak Not really :)
 
instead of just saying "imagine a binary file containing 10 uint8 data points"...
 
"Memory-mapping allows you to work with data in a file as if it were a MATLAB array." An example of this would be awesome.
 
@AbhishekBhatia The bits with fwrite just set the scene
the actual example comes in each second block
Such as
m = memmapfile('mybinary.bin',...
'Format',{'uint16',[50 1],'pressure';...
'uint16',[50,1],'temperature';...
'double',[5,10],'volume'},'Repeat',2)
m =

    Filename: 'd:\matlab\mybinary.bin'
    Writable: false
      Offset: 0
      Format: {'uint16' [50 1] 'pressure'
               'uint16' [50 1] 'temperature'
               'double' [5 10] 'volume'}
      Repeat: 2
        Data: 2x1 struct array with fields:
         pressure
      temperature
           volume

The Data property of the memory map, m, is a 2-by-1 structure array because the Format is applied twice.

Copy the Data property to a variable, A. Then, view the last block of double data, which you can access using the field name, volume.
If you can't make use of this then I'm afraid that I will have to continue not being able to help you.
(But the others are generally more patient than me, so that might not be a huge loss for you;)
 
    Using
    m = memmapfile('mybinary.bin',...
    'Format',{'uint16',[50 1],'pressure';...
    'uint16',[50,1],'temperature';...
    'double',[5,10],'volume'},'Repeat',2)
Should there be a file by mybinary.bin already there?
 
yes
they created it
that's what the fwrites were for
 
Thanks for support! But I can still can't get it. Does the file contain the array of same size as we have specified in memmap?
So, when I write to the file the first time using fwrite the array should be in the memory?
Does this make sense?
 
9:59 PM
at least portions of it... see the last link given by @AndrasDeak
 

« first day (109 days earlier)      last day (3136 days later) »