« first day (74 days earlier)      last day (3149 days later) » 
05:00 - 22:0022:00 - 00:00

5:46 AM
@OneRaynyDay - Yeah. You need to keep decreasing the learning rate until you get something good.
 
6:10 AM
@rayryeng gotcha :)
Hey by the way, ray, I made an account on codementors :)
Though I'm not done my coursera course yet... I kind of am interested in implementing something for a project - is it okay if you could help me with it on codementors? :)
it's quite an interesting problem actually. But it's 2 AM there for you I think, so maybe I'll discuss it with you tomorrow if you have time ^_^
 
 
1 hour later…
7:32 AM
0
Q: Write a simulation of a funny game with a dice in MATLAB

user162343I am trying to write a code that simulates the following game: Roll two dice and let x be the sum of them. If x=7 or x=11 then you win. Otherwise roll both dice again until you get x (in which case you win) or 7 or 11 (in which case you loose). Imagine you have a two dice, then if in the first ...

y'all: golf time
all solutions now comprise 15+ lines
 
7:50 AM
@OneRaynyDay - Sure! I'd love to talk about it
@Adriaan - Really? I'm sure I can do it in a few lines
 
@rayryeng oh you're still awake? O_O
 
@OneRaynyDay - Yeah just looking over some Java GUI stuff. I'm codementoring someone tomorrow.
 
ahh I see. Is it cool if I give you the game rules right now to look at? I'm trying to find a way to win the game
With AI
 
sure
 
My friend at Berkeley said "My way of playing this game is so good, I have an ~85% win rate. Your dumb AI tricks won't beat it"
And that was obviously a challenge.
 
7:54 AM
@Adriaan - I think I'll pass. 5 solutions already lol
I've never applied AI to game learning before. I'd have to think about it
 
Yeah true... I'd think maybe reinforced learning would be the only way... Not too sure
 
I'm not familiar with reinforced learning. Bucket list.
 
No reinforced learning in the coursera course?
 
Nope.
 
Aww darn
 
7:57 AM
Bucket List. Been wanting to learn it.
Lots of things on the bucket list for learning
 
Haha, technically the bucket list could be never-ending
but yeah... there's a couple of things that are kind of iffy in terms of clustering algorithms here
At specific numbers(like primes), you have the chance to gain a specific advantage
I don't know how the AI can realize that, unless it has a map of every single # of one player to every single # to the other player
say he'll know exactly what to do at 32 pts vs 75 pts
 
I'm gonna tackle CS229 when I have time. There is a lot of machine learning that I don't know about that I'd like to learn.
I'll have a read at the rules later.
ok going to bed now. I'll see you guys tomorrow.
 
awesome, I'll see you tomorrow then! gnight ^_^
 
8:14 AM
From one of Divakar's answers: "Seemed like a good setup to use bsxfun"... I think I'll write a script that inserts that sentence at the start of all his answers.
Also, one of these days I'll try to come up with a code golf challenge where MATLAB can score well. From power systems: Solving a power flow. (Solving a linear systems ax=b, and using imaginary numbers... Do you guys have any ideas for what type of stuff that requires few bytes in MATLAB, but can be more cumbersome in other languages? (Not too specific (Challenge: output "A not very terrified engineer helped some programmer."), as that would lead to the question being downvoted).
Are there anything MATLAB does very smoothly? Hmm, complex conjugated can't be done in less than one character by any language... Any function names that are very short in MATLAB?
I'll try to make the challenge interesting in all languages, but make it so that MATLAB has a little edge. =) All my question have a score of 15+, so I hope I'll manage something fun this time too... =)
 
 
2 hours later…
10:17 AM
@StewieGriffin There's of course all the basic matrix operations which are reasonably short (tril, conv, \, eig, etc)
@rayryeng my problem was that it more or less requires a while loop in my world, since it runs as long as you haven't won; and that you need to display all kinds of messages, possibly prompting the user for input, in all kinds of different cases. Thus while, if and disp are forced for using
 
 
2 hours later…
12:14 PM
Here's a `bsxfun` practice session for you, if you are really interested.

Consider :

