« first day (358 days earlier)      last day (2875 days later) » 

Also, isn't this blasphemy? "Do you really think bsxfun with reshape is the best solution?"
As far as I know, bsxfun with reshape is always the best approach, even when there are faster more obvious approaches...
Can't touch this... Nananana...
 
@StewieGriffin bsxfun and permute afaik, but yes
@StewieGriffin @Suever if you're here: Stewie needs your hammer
 
True, but sometimes I can't justify permute...
 
blargh, the chap who said that used i as a loop index
@dora Please consider the other answers as well. Although this is a correct solution, I think it is the worst one posted (in terms of efficient use of Matlab) — Bernhard 1 min ago
 
7:08 AM
A = reshape(permute(bsxfun(@plus, zeros(3,1), ones(1,4)),[3,2,1]),4,[]) is definitely way better than ones(4,3)...
 
hehehe
 
7:53 AM
So you though arrayfun was fast because it doesn't have an explicit for-loop? Think again... JIT for the win! =)
 
arrayfun is a wrapper for a loop innit
 
I know... But to beginners it looks like vectorization... Whohoo, no loops, this must be fast!
 
8:10 AM
UK, don't leaveeeeeeeeeeeeeeeeeeeeee
 
@AnderBiguri Exactly!
 
8:24 AM
I hope they dont leave. It will be a huge mistake for their future
 
9:10 AM
Hi folks
 
Hi there
 
well it will be poo + industrial-grade fan, for everyone, big time
 
@AnderBiguri :-D
@StewieGriffin Well said! :-)
@StewieGriffin arrayfun is (or was) known to be slow
74
Q: arrayfun can be significantly slower than an explicit loop in matlab. Why?

Colin T BowersConsider the following simple speed test for arrayfun: T = 4000; N = 500; x = randn(T, N); Func1 = @(a) (3*a^2 + 2*a - 1); tic Soln1 = ones(T, N); for t = 1:T for n = 1:N Soln1(t, n) = Func1(x(t, n)); end end toc tic Soln2 = arrayfun(Func1, x); toc On my machine (Matlab 2011b...

 
9:30 AM
@LuisMendo, Hammer time?
 
@StewieGriffin Hammered
 
@LuisMendo =)
 
10:07 AM
does anyone remember what the command for matlab syntax highlighting looks like?
 
@flawr In answers? <!-- language: lang-matlab -->
 
oh, it is not language-all
 
@StewieGriffin Rumor has it, that in GPGPU applications that conclusion is dangerous
 
@rayryeng ^^
 
Wanna participate?
http://codegolf.stackexchange.com/a/83654/24877

http://codegolf.stackexchange.com/a/83655/24877
 
10:18 AM
@flawr that's the default, which sucked. Now we have matlab-specific
 
Packet capturing in MATLAB is "fun"....
 
less support, but syntactically correct
 
@AndrasDeak thanks!
 
10:40 AM
@Dev-iL Duplicate :P
I already posted that :P
@flawr you should implement A* algorithm
:P
 
 
1 hour later…
11:44 AM
@AnderBiguri How did the three kings find baby jesus?
 
@AnderBiguri A problem is, that I cannot find any good heuristics, because you can only see the most immediate neighbours.
 
"go left"
 
you mean "go west"?
 
I guess that's something what one first does anyway
@flawr no, "go left", Always left (or always right)
 
since the cheese is on the wall, you will always end up there sooner or later
:D
but I assume something like that is what you're already doing
and this can lead to very long paths, I don't know how scores are computed
I only saw that it's not golf
 
Well you only see exactly what is around you (but you can make your own map). My approach is a depth frist search. The problem is that if you are in a dead end, you have to go all the way back, you can only make steps of one square at a time.
 
yeah, I think DFS is "go left"
 
@AndrasDeak The score is just the number of total steps
 
ah I see
yeah I guess building a map would be much more advanced
 
11:51 AM
That is what my algorithm is doing=)
 
I'm not surprised;)
 
