« first day (75 days earlier)      last day (3148 days later) » 

12:07 AM
@rayryeng hey Ray, so did you think of a way to maybe implement an AI for that game I linked yesterday?
 
I'd have to think about it. Not sure where I'd start.
 
it's okay if you didn't, I'd imagine you're pretty busy yourself xD
yeah hmm..
 
later all, i'm off
 
@beaker later! :)
 
 
2 hours later…
1:53 AM
@OneRaynyDay - I'll have a look tomorrow. Maybe I can propose something.
 
awesome :) no problem!
It's a sunday afterall, no worries
 
sure.
Is this time-sensitive?
 
mmm yes and no haha
The "contest" ends september 21st, but I'm not really expecting to finish before then
(I go to UCLA, not berkeley so I can't submit the entry anyways)
hmm.. So I'm reading up on the multivariate linear regression using gradient descent...
it doesn't actually look too bad!
 
 
2 hours later…
3:35 AM
@OneRaynyDay - oh :) lol
Did you start your first term already?
 
Nope! It starts next week
Next next week* considering today's sunday for me
 
 
4 hours later…
8:00 AM
@AndrasDeak exactly equal in rep now ^^
 
@beaker If you ever find out how to set vim as default, tell me, I'm quite interested as a full vim user
 
 
2 hours later…
10:14 AM
@rayryeng Another brilliant answer!
 
 
3 hours later…
12:50 PM
1
Q: MATLAB - Avoid repeated values in a vector inside cell arrays and take next

S. PerezThis is the problem: I have a cell array on the form indx{ii} where each ii is an array of size 1xNii (this means the arrays have different size). And another cell array on the form indy{jj} where each jj is an array of the same size as ii. The question is that I would like to create a function...

anyone up for vectorising this?
 
I would just do it with a for
XD
as you did!
 
yea, but Im wondering whether cellfun can do it at all. Problem with all the tmp variables was that logicals (at least isequal) do not work on cells
 
So not interested in speed but in possibility itself
 
both, since vectorisation is usually faster than loops
 
not always, not anymore
 
12:54 PM
and improving readability, since all the tmps are terrible
 
The issue that I see in using cellfun on this one is that you have to access an array of already used value by the previous iterations of cellfun
 
hmm, recursivity coming back to bite me
 
:P ikr
I love cellfun one-liners tho, so I'm gonna search for a way
 
I even stumbled onto a question of someone with ~50 lines of code, asking if he could use parfor. I pointed out that his code was recursive so he couldn't, he answered: "Well yes, that's the complete problem! How to rewrite my code to make it parallellisable." >.,
 
Looks like a code review question haha
 
1:04 PM
Unforunatedly, 95% of Matlab parfor code questions are "I want this fast, and I heard paralel computing is the futureeeeee"
Without actually knowing if the code is paralelizable or not
 
"Make it great before you make it fast"
 
and actually make it work at all in serial before flooding SO
 
That's the moto of one of my IT professor
 
In my uni there was a big discussion about letting Matlab users use the HPC
 
HPC?
 
1:08 PM
IT people were saying "Matlab users dont know how to program, they write bad code and then they trow it in paralel because its slow"
High performance computer
Supercomputer, basically
 
hehe, I completely agree with your uni
 
yeah. People write bad Matlab. very bad Matlab.
spetially in research, where people have zero coding education. Its just a tool
 
as it is for me
 
A hammer will eventually insert the nail , even if you are hitting it with the wooden part....
thats how I see most Matlab users XD
For me also MAtlab is a tool, but I lke to use the metalic part of the hammer
 
Don't start me on this. Had to take over the code of another R&D intern this summer. The temporary variables were : PHI. Then PHI1. Then xPHI. The xPHI1. Then xPHI1_1
sbaf
 
1:13 PM
The research code i've seen in my lab generally has about 20 variables defined in very complex way that are never used later....
 
"Created it just in case we would need it later"
 
@HamtaroWarrior I just used tmp1 up to tmp5 for that cell thing :p
 
or the code is full of if 1==3
instead of commenting the parts...
 
@Adriaan Shame!
 
that irritates me quite a lot
 
1:15 PM
if 1==3? What's the point? Oo
 
not executing that piece of code XD
" commenting it "
 
.. Wow.
 
when they want to run it, they change it to if 1==1
 
Ok I was not expecting this.
I was definitely not ready for this.....
 
hahahaha
 
1:16 PM
I do use switches in if statements a lot, but in the sense of a function which can produce 5 plots, or none, depending on the input value of the switch
 
