Using agsXMPP in Metro-style applications - xmpp

I was trying to use agsXMPP reference in a Metro-style app for Windows 8 but I'm getting this error:
Cannot find type System.Collections.CollectionBase in module mscorlib.dll
I think I need the whole .NET for using agsXMPP and Metro does not have the whole. What can I do? Is there any way to use agsXMPP in Metro?

I would suggest investigating Matrix for WinRT (Metro) which is the successor to agsXMPP. While it's not free, it's supported (or soon will be).
According to their forum, they're working on making Matrix work for Metro/WinRT. Given that their comment suggests that they're needing to rewrite lots of code, it's doubtful that agsXMPP will be easily ported.

Related

Can I use webassembly for plugins like blender uses python?

I was talking to a friend of mine who knows a lot about js and wasm.He told me the technology goes far beyond web, since it is basicly a way to run near native applications on devices without actually giving them access to the computer.
Which means that thrid party or untrusted code on a smartphone for instance cannot accidentally or intentional change other apps or parts of the system.
This seamed to me like the perfect conditions to build a plugin system for an application I am working on.
I asked him about it but he was unable to give me a clear answer.
So the question is, can I use webassembly outside of a webbrowser, with custom bindings to safely allow users to extend the functionality of my application (a special image viewer) without sacrificing too much speed? It seams it should work using libnode or something, but is there a problem I might run into?
I don't know how much you know about web assembly but it depends on what your plugins actually should do. If it basically handle Arrays and numeric data with not that match interacting with host applications then it might fit. But when you have heavy object handling then it will not fit at the moment. So for image processing it might be perfect match like it is used in some web examples. Also be aware that some web assembly targeting system or not suitable for none web targets as they generate also some javascript code to be used in browsers beside the generate wasm. Some wasm modules for example require that you call malloc and free for string handling other have functions like new and gc for the nearly the same.

Are there semantically identical alternatives for getaddrinfo on Win8 Metro?

I am trying to port an existing, large-scale, multi-platform library to Win8 Metro, but got blocked by some removed APIs. Browsing the documentation and looking into some code samples did not help, I still cannot find a simple, reliable alternative for the missing GetAddrInfoW and getaddrinfo functions. Can anyone tell, what the proposed alternative is for these removed functions? AM I just overlooking something in the docs? Thank You,
György
Are you sure, that those functions really do not exist anymore? The winsock docs specifically mention that GetAddrInfoW was actually extended in Windows 8 Consumer Preview, and not removed.
Quote: "On Windows 8 Consumer Preview and Windows Server 8 Beta, the GetAddrInfoW function provides support for IRI or Internationalized Domain Name (IDN) parsing applied to the name passed in the pNodeName parameter. Winsock performs Punycode/IDN encoding and conversion. This behavior can be disabled using the AI_DISABLE_IDN_ENCODING flag discussed below."
Edit: Looking at it again it says at the top of the document that it only applies to desktop applications. For Metro Apps winsock2 seems to be unavailable and without an equivalent alternative for those two functions. At least i couldn't find one.

Call REST Webservice from Blackberry

I am new to Blackberry app development. I need to call REST webservice from blackberry application using JDE 4.7. I searched but not got any solution. Anyone help pls?
sri
You have to make an HttpConnection request and read the data as an InputStream... have a look at this tutorial Calling REST based web services
I appreciate this an old post - but it has been updated so someone is looking at it, so I thought it appropriate to contribute.
I am sorry, but I can not recommend the code supplied the link from another answer called "Calling REST based web services".
I have made a comment explaining this on the site, along the following lines:
"In my opinion this code is flawed because it does not consider the different connection methods, nor does it consider different encodings. More over it does not consider the Event Thread or provide reasonable error checking and logging. I appreciate that this is just a sample, but I think the author has a responsibility to make people who might use this code aware of how it should be used properly. And this code will cause more problems that it solves. Refer to the supported BlackBerry documentation and web sites for better samples."
Sorry, I am not as familiar as I should be of the questions asked on stackoverflow, but questions like this come up regularly on the BBRY forum here:
http://supportforums.blackberry.com/t5/Java-Development/bd-p/java_dev
I recommend that you go on that forum and type network in the Search box on that site and you be presented with a range of tutorials and KB articles that discuss all aspects of networking. In this particular case I would recommend this:
http://supportforums.blackberry.com/t5/Java-Development/What-Is-Network-API-alternative-for-legacy-OS/ta-p/614822
Networking is not trivial on the BlackBerry, do not expect a cut and paste of the code supplied to work for you. Specifically you should be aware of:
a) The various connection methods, the costs associated with each and the impact that using each might have (e.g. transcoders or caching)
b) The Event Thread, how to get off it and back on when processing a response
c) Logging and reporting so that you can investigate problems when they occur (and they will).
Personally, given that all OS 4.7 devices can be upgraded to OS 5.0 and should be, since OS 5.0 is better, I would forget supporting OS 4.7. Instead look at OS 5.0 and above support and use ConnectionFactory.

Executing prolog code on an iPhone

