I searched everywhere from google to this site but seems no answer for it. Does anyone know if IronRuby supports clr class attributes? If yes, how?
Thanks in advance.
There's no way to apply CLR attributes in IronRuby today. IronPython support it experimentally with its clrtype module, which uses its own way of overriding the underlying .NET class for a Python object.
If one would want to implement this in IronRuby themselves, it'd be a large undertaking, but not impossible. If anyone is interesting, please ask about it on the mailing list to get started.
Related
Please, help me to figure out this, I was curious about the source code of methods like XMLHttpRequest.open() as per
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest,
after some (relatively) lazy googling I wasn't able to find out how methods of that API are implemented, I found references to some code on c++, for example here nsXMLHttpRequest. My question is, are the implementation of that object especific to browsers?
A beginner question, certainly. Thanks if you can help me to understand how this all stuff is related.
This question is about design / is fairly open-ended.
I'd like to use OpenCV, a large C++ library, from Haskell.
The closest solution at the moment is probably Arjun Comar's attempt to adapt the Python / Java binding generator.
See here, here, and here.
His approach generates a C interface, which is then wrapped using hsc2hs.
Due to OpenCV's lack of referential transparency in its API, as well as its frequent use of call parameters for output, for Arjun's approach to fully succeed he'll need to define a new API for OpenCV, and implement it in terms of the existing one.
So, it seems it might not be too much extra work to go whole-hog and define an API using an interface description languages (IDL), such as SWIG, protobuf-with-RPC, or Apache Thrift.
This would provide interfaces to a number of languages besides Haskell.
My questions:
Is there anything better than SWIG for a server-free solution?
(I just want to call into C++; I'd rather not go through a local server.)
If there's no good server-free solution, should I use protobuf-with-RPC or Thrift?
Related: How good is Thrift's Haskell support?
From the code, it looks like it needs updating (I see references to GHC 6).
Related: What's a good protobuf-with-RPC solution?
With Apache Thrift, you get Haskell support. You are correct, code is not generally "latest", but you rarely care. You can do complex things on other abstraction levels and keep things as simple as possible at messaging level.
Google Protobuf has no support for Haskell, nor does SWIG. With Protobuf you get C++, Java, JavaScript and Python, to my knowledge the main languages at Google. Have a look at this presentation. Without contest, Thrift and Protobuf are the best in house.
It seems in your case you have to go with Thrift, as it supports Haskell.
It sounds like the foreign function interface for C++ is what you want:
Hackage,
Github
Disclaimer: I haven't used it, only heard good things about it.
I would like to use a text-based UI in my Haskell program. I found some bindings for the ncurses library (see also hscurses or ncurses, which one to use?). The hscurses and nanocurses packages are just simple wrappers around the C library, while vty isn't very well documented and a bit ugly (for example mixing snake_case and CamelCase).
The ncurses library on Hackage looks much more pretty and provides API which nicely fits Haskell. The problem is that it doesn't seem to implement some crucial features, like resizing or refreshing the windows.
So my question is:
is there any other Haskell text UI library, either ncurses-based or not, which I missed?
if there isn't anyone, is it possible to extend the ncurses Haskell library to at least support window refreshing and resizing? (this should be probably consulted with the project owner, but I need the solution quickly)
EDIT:
I finally used nscurses without windows (and panels) to avoid the troubles with refreshing them. I had problems with output to bottom-right corner of a window (a very similar issue was reported for Python's ncurses binding). I solved it by not writing there :).
Have you looked at vty-ui? It has a very nice user manual with lots of examples. I believe it's essentially a wrapper around vty.
I've used nanoncurses and hscurses succesfully, my hmp3 app has a binding that was the basis for nanocurses.
No matter what you probably will want a nice high level API. hscurses does have a box abstraction at least.
You'd be fine going with hscurses.
There is another good choice for Text-based user interfaces in haskell;
Brick is written by jtdaugherty, the same person that developed vty-ui which is Deprecated now.
The API is Declarative, which is Better for Presenting a language like Haskell.
also the Documentation was great and complete.
Is there any other class library like MFC which provides Document/View architecture or is it totally unique concept of MFC?
I realize that this is an old question, but for the benefit of those seeing this question via Google searches, the wxWidgets cross-platform GUI API contains a document-view framework as well. I never used it before, so I cannot tell how it comparess with the MFC implementation.
No, it is not, Apple used it for iPhone programming, at least until iOS 5 and if you take a look at the Stanford Universirty iOS Programming courses on iTunesU, you'll see that they'll teach it too. Moreover I've studied it in my OOP course here in Italy, so I can guess it's a worldwide accepted way to organize your code.
Certainly the concept can be found in other languages/frameworks. But, if you compare MFC with WinForms and WPF, then yes, this technique is unique.
In Groovy++ I often hear of the term Annotations. Can anyone explain me what is that in simple terms?
In short It's a way to label a piece of code. But it's not Groovy specific thing.
These labels can be used as meta-data by other applications to perform tasks like identifying unit test, dependency injection, or just a way to tell someone that a method is deprecated.
Here is a link to some java documentation.
Some basic info to get you started.
http://groovy.codehaus.org/Annotations+with+Groovy