« first day (842 days earlier)      last day (3659 days later) » 

3:51 AM
I'm excited for version 10 too
I hope it comes soon since my student license is about to run out ;-;
 
 
4 hours later…
7:49 AM
@xslittlegrass On Meta, there's a comment that implied it would have been released roughly during April, according to idea of someone from WRI at end of January or so. Obviously, it didn't happen...
Also, preview documentation clearly still has missing pieces in it.
 
8:43 AM
@rm-rf how can I access nest iteration index inside a nest
 
0
Q: Tag merge: Keyboard and Shortcuts

KubaThere is well established but sometimes (e.g. by me) forgotten tag: keyboard. It's tag-wiki is also written and it says that shortcuts is in fact under it's scope. [...] Questions about built-in and custom keyboard shortcuts, [...]

 
 
2 hours later…
10:16 AM
@brama Why don't you count the iterations by yourself?
 
@halirutan Can you give me a simple example? Do you mean I do multiple functions inside nest (actual function "F" to be nested and the counter) or the "F" has the counter inside it?
 
@brama something like this:
Module[{count = 0},
 Nest[
  (count++; Print[count]; # + count) &, arg, 10]
 ]
 
@halirutan great!!..works..Thanks
 
@brama you're welcome
 
@halirutan one small question: what does arg mean?
 
10:30 AM
@brama it's just an example. You can replace the Nest-call with your code. The important detail was only how the count works.
 
@halirutan I got the count thing...
 
10:59 AM
How would you search for IPv4 in strings? StringExpression @@ Riffle[ConstantArray[DigitCharacter .., 4], "."] works but I don't see a compact way to make it precise (0 to 255 separated by dots).
 
11:09 AM
Never mind,
x : StringExpression @@
Riffle[ConstantArray[DigitCharacter .., 4], "."] /;
And @@ ((0 < # < 256) & /@ FromDigits /@ StringSplit[x, "."])
is probably as compact as it gets. :-)
 
11:39 AM
@Akater This should work too:
With[{n = "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)", d = "\\."},
 RegularExpression[StringJoin[n, d, n, d, n, d, n]]
 ]
Example
regex = With[{n = "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)", d = "\\."},
   RegularExpression[StringJoin[n, d, n, d, n, d, n]]];

StringReplace["This here is an ip 123.234.233.111 and we will replace it", x : regex :> "(" ~~ x ~~ ")"]

(* "This here is an ip (123.234.233.111) and we will replace it" *)
@Akater Btw, you have to use 0 <= # to make valid ip's like 127.0.0.1 work.
 
 
1 hour later…
12:47 PM
@MichaelE2 You around?
 
1:25 PM
@halirutan I can spare a few minutes.
 
@MichaelE2 I only wanted to comment here about your comment there.
 
@halirutan Sure.
 
As far as I can see, NValues are used in kind of the same way as FormatValues but when you use N[..] it doesn't matter whether or not your rule is only in a deep sub-expression:
E.g.:
N[a] := Pi;
N[a^2 + 1]
This works although it has the same kind of rule for as you would set with Format[.., TeXForm].
 
@halirutan I think the problem is probably that TeXForm calls MakeBoxes[.., TraditionalForm] before formatting for TeX. Except for a symbol that triggers FormatValues first (somehow). I'm not really very knowledgeable on this stuff.
Gee, I just looked at FormatValues@x...hmm
 
@MichaelE2 Hehe... the problem is that HoldPattern doesn't hold the Format[..,TeXForm] so the LHS is evaluated :-)
That's why the rule looks awful.
 
1:42 PM
@halirutan Does that mean the rule is never used?
 
@MichaelE2 First of all, in the doc to Format you find the sentence
> Definitions given for Format are used before those given for MakeBoxes.
@MichaelE2 Second, I think it doesn't matter that the FormatValues rule look awful. I hope this is only in the display and the rule is stored correctly.
 
@halirutan Well ??x shows the right definition for Format, so it's in there somewhere.
Acutally, it's there. Do Show Expression on the format value. It's in the InterpretationBox.
 
@MichaelE2 Or you block Format:
Block[{Format},
 Print@FormatValues[x]
 ]
@MichaelE2 Does the formatting happen purely through the FE?
 
@halirutan I don't know. I don't think so. From LinkSnooper, it seems the kernel returns the formatted expression.
 
@MichaelE2 Hehe, I was about to setup LinkSnooper as well :-)
Historically, the kernel must do something because something like TeXForm worked in early versions of M.
 
1:53 PM
@halirutan I suspect that the trouble is that TeXForm[x] engages the format rule before anything, but TeXForm[expr] first calls MakeBoxes[expr, TraditionalForm], which bypasses the format rule for x.
 
@MichaelE2 But after MakeBoxes all the symbols are strings. M cannot apply FormatValues correctly after that..!?
 
@halirutan I'm only guessing that TraditionalForm being inside TeXForm trumps the format values. Another guess: the conversion to TeX takes place in a special function where format values are ignored.
 
@MichaelE2 This really is a mess. Thanks for looking into it.
 
@halirutan You bet. I think we have to leave to WRI to fix it. At least for me, there's too much I don't understand.
 
@MichaelE2 I sent them a report for the current beta. Let's see whether they come up with some fix.
 
2:03 PM
@halirutan I would say that they should consider abandoning TeXForm and switch to something like ExportString[expr, "TeX", "Rules" -> {..}]. Unless they can fix it. But it's been a problem since V5 or so. Presumably someone has notice before now.
 
Mornign
 
@Rojo Mornign to you too. :P
 
@Rojo Oha.. still asleep? :-)
 
@halirutan Only my left eye is still asleep
Funny how they open at their own pace
 
@Rojo Parallel processors. Parallax processors, at least.
 
2:15 PM
Hehe
 
@Rojo It's the third cup of coffee speaking. :)
 
Oh, I find formatting complicated too
 
@MichaelE2 @Rojo The 3rd RedBull speaking here..
 
That's cheating you two
I seem to recall having an approximate idea of how Format and all those worked for box forms, but I was never near understanding print forms
 
@Rojo I'm always unsure on how much the FE does and what comes from the kernel. therefore, using a terminal-Kernel or a LinkSnooper is probably a good thing to start with. But as Michael already pointed out, there is much hidden stuff you can only guess about.
 
2:24 PM
@halirutan I think it's 99.999999999% kernel
Yes, the challenge is guessing something simple, even if wrong, that works for most times. Until you bump into a new issue or some Wolfram guy decides to speak truth
 
2:48 PM
@halirutan You there?
You are interested only in understanding if it's intended, bug, how it works, etc, or in a workaround?
 
@Rojo still here, yep
@Rojo I would be interested in understanding how it works/ was intended to work in general. I'm currently searching for a V5.2 or earlier where you have more options to look into the code.
@Rojo Do you have some ideas?
 
@halirutan Not much, but i'm trying stuff
I'll ping you if I get some vague idea
 
3:06 PM
I want it to print 9 thru 0, what am I missing?Module[{TT = 10}, NestWhile[(TT--; Print[TT]), 1, TT > 0];]
 
@brama OK, when I answered your question, I thought you need some iteration number inside the body of you Nest construct. But seeing this example now, I ask myself, why don't you use something like
Do[
 Print[tt],
 {tt, 9, 0, -1}
 ]
 
@halirutan @ this is a different question I have. I want to use NestWhile instead of While loop in my program
 
Without knowing what exactly you try to do, it is really hard to give you tips for good-style programming.
@brama But are the nest functions really what you need for your problem?
You use Nest, when you have a single input and you want to apply a function on it and then apply the function again on the output and so on..
@brama Currently, you don't use the input (1 in your case) at all.
This makes me thinking whether you have chosen the right way.
 
yes...I am doing unknown number of iterations of "a number of steps" till a condition is satisfied. Forget my previous question on Nest iteration index. That was a different problem.
I mean during every iteration, a number of computations are made
 
@brama OK, beside the fact that I still don't think this is the right approach, let me show you why your code doesn't work:
 
3:18 PM
something like this: While [TT>0, TT=0;L1=...;L2=...;TT=Total@L1;TT+=Total@L2]
 
In a call NestWhile[func, arg, test], func and test need to be functions!
@brama Therefore, you want:
Module[{TT = 10},
 NestWhile[(TT--; Print[TT]) &, 1, TT > 0 &];
Please note the & which make both expressions (TT--; Print[TT]) and TT>0 into anonymous functions.
 
That worked....Thanks....
 
posted on May 09, 2014 by Dan Fortunato

If you’ve been anywhere on the internet these past few weeks, there’s little doubt that you’ve come across the game 2048 (made by Gabriele Cirulli). Based on the similar games 1024! (by Veewo Studio) and THREES (by Asher Vollmer), this game has a simple mechanic that can leave you puzzled for days—slide powers of two [...]

 
4:08 PM
One advantage with Point over for example Disk is that it is visible regardless of the plot range. I would like to replace a point with a cross -|-, that also has the property that it is always visible regardless of PlotRange. Is it possible?
 
 
1 hour later…
5:28 PM
0
Q: Preview of a question - to avoid being banned from asking

MathLindI,m rather new here and have low rep. In spite of my state of relative ignorance, I have had the audacity to post three questions that haven't been received very well. One was closed, one was marked "duplicate" and one about programming style has disappeared. Recently I had a question on my mind...

 
 
4 hours later…
9:27 PM
@halirutan Oh yes, indeed.
@halirutan Yes, thank you, I was expecting a RegularExpression solution. :-) (I still can't even read it, it's a shame.)
 
Hey guys, quick question: What's the difference between passing InterpolationOrder into the Method of NDSolve to passing it into NDSolve directly? Is there one?
 
 
2 hours later…
11:24 PM
Hi I have a simple question, why SetPrecision[1.1`,32] give me 1.10000000000000008881784197001252 instead of 1.1 followed by 32 zeros?
 
11:44 PM
@Guillochon Passing it to NDSolve directly influences the final output whereas when you pass it to the Method it influences the interpolation of the steps during the integration
 
@halirutan OK, that's what I had thought it did, but wanted to make sure.
 
@Guillochon You can read about this in the Options section of the help of NDSolve
@xslittlegrass Please read in the details section of the SetPrecision help:
> When SetPrecision is used to increase the precision of a number, the number is padded with zeros. The zeros are taken to be in base 2. In base 10, the additional digits are usually not zeros.
 
@halirutan Ah, I should read more carefully. But what does it mean by adding zeros in base 2?
 
@xslittlegrass Do you know what 1.1 is in base 2?
 
@halirutan OK, I think I get, BaseForm[1.10000000000000008881784197001252, 2] give 1.00011001100110011001100110011001100110011001100110100000000000000000\
00000000000000000000000000000000000000 in base 2
@halirutan thanks :)
 
11:54 PM
@xslittlegrass See, 1.1 is a periodic number in base 2 so you would have to continue the period. If you pad it with zeroes, it doesn't give the same..
@xslittlegrass You're welcome.
 
@halirutan but if I want to pad zeros in the 10 base, how can I do ? For one number I can just change 1.1` to 1.1`32, but how can I do that in program?
 

« first day (842 days earlier)      last day (3659 days later) »