#################################
#!!!! !!!!!!!       !!!!! !!!!! #
#Swww!swwwwww!      swwww!swwww!#
#!!!n!s! !!!n!     !s!!!n!s!!!n!#
#  !nww!   !n!     !s! !n!s!s!n!#
#   !!     !n!!!!!!!s! !n!s!s!n!#
#          !nwwwwwwww! !nww!een!#
#           !!!!!!!!!   !!!!n!! #
#                      !eeeen!  #
#                      !n!!!!   #
#                      !n!      #
#                    !!!n!      #
#                   ees!n!      #
#                    !s!n!      #
#                    !een!      #
This is just one indermediate map. The n e s w entries are just point back to where it was coming from S is the starting position, ! are walls.
The "advanced" algorithm also blocks all the enclosed unmapped areas, as the cheese is always on the wall.
Thinking of that, I could also block the whole convex hull.
Ah no, that probably does not work
 
12:12 PM
@AndrasDeak "Two energy levels are occupied by two spin-1/2 fermions. How many different configurations are possible?" Why's the answer 6 and not 3? I'd say both in 1 state, both in the other, or one in each state = 3 possibilities. 6 suggests me that they are not indisthinguishable
oh tits, there's four possibilities for each in its own level innit? up-up, up-down, down-up and down-down.
 
@flawr If you're interested in search problems, there's one pending, with a bounty of +200 in
 
@Dev-iL Oh lets see=)
 
Well actually, that would be my approach
you see, one has to build a graph and then traverse it
 
Oh you already answered=)
 
no no
my answer is incomplete
 
12:15 PM
@Adriaan there's 1_up 1_down, 2_up 2_down, 1_up 2_up, 1_up 2_down, 1_down 2_up, 1_down 2_down; where k_dir stands for "electron with spin dir at level k"
 
it only brings you halfway
 
Pauli forbids 1_up 1_up, 1_down 1_down and the same on level 2
 
so the OP wants a list of subclasses. I currently can provide a list of all known classes and their parents.
 
@AndrasDeak yea, so that's what I already figured out. Darn, need to think more on my exam in that case
 
@flawr I don't mind making the answer CW if you want to contribute
 
12:17 PM
@Dev-iL Nah, I know about as much about matlab classes as Jon Snow.
 
@Adriaan you bloody well should, lad:P
 
@AndrasDeak it's going to be a proper nightmare.
 
And who need stackoverflow rep-points anyway? The only thing I want is PPCG rep=)
 
@flawr you don't need to know anything about them.. What you need to know is how to take arbitrary objects with connections, build a graph, and then find stuff in it
 
Please be on standby; I might be calling Monday evening fully in tears
 
12:18 PM
@Dev-iL Perhaps after my impending exam=)
 
hehe ok...
 
You know, I'm "studying" right now
 
only Andras doesn't....
 
exams? they are over!
 
@Adriaan :(
is the exam on Monday or Tuesday? Huge difference:D
 
12:20 PM
It's tomorrow=)
 
@Adriaan Are you phone-buddies now?
 
sorry, I meant Adriaans, I just noticed you're having one too
break a leg @flawr:)
is it some nice saucy maths?
 
@AndrasDeak Monday afternoon
 
@AndrasDeak somebody else's, obviously ;)
 
Graph Theory, so no, just some dirty applied stuff.
 
12:20 PM
@flawr oh, condolences
may the Barabási--Albert graphs give you strength
(I only know that because they're my people)
discrete maths and I don't mix
 
@Adriaan Good luck too!
 
@flawr you 's well
@Dev-iL yes, we are. Though I haven't actually called him ever
 
At least somebody here has friends :'(
 
@Dev-iL I'd call it fans/stalkers
 
user image
2
 
12:29 PM
@flawr I don't get it, but it looks fancy as fuck
 
Doesn't matter. Looking fancy is the most important thing in science=)
4
 
tho sysmetric sparse matrices
<3
 
Graph based solver <3
 
@AnderBiguri adjacency matrices
 
I really like the shape sparse matrices take in graph theory/ FEM
yeah, was going to say that :P
 
12:31 PM
:)
 
I did some FEM stuff early PhD
 
I assume, at least one or two should be that
 
@ballBreaker check these dudes out:
@AndrasDeak Yuli has humour in his multiple choice:
A boson bath
 a. is what you use to clean your bosons;
 b. has a spectrum which is analytical in the upper half-plane;
 c. is a simple way to model a quantum system coupled to many degrees of freedom.
I love option a
 
lol:D
that doesn't sound very hard
 
