GraphQL Type definition parsing as a string? - parsing

Did I not download something right? Vs Code sees my type def as a string. It doesn't know how to parse the back ticks? Maybe the apollo-server package is outdated? following this https://www.apollographql.com/tutorials/lift-off-part1/building-our-schema

Related

How to parse comments / documentation in Groovy code?

I'd like to parse the JavaDocs / GroovyDocs in my Groovy source code and build a JSON file with the parts that I'm interested in. Is there a clean way of doing this? I'd like to retrieve the class docs, field docs, method docs, etc. Example:
/** Please parse me. */
class Foo { /** And me too */ def prop }
One of the responses in the following thread was helpful in mentinoing GroovyDocTool / GroovyLexer / GroovyRecognizer, but I could really use a concrete example of how to add my own custom parsing: How to parse groovy code?
My current workaround is to attempt parsing the HTML that the "groovydoc" and "grails doc" commands generate. I'll probably try using NekoHTML to convert the HTML into well-formed XML, then use XmlSlurper. See: http://www.codercorp.com/blog/groovy/reading-html-using-groovys-xmlslurper.html
You may try ANTLR and create a parser. But this will be a brand new parser you may have to write

Deedle - what's the schema format for readCsv

I was using Deedle in F# to read a txt file (no header) to data frame, and cannot find any example about how to specify the schema.
let df= Frame.ReadCsv(datafile, separators="\t", hasHeaders=false, schema=schema)
I tried to give a string with names separated by ',', but seems don't work.
let schema = #"name, age, address";
I did some search on the doc, but only find following - don't know where I can find the info. :(
schema - A string that specifies CSV schema. See the documentation
for information about the schema format.
The schema format is the same as in the CSV type provider in F# Data.
The only problem (quite important!) is that the Deedle library had a bug where it completely ignores the schema parameter, so no matter what you provide, it would be ignored.
I just submitted a pull request that fixes the bug and also includes some examples (in the form of unit tests). See the pull request here (and click on "Files changed" to see the samples).
If you do not want to wait for a new release, just get the code from my GitHub fork and build it using build.cmd in the root (run this for the first time to restore packages). The complete build requires local installation of R (because it builds R plugin too), but it should build Deedle.dll and then fail... (After the first run of build.cmd, you can just use Deedle.sln solution).

Is there a way to POST graphML to gremlin/neo4j?

So it looks like the gremlin API requires a url to import a GraphML file to the server (http://docs.neo4j.org/chunked/stable/gremlin-plugin.html#rest-api-load-a-sample-graph). I was hoping there'd be some API where you could just POST the GraphML to it, does something like this exist?
I realise I could write a Neo4j extension to essentially do this, but I was wondering if one already existed...
There a shell extension at https://github.com/jexp/neo4j-shell-tools#graphml-import providing this feature. It should not be too hard to convert that into a server extension.
If the graph is not huge, perhaps you can try passing the file as a string to the gremlin extension and use the script in the doc you cited. Therefore your gremlin script expects a String variable that contains your graph and it creates the file (by writing the string graph to the file):
def fos= new FileOutputStream('path_to_my_file.xml')
fos.write(myGraphAsString)
You can then load this file:
g.clear()
g.loadGraphML('file:/path_to_my_file.xml')

Lua luac.exe create binary file from string

Using luac5.1.exe is there anyway to pass it a string to create a binary file or does anyone know of any module that could create a syntax checked binary file, what I'm looking to do is create a settings file that can be loaded again by require.
Note that require loads lua source files or dynamic libraries. Yu might be better off with a custom loader if you really need binary data.
Two libraries that do this are Roberto's struct and lhf's lpack.
If you really want require then you could convert your binary data to strings, but since presumably that are userdata, you'll need a C function to translate the userdata to a Lua accessible type such as string or number.
Perhaps try this:
function compile(source,file)
io.open(file,"wb")
:write(string.dump(assert(loadstring(source,""))))
:close()
end

Get methods params type parsing wsdl file in a rails/ruby application

I have a question about ruby and wsdl soap.
I couldn't find a way to get each method's params and their type.
For example, if I found out that a soap has a methods called "get_user_information" (using wsdlDriver) is there a way to know if this method requires some params and what type of params does it require (int, string, complex type, ecc..)?
I'd like to be able to build html forms from a remote wsdl for each method...
Sorry for my horrible English :D
Are you using soapr4?
Soap4r comes with a command line client to build proxies for accessing web services via SOAP. This is preferable to using the wsdlDriver which has to build the proxy dynamically every time it runs.
To build a "permanent" proxy then you need to run the following command
wsdl2ruby.rb --type client --wsdl http://some/path/to/the/wsdl
When this command runs then you should end up with a bunch of ruby files one of which (probably default.rb) will call each method in turn and document the necessary inputs and outputs.
Alternatively you may find the Wsdl Analyser useful. This will allow you to enter the URL for a WSDL which it will then analyse and list all of the operations and (sometimes) the paramaters required
Thank you for the very quick response!
I'll try to explain myself a little better :D
I've tried soap4r, and I'm able to get soap's methods with something like this:
require "soap/wsdlDriver"
client = SOAP::WSDLDriverFactory.new(my-wsdl-url).create_rpc_driver
puts client.singleton_methods
What I'd like to know is:
If, for example, my soap has a method called "get_some_params_and_sum_them", is there a way to know how many params it takes and which type they should be?
Something like
puts client.method("get_some_params_and_sum_them").params
Wsdl Analyser does it, and I'd like to know if this is possible also in a ruby script without tons of code lines :D

Resources