« first day (459 days earlier)      last day (2419 days later) » 

12:07 AM
wow.. 100k chat messages in this room (happened sometime earlier today)
Hmm... in WolframCompileLibrary.h we have the MTensor_get*DataMacro macros that seem to return this pointer directly. Can anyone confirm or deny that this pointer is the same one that would be produced by the corresponding MTensor_get*Data function?
@OleksandrR. When I remember right, I usually use just e.g. lib->MTensor_getRealData and then work with it.
It's the direct pointer to the data.
@halirutan okay, great, thanks! I was not sure if it was a copy or not since this isn't documented anywhere. For reading maybe it doesn't matter too much but if one is setting elements of a tensor of course it becomes important. Compiled functions always use MTensor_get*DataMacro to get these pointers so I thought maybe there is some semantic difference?
12:24 AM
@OleksandrR. I thought it is documentad in the LibraryLink tutorial in the section about shared passing of tensors..
Of course maybe there is no difference but they just wanted to be able to change the internal representation of tensors in future and for LibraryLink functions still to work
@OleksandrR. Thats possible.
@halirutan yes that's right but it's not so much reading passed-in tensors that I'm worried about; it's when you've created your own tensor using lib->MTensor_new that I'm not sure if you can get the pointer to its data and then start setting it or if you have to use the functions. The LibraryLink examples all use the functions.
@OleksandrR. No, I do this regularly.
@halirutan great! Okay, thanks very much
12:30 AM
E.g. here
MTensor result;
        lib->MTensor_new(MType_Real, rank, dim, &result);
        mreal *ut = lib->MTensor_getRealData(result);
then I work with ut
and at the end I just do
MArgument_setMTensor(return_value, result);
If the data would have been copied, I would get the result
Excellent. :) I was worried when I wrote the Hamming distance code that one had to use the functions (and I was cautious and used them as I never used LibraryLink before) but this really slows it down
@halirutan another question... can we rely on packed arrays always being stored in C order or can they perhaps be in Fortran order under some circumstances?
12:47 AM
May 22 '12 at 3:42, by Brett Champion
@rcollyer Pick[{1, 2, 3}, {1, 0, -1}, Except[0]]
12:59 AM
@J.M. Hi! Did you get a chance to look if the matlab link works on 32 bit Linux?
@Szabolcs I had to leave the computer I tried the thing on for now; will be back to it in an hour or so.
@J.M. Is it Sunday there now?
@J.M. Thanks for trying :)
If it's a problem to get to that computer, don't bother.
BTW does anyone here use R?
@Szabolcs Yes, Sunday now. Sorry for some delays, but I'll be able to give the results later.
I think it's pretty much finished now. Quite a few bugs squashed last week.
The "MATLAB computer" is about a block away from where I am now, so I'll be able to get to it later.
@Szabolcs Good to hear!
1:13 AM
@OleksandrR. I have no idea, sorry.
1:53 AM
@halirutan well, never mind. I assumed that it would be in C order so that I could update the answer. Now it's nearly twice as fast as before and probably the difference between using a computer with the POPCNT instruction and one without will be noticeable now.
It's 20 times faster than the Mma code compiled from C, which I suppose is quite an improvement
2:15 AM
@OleksandrR. I should really get around to learning C, if only to be able to get dramatic speed improvements in my code where possible (and is needed)...
@rm-rf this is actually the first proper C code I ever wrote. But it seems worthwhile to use it when justified.
@OleksandrR. Is there a way to do a PadRight[list, n] in a Compile compatible way? My guess right now would be to write a custom function that's basically res = Table[0, n] followed by res[[;; len]] = list;, where len is Length@list (with appropriate checks for len > n thrown in) and compile that. Do you see a better way?
@rm-rf not sure if it's better or not, but what I would probably do is just make a list of zeros of the appropriate (remainder) length and then join it onto the original list
@OleksandrR. Ah, for some reason I thought Join was not compilable
@rm-rf to be honest it surprises me that PadRight isn't (I've never had to use it in compiled code before)
2:30 AM
Yes, it's an operation that I'd think would've been in the list already...
3:29 AM
Blah, no @szabolcs
4:13 AM
@J.M. What happened? Failed?
@rm-rf Apparently, the MATLAB on this machine is too old. (R2010a)
aah. Oh well...
mengine.exe is complaining about not being able to find libmx.dll
Would you have access to a newer version?
@J.M. No, even otherwise, that old a version is not supported...
No, sorry, I won't be able to see the computer with 2012b until this Friday. :(
4:15 AM
Is that a 32bit machine?
Yes, 32-bit.
Windows 7.
blegh... :P
Well, hell, this university does not seem to believe in Linux. :P
4:16 AM
Just kidding... still good. 32 bit still needs testing
The only Linux computer I have is already too crowded to insert a MATLAB installation.
(and currently churning away at my apartment)
@rm-rf So, the link you guys are leaning on was only introduced in R2011b?
@J.M. leaning on?
The main reason is that it uses MATLAB's internal error checker to catch syntax errors and stuff, because otherwise the low level MATLAB engine crashes. This was introduced only in the recent versions
@rm-rf i.e. you guys are relying on something that was only introduced in 2011b, if I'm understanding things correctly.
Ah, you're too quick... :D
@J.M. The checkcode function is used, and this replaced the older mlint function which was more or less the same (mlint is now not recommended). If everything else is the same, it would be possible to modify it to use mlint for an older version and checkcode for a newer one, but that's something worth doing only if there's a demand for it...
The target audience (i.e., users who use mma + matlab) is already pretty small to begin with...
"only if there's a demand for it..." - oh, of course. Well, I'll still be able to do the tests on the other computer with the newer version, but it'll take a while; Friday's my schedule there.
4:29 AM
No problem, can wait :)
but hell, it's been saving me 4-5 hrs per week right now (will decline eventually)
most important use — instantly zoomable graphics!
4 hours later…
8:16 AM
@rm-rf @MichaelE2 @Rojo Seen this?
Q: Is there a bug in Pick?

