« first day (1576 days earlier)      last day (3206 days later) » 

01:30
Anyone around?
@William Me?
@xzczd maybe you can help
Why doesn't this repeat replace multiple times
ReplaceRepeated[
 ReplaceRepeated[
  BoxData[
   RowBox[{"wget", " ", "-", "qO", "-", " ",
     RowBox[{"test", " ", "tacos"}]}]]
  , RowBox[{x__}] :> x
  ],
 BoxData[x__, " ", y___, " ", z__] :>
  BoxData[{x, " ",
    StringJoin[{"\"\<", y, "\"\<"}], " ",
    z}]
 ]
@William The expected output is?
BoxData[{"wget", " ", "\"-qO-\"", " ", "\"test\"", " ", "tacos"}]
@xzczd
Its okay if you don't know, although it appears you do have more experience with M then I do.
01:47
I'm trying to boil it down..
Ah, I see :)
After the second rule is used for once, the expression will become something with the pattern
BoxData[{__}]
so it no longer matches the rule
BoxData[x__, " ", y___, " ", z__] :>
BoxData[{x, " ", StringJoin[{"\"", y, "\""}], " ", z}]
Yes here is a simpler example that boils down the issue
ReplaceRepeated[
 BoxData["wget", " ", "-", "qO", "-", " ", "test", " ", "tacos"],
 BoxData[x__, " ", y___, " ", z__] :>
  BoxData[{x, " ",
    StringJoin[{"\"\<", y, "\"\<"}], " ",
    z}]
 ]
Oh dear god I think I see what you mean
So if I fix it like this
ReplaceRepeated[
 BoxData["wget", " ", "-", "qO", "-", " ", "test", " ", "tacos"],
 BoxData[x__, " ", y___, " ", z__] :>
  BoxData[x, " ", StringJoin[{"\"\<", y, "\"\<"}], " ", z]
 ]
it runs into a lot of issues
how might I fix it?
I hope you didn't freeze your computer
@xzczd
you still there
02:04
Hmm... troublesome. StringTake seems not to notice the "\""
I'm thinking maybe pattern test could be used but I'm not sure.
02:27
@William Are you just trying to surround the words in a string with quotes, except for the first and last?
@MichaelHale here is the actual question mathematica.stackexchange.com/questions/114666/…
I was trying to use the BoxForm of the expression instead of building a parser not sure it would work
Yes what you said is correct
I think I know what to do, give me 3 minute!
@William Not sure if this helps:
"wget -qO- \"http://google.com/line
   break\\\"\" $var" // StringSplit[#, " "] & //
  Replace[#,
    a_?(StringStartsQ@"$") :>
     ToExpression@StringDrop[a, 1], {1}] & // (ToExpression@First@#) @@
    Rest@# &
omg I'm not quit sure what you did
Well it inserted some extra spaces before "break" when I pasted into chat.
02:40
@MichaelHale it doesn't work if you add a space inside the quotes
kinda defeats the purpose of the quotes
Ah true
OK after a long long 3 minutes I've finished a dirty one:
data = BoxData["wget", " ", "-", "qO", "-", " ", "test", " ", "tacos"];

pos = Flatten@Position[data, " "]