A = rand(4,3);
idx = reshape(1:numel(A),size(A))

Now, re-create `idx` with just `bsxfun` and `size of A`.

Then, go 3D :

A = rand(5,4,3);
idx = reshape(1:numel(A),size(A))

Repeat recreating `idx`. Continue with more dimensions as and when you fill comfortable.

Next up, learn `permute`,as it gives `bsxfun` "flying" power.

Consider again,

A = rand(5,4,3);
idx = reshape(1:numel(A),size(A))

Now, recreate output of `permute(idx,[2,1,3])` with `bsxfun` and `size of A`. Consider all possible combinations
 
Thanks @Divakar !
 
Hope it goes well for you @Adriaan, it's gets better as you use it more.
 
I have at least three years of MATLABing ahead of me, so practise time a'plenty
 
Awesome! You would be a MATLAB guru by then ;)
 
By now I am comforatble in basic MATLAB and machine learning, the rest is quite magic for me
 
12:49 PM
MATLAB does automatic broadcasting of indices, whereas in NumPy, you need to explicitly do it with `ix_`.

So, MATLAB would have -

>> A
A =
2 9 8 9
5 1 9 7
7 9 1 1
1 7 4 5
5 1 9 3
>> A([2 3],[3 4])
ans =
9 7
1 1

Equivalently in NumPy -

In [57]: A
Out[57]:
array([[5, 4, 2, 2],
[0, 0, 3, 0],
[2, 0, 5, 3],
[3, 4, 1, 5],
[4, 0, 4, 8]])

In [58]: np.ix_(np.arange(1,3),np.arange(2,4))
Out[58]:
(array([[1],
[2]]), array([[2, 3]]))
@LuisMendo The formatting isn't helping me hmm!
@LuisMendo But the indexing is just pure fun in NumPy. Specially many things like reshape, etc. are literally "free" performance-wise. When setting values into one dimension, if they are needed to be replicated, that's done internally, so no need to do explicit replication, as we would use repmat here.
To top it all, there is a function for performing multidimensional matrix multiplications, its called einsum - docs.scipy.org/doc/numpy/reference/generated/numpy.einsum.html. Its like mtimesx - in.mathworks.com/matlabcentral/fileexchange/… for NumPy, just very nice tool! You gotta get your hands dirty sometime with these! :)
 
1:12 PM
@Divakar I'm stuck already at *Now, re-create idx with just bsxfun and size of A. *
the basic functions bsxfun can handle that are mentioned in the docs arent of any use I think
 
