portability

Protocol buffers and UTF-8

帅比萌擦擦* 提交于 2019-12-03 08:50:26
The history of Encoding Schemes / multiple Operating Systems and Endian-nes have led to a mess in terms of encoding all forms of string data (--i.e., all alphabets); for this reason protocol buffers only deals with ASCII or UTF-8 in its string types, and I can't see any polymorphic overloads that accept the C++ wstring. The question then is how is one expected to get a UTF-16 string into a protocol buffer ? Presumably I need to keep the data as a wstring in my application code and then perform a UTF-8 conversion before I stuff it into (or extract from) the message. What is the simplest -

Could Grand Central Dispatch (`libdispatch`) ever be made available on Windows?

Deadly 提交于 2019-12-03 08:03:47
问题 I’m looking into multithreading, and GCD seems like a much better option than manually writing a solution using pthread.h and pthreads-win32 . However, although it looks like libdispatch is either working on, or soon going to be working on, most newer POSIX-compatible systems… I have to ask, what about Windows? What are the chances of libdispatch being ported to Windows? What are the barriers preventing that from happening? If it came down to it, what would I need to do to preform that

How do I typedef an implementation-defined struct in a generic header?

别来无恙 提交于 2019-12-03 08:01:23
I have a C project that is designed to be portable to various (PC and embedded) platforms. Application code will use various calls that will have platform-specific implementations, but share a common (generic) API to aid in portability. I'm trying to settle on the most appropriate way to declare the function prototypes and structures. Here's what I've come up with so far: main.c: #include "generic.h" int main (int argc, char *argv[]) { int ret; gen_t *data; ret = foo(data); ... } generic.h: (platform-agnostic include) typedef struct impl_t gen_t; int foo (gen_t *data); impl.h: (platform

What do I need to run PHP applications on IIS?

房东的猫 提交于 2019-12-03 07:48:02
Having been a PHP developer on LAMP servers for quite a while, is there anything that I will need to take into consideration while preparing an application for IIS on windows. Make sure you get the FastCGI extension for IIS 6.0 or IIS 7.0. It is the single most important thing you can have when running PHP under IIS. Also this article should get you setup: http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60/ Everything beyond this is simple, MySQL and what not. Kev We just rolled out PHP 5.2.6 + FastCGI on our shared hosting platform without any problems. As

Lightweight, portable C++ fibers, MIT license

牧云@^-^@ 提交于 2019-12-03 07:30:46
问题 I would like to get ahold of a lightweight, portable fiber lib with MIT license (or looser). Boost.Coroutine does not qualify (not lightweight), neither do Portable Coroutine Library nor Kent C++CSP (both GPL). Edit: could you help me find one? :) 回答1: Libtask: MIT License Libconcurrency: LGPL (a little tighter than MIT, but it's a functional library!) Both are written for C. 回答2: I actually blogged about this in the past. Have a look! I hope it answers your questions. In it, I cover a number

Setting up RStudio Portable Default R version

冷暖自知 提交于 2019-12-03 07:11:40
问题 I recently discovered a portable version of R and RStudio @ http://rportable.sourceforge.net/ Open source rocks! At any-rate, I am jumping from pc to pc at my university, and I'd like to get Portable R-studio to recognize Portable R as the default R version. Most computers at the university already have several versions of r-installed, and RStudio uses one of those versions of R. When I go into the Global Options to change the default version, it does not "see" portable R on the USB drive. I

Creating a Portable Python (local install) for Linux

亡梦爱人 提交于 2019-12-03 05:47:51
I'm looking to create the following: A portable version of python that can be run on any system (with any previous version of python or no python installed) and have it pre-configured with various python packages (ie, django, lxml, pysqlite, etc) The closest I've found to the above is virtualenv , but this only goes so far. If I package up a nice virtualenv for python on one machine, it contains sym links to a lot of the libraries it needs. I can take those sym links and convert them to their actual files, but if I try to move this entire directory to another machine, I get seg fault after seg

Is the .NET string hash function portable? [duplicate]

自闭症网瘾萝莉.ら 提交于 2019-12-03 05:20:29
Possible Duplicate: How do I create a HashCode in .net (c#) for a string that is safe to store in a database? I use C# 4.0 and gets the string hash by invoking: "my string".GetHashCode() Code generated by this call is stored into database to future use. This hash code is used to find some subset of strings and then to equal comparison. Questions are: Is it a standardized hash calculation? May I assume that it is possible to calculate the same hash in different environments like C# in .Net 3.0 or future .Net editions? Is it possible to calculate the same hash function on yourself by writing it

What is the difference between a wrapper, a binding, and a port?

限于喜欢 提交于 2019-12-03 01:54:45
问题 In a software portability context, what is the difference between these three concepts? For example, I want to use the ncurses library, the original ncurses library is written in C, but my application is being written in C++, and then I found "ncurses wrapper", "bindings to ncurses", and "ncurses port". Which one should I use? What are the pros and cons of each one? 回答1: A wrapper is a bit of code that sits on top of other code to recycle it's functionality but with a different interface.

How does one include TR1?

隐身守侯 提交于 2019-12-02 23:36:42
Different compilers seem to have different ideas about TR1. G++ only seems to accept includes of the type: #include <tr1/unordered_map> #include <tr1/memory> ... While Microsofts compiler only accept: #include <unordered_map> #include <memory> ... As for as I understand TR1, the Microsoft way is the correct one. Is there a way to get G++ to accept the second version? How does one in general handle TR1 in a portable way? Install boost on your machine. Add the following directory to your search path. <Boost Install Directory>/boost/tr1/tr1 see here boost tr1 for details Now when you include