Irecently discovered this youtube channel: youtube.com/channel/UCoxcjq-8xIDTYp3uz647V5A
as an engineer tha kind of lieks maths
I am enjoying it enormously
maybe some of you also will
it has interviews with amazing mathematicians
plus explains a lot of fancy maths problems very easily
 
12:41 PM
@AndrasDeak I'll send you the multiple-choice + answers. Then you can judge :p
 
12:52 PM
@AnderBiguri I like the 3d gears!
 
haha they are really nice
I just watched Sum(n=1,inf)n= -1/12
WTF
 
overflow obviously
 
Yuli fell into the typo trap of Lorentz--Lorenz
 
:P
 
also, that exam is pretty easy, if you know the drill
 
12:55 PM
yeah im jsut watching more videos
because I cant deal with that
 
I like that one with the 5 fermionic operators
 
not rigth now.
Can imagine that adding all positive integers, it gives me a negative
 
@AndrasDeak he actually has a bit in the book written about it, the difference between the two that is
@AndrasDeak care to explain? I got to a+(1-n_l)n_k
(where a+ is the creation operator)
why that's equal to zero is beyond me though
 
@Adriaan well look at state k
 
oh tits. If there's no fermion in it, it becomes 0, if there is one, you can't add one so it becomes 0 as well
 
1:01 PM
yup
 
köszönöm! Te vagy a leggjob!
 
a^+_l a_l doesn't change particle count
so between a^+_k and a^+_k there's no change in electron count, but you can't have two electrons in the same eigenstate
 
yes, makes perfect sense
can you take over Yuli's job? Then at least the class will understand the course :P
 
well the proper thing is to write out the commutors and such:)
it's only a possible shortcut to notice this
 
@AndrasDeak jah, I did
I just should've noticed that fermion's can be with only 1 per state
 
1:05 PM
yes:P
 
I'll try to be more careful sensei
 
but if there was another combination of operators between the two a^+_k, it could've turned out not zero in cases where the other index coincides with k
so you really need to be careful
 
@AndrasDeak Careful, I will be master
 
1:17 PM
@AndrasDeak on Tuesday I was in a bar with my sister+brother in law because my sister had her birthday. I then had to explain why QM is of any use, to a banker and a doctor (the one healing patients)
 
sorry, gotta go now
ask them how they expect to plug their laptop into the mains without QM
(you need tunnelling for a sensible current to flow)
 
didn't know that, interesting
have fun today!
 
well, anecdotally
thanks, you too:) I'll be back later
 
I'll be reading Yuli's book till 17:15, then off to Amsterdam
 
1:42 PM
@AndrasDeak just to get back at this; page 176 in the book: Lorenz gauge, Lorentz covariant
 
2:02 PM
@excaza I undrestand, but how some engineering softwares does that to the given matrices? I think there must be a possible way — Hadi Aghandeh 1 hour ago
Sigh
 
 
3 hours later…
4:44 PM
@AndrasDeak, your countryman accepted my answer on the hypercube problem.
It's a bit unfortunate, really. I would have liked to have seen more answers.
 
hmm...well you can still tell them to wait if they agree:P
but good job:)
i haven't looked at yours yet, let me see...
 
I thought about mentioning it, but I think the OP felt a bit like everybody was criticizing his question from the beginning.
 
very nice:)
 
I still don't understand how the JavaScript answer generates the rotation matrices, and I can't get the snippet to run.
 
@beaker yeah I can see that
stupid comments like this don't help either
 
4:49 PM
yeah, that was a late one piling on :(
 
@beaker P("0267fd9804c8ab915dcefb37546ea2310").map((e,i) ....
that might be some base64 for them
or maybe those are the vertices...
 
@AndrasDeak That's the vertices... 33 vertices in the cycle
 
ah OK
 
5:08 PM
@AndrasDeak Okay, I see what they're doing...
(...[[1,2],[0,2,-1],[0,1],[0,3,-1],[1,3],[2,3]][i])),e)),
contains the row/column indices (zero-based) for the cos/sin values
the -1 is for change of sign on the sin values
 
ah, tricky:)
I had this suspicion too, but the mixed 2- and 3-index vectors convinced me otherwise
 
that's what threw me at first... couldn't figure out what a -1 index was
wtf...
@AndrasDeak ok I suppose I get what you are saying. It's just hard to conceptualize a shape since we can only understand up to 3D as humans. — Ashwin Gupta 18 mins ago
why comment then?
 