I currently have the need to execute prolog code in an application I am making. I am aware that Apple probably never would allow something like this in the App Store, but that is not the intention either. This is more a private project that will never reach the App Store.
Purpose
In this case prolog is used to describe an object (like for example a telephone) and its properties. The object will be drawn with OpenGL using coordinates specified in the prolog script. The reason for using prolog is that I need the ability to query the program about some of the features this object has, and prolog eases this a lot. Bottom line: I "need" to query a prolog script from my app.
Possible solutions
Embed an already existing implementation written in C. I am unsure if this will even work.
Execute the prolog code on another machine and use the network to query prolog.
It seems that it is possible to run some sort Ruby VM inside the app (shinycocos uses this as far as I understand), could this be used to run one of the Ruby Prolog implementations?
Find some alternative to Prolog. This needs to give me some of the same possibilities I get with prolog.
Sadly, google gives me close to no results at all, so I have a feeling that I might be quite alone on this project. If anyone have any experience or clue at all, I would be very thankful.
Having faced similar difficulties calling prolog code, albeit in a different situation, I'd recommend checking out the castor c++ library. This allows you to write logic paradigm code in native c++ without needing to extend the language at all. As castor is a header only library it is easy to compile wherever c++ is available.
Castor website: http://www.mpprogramming.com/cpp/default.aspx
Half a year later, I would just like to provide some insight on this. I ended up writing a server with an interface to prolog in Java, accepting prolog calls through TCP. It works almost exactly like the live prolog interpreter SWI-prolog (among others) provides, and mostly works quite well. However, it is far from an optimal solution, as you can't call functions from inside prolog. You lose the possibility of having two-way communication.
If I were to start all over again, I would certainly have tried harder to compile one of the pure C implementations for iOS. I gave it a quick go, but my lack of experience stopped me from even removing all of the errors I got. Judging by the fact that you cannot have prolog running as a background process on a unmodified version of iOS as well, some major rewriting would have to be done. Because of this, one might just have to write a new implementation (perhaps inspired by some of the more lightweight ones out there) from scratch to get the perfect solution.
You can download SWI-Prolog's source code and compile it with XCODE for iOS platform. I've never done that, but it's certainly technically possible.
Once you do that, there are a lot of examples on how to run prolog code from C/C++, hence, you will be able to run prolog from Objective-C.
FYI, you can quite easily bi-directionally make calls between Java and SWI-Prolog if you use JPL:
http://www.swi-prolog.org/packages/jpl/
It is also fully re-entrant, so you can instantiate prolog code from java, which in turn instantiates java code etc...
I did this for a number of commercial projects a few years ago when I was required to connect a Prolog based Reasoning Engine to a lot of Java code.
It does use JNI (the Java Native Interface), so you need to be careful about how you compile and link to the native api. Though if you compile it appropriately for each platform you can make it work cross platform. I had it working on OS-X, Windows, Linux & Solaris.
I do not know if this has been tried but there is the possibility to use the combination of NodeJS for Mobile Apps & TauProlog:
https://code.janeasystems.com/nodejs-mobile
https://github.com/JaneaSystems/nodejs-mobile
and
http://tau-prolog.org/

Which script language interpreters will work on iOS?

For an App that is not going to be released on the AppStore I'm looking to embed an interpreter for easy scripting needs. Since I don't really like to get down with pure C, the interpreter should be an Objective C library.
While searching the web I've come across a couple of script interpreters for Objective C but whether those guys work on iPhone is not quite so clear. The one I found that apparently works well on iPhone is LuaCore which brings Lua scripting to iOS Apps.
Which Objective C scripting interpreters have you successfully embedded in iOS Apps?
Some Javascript options:
Using a headless WebKit instance
Instantiate a custom build of JavaScriptCore
CouchBase's attempt at getting SpiderMonkey running (more modern Javascript than V8)
Notice that the JS option will provide with a quite raw runtime environment, you'll probably need to write at least some of it yourself for it to be a convenient development environment.
Other languages:
An attempt with Python.
Clojure by way of a static build of JavaScriptCore (see point 2 above).
The Nu language is also supposed to integrate well, and have a good Objective-C bridge.
I have only tried the first headless WebKit variant for Javascript, but plan to try as many of those listed as possible for a project during the coming months.
Update:
I've used the Javascript method 1 (headless WebKit) a bit longer. I got it running quite effortlessly, and will stick with that for a while. But it has a huge drawback: you can't call back to native in an easy manner. I solved this by writing a PhoneGap inspired bridge that empties a command queue after the script has run.
I've also tried Python using the link I gave. I made it compile and execute some sample code, but it suffers from the same problem as using Js via headless WebKit, and since it consumes quite a bit of memory I skipped it for now. A callback command queue in the same spirit as the one I created with Js would be possible though. Another Python method would be to attempt to call into the Objective C runtime using ctypes. That approach is described in this answer.
Update 2: Here are several new(ish) links for running Scheme, with both interpreter and compilation options.
I just stumbled upon a really decent description by Twitter user #mysterycoconut of how to get Lua support up and running.
Just discovered a post regarding scripting on iOS at answerspice.com.
Based on the post I evaluated Nu and had it up and running pretty quickly based on the Xcode project referenced in this discussion (thanks Tim!). I tested in the simulator and on an iPhone 4. So Nu is definitely among the scripting languages that can be embedded in an iOS App.