New answers tagged

2

The code would be: lol[[1]][[2]]


2

(* erase <=3 *) pos={1,2,3,82,84}; Cases[pos, x_?(# > 3 &) :> {x - 3, x + 3}] // Flatten (* keep <=3 *) pos={1,2,3,82,84}; pos /. x_?(# > 3 &) :> {x - 3, x + 3} // Flatten


1

Answer suggested by [b.gates.you.know.what][1] ifs = If[# > 3, List[Sequence[# - 3, # + 3]]] & /@ pos It works!! [1]: https://mathematica.stackexchange.com/users/134/b-gates-you-know-what


4

In addition, using a modification of this regex: (StringCases[#, RegularExpression["[^/]+$"]]&/@list)//Flatten {0208009v1, 0905.0227v1, 0907.5143v2, 0509348v1, 0608711v2, 0002018v2} where list = {{"http://arxiv.org/abs/math/0208009v1"}, {"http://arxiv.org/abs/0905.0227v1"}, {"http://arxiv.org/abs/0907.5143v2"}, ...


3

list = {{"http://arxiv.org/abs/math/0208009v1"}, {"http://arxiv.org/abs/0905.0227v1"}, {"http://arxiv.org/abs/0907.5143v2"}, {"http://arxiv.org/abs/math/0509348v1"}, {"http://arxiv.org/abs/math/0608711v2"}, {"http://arxiv.org/abs/math-ph/0002018v2"}}; In addition to StringSplit suggested ...


2

I found the function StringDelete, and removed white spaces from all elements in the lists. I seem to be using & /@ frequently to thread over the list. speciesList = StringDelete[speciesList[[#]], " "] & /@ Range[Length[speciesList]];


0

@PrintDayChoiceS did not quite give me what I wanted -- it produced the solution or day pick but not as a string. The work around i used in the end was to skip the printing and just execute the API within the Button[] function. Not sure if this is the most efficient. But seems to work for the moment. Thanks again @Kuba :) GetRawDataGrid = Grid[{ {...


2

You need to turn $Context into a string. You also do not need to add the quotation marks, as you are joining strings, so the end result will automatically be a string again. This should do what you want. Clear@Evaluate[ToString[$Context] <> "*"]


Top 50 recent answers are included