How to exclude header files when i search repositories in github? - github

Sorry for rookie question, I want to search a specific API in Github, but want to exclude every file match that has a .h at the end, how to do this? I set the filter to only C files, but that doesn't exclude .h files.

If you are using Github Search Code API, and you want to remove a specific extension, add:
-extension:[your_extension]
Example: -extension:h to exclude all header files in your case
References:
documentation about the extension param
documentation about param exclusion
API example:
https://api.github.com/search/code?q=org:google%20language:c%20-extension:h
This also works on Github Search UI: https://github.com/search?q=org%3Agoogle+language%3Ac+-extension%3Ah

Related

Azure Factory v2 Wildcard

I am trying to create a new dataset in ADF that looks for csv files that meet a certain naming convention. These files are located within a series of different folders in my Azure Blob Storage.
For instance, in the sample directory below, I am trying to pull out csv files that contain the word "cars".
Folder A
fastcars.csv
fasttrucks.csv
Folder B
slowcars.csv
slowtrucks.csv
Ideally , I would end up with the files "slowcars.csv" and "fastcars.csv". I've seen examples out there were people were able to wildcard the file name. I have been playing around with that, but have had no luck. (See image below for one example of what I have been doing).
Is what I am trying to do even possible? Would appreciate any advice you guys may have. Please let me know if I can provide further clarification.
According to the description of filename in this documentation,
The file name under the given fileSystem + folderPath. If you want to
use a wildcard to filter files, skip this setting and specify it in
activity source settings.
so you need to specify it in activity not in file path.
A easy sample in copy activity:
Hope this can help you.

GitHub Find file by its content

Can I filter files in a GitHub repository by file content?
For example, there is the public repo:
https://github.com/xamarin/mobile-samples.
I know that I can find file by name using this option:
https://github.com/xamarin/mobile-samples/find/master
But, can I filter results to files containing specified text eg. "Entry"?
Is there some query-string which I can use to do that?
I mean something like this:
https://github.com/xamarin/mobile-samples?content=entry
Just open repository, go to top search bar (where you search for other repos) and type:
Entry
Select to search in current repository, not "All GitHub".
To search for term in particular file of repository type:
Entry filename:example_filename.java
It will display all "Entry" in particular file.

List all files in a sub-folder in a given branch / tag

I have been spending the last couple of hours trying to figure out a way to reliably list all the files in a given git repo's sub-folder. For example, if I want to list all files under in the repo -
https://github.com/aws/aws-sdk-java
under the tag -
/tree/1.11.244
using the github api v3 or v4, could anyone please point me in the direction on the different steps to be done for this? Also, if we have a lot of files, is there a way I could add a file filter to look for a file pattern to list?
You need to pass the ref parameter when listing contents:
GET /repos/:owner/:repo/contents/:path?ref=:ref
And if you want it to be recursive you can use recursive=1
For example
GET /repos/user/my_repo/contents/tests/units?ref=0.1
If I want to see the files in tests/units under tag 0.1, with curl it would look like:
curl -u user:pass -X GET https://api.github.com/repos/user/my_repo/contents/tests/units?ref=0.1
Unfortunately I don't think you can add a query string to a request to this endpoint (also this endpoint has a maximum 1000 files to retrieve from a directory, if you have more you are going to need the Git Trees API)

Search code in the repositories whose name contains a keyword

In github search, the following string allows me to search JavaScript code that contain Acode in all the repositories of the user NameOfUser:
user:NameOfUser language:JavaScript ACode
Now, I would like to add another condition: i am only interested in the code containing ACode in the repositories whose name contains repokey.
Does anyone know how to write the request?
The search API already does this. You can just use the search that you've posted above to search for repositories containing the text you've specified.
For example...
user:mrdoob language:JavaScript Three Extension
returns this...
https://github.com/search?utf8=%E2%9C%93&q=user%3Amrdoob+language%3AJavaScript+Three+Extension&type=Repositories&ref=searchresults
As above answer I also tried with type=Code and added a "WebGLBufferRenderer" keyword, See if it helps:
https://github.com/search?utf8=%E2%9C%93&q=user%3Amrdoob+language%3AThree+Extension+WebGLBufferRenderer&type=Code&ref=searchresults

Merging doxygen modules

I have a large amount of code that I'm running doxygen against. To improve performance I'm trying to break it into modules and merge the result into one set of docs. I thought tag files would do the trick, but either I have it configured wrong or I'm misunderstanding how it works.
The directories are laid out:
root +
|-src+
| |-a
|
|-doc+
|-a.dox
|-main.dox
|-main.md
|-output+
|-a+
| |-html
|-main+
|-html
In addition to 'a' there are other peer directories but am starting with one.
a.dox generates output and a tag file into root/doc/output
OUTPUT_DIRECTORY=output/a
GENERATE_TAGFILE = output/a/a.tag
INPUT=../src/a
main.dox just inputs the markdown file that has a mainpage tag and refers to the other projects tag file.
OUTPUT_DIRECTORY=output/main
INPUT = main.md
TAGFILES=output/a/a.tag=output/a/html
Should this merge or link all the docs under main where I can browse 'a' globals, modules, pages, etc? Or does this only generate links to 'a' if I explicitly cross-reference a documented entity in 'a' from inside of 'main'?
If this should work, any thoughts on where my syntax is incorrect? I've tried various ways to define TAGFILES, is the output directory relative to the main.dox file? To the a.tag file? Or to the a/html directory?
If I'm off base an TAGFILES don't work this way, is there another way to merge sets of doxygen directories into one?
Thanks.
I suggest you read this topic on how I recommend to use tag files and the conditions that should apply: https://stackoverflow.com/a/8247993/784672
To answer your first question: doxygen will in general not merge the various index files together (then no performance would be gained). Although for a part you can still get external members in the index by setting ALLEXTERNALS to YES.
Doxygen will (auto)link symbols from other sources imported via a tag file. So in general you should divide your code into more or less self-contained modules/components/libraries, and if one such module depends on another, then import its tag file so that doxygen can link to the other documentation set. If you run doxygen twice (once for the tag file and once for the documentation) you can also resolve cyclic dependencies if you have them.
In my case I made a custom index page with links to all modules, and made a custom entry in the menu of each generated page that linked back to this index (see http://www.doxygen.nl/manual/customize.html#layout) how to add a user defined entry to the navigation menu/tree.