portability

How necessary or convenient is it to write portable SQL?

谁说胖子不能爱 提交于 2019-12-04 08:52:33
Time and again, I've seen people here and everywhere else advocating avoidance of nonportable extensions to the SQL language, this being the latest example. I recall only one article stating what I'm about to say, and I don't have that link anymore. Have you actually benefited from writing portable SQL and dismissing your dialect's proprietary tools/syntax? I've never seen a case of someone taking pains to build a complex application on mysql and then saying You know what would be just peachy? Let's switch to (PostGreSQL|Oracle|SQL Server)! Common libraries in -say- PHP do abstract the

Java Desktop Application using SQLite installed by a single installer

寵の児 提交于 2019-12-04 06:37:48
I am a beginner in programming Java Desktop Application interacting with databases. My goal is to make a simple java application which uses a database to store it's data locally. After some googling I found that SQLite/Derby would cover my needs. I've googled SQLite and Derby and I found that in order to use them I need to install them on the computer through commands in terminal. My question is how the application could be done so that at the end the client will be given a simple installer file which installs both Java Application and the SQLite/Derby Database avoiding doing any installations

Creating portable (non-installing) windows applications in C#

匆匆过客 提交于 2019-12-04 05:46:52
I have a .net 3.5 application and i'd like to make it portable. It's simple and runs perfectly, i've sent the .EXE + .DLL's to some friends and it works as intended when running the exe with the .DLL's and the .ICO (that i have used in it) along in the same folder. What i want is simple: creating a single EXE file that cares the dll's, image and whatever-i-want along with it without being a setup, and requiring no installation. (a.k.a portable) I may consider migrating it to .net 2.0 if needed, i don't use any 3.5-only functionality, in fact, i'm not really sure why i'm using 3.5 (i'm new at

Default file extension of the executable created by g++ under Cygwin vs Linux

放肆的年华 提交于 2019-12-04 04:43:50
I've done most of my work on VisualStudio and don't have much experience with gcc or g++. When I tried to compile a (ex. aprogram.cpp) this morning on my pc using cygwin, I got (aprogram.exe) when I tried to compile the same thing on my Ubuntu box I got (aprogram) w/o any extension. I am just wondering if someone be kind enough to tell me why. This question is just out of curiosity. :) Thanks in advance! EDIT: (from Jimmy's comment) g++ under Cygwin defaults to .exe Charlie Martin That's easy: on UNIX, you don't need no steenkin' extensions . In fact, an "extension" like .c is just a

Maximize SDL window

为君一笑 提交于 2019-12-04 03:54:51
How should I tell SDL to maximize the application window? I'm creating the window with these flags: SDL_OPENGL | SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_RESIZABLE. Judge Maygarden This functionality is controlled by the window manager when you use the SDL_RESIZABLE flag. To simulate the maximizing a window with SDL you would need to first determine the size the window would occupy when maximized. Then you would call SDL_SetVideoMode with this size after placing the window with the SDL_VIDEO_WINDOW_POS environment variable . If you truly need the window to be maximized as if you had clicked on the

How to determine C code is compiled for Android/NDK or iOS

心已入冬 提交于 2019-12-04 02:57:51
I am reusing a legacy C library in an iOS app and in an Android app. I want to customize some macro definitions (e.g. for logging). Are there standard defines to check for (using #ifdef) whether the code is being compiled for iOS or Android/NDK? __ANDROID__ or ANDROID for Android (compilation with the NDK) and __APPLE__ on Apple platforms (iOS or OSX) you should consider creating two separate projects for those platforms with separate output/bin directories but shared source code. Then you just set some define in project properties for android and ios so you can recognize it when compiling 来源:

SQLAlchemy: How to conditionally choose type for column by depending on its backend

随声附和 提交于 2019-12-04 02:52:42
I want to use HSTORE type for a column if it uses PostgreSQL as its backend, or PickleType otherwise. The problem is that we cannot determine which backend will be used when schema is being defined (in Python). How can I determine this and conditionally choose the data type when the table actually is created on the backend database? You can accomplish something like this with TypeEngine.with_variant : from sqlalchemy.types import PickleType from sqlalchemy.dialects import postgresql HybridType = PickleType() HybridType = HybridType.with_variant(postgresql.HSTORE(), 'postgresql') This creates a

Unix paths that work for any platform in Python?

天涯浪子 提交于 2019-12-04 02:14:35
Can all paths in a Python program use ".." (for the parent directory) and / (for separating path components), and still work whatever the platform ? On one hand, I have never seen such a claim in the documentation (I may have missed it), and the os and os.path modules do provide facilities for handling paths in a platform agnostic way (os.pardir, os.path.join,…), which lets me think that they are here for a reason. On the other hand, you can read on StackOverflow that "../path/to/file" works on all platforms… So, should os.pardir, os.path.join and friends always be used, for portability

Doctest fails due to unicode leading u

一个人想着一个人 提交于 2019-12-03 22:04:15
问题 I am writing a doctest for a function that outputs a list of tokenized words. r''' >>> s = "This is a tokenized sentence s\u00f3" >>> tokenizer.tokenize(s0) ['This', 'is', 'a', 'tokenized', 'sentence', 'só'] ''' Using Python3.4 my test passes with no problems. Using Python2.7 I get: Expected: ['This', 'is', 'a', 'tokenized', 'sentence', 'só'] Got: [u'This', u'is', u'a', u'tokenized', u'sentence', u's\xf3'] My code has to work on both Python3.4 and Python2.7. How can I solve this problem? 回答1:

Python: import _io

别来无恙 提交于 2019-12-03 20:12:15
I'm trying to determine which files in the Python library are strictly necessary for my script to run. Right now I'm trying to determine where _io.py is located. In io.py (no underscore), the _io.py module (with underscore) is imported on line 60. Some modules are compiled directly into the interpreter -- there are no files corresponding to them. You can retrieve a list of these modules from sys.builtin_module_names . In my Pyton 3.1 installation, _io is included in this list. You might want to have a look at snakefood to determine the dependencies of your script. Not all Python modules are