How about bsxfun(@plus?
 
bsxfun(@plus,size(A)',size(A)) isnt it either
and I cant do bsxfun(@plus,A,size(A)) because their singleton dimensions dont match
 
well you dont have to use A, just the size of A, so how about [m,n] = size(A) and see if m and n help.
 
perhaps I should first understand what bsxfun does with respect to the two input arrays and how they are related... Im just pressing random buttons here (bsxfun(@plus,1:n,1:m) doesnt work, bsxfun(@plus,n,m) gives me 7)
 
One important thing is the concept of singleton dimensions of the inputs to bsxfun.
 
1:22 PM
thats more or less the output of size() isnt it?
"The corresponding dimensions of A and B must be equal to each other or equal to one."
 
That "or equal to one." is basically singleton dimensions they are referring to, that we need to exploit here wit bsxfun.
so, to create a 2D array with bsxfun, feed a column vector and a row vector.
 
use bsxfun(@plus1:n,[1:m]')?
 
yup!
 
ans =

2 3 4
3 4 5
4 5 6
5 6 7
 
But, yeah thats the thing
so you need an offset for each column
 
1:26 PM
bsxfun(@plus,[1:n]-1 ,[1:m]')

ans =

1 2 3
2 3 4
3 4 5
4 5 6
still not what we wanted
 
keep playing :)
you are close!
 
alright, what it's doing now is add to the row [1:n]-1 the corresponding row (1 value) of [1:m]'. Nice, but I need to get the numbers 1:12, not each column being the previous column +1
 
so that input [1:n]-1 needs some change huh?
 
lemme think a bit on this
 
take your time, dont rush it.
 
1:30 PM
Im just going to hand-write it (pen and paper), that usually helps me
 
yup! thats the best method for these
 
@times at least gives the correct first column and the correct last entry, but not quite
bsxfun(@plus,[1:n],[1:n:n*m]'-1)

ans =

1 2 3
4 5 6
7 8 9
10 11 12
@Divakar so close!
 
hmm yup!
transpose it or .. ?
 
bsxfun(@plus,[1:n:n*m],[1:n]'-1)

ans =

1 4 7 10
2 5 8 11
3 6 9 12
almost!
@Divakar bsxfun(@plus,[1:m:n*m],[1:m]'-1)

ans =

1 5 9
2 6 10
3 7 11
4 8 12
done :D
so proud!
 
haha nice!
that makes for one more game for you, if you are up for it
 
1:45 PM
so now an additional dimension?
Ive got ~40 mins
 
ok
 
Im all ears (or actually eyes) for you
 
so same problem, but use m twice and n once
you have used m thrice.
 
so I need to get rid of one instance of m
 
yup!
and just bsxfun, no other function.
hint is - It would be again bsxfun(@plus..)
 
2:15 PM
hmpf. I can initialise the arrays as [1 2 3], [1 2 3 4] and [3 4] basically, without multiplication or subtracting other numbers
 
Try going like this - bsxfun(@plus,[1:4]',something_here)
That [1:4]' basically got us the first column of expected output.
 
that 'something' needs to be an array [0 4 8]
 
so now do reverse engg - How to express m and n to get [0,4,8]
 
[0:m:(n-1)*m], but that wasnt allowed :p
 
thats one way, but any other?
One m and one n.
you are very close you know
 
2:21 PM
the trick is in the n elements, which are equal to the sum over ii of (ii-1)*m, where the sum runs from ii=1:n
but how to code that
bwuk, have to go :(
I'll try and think of a solution in the mean time!
 
ah ok
sure!
dont rush it, see ya!
 
thanks for the time and advice!
 
no worries :)
 
3:04 PM
@Divakar One more reason for me to learn Python... some day! :-)
 
3:57 PM
Morning!
 
4:15 PM
@Adriaan - I see you're getting your hands dirty with bsxfun. Combine that with permute and you've got a good arsenal to tackle a lot of MATLAB problems.
another pairing that goes very well together is unique/accumarray.
 
4:33 PM
@rayryeng yea, the unique/accumarray combination is wonderful. Ive utilised it in my terrainclassification code (though I rounded instead of uniqued, due to the need to preserve the coordinate system)
@Divakar after dinner I'm going heads on with my problem again :D
 
cool
 
0
Q: Letting accumarray ouput a table

AdriaanAccumarray uses two rows of indices to create a matrix with elements on the location of valid index pairs with a value assigned by the specified function, e.g.: A = [11:20]; B = flipud([11:20]); C = 1:10; datamatrix = accumarray([A B],C); This way datamatrix will be a 20x20 matrix with value...

that's how I'm using accumarray
 
woah... 7 separate calls? lol
 
yea, I get [X Y Z R G B Intensity] out of my pointcloud
and I require grid-based averages of [Z R G B I] and the standard deviation of heights, which is the terrain roughness
and with 800M points it's getting a bit memory intens
 
yeah no kidding lol
 
4:42 PM
up to 600M points on a 25cm grid is fine, but the boss wants 1.5billion (with a B) points on a 10cm grid...
 
 
1 hour later…
6:08 PM
@Adriaan: besides, easy questions means easy rep, so don't worry;)
I just didn't want to include this in my comment:D
Oh yeah, and hi everybody, it's been a busy week for me...
 
cheers :P
yea, I encountered it when trying to create a mcve for another question I just answered: stackoverflow.com/questions/32548928/…
 
6:41 PM
0
Q: how to set many arrays value at the same time?

Cherrysa HerrimI need to check in an array all cells with a value under 9. I build an array with the indexes of those cells using find. So I have for example array of values A = [ 2, 10, 3 ] and array of index B = [ 1, 3 ] then I need to set in a new C array the value of index 1 and 3 to 7. How can I do ...

anyone know a duplicate? Ive seem at least three such questions marked as one the past month
 
Hmm..I just overtook you in rep due to your question:P
 
Ghe, but I took way less time getting there ;)
 
true:)
(though I wasn't actively doing anything for a while after my question which made me register)
but it's not a contest
:D
And yeah, you'd still win.
 
The post by Luis Mendo seems t be a good duplicate
12
Q: Linear indexing, logical indexing, and all that

Luis MendoWe are used to different forms of indexing in Matlab: standard (using integers along each dimension), logical (using logical values), linear (using a single index to traverse an array with more than one dimension). At first sight, it may appear that these forms are exclusive: an index is eith...

I should mark that as a duplicate I think
 
can I?
hmm, the answer is a case of find it in Luis' , but not the question per sé I think
 
7:01 PM
Sorry to be a grammar nazi, but isn't it per se? I believe it comes from latin, "as itself" or something
Just since in Hungarian we have "persze", meaning "of course", stemming from "per se intelligitur", meaning "it is self-evident" or something along these lines
 
could be. In Dutch we add the accent to make it explicit 'sé' like in 'say' more or less (when you pronounce it with a Geordie accent)
 
Ah, I see:) And who's a Geordie?
 
Someone from Northumbria, with a ridiculous accent. Check e.g. Ross Noble, a comedian from that area
@rayryeng I didnt know the Community-moderator could mark duplicates. Fancy system
 
Thanks
 
7:32 PM
Yes per se.
@Adriaan - Yup! If the marked duplicate has a lot of activity, the system automatically marks the question as duplicate.... at least from what I have seen
I really don't know what the internals of the Community moderator does
 
7:44 PM
Why do I always fall for the new-to-matlab noob questions >.<
You give them the short and correct answer in 2 lines for them to implement, but then you have to write EVERYTHING for them, since they don't understand it
 
I took a look at his questions...
At least he admits that he doesn't know matlab, lol:D
 
I gave him the two line solution and then I have to suddenly do all his work, since he can't copy two lines :(
 
Well, you gotta draw the line somewhere. They will suck you dry otherwise:D
 
high time I upgrade to R2015b, I can't answer half of the questions since I dont have the functions yet
this was an easy copy-paste luckily. I let him figure out the rest, though this answer will probably go unaccepted and unupvoted down the SO abyss :P
 
unupvoted?:D
 
7:53 PM
or even downvoted since my solution apparently gives errors, since I cant recreate his problem with my old version of MATLAB
 
@Adriaan - I'm on R2013a for Mac and R2014a for PC
I stick with R2013a because that seems to be a happy medium for most people
 
stackoverflow.com/questions/32553638/… can someone quickly check the error the OP's getting?
 
mainly because there are people who don't have the most recent version and this version seems to accommodate most people
@Adriaan - Runs fine.
The OP is probably not putting in the date right.
 
pff
that sucks :P
 
Please enter a date in the DD/MM/YYYY format 03/03/2000

date =

03/03/2000

hello

day =

     3


month =

     3


year =

        2000

This is a leap year
 Its a valid date
 
7:56 PM
tell him please ;)
 
Done.
@rayryeng how do make sure it has 's' flag ? — Santosh 43 secs ago
@Santosh - By copying and pasting the above code exactly into a file and run it. — rayryeng 22 secs ago
 
sorry for letting him loose on you :P
was an easy, but interesting fix. Getting leap years was rather easy once I found their structure
 
gotcha :)
 
stackoverflow.com/questions/32553891/… -> OP asking for more work after I posted an answer ><
 
8:18 PM
Help me out here: is "jajaj" and sorts a hispanic version of "hahah"? A numbered user shows uncanny similarity to a former numbered user with many questions:D But I'm guessing this is just a cultural thing.
 
might want to ask Ander or Luis :P
I'm being stumped by the sheer scope of the stupidity of the Leap Year OP >.<
 
Well, I was thinking that @rayryeng's hobby was linguistics, so he might know:P
 
"ja" is of course "yes" in many languages, including Dutch, German, Swedish
 
Well, yeah, but the context seemed off.
> Well I thought in MATLAB because it will be useful for me in the future and this code was taken from the notes of a student that had a course in matlab a long time ago jajaj but I only thought that is could only need slightly modifications but I can't figure out how to get all the plot, not only the quarter part I've got, and it doesn't matter the plot, [...] – user162343
 
seen that, yest
the j is right beside the h on the usual, US-international keyboard, might be a typo
he does use a ridiculous amount of smileys and msn-language
 
8:22 PM
Could be, but former user353... was prone to saying the same
Maybe those were typos too, lol:D
 
Im done with that Santosh. Just close the damn thing as a duplicate ray
He's asking me to do his homework, I provide a perfect solution, have ray check it and he still gets errors and wants me to debug my perfect code. Urgh, noobs
 
His error tells me that he didn't use the proper format indeed
probably missed the slashes
> So I wrote this small matlab code to check for date validation but I am stuck on how to check for leap year.
yeaaaah right
 
it does seem like a code written by someone in his/her first week of matlab
and getting the actual leap years is difficult if you do not know there's a system behind them
 
But that's not matlab, that's time system.
 
@AndrasDeak Yes, that's Spanish for "hahaha"
We also have "jejeje", which is more or less "hehehe", but the "e" sounds different (between the "e" in "bet" and the "i" in "bit"). It's a plain /e/ in the International Phonetic Alphabet, if you're into that stuff
And "j" in Spanish sounds like a strong "h"
 
8:31 PM
I mean, checking for all months in separate or statements, geez :P
 
And I find it hard to believe that if you write a program on your own which doesn't work perfectly, you at one pont say "rayryeng or if you could provide equivalent program for this that would be helpful Thanks – Santosh".
 
he is quite the little scrub
 
@LuisMendo thanks:) Yeah, IPA helps. I think your e corresponds to our é, only shorter.
 
Yes, Spanish vowels are all short
In fact, it took me some time to grasp the concept of English long vowels :-)
 
