« first day (432 days earlier)      last day (4053 days later) » 

12:20 AM
@OleksandrR. Give a man a sardine, and he'll ask for a salmon... and your email address
 
12:31 AM
@rm-rf it doesn't make sense to me that someone would post here before even understanding the basic syntax and usage of the language
 
acl
1:18 AM
@Jens, you don't have to be that pedantic, if you don't want to answer the question then don't. If you think the title should be different you can edit the question and type your proposed title. — Barefeg 26 mins ago
he
 
@acl I suppose we could edit the title to "How NOT to get an answer".
 
acl
@MichaelE2 ha, yes. I suppose he's thinking "not evaluate the arguments of the derivatives", or something along those lines. but still, the question as worded is hard to interpret correctly
it's asking the wrong thing really
 
@acl He just changed it. Seems clearer now, at least.
He wants the inverse of differentiating....Hey, Integrate works. Surprise, surprise.
 
acl
@MichaelE2 looks like it
@acl, OK. First, do you have a suggestion for a better title? Second, I assume both of you don't know the answer otherwise I don't see why the title should matter in order to get the answer. — Barefeg 8 mins ago
heh.
 
Seems to be a nice bloke to have around. High social competency.
 
acl
1:35 AM
@Matariki well, probably felt under attack.
 
@acl Might be. Hard to tell the intended tone from plain text.
 
@acl Some don't respond well to criticism. He also doesn't understand yet the community nature of SE
 
1:59 AM
I was recently interviewed by this guy about using M for stats. Thought I'd point out his blog post and suggest others make comments as they see fit. statisticsblog.com
3
@sjo
@SjoerdC.deVries I think you might be an ideal person to look this over.
 
2:21 AM
@Szabolcs Do you have a few minutes to chat? (not here)
 
@rm-rf OK
 
 
5 hours later…
7:51 AM
@halirutan I have downloaded the file. You can delete it now from the server. Many thanks!
 
@Matariki Thank you. My husband is still sleeping, but I will tell him.
 
@halirutan Danke und Gruß nach D
 
 
4 hours later…
acl
12:09 PM
Compile[{x, _REal}, Sin[x]*_REal] // CompilePrint
so, arguments in Compile can have names starting with underscores...
 
 
1 hour later…
1:31 PM
How much is premier service? (I can't get a price in the store because I have v8)
(also :O @ 95GBP for worbench)
 
acl
2:32 PM
this is really a fantastic answer
much much better than some of the stuff that gets 10-20 upvotes...
 
@acl whuber's usually are
 
3:32 PM
Does save as tex work properly? I just blindly tried it and mathkernel's CPU usage hasn't stopped for a few minutes
 
4:02 PM
@Rojo are you still here?
Hello R.M :-)
@acl You could nominate that post for additional attention, or other posts of whuber's as you see fit.
 
Hello Mr.Wiz :)
 
@rm-rf Is Subsets optimized to produce packed arrays in later versions? I mean Subsets[Range@20, {2}] // Developer`PackedArrayQ is True?
 
I doubt it... let me check
False
 
Okay, thanks. Too bad, really, it would be handy.
 
yeah
 
4:09 PM
@Mr.Wizard Alo
 
Rojo, I just wanted to point out that you can still nominate posts for additional attention with my "fund."
 
@Mr.Wizard Thanks. I've just been lazy lately, but I'll give it a thought
 
Thanks, I'd appreciate that.
 
I also wanted to see if halirutan's answer on my IterationLimit question offered a way to get the counter. Got lazy too. Same for the tail recursion question
 
@Rojo It was and I'm very very close to 20k now ;-)
 
4:17 PM
@halirutan I just noticed that your associated chat profile is still StackOverflow -- you might want to change that to Mathematica.
@Rojo Same for you now that I look.
@Rojo oops! I just changed yours for you while playing with the moderator tools.
 
@Mr.Wizard It's appreciated
:)
 
@Mr.Wizard I think I changed it.
 
@halirutan Confirmed.
 
Is there something better/faster now? ;-)
 
4:34 PM
@halirutan nope :)
 