5:54 PM
@beaker exactly
asshole
@beaker -1 is "last index" in python, mathematica, etc.
 
yes, but i don't think JavaScript has that, right?
What does this even mean?
Try adding a period for the types. Often that helps: praq=pr.(1:1:99)Christina Docenko 22 mins ago
 
 
1 hour later…
7:10 PM
Do you realize what mod(x, 1) is? In particular the fact that it's constant, regardless of x? — twalberg 2 hours ago
lol
@Suever The problem is the script I want to use is already there and is pretty huge and load a big amount of data I want to load just a few sections in it — Umar 3 hours ago
is "laziness is not a problem" a constructive comment?
 
 
1 hour later…
8:17 PM
@excaza lol
well this post went from dumb to interesting.
1
A: Clearing selected variables from MATLAB's workspace in a performant way

SueverRather than using eval you can simply use the function syntax () to call clearvars and pass your VarsToKeep to it using {:} indexing to create a comma-separated list. clearvars('-except', VarsToKeep{:}); As far as why it is slow, it really depends on how many variables that you are removing. I...

 
8:42 PM
lol
I wonder how long the generated regex string is for his case
 
9:00 PM
Yea that's what I want to know
what his average variable name is
I_love_underscores_in_my_variable_names
I added a benchmark for good measure @excaza using variable name length of 25 chars
 
 
2 hours later…
11:06 PM
@Dev-iL @AnderBiguri I think you guys will like this one: discrete Fourier transform with gears, cams and springs
 
let's see....
@LuisMendo Not bad :)
 
that's like a specialized Babbage engine, right?
oh, no, it has springs and shit
nice
 
@AndrasDeak I guess it's similar. I don't know how that one works, other than that it computes derivatives?
 
wow that's some engineering porn there too
 
Hehe
It's like Amro's script, but in real life
Oh. I repeat myself :-)
Jul 21 '15 at 18:36, by rayryeng
OHhhhh
 
11:16 PM
:)
 
And you repeat Ray :-P
Jul 21 '15 at 18:36, by rayryeng
Is this the Babbage machine?
 
The next movie (analysis) is also pretty cool
 
@Dev-iL Yes, the four of them actually
 
@LuisMendo except I know it's not:P
 
This is the script by Amro I was referring to
 
11:19 PM
the only thing I know about the difference engine is that it has a buttload of cogs and it's a calculator
 
@AndrasDeak Me, more or less the same
 
not an SFT (slow Fourier transformer:D)
 
> This series on Albert Michelson’s Harmonic Analyzer celebrates a nineteenth century mechanical computer that performed Fourier analysis by using gears, springs and levers to calculate with sines and cosines—an astonishing feat in an age before electronic computers.
 
@LuisMendo WOW
 
@AnderBiguri I knew you'd like it :-)
So Brexit or Brestay? How did that go?
 
11:23 PM
still counting
 
Bremain*
 
latest estimate was 52:48...talk about close call
 
but yeah, still counted 5 places only
 
@AnderBiguri Haha. That's much better indeed. My "e" was out of place
 
hahaha
hopefully remain
we will see
Gibraltar 95% remain XD
 
11:26 PM
:-D
 
Imagine the poor fellas leavin the EU and getting trapped betwen 2 continents that they dotn belong to anymore XD
 
I wonder if Scotland ruined it for them :P
 
They will vote remain to piss of english :P
 
it's all very gripping
 
Im oigng to bed
I really really hope tomorrow I dont need to stat looking for a visa :P
 
11:34 PM
@AnderBiguri It wouldn't actually be implemented for several years, though
 
I know I know
well a couple of them
they promised that a Yes would be carried in less than 2 years
 
hm... I thought I read that the process for exit required them to wait several years, but I could misremember
 
no really sure about the technicallities
but definetly the UK goverment needs to deal with everithing within two years
maybe then the process is slow
 
well, I'll keep an eye on it for you ;)
 
I think I'll add the Github repo feed to this room
 
11:41 PM
Going to bed! Bye!
 
Good night!
Get ready for some spam....
 
Dev-iL has made a change to the feeds posted into this room
 
Good night
 
Dev-iL has stopped a feed from being posted into this room
 
Need to find a better way for ^
 

« first day (358 days earlier)      last day (2875 days later) »