I liked Hungary. They had a pizzeria called "Den Haag" with Dutch pizza names right behind the Synagogue in Budapest :D
 
8:34 PM
BTW the reason I lke IPA is that normal letters are written properly, see en.wiktionary.org/wiki/kifli ;)
 
IPA = India Pale Ale ...?
 
international phonetic alphabet:D
 
sounds more dull than ale imho
 
You would think that, but you'd be wrong:P
 
@AndrasDeak Same in Spanish. The vowel sounds are transcribed just as the vowel name. So it's easy. Phonetic transcription is almost same as the word :-)
 
8:35 PM
Many questions starting with "How the hell do I pronounce" can be solved with it;)
 
Yes, it's a great invention, IPA
 
Yup
 
they can also be solved by adding more ale, then everything will be fine anyway :D
 
I hate dictionaries that use their own symbols
I mean, there's a STANDARD!
 
@Adriaan:D
@LuisMendo Yeah, and when people try to use english-spelled syllables to help in pronouncing. I usually get the idea, but it's so ambiguous...
 
8:37 PM
I never got to know a phonetic alphabet. I just learned by listening to the people. That's how I learned English, German and Swedish fluently and passed my classes on French ans Spanish
 
@AndrasDeak Yes. That's supposed to help, but usually not much
 