@acl wow... confusing!
@acl yes, I agree. In fact whuber's answers are usually superb.
 
Creating my first Mathematica package and am reading through some of the builtin packages, what on earth is the point of doing SetAttributes[ANOVA,ReadProtected]; in "AddOns/Packages/ANOVA/ANOVA.m"?
since all definitions are still readable by just opening up the .m
(line 646)
 
4:51 PM
@ssch good question. My guess: if the package ever gets pulled into System` , then no changes have to be made. Until then, you're right. There doesn't seem to be much point.
Hi @Rolf.
 
@rcollyer Thanks, wasn't sure if it was some trickery going on
 
@ssch If you do ??function where function is ReadProtected then you see the Options, Attributes, but not the implementation. I find this useful.
@rcollyer Hi. How is life? Busy?
 
@RolfMertig It would print the entire package definition otherwise?
 
@RolfMertig ah, a more cogent explanation.
@RolfMertig busy.
 
@ssch: no, just each function.
 
4:54 PM
ah, that seems like a good thing
 
@RolfMertig you?
 
@ssch Yes. It comes from a long time ago, when there was no FrontEnd and people used text editors and Kernel interace only ( I did that on Dos, back in 1991 or so ..., then Unix)
 
@RolfMertig wow. My usage only dates back to '94.
 
@rcollyer Have to correct exams, just trying to warm up. And go on with some funny webMathematica project (where @Leonid condoled me because I have to meta-program SetDelayed (kind of fun: suppose you want ot manipulate a package programmatically: use Import[ ... "HeldExpressions"] . Then you manipulate the HoldComplete expressions. Nasty, but nice)
 
@RolfMertig I was using Lotus 1-2-3 for math back then, that is, when I wasn't playing video games.
 
4:58 PM
@rcollyer And before Mathematica I used good old Macsyma (from 1986 on). But the pattern matcher made me convert to Mathematica.
 
@ssch usually, this will be done to aid debugging of user code. It avoids all the package internals showing up in a Trace and stops the user from being exposed to irrelevant and possibly confusing implementation detail.
 
@RolfMertig I always hate manipulating Hold and HoldComplete. Had to extract some examples (by some I mean all of them) from the docs, so I feel your pain.
 
@Mr.Wizard I only played Tetris and some russian Dos-game . Mostly I was just working. No distractions at that time by social web-sites ...
 
@RolfMertig I wasn't in college then, or high school for that matter ...
(and, no I won't tell you what grade I was in, it would embarrass both of us.)
 
@rcollyer Yes, wouldn't one want some SymbolicM` package, akin to SymbolicC`? @Leonid, where are you?
 
5:01 PM
@rcollyer In the late 80's this was my "math" program: old-games.com/download/3323/monster-math :^)
 
@RolfMertig That is a very good idea.
 
@ssch In addition to what @RolfMertig and @OleksandrR. said, I add ReadProtected, Protected, Locked for my packages that I eventually share with others, because then if something isn't working correct in their version and mine, it is almost definitely because they tinkered with the .m file (i.e., you can't unprotect to add definitions, etc.)
 
@Mr.Wizard my computer experience consisted of Apple ii's at that point, and of course: Oregon Trail.
 
@rcollyer related question
 
@RolfMertig had not seen that.
 
5:03 PM
@rm-rf Pure evil to tinker with the file and then complain when it doesn't work :D
 
@rm-rf personally I think Locked is just an inconvenience to the user. One already has to make a concerted effort to remove attributes, so unless there's a symbol that if it's changed will break the whole system, I wouldn't use Locked myself.
 
@RolfMertig that's essentially what I did, though. The third argument to ToExpression is very useful.
 
@OleksandrR. They're most certainly welcome to edit the .m file :)
 
Got to run. Lunch with the munchkin.
 
@rm-rf Locked also means you can't use tricks like Blocking symbols, hooking certain functions, etc.
My point of view is that if the user wants to sabotage their own system, well, let them. :)
 
5:09 PM
@OleksandrR. I believe the same too, except I want them to explicitly alter the file I gave them before they can :D I mean, if they really need that functionality, they'll know what to do with it.
Of course, these are small packages not meant for mass use... I'm sure my approach is unreasonable if it were, say, a package aimed at a wide audience for the reasons you mentioned.
btw, @ssch's gravatar reminds me of @Mr.Wizard's old one...
 
@rm-rf the same can be said of Encode ;)
 
@rm-rf I noticed that too.
 
@OleksandrR. Heh, I've never used Encode, but if it fits in with what I've said so far, then consider it included too :D
 
 
1 hour later…
hhh
6:31 PM
I am trying to get this M6 command working with M8, ideas?

GraphicsRow[Table[PeanoGosper[n], {n, 3}]]
 
7:24 PM
Which was the setting that controlled the tolerance of Equal?
I need to change this to get Union, Complement, etc. to take it into account while preserving good performance. Ideally change it in a localized environment (like Block...)
 
@Mr.Wizard Thanks and thanks to everyone who voted on my stuff so that I'm no longer a teenager anymore but instead can call myself to be in my twenties ;-)
 
@Szabolcs Internal`$EqualTolerance
 
