How to use Haskell tool xml-to-json in terminal? - json

I am going to use xml-to-json to process a large xml file. I searched several methods, but they did not work due to out of memory. Then I found a tool implemented in Haskell, but when I tried this tool according to the guide, it says command not found. Could anyone please tell me how to use this tool? Thanks in advance. here is the link of the tool: https://github.com/sinelaw/xml-to-json#readme
Update
Screenshot of error

Most probably, your executable is built but isn't in your PATH.
On many systems cabal installs things to $HOME/.local/bin. So you can try adding that to your PATH environment variable.
It looks like you're using a Mac, in which case the path to use is $HOME/Library/Haskell/bin/. This page seems to have relevant instructions on how to configure Mac OS X.

Related

Octave runs but graph not displayed

num=[1];
den=[1 3 1];
G=tf(num,den);
H=1;
T=feedback(G,H);
step(T);
hold on;
Kp=23;
Ki=0;
Kd=0;
C=pid(Kp,Ki,Kd);
T=feedback(C*G,H);
step(T);
When run this script nothing happen in Octave but works fine in octave-online.net
online octave
Octave Windows
I will put a proper answer here for future users, even though OP has already solved their problem from the comments.
octave-online.net is an excellent cloud service providing an instance of octave on the cloud.
Contrary to a typical installation of octave on linux or windows, the octave-online client autoloads some of the more popular packages, one of which is control.
You can confirm this by typing pkg list in the octave-online console.
In your normal linux / windows installation however, this needs to be loaded explicitly before use, e.g. in the case of the control package, by doing pkg load control.
Your code uses the functions feedback and pid, both of which rely on the control package, therefore in your windows instance, your code failed, because you tried to use these functions without loading the package first.
Presumably there was also an error in your terminal informing you of this fact, that you may have missed.

How to check what's wrong with visual studio code debugger

I've spent a lot of time trying to find a reason why vscode debugger (vscode-chrome-debug module) doesn't work as expected. I didn't find any way how to enable logging in vscode.
The solution is pretty easy, thanks to Andreas. You don't need to search additional vscode environment variables or config parameters. Just enable the diagnosticLogging option in your launch.json. It enables logs writing of vscode-chrome-debug module to ~/.vscode/extensions/msjsdiag.debugger-for-chrome/vscode-chrome-debug.txt

If I make a sikuli script in Windows, will the same script work in Linux?

I am currently looking for a tool to test a a website and Sikuli seems perfect. However, my company uses both Windows and Linux, and I'd like our scripts to be transferable.
Will it work or are Windows scripts for Windows and Linux scripts for Linux?
It seems like Sikuli can be run from the command line, perhaps I can run the same script on both the Linux and Windows Computers?
There is no technical reason why a Sikuli script won't run under both operating systems (jython has the same syntax on both platforms). The biggest technical issue faced is that the screenshots may not match between Windows and Linux.
This thread discusses how to setup two images pools, one for each OS.
Creating Sikuli scipts directly in java might ease the cross platform issues. But you will still have the images looking slightly different issue. File directories are handled well accros OS in java though.
there are two main points to be concerned of:
Images: Even if the application looks the same in both the systems the ways to launch it are different. In the worst case one needs two complete sets of images.
Paths: In Windows and Linux paths are different. Different slashes, different lengths of the whole paths and components, different set of allowed symbols in the naming. Windows paths are not case sensitive by default.
There are some points to use the same script still with set of OS specific libraries.
- The more common logic in applications the more reusable code.
- The policy "changing something are must for both platforms". is easy to follow.
So the answer for your question is:
Specially prepared script will work on both the platforms

alternative to opengrok

I am using for an alternative to OpenGrok. I can't configure it properly. What I want is to browse to the code, like I would be in Visual Studio. I'd like to have a menu with a minimum option of Go To Definition, find references etc. How can that be achieved ?
I suggest to have a look at the Woboq Code Browser.
It works like a compile step and dynamically analyzes the code and how symbols are linked to each other.
Did you have problems configuring it on Windows?
OpenGrok works best through a web-server. You might find it easier to rent some cheap VPS box, and configure OpenGrok remotely on such server (instead of trying to configure it locally on a Windows box), and then use your web-browser to access the remotely-running OpenGrok instance through the web-interface.
I've once tried using OpenGrok locally on a Windows machine, and even though it worked, I was not happy that the non-web version didn't have any syntax highlighting, and was overall just way too awkward to be of any real use.
There's Text-Sherlock. And the github project. It can use either Whoosh or Xapian as its backend.
I would recommend Codatlas. It has features such as jump-to-definition and cross-reference and poly-glot support such as C/C++, Java, Python, Scala etc.

Using stl in an Android adb shell native program

I'm trying to port a C++ utility program that I want to be run from the Android ADB shell.
For that, I'm using the Android NDK's make-standalone-toolchain.sh script, and compiling my program with it.
Unfortunately, when I try to run it, I get this error:
reloc_library[1315]: 16304 cannot locate '_ZNKSs5c_strEv'...
CANNOT LINK EXECUTABLE
After some research, I saw that this means that the c_str function doesn't exist in libstdc++.so in the NDK. I also couldn't find the symbol in stlport.so either, and actually only found it in the ./sources/cxx-stl/gnu-libstdc++/libs/ version of the C++ libraries. These libraries are not included in the standalone toolchain I made, and I also couldn't find them on the device (the device is running Honeycomb).
The text in the NDK clearly states that there's support for the entire STL when I use stlport. Is this something that is only true in Ice Cream Sandwich? The libstlport.so or in libsupc++.so on the device and in the NDK didn't have any signature like the one that wasn't found.
So my question has two parts:
Is there something I'm missing in the build process/Android setup? Can I set up things differently so that the program will compile without needing the gnu-libstc++, or at least fail with a compilation/link error instead of failing to load on the device?
If linking with gnu-libstc++ is the only way, how can I do that? I think I can manage statically link to it but I'd rather not.
How can I add the gnu-libstdc++ version to my
If someone else is looking for a solution, I ended up adding a dependency using the -l switch on libgnustl_shared.so. You can find it inside the NDK at
sources/cxx-stl/gnu-libstdc++/libs/&ltarchitecture&gt/
I then pushed this .so together with the program to the device, and made a script that adds the current directory to LD_LIBRARY_PATH. It seems similar to what the NDK does when you use the make scripts to create a program that depends on gnustl.