porting

Cannot convert from 'const wchar_t *' to '_TCHAR *'

时光毁灭记忆、已成空白 提交于 2019-12-01 17:04:56
_TCHAR* strGroupName = NULL; const _TCHAR* strTempName = NULL; //Assign some value to strTempName strGroupName = _tcschr(strTempName, 92) //C2440 I get an error at the above line while compiling this code in VS2008. In VC6 it compiles fine. Error C2440: '=' : cannot convert from 'const wchar_t *' to '_TCHAR *' What seems to be the problem and how do I fix it? Try casting it as strGroupName = (_TCHAR*)_tcschr(strTempName, 92); Seems to me that VS2008 got a little more strict on type casts, and won't automatically do them in some cases. strGroupName = const_cast<_TCHAR*>( _tcschr(strTempName, 92

Porting an application with fork() to pthread_create()

倾然丶 夕夏残阳落幕 提交于 2019-12-01 14:27:05
I am porting a linux application to the iphone and I would like to know how much re-writing I have to do to make it a multi-threaded application rather than a multi-process application. Also, if I simply replace the forked code with a call to the functions on another thread I get exec_bad_address at seemingly random places in my flow of execution... Does anyone know why this may be the case? Thanks! It is exactly the same effort you would undergo in transitioning your application to a multi-threaded one on a unix platform. Simply replacing the forking code with calls to pthread_create() is -

Create new multidimensional Associative array from 2 arrays

拥有回忆 提交于 2019-12-01 11:19:47
I am looking for a solution to create a single multidimensional associate array in javascript. What I have: I have a mysql database I am accessing with php and have an array containing all fields (key,value pairs) in a single record. Their are upwards of 30 fields in each record so I am looking for a dynamic solution. In the html coding, there is a form that is used to update a specific record in the table. I am using a function call on each input to fill a javascript array by key and value. The keys are identical to the keys in the php array. In the function I am doing a json_encode call on

Create new multidimensional Associative array from 2 arrays

泪湿孤枕 提交于 2019-12-01 08:03:18
问题 I am looking for a solution to create a single multidimensional associate array in javascript. What I have: I have a mysql database I am accessing with php and have an array containing all fields (key,value pairs) in a single record. Their are upwards of 30 fields in each record so I am looking for a dynamic solution. In the html coding, there is a form that is used to update a specific record in the table. I am using a function call on each input to fill a javascript array by key and value.

Porting Winsock to Linux Sockets

痴心易碎 提交于 2019-12-01 04:22:05
I have a program that does some networking using Winsock, and one of our requirements right now is to port over our program to Linux. The only thing stopping us from doing this is Winsock. My question is: How easy can I port this over to a Linux implementation? Are there any pitfalls I should be aware of, and if I simply include the appropriate header files, what sort of things will I have to be sure to handle? Thanks for any help! I'd post code but I can't unfortunately due to legal reasons. But, our code does use the following: WSAStartup(..) WSACleanup(..) Socket(..) sendto(..) recvfrom(..)

tkinter woes when porting 2.x code to 3.x, 'tkinter' module attribute doesn't exist

泪湿孤枕 提交于 2019-12-01 04:08:36
问题 UPDATED: SEE BELOW I've been porting the code for this assignment: http://www.stanford.edu/class/cs221/progAssignments/PA1/search.html (the entire source code is available as zip from there) from Python 2.x to 3.x. Note, porting is not the assignment, that's just me trying to keep the code up to date and avoiding installing another version of Python... After the usual 2.x -> 3.x syntax fixes (printing, exception raising, etc), and realizing that the module Tkinter is now known as tkinter in 3

Converting iPhone/iPad apps onto Android [closed]

旧街凉风 提交于 2019-12-01 02:19:35
I have started to build my own apps on iPhone and iPad using the iPhone SDK. The next question that is always asked by the client is, "Can we have it on Android?" So my question to you, 'the internet', is: what are my options? I don't have the time to learn another language (learning iOS has been enough!), so are there companies who specialize in this, or are there any online services that do a conversion? Any help on this welcome, just need to know which way to turn... No , there is no way to convert an existing iOS app to an Android app. However, there are cross-platform frameworks that

Check requirements for python 3 support

余生长醉 提交于 2019-11-30 22:05:07
问题 I have several python projects with different set of dependencies listed in pip requirements files. I've started to think about porting the code to python 3, but I need to know if my dependencies are already there. Is it possible to check what packages from a requirements.txt file support python 3 and what don't? Example requirements.txt contents: mysql-python==1.2.5 lxml==3.3.4 Fabric==1.8.0 From this list, only lxml supports python 3. Just a side note. There is a Python 3 Wall of

How does porting between Linux and Windows work?

纵然是瞬间 提交于 2019-11-30 20:38:37
If a particular piece of software is made to be run on one platform and the programmer/company/whatever wants to port it to the other, what exactly is done? I mean, do they just rewrite linux or windows-specific references to the equivalent in the other? Or is an entire rewrite necessary? Just trying to understand what makes it so cost-prohibitive that so many major vendors don't port their software to Linux (specifically thinking about Adobe) Thanks this is the point of a cross-platform toolkit like qt or gtk, they provide a platform-agnostic API, which delegates to whichever platform the

Getting the System tick count with basic C++?

倖福魔咒の 提交于 2019-11-30 14:58:51
问题 I essentially want to reconstruct the getTickCount() windows function so I can use it in basic C++ without any non standard libraries or even the STL. (So it complies with the libraries supplied with the Android NDK) I have looked at clock() localtime time But I'm still unsure whether it is possible to replicate the getTickCount windows function with the time library. Can anyone point me in the right direction as to how to do this or even if its possible? An overview of what I want to do: I