Internal`$EqualTolerance and Internal`$SameQTolerance. But these have no effect on Union!!
 
@Szabolcs try Internal`$HashTolerance
 
Nope. Union and related functions are immune to these. I'd consider this a bug ...
I mean the fact that Union is more strict than either Equal or SameQ
 
7:33 PM
@Szabolcs it probably works on hash comparisons, hence why I suggested Internal`$HashTolerance. But that doesn't work either?
 
@OleksandrR. No, it doesn't, undortunately :(
 
In that case it's probably implemented without using Internal`CompareNumeric or Internal`HashSameQ (which these tolerances affect)
 
This is disappointing because providing a SameTest makes Union have a quadratic complexity.
 
@Szabolcs are you working with machine-precision values? If so then you can roll your own with Compile
 
@OleksandrR. It's a list of 2D points. First I'll see if I can get rid of the machine precision comparisions. If it's not convenient, I'll use Compile as you suggested
 
7:42 PM
@Szabolcs BinLists any good to you?
 
It would be good if I had just numbers, not 2D points. But maybe I can make the bin size very large in one direction
But I also have Complement, not just Union, so I want to go through the code and check if I can get rid of these comparisions completely. Sometimes I am working with the indexes of the points in a list, and comparison is not a problem there. But the indexes change when the list of points changes. I need to check if I can still keep working with the indexes.
 
@Szabolcs I'm not sure what you're trying to do here actually
Graphics@Map[
  Composition[Point, Mean],
  BinLists[RandomReal[{-1, 1}, {10000, 2}], {-1, 1, 0.1}, {-1, 1, 0.1}],
  {2}
]
 
hhh
8:37 PM
<< MathWorld`Fractal` <--- what does ` sign mean?
Does it mean that load a function from pkg MathWorld? Why does this have this kind of programmer quotes?
 
8:50 PM
@hhh it is a context mark
sort of a path separator
 
hhh
Why not just <<PkgName["Fractal.m"]?
(it is stupid there is no manual about programming quote)
 
9:20 PM
@hhh If you are more comfortable with it then just compare it to java:
import com.intellij.lang.PsiBuilder;
and now replace the .'s in java to ` in Mathematica
Please further note, that in both languages the context (package) separator can be viewed as directory separator and that it matches the underlying filesystem-structure.
 
hhh
@halirutan yes but why does it have ` on both sides of the function like <<Pkg`Fractal`?
<<Pkg`subDir`subDir`functionName` <-- I cannot fully understand whether the ` acts as a directory separator or alias or shortcut or something else?
 