Replace[Flatten[
Apply[Replace[(Insert[#1, "\"", {{2}, {-2}}] &)[data[[#1 ;; #2]]],
BoxData[" ", a__, " "] :> {" ", StringJoin[a], " "}] &,
Partition[pos, 2, 1], {1}]], {b__, " ", " ", c__} :> {b, " ", c}]
Oh, I mean
Ideally my example should be generalizable to any number of arguments
data = BoxData["wget", " ", "-", "qO", "-", " ", "test", " ", "tacos"];
pos = Flatten@Position[data, " "]
BoxData @@ Replace[
Flatten[Apply[
Replace[(Insert[#1, "\"", {{2}, {-2}}] &)[data[[#1 ;; #2]]],
BoxData[" ", a__, " "] :> {" ", StringJoin[a], " "}] &,
Partition[pos, 2, 1], {1}]], {b__, " ", " ", c__} :> {b, " ", c}]
@MichaelHale is there a split not for strings
BoxData["wget", " ", "-", "qO", "-", " ", "test", " ", "tacos"]
02:44
@William You mean Split and SplitBy?
Split lists identical elements
To be fair, your question just asked to support line breaks and quotes, lol
I'll give you the bounty if there are no other better answers, but being a shell I thought it was implied
I'll edit it
@William SplitBy[{"a", " ", "b", "c", " ", "d"}, " " == # &]
Yes that works
Now I just need to remove {" "} and merge the remaining values
03:14
How do I remove all instances of the " " character
in a list
This is what I have so far
Map[(If[StringTake[#[[1]], 1] == "\"",
    StringJoin[#],
    StringJoin[{"\"", StringJoin[#], "\""}]
    ]) &,
 SplitBy[{"wget", " ", "-", "qO", "-", " ", "\"test\"", " ", "tacos"},
   " " == # &]]
@MichaelHale
{"a", " ", "b", "c", " ", "d"} /. " " -> Nothing
{"a", " ", "b", "c", " ", "d"} // DeleteCases@" "
neither work
Map[(If[StringTake[#[[1]], 1] == "\"",
     StringJoin[#],
     StringJoin[{"\"", StringJoin[#], "\""}]
     ]) &,
  SplitBy[{"wget", " ", "-", "qO", "-", " ", "\"test\"", " ",
    "tacos"}, " " == # &]] // DeleteCases@"\" \""
nevermind
03:32
@William Can't think out a solution to the original question. Just for curiosity, how did you transform the
wget -qO- "http://google.com/space line
break\"" $var
to BoxForm ?
I can't even finish this step
03:59
@xzczd I just did ctrl+shift+e on the current cell
StringCases["wget -qO- \"http://google.com/  line
      break\\\"\" $var", {a : Shortest["\"" ~~ __ ~~ "\""] /;
     StringTake[a, {-2}] != "\\", Except[" "] ..},
   Overlaps -> False] //
  Map[If[StringStartsQ[#, "$"],
     ToExpression@StringDrop[#, 1], #] &] // (ToExpression@First@#) @@
    Rest@# &
give me a second and I'll post a working example
Maybe that helps. Bed time for me.
Thank you I will definitely look into your example
04:16
@William Oops. Can handle the $var to expression behavior in the first StringCases. Here is a simplification.
StringCases["wget -qO- \"http://google.com/  line
        break\\\"\" $var", {"$" ~~ a : Except[" "] .. :>
    ToExpression@a,
   a : Shortest["\"" ~~ __ ~~ "\""] /; StringTake[a, {-2}] != "\\",
   Except[" "] ..},
  Overlaps -> False] // (ToExpression@First@#) @@ Rest@# &
 
1 hour later…
05:18
lmfdb.org - The L-functions and modular forms database
Saw this being advertised on both Tao's blog and a Numberphile video, so had to take a look at last.
 
1 hour later…
06:48
@xslittlegrass I also got that today.
07:13
@kirma Very interesting; implementing these in Mathematica is possible, but very challenging (mathematically and programatically).
Frankly, for me, it's more like "there's some fancy stuff out there." I have trouble seeing any connection to anything I would be doing either professionally, or in the armchair mode. But it is sort of interesting.
 
2 hours later…
08:54
Hi Kirma could you help me with running Mathematica online using Wolfram Mathematica Online.
 
2 hours later…
11:10
Today my M.SE editor buttons disappeared. Does anybody else have the same problem? I'm using a modified version of that script on Windows 10, Firefox or Pale Moon.
11:24
@Karsten7. Yes, and I'm already aware of this issue.
@Searke Do you know if LibraryFunctionLoad performance can be improved at all, at least in principle? What would be the best place to ask about this to get an informed answer? Support? W Community?
With ~200 functions to load, it is slow enough to be noticeable. On a Raspberry Pi it is very very slow, it takes about a minute to load my package, if I remember right.
But there is a big (> 2x) difference in performance between platforms, with OS X being the slowest. This suggests to me that the bottleneck is in platform dependent code which might be outside of the control of Wolfram developers ...
I should probably just implement lazy loading.
@P.Fonseca Any plans for the afternoon in Marseille?
@Szabolcs You mean, after the sessions?
Yes.
Actually do you know what time they end?
@Szabolcs No. (planning and time). I can imagine an ending at around 17:00.
I'm open to any suggestion! I'm staying in Marseille for two nights.
picking the train to Nice, only on the 2nd, morning.
11:39
Hm, there are more talks than I expected. I have my train back at 18:10.
Unfortunately couldn't take enough days off to go to Nice :-(
Well... I'll be working all time, except for my presentations...
Unfortunately at my current workplace---for the first time---I don't get that sort of flexibility. :(
The balance between flexibility, and the actual possibility of actually taking a day off, is a difficult science... I would prefer to be able to take the day off... With the amount of holidays a French contract has, I typically have a few ones to spare...
12:00
Does anyone know what the Package` context functions do?
 
1 hour later…
13:19
@kirma Apart from the Riemann hypothesis, there's still the BSD conjecture to be dealt with. So, a very active area of research. A good grasp of analytic number theory and complex analysis is the only barrier to entry. ;)
14:18
@Mr.Wizard, @JasonB Someone around?
Hey
I was gonna ask you about the chrome extension (which I love btw)
I have fixed the bug in the editor buttons and the new version 1.3.8 should be available in the chrome store
3
@JasonB You had Chrome, right?
Can you check whether you get an update notification or whether it is easy to update the extension?
Absolutely, just installed the new version but I probably need to restart chrome for the effect (can't just yet)
I had removed it earlier so I don't know about a notification
@JasonB For me it was enough to just reload a page of SE
Right you are
Thanks very much
My favorite is the In[] button
14:22
@JasonB No problem at all. Have fun.
@JasonB Yep, that thing is quite handy.
without it I keep turing the Out[] parts into quotes
Cheers
14:55
@Szabolcs I rarely know anything about *Link
Putting something on the wolfram community doesn't guarantee that a developer ever sees it
If were to send an email to tech support about this, I'm not sure what you'd be requesting.
A suggestion: "Since LibraryFunctionLoad can be really slow on Raspberry Pi, It'd be nice to have some method to lazily load functions"
a bug: " I think there's something wrong with LibraryFunctionLoad because it's 2x as slow on Mac"

« first day (1576 days earlier)      last day (3206 days later) »