Yeah, that was my inpresion first time I heard of it XD
 
same with verbosity
 
Yeah, a switch-case like
 
mmmm Its not the same I think. If you are doing research, and you are plotting quite complex stuff in different parts, having a piece of code that "disables" it instead of comenting is reasonable
I often have a "plot_results" boolean on the beggining of my code, as often for debugging I need to run the stuff 100 times
I dont want 50 plots each run
this, of course, only works for research code XD
 
What i do is commenting the pieces I don't want
using vim's sed
 
1:20 PM
Yes, that is my general approach. But I have had some code where the plotting was ~300 lines of code, in order to produce very complex plots
commenting/uncommenting that is a pain.
also , while debugging , I use break.
@HamtaroWarrior Im philosofically against vim, but how does sed work?
 
Why are you against vim? o:

sed's like a basic IDE search & replace, but using reg-exp (posx if I remember well).
 
because I think is too messy for nowadays. I think its a bit counterintuitive and hard to use. I did make alot of sense 10 years ago, but nowadays I preffer sublime or Atom, something more visual and user friendly
 
I agree on the way that it is not intuitive at the begginning and quite hard to take in hand.

But I find it quite powerful as it allows some quick manipulations that make the like way easier. As an example, you want to indent down 50 lines? *< 50 <* and it's done. There are a lot of quick tools like this that I like.
+ I like the idea of not using the mouse at all & vim is great with it
 
Yeah, I understand why its cool
I just dont agree hahaha
 
But the coolest thing about this is that, while working on vim, every non-IT guy looking at you will think you are a hacker ;D
 
1:31 PM
hahahaha
indeed
 
Or just type "tree /" xD
 
8
Q: Big big numbers

muddyfishWhilst trying to golf several of my answers, I've needed to write large integers in as few characters as possible. Now I know the best way to do that: I'll be getting you to be writing this program. The challenge Write a program that when given a positive integer, outputs a program that print...

 
1:46 PM
Hey guys, what are the import capabilities like on Octave? For example, on MATLAB I remember there being quite good text file imports, where you can select quite a few different delimiters
 
can you use bit-encoding in MATLAB for this one? Thus decode the first 64 as a int64, then the next 64 and so on until you eventually reach 10^64^64 (call a for loop 10^64 times with 64 bits)
 
@Dustiny There is no specific thing that makes Octave special with respect to MAtlab, but being free.
And , if Matlab is better than other programming languages for you because it imports text files properly, you are probaly using it for the wrong pourpose XD
 
Yeah it's just one specific application I'm curious about at the moment, it wouldn't be the main reason I would choose one over the other
 
Basically, in my opinion, the only reason you would chose Octave over Matlab is because you dont want to buy Matlab.
which is completely resonable because matlab is f**king explensive
 
Ahh thanks! I'll try it out :D I was going to grab it soon to test out anyways
Might as well see what kind of text file imports it has then do my mathz later
Oddly enough my home-computer still has a R2012a student license on it, but I'm worried matlab would find out I'm not a student anymore and try to sue lol
 
1:55 PM
nah, that wont happen probably. If its for your own playing definetly not. If you are working for someone/deploying software using badly licensed Matlab, yeah, be careful.
 
Ahh okay, well maybe I'll keep using it at home then and just try out Octave for my work computer
 
can anyone tell me why this happens: indx2 = {1;3;3} and then calling indx2{:}=1 or indx2{1:3} = 1
 
indx2{1:3}

ans =

     1


ans =

     3


ans =

     3
Thats why I dont like cell arrays. That indexing gives 3 "ans", not one. Thus you can not set everything to a single value
 
yea, just found that
 
Well using a cell for 3 single-values arrays is no use anyway
Still you can cellfun(@(x) 1, indx2, 'UniformOutput',0)
 
1:58 PM
Of course XD This behaviour is why cellfun makes a lot of sense
 
Yeah :P
 
room topic changed to MATLAB and Octave: Room to discuss MATLAB and Octave related topics - "Mandrill or Baboon: Know The Difference differencebetween.com/difference-between-mandrill-and-vs-baboon " - Ander Biguri [matlab] [octave]
Link was broken
 
why the Madril and baboon?
in image processing, as usual as Lena image, its a mandril image
Luis and Ray had a discussion about it being a madril or a baboon
the link explains it
 
2:08 PM
:P
 
I always thought it was funny that the full Lena image is borderline pornographic
 
It is the front page of a playboy
so yeah XD
 
Ahhhh hahahahaha
 
Back then, when scanners were a hihg tech device few people had, someone scanned the first thing they had close to them
 
