3 ms·
Firstly, this looks brilliant. If anyone can remove the extra layers of cygwin, mingw, xming etc. and provide a direct ability to execute linux programs from po
by Intermernet 12y ago
Firstly, this looks brilliant. If anyone can remove the extra layers of cygwin, mingw, xming etc. and provide a direct ability to execute linux programs from powershell/cmd , I call Black Magic. Voodoo I tell you; Windows cannot be this user friendly (I work with it every day).
Secondly, completely off topic, I noticed that Github picks up 0.4% of the code-base as Objective-C (https://github.com/wishstudio/flinux/search?l=objective-c https://github.com/wishstudio/flinux/search?l=objective-c) due to the files functionally consisting of a single line, `#pragma once`. Is this statement more common in Objective-C than C or C++ ? Just wondering if Github detects the language based partly on some statistical analysis of other existing code, or if it has "set rules".
- matthewmacleod 12y agoGithub's language detection is actually open-source — you can have a look at what it does here: https://github.com/github/linguist https://github.com/github/linguist Linguist uses a number of different 'strategies' to identify the language – in the case of C vs. Objective C, it uses a pretty simple heuristic (https://github.com/github/linguist/blob/master/lib/linguist/heuristics.rb#L83-L90 https://github.com/github/linguist/blob/master/lib/linguist/...) to disambiguate C/C++/ObjC where required (such as in header files, which can't be disambiguated by file extension.) In this case, the content of the file can't be reliably disambiguated, so I imagine it'll probably fall back to the Bayesian classifier. Interesting that the classifier identifies it as Objective C though!
- Intermernet 12y agoThanks for the link! Time to do some reading.
- pbhjpbhj 12y agoI'm not a programmer so bear with me. They have a cadre of samples in the project, searching on "#pragma once" shows no examples of Objective-C (that I can see) using that line but does show C/C++ examples with it. Is that the input to the classifier? The heuristic you linked appears to default to identifying as C; that regex doesn't look like it has anything to make the else-if return the sample as Obj-C. I'd have expected the fact that most other files on the project were C to be the dominant factor that - without any other positive result in the classifier - would weight the files as being C. Presumably this data isn't used in classifier though? Interesting.