inet_pton inet_ntop roll your own - inet

Our code has to run on both SLES9 (old) and an even older version HPUX.
We're implementing IPv6 now, but inet_pton and inet_ntop do not exist on our HPUX, so have to roll our own.
S/W is in C++. If I have an IPv6 address string, can someone provide the C/C++ equivalent of the above 2 methods?
Many Thanks!

Just look in your favorite libc source (preferably not HPUX's).
http://repo.or.cz/w/glibc.git/blob/HEAD:/resolv/inet_ntop.c,
http://repo.or.cz/w/glibc.git/blob/HEAD:/resolv/inet_pton.c.

Musl's implementation: inet_ntop, inet_pton (simpler than implementation from glibc).

Related

How can i implement a NIO approach to serialports?

OiO is deprecated in the current Netty version and all the serialport implementations i could find use this.
Now i haven't been able to find any sort of guide on how to write your own channel so maybe i'm doing it all wrong.
I've tried starting from NioSocket but keep getting stuck on the Unsafe override...
Could someone tell me which base class i should extend to implement JserialComm or any other lib? Or point me in the direction of a decent howto?
I am finding myself in the same boat. I have done work with both JSerialComm and PureJavaComm and benchmarked both their input/output stream performance and their OIO implementations I found on github. https://github.com/gsrunion/Java-Serial-Solution-Performance-Tests
Per the issue https://github.com/Ziver/Netty-Transport-jSerialComm/issues/2 I believe I am going to have to take an approach where I use Netty's EmbeddedChannel as a go between between a the input/output streams and a Netty stack.

openCL on consoles for General purpose GPU?

Can we use openCL on consoles like Xbox One and PS4 for General purpose GPU? If yes, can we use openCL framework like ArrayFire - http://arrayfire.com/ ?
No.
While the AMD GPU hardware on the most recent version of each console is similar enough to desktop hardware that has OpenCL support, the console vendors do not offer OpenCL as a programming API (unless it's not public information and only available under NDA). If enough game devs asked for it perhaps it would happen.
I was also looking for it too! And I've found this discution: here
Apparently, up to now, the only way out is to use HLSL for Xbox, and PSSL on Playstation. According to a guy on the topic above. They (the APIs) are different, but very similar in such a way that shall be possible to write a code that compiles under both platform using some preprocessors.
PS.: I'm also looking for a good answer for that question. So, if you've found anything around, please post here, I'd love to know ^^

LLVM: How to access JIT API at runtime & edit myself?

could you suggest if that's possible to access LLVM JIT API from the program being executed? My goal is to be able to manipulate(add/update/remove) classes, methods and data on the fly.
Preferably, I would stay with Clang. Any ideas are welcome.
This seems to be pretty easy stuff. In the JIT you can provide a mapping between any external function to the arbitrary address. So, basically you'll just define some function in your IR being JITed, bind it to the address in the outside world and this will make a trick for you.
In particular, http://llvm.org/doxygen/classllvm_1_1ExecutionEngine.html#a805704b52a327cc6b37aebf9cba14169 is the function you should use here.

clCreateSubBuffer not found oO

i can't seem to find clCreateSubBuffer in cl.h or cl.hpp (only error macro). it is mentioned in the specifications, any idea about this? or any other way to create a sub buffer?
all i can think of is recreating the buffers using an incremented pointer.
Note that clCreateSubBuffer is a OpenCL 1.1 function, maybe your using/looking into openCL 1.0 header files.
What platform are you btw using? (im pretty sure that NVIDIA supports until now "only" OpenCL 1.0)

Where can I find line buffering code?

I can't find any code for doing this. The only places I can find it is in GIS APIs. Preferably in java, but I can port other languages too. I'd even settle for a overview of all the formulas required.
Use either:
The method Geometry.buffer(distance)
in Java Topology Suite (JTS) library http://www.vividsolutions.com/jts/JTSHome.htm
The GEOS
http://trac.osgeo.org/geos/
port of JTS library to C++.
I'm a little puzzled by your question, so this may not be the (type of) answer you are looking for.
Look for line buffering code in the source files of any of the open-source GIS out there. there are several.
As for algorithms, I Googled for gis buffering and got several useful hits on the first page.

Resources