@hhh It doesn't has it on both sides. It is important that it ends in an ` because then:
If name is the name of a Mathematica context, ending with a ` context mark character, then Get will process this name to find the file to read.
Important is the thing process this name to find the file to read.
 
@OleksandrR. I'm implementing an adaptive sampling algorithm, like here. Sometimes I get duplicate points (that come from different calculations) for various reasons, and it is not easy to avoid this. I need to filter out duplicate points. I used to do this using Union, trusting that it has a bit of tolerance, but it seems it doesn't ...
 
@Szabolcs Couldn't you just write a compare func for Sort which sorts your points wrt the distance and then throw out points which have distance < eps?
 
hhh
I am trying to load file i.stack.imgur.com/aw6EX.png
What is wrong with this? <</Path/to/Mathematica_file?
 
9:33 PM
@hhh It's <<"/Path/to/Mathematica_file"
 
hhh
It needs no programming-quote at the end, why no?
 
@hhh Example: In my search path $Path in Mathematica there is my home dir /hom/patrick and there I have placed a file test
Now I can do either
<< "/home/patrick/test"
or
<< test
 
hhh
but you did not use Programming-quote with neither?! Is ` only for packages? I don't yet get it, trying to re-read manual
 
@halirutan I think I'll use Split, as in First/@Split[Sort[data]]
 
@hhh Now I make something crazy. I build up a directory structure in my home (and remove the test file)
The directory looks as follows:
test/
├── Kernel
│   └── init.m
└── test.m
@hhh And now you can do <<test`
 
hhh
9:41 PM
@halirutan Did you source the file before removal inside Mathematica? So did it have the test file as environment thing? If you close Mathematica and then do the "<<test`", it should not work.
 
Of course it works ;-)
Please read this.. give me a sec
and maybe this tutorial/Contexts
@hhh And you should definitely have a closer look how the usual packages are set up in Mathematica. You find a lot of them here
FileNames["*", {$InstallationDirectory <> "/AddOns/Packages"}]
@Szabolcs how many sampling points are we talking about?
 
@halirutan Up to a million. I'm posting a question right now ...
0
Q: How to remove duplicates from set of machine precision 2D points?

SzabolcsI have a set of 2D points with machine precision coordinates. I need to remove all duplicates. Performance is important. This is the most obvious fast solution: Union[points] Side note: Union[] is much faster than DeleteDuplicates because it relies on sorting, and thus only needs $\sim n \l...

@halirutan Up to a million but the function will be called many times, so it really needs to be fast.
 
@Szabolcs I have an idea.. let me see whether it's worth telling anyone.
 
hhh
10:01 PM
@halirutan << MathWorld`Fractal` <--- so this command uses Get two times?
Firstly, it gets MathWorld and then it gets Fractal
where the MathWorld dir can be found in a dir mentioned in $Path
I cannot fully understand this, why not just <<MathWorld/Fractal`?
 
@hhh Because / is no system-independent virtual file separator!
 
hhh
ERR so ` makes it work with different OSs?! ` means / in OS X and at least most Unixes while ` means \ with Windows...
 
@hhh Yes.
As written in the link I provided.
When you create or use Mathematica packages, you will often want to refer to files in a system-independent way. You can use contexts to do this.
 
@hhh Because that's how the language is defined ... they could have chosen /, but they didn't. They chose `
 
hhh
ok I am starting to understand it <<"/Path/unix/fileName" system dependent while <<Pkg`FunctionName -- system independent, works in any os
 
10:05 PM
It's a bit like asking why isn't the sea called sjø in English
 
hhh
Ok thank you, I think I am starting to understand this.
 
@hhh You should try to not ask the first question that pops into your head. You've now asked several questions in chat and main of the form "What is the equivalent command for randomFunction in Mathematica 8" — there isn't. You'll have to implement randomFunction yourself, and almost always, the page/notebook you refer has the implementation
3
 