lmao
 
2:18 PM
and as getting pictures was very hard, the community started to use that picture
 
I kind of want to question why someone had a playboy magazine next to their scanner / desk
but I think I know the obvious answer to that
 
some years she attended an image processing conference
 
@Dustiny For research purposes, of course.
 
Why does cell2mat(rand(5,1),5,1) result in a 1x1 cell containing a 5x1 double?
 
okay, no imwarp in Octave? grrr...
 
2:21 PM
@HamtaroWarrior I find the articles interesting! okay?!
 
@beaker no image processing toolbox, rigth? or did they released one?
 
@Adriaan I don't get what you are trying to do, rand is outputing an array + you put too much inputs on cell2mat
 
Package Name  | Version | Installation directory
--------------+---------+-----------------------
     control *|   2.8.3 | /opt/local/share/octave/packages/control-2.8.3
     general *|   1.3.4 | /opt/local/share/octave/packages/general-1.3.4
       image *|   2.2.2 | /Users/bryan/octave/image-2.2.2
          io  |   2.2.9 | /opt/local/share/octave/packages/io-2.2.9
        nnet  |  0.1.13 | /opt/local/share/octave/packages/nnet-0.1.13
      signal *|   1.3.2 | /opt/local/share/octave/packages/signal-1.3.2
>> help imwarp
error: help: the 'imwarp' function belongs to the image package from Octave Forge but
has not yet been implemented.
 
@HamtaroWarrior I menat mat2cell(rand(5,1),5,1) of course. So instead of a 5x1 double I want a 5x1 cell array
 
2:24 PM
Ho, it makes sense this way!
 
@beaker Is that all packages or the ones you have installed?
 
@AnderBiguri Those are the ones I have installed. * means loaded.
 
Still, imwarp is just multiplying [i,j,1]*tform
 
yes, but it makes it hard to answer a question from somebody who is using imwarp in Matlab :)
 
you can code your own imwarp in about 10 lines of matlab code
haha indeed
 
2:25 PM
simple question, I know the answer, I just can't verify the code :)
 
but write your own and add it to octaves open source image processing!
 
@AnderBiguri Still a babe!
 
along with affine2d and a new data type... i'm sure several other dependent functions I don't know about...
 
@beaker nah, the data type is not needed
imwarp(I,T), being T a 3x3 matrix
no need of anything more.
 
that depends on whether you want to be compatible with Matlab
 
2:28 PM
Still, this is the expected behavior of `mat2cell`! Doesn't work the same way as `reshape`, be careful ;) if you want a 5x1 cell array, you should do

`mat2cell(rand(5,1), [1 1 1 1 1])`
or more simply
`mat2cell(rand(5,1), repmat(1,5,1))` !
 
@beaker Yeah, you are rigth. However I still dont know why there is a tform data type in Matlab....
 
neither do i... it accepts a normal matrix just fine
 
@HamtaroWarrior cheers, but what if I do not have 5 entries, but a couple of hundred?
 
Then

N = 15; %your number of entries
mat2cell(rand(N,1), repmat(1,N,1));
still I'm not sure why you want to use cells for this ._.
 
@HamtaroWarrior I don't, but the OP wants :P
2
A: MATLAB - Avoid repeated values in a vector inside cell arrays and take next

Adriaanindx{1} = [1 3 2 7]; indx{2} = [3 8 5]; indx{3} = [3 6 2 9]; indx{4} = [1 3 4]; indx{5} = [3 1 4]; indy{1} = [0.12 0.21 0.31 0.44]; indy{2} = [0.22 0.34 0.54]; indy{3} = [0.13 0.23 0.36 0.41]; indy{4} = [0.12 0.16 0.22]; indy{5} = [0.14 0.19 0.26]; indx2 = NaN(numel(indx),1); indx2(1) = indx{1...

now it's at least got the cell structure as output
 
2:38 PM
Okay then!
 
was an interesting fix from the first version of code to the second
had to flex my logical muscles ^^
 
I've been looking @ it but can't find out a way to make it "oneliner" using cellfun & avoiding the looping
 
compressing that beast into a one-liner is quite a challenge :P
perhaps Divakar can do it ;)
 
With the same size of arrays, bsxfun would have done the job tho (Divakar, if you hear us..)
 
the problem is that he stores them in cells, so you'd need to pad all array's to the same size, then plug it into a matrix, then perform your logicals
 
2:41 PM
Yup ikr
Anyway gotta go guys, don't forget to eat your vegetables!
 
