Mathematica Manipulate: How to extract the values of local variables? - extract

I used random values in Mathematica's Manipulate. Can I get them out from there?

Related

Best way to translate variables in a json array

I have a Microsoft Form (customer facing), that has several fields with values such as UK/Europe. Ultimately within Power Automate, I need the value as "uksouth" for example. I know I could initialize a variable and use if statements to swap them, but that is cumbersome and would make expanding the list later on more difficult.
Not a programmer/developer, and just starting to explore JSON, variable manipulation, etc.

Split Data operator in RapidMiner generates always the same splits

I am using RapidMiner Studio 7.0.001 on Mac OSX platform.
While using Split Data operator, I recognized that it always generates the same splits for my data. I didn't use local random seed and all the sampling types have the same problem.
Any help is appreciated.
In the top level process, there is a parameter called random seed. Set this to -1 to cause a new random seed to be generated from the system time. Make sure the parameter use local random seed in the Split Data operator is unchecked.

Octave(loading files with multiple NA values)

I have a dataset which has a lot of NA values.I have no idea how to load it into octave.
The problem is whenever i am using
data=load("a,txt")
it says error: value on the right hand side is undefined
First, ensure that you are using data=load("a.txt"); and not data=load("a,txt");
If you want to load all of the data from the file into one matrix then use
data = dlmread("a.txt", "emptyvalue", NA);
This reads in the data from a.txt, inferring the delimiter, and replacing all empty values with NA. The code preserves NaN and Inf values.
If you have multiple data sets in the file you'll need to get creative, and it may be simpler to just use the above code and segment the data sets in Octave.

Parse a flat file with multiple layouts to multiple destination tables?

I am trying to load a flat file which mixed multiple data sets. The flat file looks like.
1999XX9999
2XXX99
1999XX9999
2XXX99
3XXXXX999.99
1999XX9999
The first character of the every row defines the record type of the line. I want to create a script component in data flow and parse the raw rows (as the below) and save three output (1, 2, 3) to three different tables. Is it possible?
Table1(col1, col2, col3):
999, XX, 9999
999, XX, 9999
999, XX, 9999
Table2(col1, col2):
XXX, 99
XXX, 99
Table3(col1, col2):
XXXXX, 999.99
Any other way in SSIS if script component cannot do it? The best solution is writing a program to split the file into three files and load them using SSIS?
It is possible, and you probably should use a script transformation to create a maintainable solution.
You won't be able to completely parse your input file into columns using a flat file source and connection manager. Read your lines as full and use string functions in the script transformation to parse each line into the desired columns.
Now to distribute records to different destinations, you can either:
Define multiple outputs on your transformation and use a condition on the first character of each line to determine the output to which you send the columns.
Only use the script transformation to parse the line into columns and use a Conditional Split Transformation to logically divide your records over multiple data paths.
Both methods are logically similar, the implementation is different.

Sanitizing database inputs in Matlab?

Does Matlab's database toolbox have a function to sanitize inputs? I can't find any mention of one in the documentation.
I have a bunch of strings that I'd like to write to a MySQL database. Some of the strings contain apostrophes, and these are causing errors. I'm looking for a simple way to preprocess the strings to make them database-friendly.
Also, it's not necessary in my application to be able to reconstruct the original strings exactly. The preprocessing step never needs to be "undone".
In the end I used matlab's genvarname function to preprocess my strings. This function doesn't do database sanitization, per se, and it's not invertible, but it does remove apostrophes. It met my needs.