I am looking for more information on the core functions of the haxe.ds package class Vector. Particularly, I am looking to find out what the available functions are, and what they actually do to the class (eg. add, remove, insert, pop, size).
So far, I have found:
https://haxe.org/manual/std-vector.html
and
https://api.haxe.org/haxe/ds/Vector.html
however neither offer me the information I am looking for. I have briefly and without success searched through haxe's github files in an attempt to find the ds package.
Any information on Vector documentation would be greatly appreciated.
My bad, there was a link to source in one of the links I posted above.
https://github.com/HaxeFoundation/haxe/blob/3.4.7/std/haxe/ds/Vector.hx
Related
I am studying some source codes from PytorchGeometric.
Actually I am really finding from torch_sparse import SparseTensor in Google, to get how to use SparseTensor.
But there is nothing I can see explanation. I saw many documents about COO,CSR something like that, but how can I use SparseTensor?
I read : https://pytorch.org/docs/stable/sparse.html# but there is nothing like SparseTensor.
Thank you in advance :)
I just had the same problem and stumbled upon your question, so I will just detail what I did here, maybe it helps someone. I think the main confusion results from the naming of the package. SparseTensoris from torch_sparse, but you posted the documentation of torch.sparse. The first is an individual project in the pytorch ecosystem and a part of the foundation of PyTorch Geometric, but the latter is a submodule of the actual official PyTorch package.
So, looking at the right package (torch_sparse), there is not much information about how to use the SparseTensor class there (Link).
If we go to the source code on the other hand (Link) you can see that the class has a bunch of classmethods that you can use to genereate your own SparseTensor from well documented pytorch classes.
In my case, all I needed was a way to feed the RGCNConvLayer with just one Tensor including both the edges and edge types, so I put them together with the following line:
edge_index = SparseTensor.from_edge_index(edge_index, edge_types)
If you, however, already have a COO or CSR Tensor, you can use the appropriate classmethods instead.
While writing a Haskell binding for some libs written in C, a thing has to do is writing docs in haddock format. But since normally the binding is just plain, the doc would be just reformat of original libs' doc.
So my question is, is there some tools to help with this? Thanks.
I don't know of any tool for that. Since C docs can take many forms, I don't think there is any tool.
If the binding is indeed plain, essentially everything in IO, same names as the C library, etc. there is a very lazy option: provide a link to the C docs and refer to that.
Better: if the C docs are online, and each function/variable/entity has its own link, provide a link for each entity. In such way, the Haskell programmer can find your docs in Hackage, as usual, and then it's just one more click away to the real docs.
Of course, ideally one should copy the C docs, so that it's immediately available. However, this can require a lot of work, and some care in handling copyright correctly.
We have a large number of repositories. We want to implement a semantics(functionality) based code search on those repositories. Right now, we already have implemented keyword based code search in which we crawled through all the repository files and indexed them using elasticsearch. But that doesn't solve our problem as some of the repositories are poorly commented and documented, thus searching for specific codes/libraries become difficult.
So my question is: Is there any opensource libraries or any previous work done in this field which could help us index the semantics of the repository files, so that searching the code becomes easy and this would also help us in re-usability of the codes. I have found some research papers like Semantic code browsing, Semantics-based code search etc. but were of no use as there was no actual implementation given. So can you please suggest some good libraries or projects which could help me in achieving the same.
P.S:-Moreover, companies like Koders, Google, cocycles.com etc. started their code search based on functionality. But most of them have shut down their operations without giving any proper feedback, can anyone please tell me what kind of difficulties they are facing.
not sure if this is what you're looking for, but I wrote https://github.com/google/zoekt , which uses ctags-based understanding of code to improve ranking.
Take a look at insight.io
It provides semantic search and browsing
I searched on google, searched on google with "site:haskell.org", and used hoogle. But I didn't find anything. There was some code that referenced "Data.Relation" in gf, the grammatical framework, but I couldn't find further information.
Is there a library for binary relations in haskell?
(I just want to do basic stuff like finding the transitive closure.)
ps: in agda, it is easy to find relations in the standard lib
=== EDIT: ===
I only need finite relations.
Just a function to get all related things (mathematical objects). And this also with transitive closure of the relation.
LATEST UPDATE:
I just found source code for Binary Relations on github:
https://github.com/fmaste/hgraph/blob/master/src/Data/Collection/Relation/Binary.hs
https://github.com/fmaste/hgraph/blob/master/src/Data/Collection/Relation/Binary/Simple.hs
https://github.com/search?langOverride=&language=Haskell&q=relation&repo=&start_value=1&type=Code&x=0&y=0
http://hackage.haskell.org/packages/archive/relacion/0.1/doc/html/Data-Relacion.html
I think I just answer my question for now.
There are Binary Relations on github:
https://github.com/fmaste/hgraph/blob/master/src/Data/Collection/Relation/Binary/Simple.hs
It should work for what I need.
The library hgraph seems very interesting, but unfortunately it's not on hackage. So I missed it.
So the lesson learned is:
it's very important to search on the github (directly on the website). It also seems that github is not very well index by google, since searching for "binary relation haskell site:github.com" dosen't get the results I want (even searching for 'binary relation "Simple.hs" site:github.com' doesn't work.)
The library that nponeccop links to is translated to English and is availably on Hackage:
http://hackage.haskell.org/package/relation
It's simple and gets the job done.
I need a set of key-value pairs for configuration read in from a file. I tried using show on a Data.Map and it doesn't look at all like what I want. It seems this is something many others might have already done so I'm wondering if there is a standard way to do it and what library to use.
Go to hackage.
Click on "packages"
Search for "config".
Notice ConfigFile(TH), EEConfig, and tconfig.
Read the Haddock documentation
Select a couple and implement your task.
Blog about your findings so the rest of us can learn from your new found expertise (thanks!).
EDIT:
I've recently used configurator - which was easy enough. I suggest you try that one!
(Yes, yes. If I took my own advice I would have made a blog for you all)
The configuration category on Hackage should list all relevant libraries:
http://hackage.haskell.org/packages/#cat:Configuration
I have researched the topic myself now, and my conclusion is:
configurator is very good, but it's currently only for user-edited configurations. The application only reads the configuration and cannot modify it. So it's more for server-side applications.
tconfig has a a simple API and looked like it was what I wanted, maybe a bit raw, until I realized it's unmaintained and that some commits which are really important to use the app are applied on github but the hackage package was not updated
Other solutions didn't look like they'd work for me, I didn't like the API, but every application (and tastes) are different.
I think using JSON for instance is not a good solution because at least with Aeson when you add new settings in a new release, the old JSON without the new member from the previous version won't load. Also, i find that solution a bit verbose.
The conclusion of my research is that I wrote my own library, app-settings, which aims to be key-value, read-write, with a as succint and type-safe API as possible. And you'll find it also in the hackage links for the configurations category that I gave.
So to summarize, I think configurator is the standard for read-only configurations (and it's very powerful too, you can split the configuration file with imports for instance). For read-write there are many small libraries, some unmaintained, and no real standard I think.
UPDATE 2018 be sure to look at dhall
I'd also suggest just using Text.JSON or one of the yaml libraries available (I prefer JSON myself, but...).
The configfile package looks like what you want.