gwrI wanted to use the Pick function with a condition. But there seems to be an issue here. Take a look at this: selection = {0,1.2,3,0.,5}; Pick[{1,2,3,4,5},selection,elem_ /; elem =!= 0] In Mathematica 8 it will give {1,2,3,4,5} instead of {2,3,4,5}. Please note, that the Pick function works ni...

8:34 AM
@SjoerdC.deVries ha! completely forgot about that one... (apparently I've seen it, since it has my votes on it)
9:08 AM
is anyone working on patterns of primes ?
10:06 AM
@OleksandrR. This is good news.
3 hours later…
1:32 PM
@SjoerdC.deVries No, I hadn't. I'm glad the answers agree with what we came up with. Perhaps we're no longer confused.
1:48 PM
@SjoerdC.deVries Perhaps we could add another answer or edit one adding the missing bits
2:27 PM
@rm-rf Actually that's not a problem any more because the commands are written to a file anyway and run from there. There's no crash in that case. So that check can be safely removed.
2:41 PM
Has someone noticed that the usage message of GetEnvironment is completely screwed?
Those StyleBoxes should style var and shouldn't be in the message itself.
2:53 PM
That is what you notice when you extract and transform the usage message of 4718 symbols.
Surprisingly, it's really consistent. Only 4 usages made problems.
@halirutan That's just 1 in 1182
3:31 PM
I can't bloody read this guy.
3:55 PM
@J.M. He's very mathematically confused. Did you get my email last night?
@Szabolcs I sent a reply. rm and I also had a chat earlier (see the transcript).
@J.M. No, I mean the only problem was that MATLAB has to be added to the path. It's a bit hidden in the installation instructions unfotunately.
@Szabolcs Oh, you sent another e-mail. I only saw it now. I'll try that on the computer with old MATLAB about tomorrow afternoon.
@J.M. But if it's a Windows computer, then only try if you'd like to play with it. I already tested on win32, it's Linux 32 that may not work.
@Szabolcs Well, I don't suppose one more data point would hurt. :) But, I'll see if I can get a 32-bit *nix machine with the two.
2 hours later…
6:17 PM
Anyone here who wants to try something? Type


and then go in the output between the brackets of `AbsoluteTime[]` and press Space or some other key.
Gives a nice and shiny
Click here to find out if this problem is known, and to help improve
Mathematica by reporting it to Wolfram Research.
@halirutan I get something like that 10 times a day...
@halirutan Here's something better: Block[{$ModuleNumber}, Null]
@rm-rf Indeed, this is better.
You already reported it?
I pointed it out to Daniel and he was shocked too... He said he reported it for me
@halirutan This is version 9?
@J.M. Yes, and Linux
3 hours later…
9:02 PM
@halirutan here too
but I get that almost nonstop
eg every time I copy to the clipboard. so...
(OS X)
3 hours later…
11:49 PM
@MichaelE2 Please don't be shy. Yes I still have "funds" and besides I might bounty something I really like anyway.
@Rojo I shall put +100 on it and consider that I still owe you another +100 on a different post. :-)
Suppose I would like to get a program created in Mathematica to my iPad/iPhone/Android/etc device, is it possible?

« first day (459 days earlier)      last day (2419 days later) »