jGraphT for Objective C? - objective-c

I'm looking for a Directed Acyclic Graph implementation in Objective C.
I've had enormous success with jGraphT in the Java space. I'm using a DirectedGraph to model a power subsystem, and now I need equivalent code for iPhone/iPad.
Does such a thing exist in an open source library? Or do I need to roll my own?

There's no available implementation in Objective C at present. However, this should be very helpful, particularly Mark Wukta's PASCAL implementation.
See
https://stackoverflow.com/questions/1284928/directed-graph-implementation-in-objective-c/13310549#13310549

AFAIK there is not Objective-C library for that. I needed a digraph and I forked Aaron Qian's digraph. Maybe add Tarjan's algorithm and you are almost there, but jgrapht is miles away in features.

Related

How does Objective-C get updated? Are there versioned releases? What is the current 'version'?

I have been trying to answer this question and looking at google/wikipedia etc but have not been able to determine this. On wikipedia I see a reference to Objective-C 2.0 but thats about it. I am curious for example in Xcode 7 there were some new features available for Objective-C like lightweight generics and __kindof. Did these exist before and they were just made available via Xcode in v7? Or did the language change? I tried to find a version history or information on releases but so far have come up with nothing. Swift is clearer on versions/releases and I keep asking myself if I am missing something related to Objective-C since I can't find this information. Does Objective-C update with Xcode releases or can the language evolve on its own?
in Xcode 7 there were some new features available for Objective-C like lightweight generics and __kindof. Did these exist before and they were just made available via Xcode in v7? Or did the language change?
To that extent, yes, the language did change.
The best way to research this sort of feature is by going through the Release Notes for Xcode. Thus, the features you are talking about appear here:
https://developer.apple.com/library/content/documentation/Xcode/Conceptual/RN-Xcode-Archive/Chapters/xc7_release_notes.html#//apple_ref/doc/uid/TP40016994-CH5-SW1
There is actually an Objective-C section with a subsection "Objective-C Language Changes". That pretty much tells you this was a change in the language!
Changes since then are listed here:
https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Chapters/Introduction.html
Of those, the most significant is probably the advent of class properties.
All these changes took place primarily to enhance Swift compatibility, and I think we may expect that all changes in Objective-C going forward will be for that purpose.
Objective-C is a very simple language. It's just a very thin layer on top of the C language. It's very important to realize that if C changes, Objective-C also changes. You can actually select which C dialect will be used for your Obj-C compiler. In that sense Objective-C changes all the time.
If we are speaking only about the object layer, there is no official specification, no discussion groups (e.g. as we have for Swift). It's not open-source. Practically speaking, current Obj-C features are exactly what the Apple's version of LLVM-Clang compiler has implemented (that is, what is shipped with Xcode). And LLVM documentation is where you can find the most interesting pieces of information about Obj-C features.
Obj-C changes a bit with every Xcode release although nowadays new features usually mean more attributes/annotations that can improve code analysis and provide more information to Swift. There is no official version number.
Objective-C has reached a state when it can't be really improved any more. It needs to support everything in C, it has to be backward compatible and its dynamicity makes it very hard to check types. That's exactly the reason why Apple has introduced a new language.

When analyzing a binary compiled from Swift, is it possible to figure out the Swift method name for a function that has no symbol?