eww, vegetables, blegh :(
see you and thanks again @HamtaroWarrior
 
that's cauliflower ;)
whenever we're eating cauliflower at home my mum always buys this to make my dad happy like a five-year old playing with his food
 
hahaha
in english at least that is not cauliflower, its Romanesco broccoli
cauliflowers is the white one
that is, unfortunatedly, not fractal
 
:(
they're both cauliflower ('bloemkool') in Dutch at least
this shatters my world
I hate food names in English, since most of them are derived from that loathsome bunch of characters called French
 
2:52 PM
^ really?
Interesting
 
oh, but fish
fish types they have : salmon, cod, and the rest is just "fish"
 
I ate a solid month Romanesco brocolli for dinner when in High-School, since I did my graduation project on fractals
 
Just broccoli for dinner?
Or had it as a side
 
We call it an "PVM" in Dutch, Potatoes Vegetables Meat
only broccoli, damn, that's a tough life :P
 
Ahhh hahaha good good.
I have PVM everynight
Sweet (or yellow) potatoes mashed, Broccoli (or salad), chicken/fish/steak
Lol quite the diverse life..
 
2:58 PM
I only do when Im at my parents. I hate cooking for 1, so I always make four portions and freeze the rest for re-heating later in the week. And since I do not have a microwave I have to reheat in a pot and with a PVM that's a problem
 
Ahhh yeah
 
My usuals are tomatosauce pasta, chicken curry (with rice) and chili-con-carne
 
I agree, cooking for 1 is annoying... But I somehow still find the time and energy to do it lol
@Adriaan Not bad
Do you not have any vegetables in there though?!
 
yea, I always do
vegi's are good as long as they are not the only constituent of your meal
 
3:23 PM
Hi all! Catching up.
@AnderBiguri - Which answer? I've written a lot since we last talked lol
@HamtaroWarrior - Part of the challenge of any coder is to create meaningful function names and variables XD. You can tell the quality of the coder if they create garbage names.
 
@rayryeng but tmp is a very useful one when you only need it up to next line :P
 
:D
 
and hell, using 6 instances just because we can!
 
3:38 PM
@Adriaan - @AnderBiguri - Doing idx{1:3} generates a comma-separated list
What this means is that it's the same thing as typing in idx{1},idx{2},idx{3} in the command prompt.
 
well, that's rather useless...
 
no not at all.
This is a very good way to unpack cell array and structures.
For example, if we had:
for ii = 1 : 5
    test(ii).val = ii;
end
doing test.val would give you a comma-separated list
You can consolidate all of those into a single array by out = [test.val];.
 
Im not even allowed to enter that statement :P
test(ii).val you need
 
I corrected that already
CSL's are not useless at all. It's the nature of unpacking elements from complicated variables, like cells or structures.
 
hello
 
3:41 PM
hmkay, that's something. But I still prefer not to use cells or structures if possible
 
@Adriaan - Yes, very good :)
However, some image processing functions output cells / structures... so I unfortunately have to deal with them.
 
I usually save my stuff in a cell at the end of complicated functions, like result.data, result.columnheaders, result.inputetc.
 
@rayryeng meh, i dont like cells
 
@AnderBiguri - Eh neither do I :)
but Python lists are essentially cell arrays... you learn to love them eventually.
 
haha, but do they return coma separated lists when called?
 
3:51 PM
:D no.
Python makes more sense that way
 
@rayryeng u one told me to use SVMs instead of neural nets if possible why so?
 
Because SVMs have been shown to be more accurate and more easily trainable than neural networks
Also, SVMs use the "kernel" trick to project non-linear high dimensional data onto a linear space
So classification is naturally better.
Which is why for the last 10-15 years, neural networks were barely used.
It has only become recent due to Google's Deep Dream that neural networks has seen a surge in popularity.
And back then, neural networks was definitely the way to do things. Applications such as digit recognition and autonomous driving were some of the cool applications.
 
well, Deep NN are very good in results, they are just quite dificult to train and code
tranini gcan take weeks
 
are they very difficult to implement or I wud say complex because I don't want use much time I want to do things fast.....because generally when something is better it takes a lot of time
 
I wouldn't say difficult to implement, but they're difficult to train correctly.
with Neural Networks, you have to be careful on what features you use, how many layers your network has, how many neurons each layer has, etc.
SVMs are more forgiving. You can throw bad features at it and it'll still do reasonably well.
like with everything, I will simply say... try both for your application... and see how it goes.
 
3:58 PM
it sounds awesome :)
throw bad features at it and it'll still do reasonably well.!!!
 

« first day (75 days earlier)      last day (3148 days later) »