How do I get SchemaCrawler to export actual table row data to the text output? - database-schema

How do I get SchemaCrawler to export actual table row data to the text output? I can't find a example anywhere, nor documentation that refers to this option, although I have seen references on the internet implying that it can be done. I am able to export information about the schema, but it is just missing the data.
I'm using the Oracle version of SchemaCrawler. I'm using schemacrawler.config.properties but I cannot find a list anywhere of all the possible options. The command I use is like this:
java.exe -classpath lib/*;. schemacrawler.tools.oracle.Main -infolevel=maximum
-database=%5 -g=schemacrawler.config.properties -user=%1 -password=%2
-schemas=%5 -port=%4 -host=%3 -table_types=TABLE -command="SELECT * FROM %5.%6"
-sortcolumns=true

Try this:
java.exe -classpath lib/*;. schemacrawler.tools.oracle.Main -infolevel=maximum
-database=%5 -g=schemacrawler.config.properties -user=%1 -password=%2
-schemas=%5 -port=%4 -host=%3 -table_types=TABLE -command=dump
-sortcolumns=true
or this (see enclosing quotes for the command)
java.exe -classpath lib/*;. schemacrawler.tools.oracle.Main -infolevel=maximum
-database=%5 -g=schemacrawler.config.properties -user=%1 -password=%2
-schemas=%5 -port=%4 -host=%3 -table_types=TABLE "-command=SELECT * FROM %5.%6"
-sortcolumns=true
Sualeh Fatehi, SchemaCrawler

Related

OrientDB: How to return plugins results?

I have create a java-function that return the full path between two OElement but I do not found the correct way to return it results.
Actually it collect all the path in ArraList<ArrayList> but it is not shown in the Studio. I suppose that I should use something like OResultSet but I don't found anythig about its.
Example:
I implemented this: fullpath(from, to, maxDepth, conditions)
select fullPath(#58:0, #65:0)
n1,path_1,n2_1,path_1,n3_1,path_1,n4
n1,path_2,n2_3,path_1,n4
n1,path_1,n2_2,path_1,n3_2,path_1,n4
n1,path_1,n2_2,path_2,n3_3,path_1,n4_1,path_2,n3_2,path_1,n4
and I'am working on this:
select fullPath(n1, n4, 100, include(path_1))
n1,path_1,n2_1,path_1,n3_1,path_1,n4
n1,path_1,n2_2,path_1,n3_2,path_1,n4
The code is here: fullPath on github
Thanks.
I think the main problem here is that the result of the function is being returned as a single result, so Studio cannot manage it.
As a first attempt, I'd try to do a
SELECT expand(fullPath(...))
This will definitely work in the tabular view in Studio, but it will still not display in the GRAPH view.
For the GRAPH view, my suggestion is to put all the RIDs in a single ArrayList and then do the expand()
With ArraList<ArrayList> did not work, but an ArrayList<OIdentifiable[ ] > did the job.

fiji macro how to use given luts and plugin

I need to write a macro in Fiji.
First I record a macro to do what I wanted. The result was the following:
run("Size...", "width=512 height=512 depth=497 average interpolation=None");
run("Rotate 90 Degrees Right");
run("Flip Horizontally", "stack");
run("Make Substack...", " slices=5-300");
run("isolum_cbs_strict");
run("Z Code Stack", "depth=Current");
run("Z Project...", "start=1 stop=296 projection=[Standard Deviation]");
I would like to do it in a batch mode. So I write a macro myself:
file = getArgument;
if (file=="") exit ("No argument!");
setBatchMode(true);
file_vasc = file;
open(file_vasc);
run("Size...", "width=512 height=512 depth=497 average interpolation=None");
run("Rotate 90 Degrees Right");
run("Flip Horizontally", "stack");
run("Make Substack...", " slices=5-200");
run("isolum_cbs_strict");
run("Z Code Stack", "depth=Current");
run("Z Project...", "start=1 stop=196 projection=[Max Intensity]");
file_vasc_out = replace(file, "\\_pvar-8bit_combined.tif", "_maxZprojection.tif");
saveAs("Tiff", file_vasc);
However I got macro errors as undefined variable for run("isolum_cbs_strict") and a unrecognized command for run("Z Code Stack", "depth=Current").
How can I access to this lut which is in:
C:\Program Files\Fiji.app\luts\isolum_cbs.lut
and to the plugin which is in:
C:\Program Files\Fiji.app\plugins\Stacks - Z-functions
Thanks for your help,
Corinne
A solution is to provide -ijpathpath as argument to Fiji. Then, luts, plugins, etc. are all derived relatively to this path. In other words, pass the following argument:
-ijpathpath "C:\Program Files\Fiji.app"
Note that, importantly, you must not have a backslash at the end of the path.
Instead of using the java runtime to start Fiji/ImageJ, use the provided launcher execuable to run your macro:
fiji-win64.exe D:\your_macro.ijm D:\your_image.tif
or (which is essentially the same):
ImageJ-win64.exe D:\your_macro.ijm D:\your_image.tif
The ImageJ launcher takes care to provide all the necessary environment to run macros and scripts from the command line. It even provides a --headless option to run your script without even showing the user interface. See Fiji's Headless documentation.

Which file contains function of core/session in magento?

I need to customize other's code,
so I found they used
Mage::getSingleton('core/session')->getMyCustomBlockInfo();
in Order.php file for custom order email
so I can't find this function getMyCustomBlockInfo();
Can anyone tell me where this function reside?
Thanks
those are magic functions get() and set() and you are asking a session variable there that is set as
Mage::getSingleton('core/session')->setMyCustomBlockInfo();
somewhere in your code. If you use terminal you can easily find by making a following grep:
grep '>setMyCustomBlockInfo(' . -rsni
and it will list the files where your variable is set to session.
example :
Mage::getModel('catalog/product'); //or
Mage::getSingleton('catalog/product');
the code must be in '../app/core/Mage/Catalog/Model/Product.php' file
then
Mage::getSingleton('core/session');
the code must be in '../app/core/Mage/Core/Model/Session.php' file
because the class Mage_Core_Model_Session's parent::parent is Varien_Object, then you can do all magic functions and you can ->getData() to see the Data inside.
Mage::getSingleton('core/session')->getData();
on your problem when go call ->getData() you can see data : [my_custom_block_info]
you can set it with call
Mage::getSingleton('core/session')->setMyCustomBlockInfo('what');
Mage::getSingleton('core/session')->getMyCustomBlockInfo();
// will return 'what'

install4j: how can i pass command line arguments to windows service

I've created a windows service using install4j and everything works but now I need to pass it command line arguments to the service. I know I can configure them at service creation time in the new service wizard but i was hoping to either pass the arguments to the register service command ie:
myservice.exe --install --arg arg1=val1 --arg arg1=val2 "My Service Name1"
or by putting them in the .vmoptions file like:
-Xmx256m
arg1=val1
arg2=val2
It seems like the only way to do this is to modify my code to pick up the service name via exe4j.launchName and then load some other file or environment variables that has the necessary configuration for that particular service. I've used other service creation tools for java in the past and they all had straightforward support for command line arguments registered by the user.
I know you asked this back in January, but did you ever figure this out?
I don't know where you're sourcing val1, val2 etc from. Are they entered by the user into fields in a form in the installation process? Assuming they are, then this is a similar problem to one I faced a while back.
My approach for this was to have a Configurable Form with the necessary fields (as Text Field objects), and obviously have variables assigned to the values of the text fields (under the 'User Input/Variable Name' category of the text field).
Later in the installation process I had a Display Progress screen with a Run Script action attached to it with some java to achieve what I wanted to do.
There are two 'gotchas' when optionally setting variables in install4j this way. Firstly, the variable HAS to be set no matter what, even if it's just to the empty string. So, if the user leaves a field blank (ie they don't want to pass that argument into the service), you'll still need to provide an empty string to the Run executable or Launch Service task (more in that in a moment) Secondly, arguments can't have spaces - every space-separated argument has to have its own line.
With that in mind, here's a Run script code snippet that might achieve what you want:
final String[] argumentNames = {"arg1", "arg2", "arg3"};
// For each argument this method creates two variables. For example for arg1 it creates
// arg1ArgumentIdentifierOptional and arg1ArgumentAssignmentOptional.
// If the value of the variable set from the previous form (in this case, arg1) is not empty, then it will
// set 'arg1ArgumentIdentifierOptional' to '--arg', and 'arg1ArgumentAssignmentOptional' to the string arg1=val1 (where val1
// was the value the user entered in the form for the variable).
// Otherwise, both arg1ArgumentIdentifierOptional and arg1ArgumentAssignmentOptional will be set to empty.
//
// This allows the installer to pass both parameters in a later Run executable task without worrying about if they're
// set or not.
for (String argumentName : argumentNames) {
String argumentValue = context.getVariable(argumentName)==null?null:context.getVariable(argumentName)+"";
boolean valueNonEmpty = (argumentValue != null && argumentValue.length() > 0);
context.setVariable(
argumentName + "ArgumentIdentifierOptional",
valueNonEmpty ? "--arg": ""
);
context.setVariable(
argumentName + "ArgumentAssignmentOptional",
valueNonEmpty ? argumentName+"="+argumentValue : ""
);
}
return true;
The final step is to launch the service or executable. I'm not too sure how services work, but with the executable, you create the task then edit the 'Arguments' field, giving it a line-separated list of values.
So in your case, it might look like this:
--install
${installer:arg1ArgumentIdentifierOptional}
${installer:arg1ArgumentAssignmentOptional}
${installer:arg2ArgumentIdentifierOptional}
${installer:arg2ArgumentAssignmentOptional}
${installer:arg3ArgumentIdentifierOptional}
${installer:arg3ArgumentAssignmentOptional}
"My Service Name1"
And that's it. If anyone else knows how to do this better feel free to improve on this method (this is for install4j 4.2.8, btw).

Eclipse - Export/Save Search Results

Eclipse's Search results view is quite handy with its tree-like structure. Is there any way to export these results to a readable text format or save them to a file for later use?
I've tried using copy & paste but the resulting text format is far from readable.
You can change the mode from tree to list by click 'upper-right corner triangle' ->'show in list', then just copy all the files in the list , it will be a perfect list of search result
I'm using Eclipse Search CSV Export.
No I don't think there is a possibility to export the results yet. (Update: Now there's a suitable plugin available). But you should be able to use the eclipse search framework programmatically an export the entries by yourself.
I did not test the following snipped but implemeted a custom search that way once (using the RetrieverAction class). You should be able to listen to search result changes without the action as well:
TextSearchQueryProvider provider= TextSearchQueryProvider.getPreferred();
// your input (you'll have to implement that one I think...)
TextSearchInput input = new TextSearchQueryProvider.TextSearchInput();
ISearchQuery query= provider.createQuery(input);
ISearchResult result = query.getSearchResult();
result.addListener(new ISearchResultListener() {
public void searchResultChanged(SearchResultEvent e) {
// -> export result
}
});
// run the query
NewSearchUI.runQueryInBackground(query);
Again: I did not test that at all and don't know if there is a better approach as well..