@Adriaan 'cause that's how you learn a language. But when you face a new word in a completely alien language, it can make all the difference.
 
@Adriaan Wow! Without phonetic symbols I'm a little lost. I would have never known English has two "u" sounds
Like "foot" / "food"
 
@AndrasDeak well I'll be damned, the scrub does indeed get that weird error no-one else has, even when entering the date correct, check his dropbox picture
 
Yeah I saw it:D
I think we should give him concrete shoes and forget about the whole thing;)
Now I wonder if he included the 's':D
 
8:40 PM
@LuisMendo I've been told I have a good ear for languages and can copy the sounds rather good. After living in Luleå for three months I got down to Stockholm for a weekend and people thought I was some native from the North, with that weird accent
@AndrasDeak then he copies very selectively :P
 
@Adriaan, easy for you, your native language is both English and German;)
 
@Adriaan When people don't identify your accent, that's a good signal. They also tell me that: "but you don't have a Spanish accent"!
 
@AndrasDeak Oi! Me native language is Dutch :P
 
@AndrasDeak Hahah yes! So similar!
 
We kicked 'em Germans out you know!
 
8:41 PM
:D
 
@Adriaan Dutch also has the "strong 'h'" sound, right? Like Spanish "j"
 
IPA [x]?
 
Yep
 