10:26 PM
@Szabolcs How do I use Internal`$SameQTolerance which has a value of 2.1?
 
@halirutan Here is is 0.3
 
Ew??
And it does mean Norm[p1-p2]<.3?
 
@halirutan I was just lookup up a question on it. Here you go: stackoverflow.com/a/6626748/695132
> $SameQTolerance gives the number of decimal digits by which two numbers can disagree and still be considered the same according to SameQ.
 
hi :)
Why does Maximize use NMaximize when you give it a function that contains real values?
like, Maximize[0.95x^2-x+a,x] gives a NMaximize error
how would I solve that then?
other than Maximize[b*x^2-x+a,x]/.b->0.95
probably worth to be posted as a Question when I come to think about it
 
@CBenni use 95/100
 
10:39 PM
mkay
 
@CBenni no, this is very well known and probably how 99.9 % of functions behave (e.g. Integrate[Sin[x], {x, 0, N@Pi/3}]), so everyone will probably end up voting it as "too localized" =)
 
ok
but thank you ;)
 
You're welcome :)
 
I wish they would change that
at least add an option that treats 0.93 as 93/100
 
@CBenni You can just call Rationalize on the stuff you pass...
 
10:41 PM
because the function I am working with has 30 decimal fractions
why didnt you tell me earlier ^.^
 
:)
 
I dont know if mathematica will be able to do this tho
 
@CBenni also be aware of this though:
Mar 15 at 21:50, by rm -rf
@Searke While I have you here, do you know why the following doesn't return an integer for the second case Head /@ Rationalize@{5.4 10^10, 5.4 10^11} and returns the same number?
 
it is a function from N^22->R
 
It is not guaranteed that Rationalize will return a rational number (even if the input is not an irrational number)
 
10:43 PM
ok
I will keep that in mind and test if necessary
appears to be working
also, I wish there was some estimate or progress report for epicly long calculations
because if the calculation takes 2 hours, I am happy with that
if it takes 10000000 years, I am not
 
@CBenni well, Mathematica probably doesn't know how long it'll take either :)
 
I bet there are estimates tho
in numerics class, we learned a ton about approximations
even approximate formulas for numbers of steps required to make sth converge
I dont need an exact result, but something +-50% would be good enough ;)
 
@Szabolcs No luck. Even the most direct way using Gather[r]; (where you could extract e.g. the first element of each gathered list) is slower than your approach.
 
@halirutan Gather is slow because it is quadratic again, I think (I'm not sure)
 
@Szabolcs It would help to sort the stuff and let Gather know that the output is sorted.
But that seems not to be possible.
 
10:56 PM
@halirutan But isn't that what Split does?
 
@Szabolcs I had hoped that Gather compares all elements in each group and not only the neighboring.
But I haven't tested it.
With a very big tolerance, your approach would fail I assume.
@Szabolcs @Leonid Consider this:
f[a_, b_] := Abs[a - b] <= 1
Split[{1, 2, 3, 4, 7, 8, 9}, f]
Gather[{1, 2, 3, 4, 7, 8, 9}, f]
 
11:37 PM
@halirutan regardless of run-time efficiency, Gather is not memory-efficient enough. On 10M points it crashed my M.
 
@OleksandrR. Do I have to wonder, why DeleteDuplicates[{1., 1. + $MachineEpsilon}, SameQ[#1, #2] &] works, btw?
 
@halirutan because these actually are SameQ. Despite claims in the documentation neither Gather nor DeleteDuplicates actually use SameQ. They use a smaller tolerance than that.
(I know, confusing, isn't it. :) )
 
Thanks for your help Oleksandr
 
@s0rce no problem, my pleasure
 
I think the compiled solution works and its fast
 
11:46 PM
Compilation and numerics are both rather subtle and mostly undocumented areas in Mathematica, so the more people who become familiar with them, the better, IMO
 
I'm really liking the mathematica compiler and compiling to C
 
BTW, I think Do is likely to be faster than For. The compiler has special support for Do loops.
 
23
Q: DeleteDuplicates not deleting duplicates

Ian HincksIt is not surprising that DeleteDuplicates[{5,5.}] returns {5,5.} because DeleteDuplicates uses SameQ by default, and SameQ[5,5.] is False. However, Equal[5,5.] is True, but DeleteDuplicates[{5,5.},Equal] still returns {5,5.}. It is interesting to note that Union works properly, in that Union[{...

 
@rm-rf well remembered. Maybe still not completely fixed.
 
Do is a tiny tiny bit faster
in this case
 
11:58 PM
@s0rce if there are lots of duplicates one might wish to use an Internal`Bag rather than a preallocated list as well
 
Yah, I thought about that but I didn't get around to testing it
 

« first day (432 days earlier)      last day (4053 days later) »