I'm new to disassembling and reverse engineering binaries, so forgive me if this question is nonsensical or impossible.
In the past when I've tried reverse engineering macOS binaries, analyzing the ones written in Objective-C yielded a lot of useful information, because generally all of the Objective-C classes and their method names were easily retrievable, making it a lot easier to figure out what any particular method did.
I'm trying to analyze a binary written in Swift (technically a combination of Swift and Objective-C), and most of the functions now have no symbol. There are some Objective-C methods that I can retrieve as usual, and a few functions that have a Swift-style mangled name, but nearly all of the rest have no symbol. I know a lot of those have to be Swift methods.
Is there anyway to figure out what this binary's Swift classes are and their associated methods like I can with Objective-C?
Using a tool like Hopper Disassembler reveals the mangled names of some Swift classes (usually a symbol like _TtC4Something25SomethingElse) and I can get a list of its instance variable names and their offsets, but no method names.
Note: the binary in question is an x64 macOS binary, not an iOS binary.
Usually reverse engineeing is the process of extracting meaningful constructs and descriptions from assembly. What you've done so far is usually only the first part of a "normal" reverse engineeing task.
This may sometimes be a tedious process, which involves mapping structures and understanding the meaning of functions directly from thier assembly code.
There are pleanty of reverse engineeing tutorials and other sources, and a good understanding of the relevant assembly language is required.
I really recommand this book (it's legally available online, original version is chm released by author) and this cannot easily be covered in a single SO question.
You might also want to get more specific help in the reverse engineeing SE beta.
I hope I pointed you in the right direction.

Node-based data visualization library in c or objective c

I'm looking for a library in c or objective c that does node-data visualizations similar to http://arborjs.org/
helpful answers include,
what are graphs like that called?
names of libraries that do something like that.
suggestions for implementation.
I'm targeting iOS and/or MacOS, hence c or objective-c/cocoa. On iOS the javascript version runs super slow.
Thanks!
Edit: GraphViz looks great. I'm a little concerned it may have dependencies that are GPL, and thus can't be used on iOS... looking into that now.
Actually there seems to be an Objective-C port of arborjs, see https://github.com/epreston/PSArborTouch.
This is called graph visualization and the best toolkit that I know for it is called GraphViz. It has C libraries.
That sort of graph doesn't have a particular name; not without knowing more context. So without more information, it's a "graph".
As for a library, there's an open source project called GraphViz. You'll have to dig a bit to find the drawing code, but it's in there somewhere. :)

Objective-C implementation of Shape Context algorithm (Image Matching)?

There is a very cool sounding technique called Shape Context matching, which can be used in an Image Recognition application to match an "unknown image" against a known "image library." There are numerous descriptions of the concept documented on the web (mostly all variations of the same original paper), for example: http://www.eecs.berkeley.edu/Research/Projects/CS/vision/shape/sc_digits.html
I found a JAVA implementation and a MATLAB implementation of the algorithm described in the paper, but I cannot find an objective-c implementation. Anyone know if there is any objective-c code out there, anywhere, implementing these techniques? I sure would like to take advantage of it, rather than trying to write that stuff myself!
Here you can find an interesting c++ implementation (for non-commercial usage, didn't check it yet.. see the downloads):
http://www.umiacs.umd.edu/~zhengyf/PointMatching.htm
I'm currently searching for a Java implementation of the algorithm. Could you please provide a link to the implementation you found?
The original matlab code can be downloaded at:
www.eecs.berkeley.edu/Research/Projects/CS/vision/shape/sc_digits.html
I also found a C# implementation:
http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=7465&lngWId=10
Take a look at OpenCV. It is implemented in C so it can be used in obj-c pretty easily.

Programming features missing in C++ and Java

What are the programming features that are missing in C++ and Java ?
For eg. You can't do recursive programming in QBasic ? You can't dynamically allocate memory in QBasic.
What would be the good to have features in C++, Java.
I think Lisp Programmers will be able to add a few.
I miss lambda expressions.
This answer deals only with C++
Things I miss from the syntax, or the standard library:
RegExp as part of the standard library
Threads as part of the standard library
Pointer to member methods (not objects!)
Properties would be nice (I have seen codes that emulate this via C++ preprocessor... note an nice looking code).
Some lower level networking API (sockets!), and higher level API (give me this file from this ftp, submit "this" to this site via POST).
This is the list of things I would like to see, but I assume other people will disagree with me.
Memory garbage collector is nice.
A n interface for a GUI toolkit - let MSVC map it to win32, and on Linux... (good question!)
A stable ABI. In C it's a standard - but on C++ we are still missing a few decades. I want also stable ABI between compilers - I want to compile one library in MinGW, the other with CL and all should work.
This is the list of things I want to see, but I know they will not get away:
Compatibility with C. Really, it's a myth right now. using namespace std killed it.
Include, headers. Most of the information is already available in the DLL/so/a/"library", do we really need to keep this bad decision from 30 years ago? If needed the compilers should keep information in the binaries.
The need for Makefiles - the compiler should be smart enough to know what to do with this code, from the code itself. Pascal is doing it quite good. I think also D.
(I might be wrong, please correct me) The official standard openly and freely available for viewing. Why should I pay for the official papers? Do I need to do it for HTTP? UTF8? Unicode?
I think this is a very subjective question. From a theoretical point of view there's nothing "missing" in Java because you can do everything you want to from the perspective of the outcome as an application.
As with QBasic - recursion may not be possible but that doesn't prevent you from changing your recursive algorithm to an iterative algorithm. Programming language theory tells us that you can do this with every recursive problem. So there's also nothing missing here.
I think what you mean are features that are "nice to have" - and here everyone has to decide for himself. I'd even say there are features in the language which would have been "nice not to have" such as static imports - but again this is my subjective opinion...