as in don quijote
 
Correct! Hehehe
 
8:43 PM
You mean Jejeje;D
 
@LuisMendo jup, Written like a "g" in Dutch. Though if you are from 'below the rivers' , like me, then that sound is soft, whilst if you're from 'above the rivers' that sound it harsh like your "j"
 
And "De Gea". I heard Van Gaal the other day. He said it perfect. I thought "of course, Dutch has that sound!"
 
We have ALL the sounds, that 's why we learn other languages so easily ;)
 
Mahaha
Do you have "ñ"? I bet not
 
except for Hungarian, but that's an arbitrary heap of consonants stirred together in a big pot
 
8:44 PM
It's like Italian "gn"
 
@Adriaan Surely you mean Czech:P
 
similar to our "ng" but not quite. I don't think so. If I think of an example I'll let you know
 
@LuisMendo We do.
 
And I bet Spanish "ll" / "y" not either
@AndrasDeak One point for Hugarian! Jajaja
 
:D
There's some slavic influence, accounting for ny, ty, gy which are softened consonants
 
8:47 PM
Pff, I'm perfectly fine with speaking four languages and able to read old Greek and Latin :P
 
Hungary is in the middle of a lot of countries :-)
 
But then again we have others like cs, dz, dzs
 
Read old Greek? Reeeeally? Oh!
Amazing
 
Yeah, and we came from the east, so we've been around slavic people for a long time.
@Adriaan Do you understand it as well, or just read it?
 
@LuisMendo that's what you get for reading grammar school
 
8:49 PM
I only had one year of Latin. I loved it
 
@AndrasDeak you got me :P had 6 years worth of classes in both. Im a bit rusty, but can decipher things slightly
 
It was an honest question. Despite being familiar with the alphabet, I couldn't read Greek, and understanding is again another thing:)
 
I can manage reading a few words in modern Greek. I was in Athens a few years ago, and many words looked familiar, Spanish having quite some Greek influence (mostly through Latin)
 
stackoverflow.com/questions/32554395/… this like a question you should solve with logarithms right?
 
@Adriaan lol that's my guy
:D
 
8:54 PM
@Adriaan To be honest, I don't understand what is being asked, exactly
 
0
Q: The Monte Carlo method for estimating pi in MATLAB

user162343I want to estimate the value of pi using the Monte Carlo method, this is, A random number generator can be used to estimate the value of pi. So I have found the following code n=input('Number of points: '); x=rand(n,1); y=rand(n,1); figure('color','white'); hold all axis square; x1=x-0.5; y1=y...

this is the guy...
asking geometric problem in matlab without knowledge of matlab and geometry
 
he's trying to prove the limit-becomes-a-derivative theory by setting the increment sequentially smaller
 
beware
 
@Adriaan I see now. Well, h=1e-16 is of the order of eps. They shouldn't go so close to zero
 
I think MATLAB's not able to do this because of eps, that's why I think he should use a logarithm, though I'm not sure how
 
8:56 PM
But the logarithm would be afterwards. Doesn't help, does it?
I would advise just not decreasing h so much
Or use vpa
 
ah no, rewrite the function so he can actually use h = -16 instead of h=1e-16
 
But you have "f(x+h)-f(x)". Log can't help there. I mean for general "f"
 
I had to do this for some very large numbers so I could simulate Bose-Einstein condenstation (although I flunked that ssignment since I was on a volcano in Iceland)
@LuisMendo stackoverflow.com/questions/32554469/… sounds like a duplicate of your indexing question
I think he can use logical indexing to assign his values
 
I don't think it's a dupe of my Q&A, although it's related to indexing
(In fact, my Q&A was only aimed at clarifying the types of indexing that exist in Matlab)
I'd approach it with max's second output
 
hmm?
he changed rather random values imho, that's what Ive used :P
 
9:04 PM
@LuisMendo hola!
brb though
 
I'll brb until tomorrow morning. 2nd year electromagnetism test comming up
good night all
@AndrasDeak only 2 rep behind you! Tomorrow I will overtake you again ;)
 
@rayryeng Hello! How are you doing?
 
Currently thinking about how to solve that problem without max :)
 
@Adriaan Bye!
 
@rayryeng find column-wise?
 
9:11 PM
Yes something related to that :)
I'd use find then use diff on the column indices for non-zero entries, then set accordingly.
I'm gonna try and see what I get
 
@rayryeng use sub2ind ;)
just for variety
 
yeah sure, what do you put in? :)
 
@beaker "find column-wise" is "max (on logical input)"! :-)
 
[1:n],find(A,2)
@LuisMendo Yeah, but we gotta use different words :D
and with find you don't have to use a logical array
 
That's right. find kind-of applies ~=0 automatically
 
9:18 PM
the trick is doing it column-wise, though
 
I figured it out. sub2ind yes at the end :)
 
@Adriaan I'm afraid so. Break a leg at your test. And don't forget, div B=0 as far as we know:P
 
As someone said in this chat: "sub2ind is for softies"! Do the sum manually! :-P @rayryeng
 
Well I'm a softie.
but if you insist :P
 
:-D
I'm kinda softie too (after having checked English dictionary) :-)
 
9:23 PM
speaking of sub2ind...
have you guys ever wished there was a matlab command that gave you the remainder and the quotient of an integer division? ;)
you can do it using ind2sub :)
 
Haha. Yes
 
unfortunately for the purposes of code golf, it's one byte longer than mod and fix
 
But ind2sub is probably full of type checking, range checking etc
Aaaah. Code Golf. Gotcha
Speaking of which... @rayryeng, I think this perhaps can be done with one of those bw-whatever functions used in image processing
10
Q: Surround a string with hashes

Jacob_I've already made this in Python, but it seems that it could be shortened a lot: txt = input("Type something.. ") c = "#" b = " " print(c * (len(txt) + 4)) print(c, b * len(txt), c) print(c, txt, c) print(c, b * len(txt), c) print(c * (len(txt) + 4)) So if the user types: Hello World The pr...

 
@LuisMendo - OK I computed the indices manually :P
 
Hahaha. Well done! That has to be faster. You had my +1 anyway
 
9:28 PM
ok :) lol
ok... the amount of space above and below the text... is that constant?
What happens if there is multi-line input?
 
I think so. It's a kind of "frame"
Hmm I hadn't thought of that
I assumed single line
Someone already asked for clarification about that. No answer from OP
 
And the OP already accepted an answer.
 
CJam of course :-(
 
yup lol
 
good night
 
9:32 PM
@AndrasDeak Good night!
 
@AndrasDeak - Good night!
 
BRB in a few minutes
 
ok!
@LuisMendo - There were a lot of interesting challenges lately.
There was one to write a program to recognize the emotion of a smiley. Given a list of possible smileys, recognize that it's happy or sad.
Easiest thing is to use regex as seen by a lot of answers, but some of them are very clever.
 
that should work :)
 
I was midediting my comment when you commented lol
I was delayed because I was trying to find the duplicate.
 
9:43 PM
hehe... i hadn't even gotten to looking for the dup
 
Those hardcore Code Golf guys are really funny:
10
A: Fixing a Fruit Loop Necklace

Martin BüttnerHexagony, 920 bytes Six different types of fruit loops, you say? That is what Hexagony was made for. ){r''o{{y''g{{b''p{......../........{{<................/{}\;.................>.<.e...........>{<...=..".|..............>}{<...><...............\*;e/....@..............._........._................>...

 
somebody's got way too much time on their hands
 
hahahahaha
 
05:00 - 22:0022:00 - 00:00

« first day (74 days earlier)      last day (3149 days later) »