porting

Drawables for qHD resolution

好久不见. 提交于 2019-12-06 05:36:37
I'm designing a game possibly for all kinds of Android devices, so I have multiple drawable folders for phones of different resolutions, and for tablets. Here is the list of my folders: drawable-mdpi - for 480x320 devices drawable-hdpi - for 800x480 and 854x480 devices drawable-large-hdpi - for 1024x600 tablets drawable-xlarge-mdpi - for 1200x800 tablets My question is what name should have a folder with drawables for qHD resolution, which is 960x540 and 256 dpi? Thanks in advance. I will deeply, strongly, emphatically encourage you not to use "-large" or "-xlarge" qualifiers with drawables.

Porting time APIs from Linux to Visual Studio 2008

你。 提交于 2019-12-06 05:17:54
问题 I have an application that I am porting to Microsoft Visual Studio 2008 that builds and runs fine on Linux. I am having trouble with the time routines, my Linux code looks like this: #include <sys/types.h> #include <sys/time.h> typedef long long Usec; inline Usec timevalToUsec(const timeval &tv) { return (((Usec) tv.tv_sec) * 1000000) + ((Usec) tv.tv_usec); } But the compiler fails on the sys/time.h header file: fatal error C1083: Cannot open include file: 'sys/time.h': No such file or

What should I use in Android when porting C++ code written with libsndfile?

不问归期 提交于 2019-12-06 05:00:30
问题 I'm porting a small (<10 classes) C++ project to Java. The project manipulates sound files, and in C++ does this using libsndfile. The code includes stuff like: const int channels = audioFileInfo.channels; ... sf_readf_double( audioFile, inputBuffer, MAX_ECHO ); ... sf_writef_double( outputAudioFile, &currentAudioBuffer[WINDOW_SIZE * channels], SEGMENTATION_LENGTH ); In Java, what's the best way to manipulate sound files on a low level? I'm talking about stuff like normalizing, adding echoes

Porting to Python3: PyPDF2 mergePage() gives TypeError

烂漫一生 提交于 2019-12-05 22:00:35
I'm using Python 3.4.2 and PyPDF2 1.24 (also using reportlab 3.1.44 in case that helps) on windows 7. I recently upgraded from Python 2.7 to 3.4, and am in the process of porting my code. This code is used to create a blank pdf page with links embedded in it (using reportlab) and merge it (using PyPDF2) with an existing pdf page. I had an issue with reportlab in that saving the canvas used StringIO which needed to be changed to BytesIO, but after doing that I ran into this error: Traceback (most recent call last): File "C:\cms_software\pdf_replica\builder.py", line 401, in merge_pdf_files

Sending a HTTP POST request from Python (trying to convert from PHP)

為{幸葍}努か 提交于 2019-12-05 21:46:28
I am trying to convert this code snippet from PHP to Python (programming newbie) and am finding difficulty in doing so: The PHP that I am trying to convert is as follows: $fp = fsockopen($whmcsurl, 80, $errno, $errstr, 5); if ($fp) { $querystring = ""; foreach ($postfields AS $k=>$v) { $querystring .= "$k=".urlencode($v)."&"; } $header="POST ".$whmcsurl."modules/servers/licensing/verify.php HTTP/1.0\r\n"; $header.="Host: ".$whmcsurl."\r\n"; $header.="Content-type: application/x-www-form-urlencoded\r\n"; $header.="Content-length: ".@strlen($querystring)."\r\n"; $header.="Connection: close\r\n\r

Porting Qt4 to Qt5: unresolved external symbols

房东的猫 提交于 2019-12-05 21:12:21
Qt5 is the new generation of Qt and it has some changes. I have a project building well with Qt4. I've downloaded Qt5-VisualStudio2010 package and I'm trying to port my project from Qt4 to Qt5. Problems arise. All 'include' paths have been fixed well. However, the compiler now reports hundreds of 'unresolved external symbols' (almost all function calls, sounds like the compiler can't find any .lib file). I even tried to add all .lib files found in the Qt SDK folder, but useless. The most basic class and method: QApplication::exec(...) also reported as 'unresolved symbol'. The project file has

How to compile a C program?

自闭症网瘾萝莉.ら 提交于 2019-12-05 15:57:57
I haven't done C in a long time. I'd like to compile this program , but I have no idea how to proceed. It seems like the makefile refers to GCC a lot and I've never used GCC. I just want an executable that will run on windows. vladr You may need to install either cygwin or mingw, which are UNIX-like environments for Windows. http://www.mingw.org/ http://www.cygwin.com/ When downloading/installing either cygwin or mingw, you will have the option of downloading and installing some optional features; you will need the following: gcc (try version 2.x first, not 3.x) binutils GNU make (or gmake) If

Are there cases where fseek/ftell can give the wrong file size?

家住魔仙堡 提交于 2019-12-05 15:07:01
In C or C++, the following can be used to return a file size: const unsigned long long at_beg = (unsigned long long) ftell(filePtr); fseek(filePtr, 0, SEEK_END); const unsigned long long at_end = (unsigned long long) ftell(filePtr); const unsigned long long length_in_bytes = at_end - at_beg; fprintf(stdout, "file size: %llu\n", length_in_bytes); Are there development environments, compilers, or OSes which can return the wrong file size from this code, based on padding or other information that is situation-specific? Were there changes in the C or C++ specification around 1999, which would have

How to get 'file creation time' in Linux

此生再无相见时 提交于 2019-12-05 14:18:21
I need to find out at what time and date a file has been created using C++ in Linux. Grijesh Chauhan How do I get the date a file was last modified? . struct stat attrib; //1. create a file attribute structure stat("file_name", &attrib); //2. get the attributes of afile.txt clock = gmtime(&(attrib.st_mtime)); //3. Get the last modified time and // put it into the time structure 4.8 File Times Update : In Linux: three distinct timestamps associated with a file: time of last access of contents ( atime ), time of last modification of contents ( mtime ), and time of last modification of the inode

Convert perl script to vba

半城伤御伤魂 提交于 2019-12-05 13:24:05
I am using a PC where perl script is not allowed. Is there any tool to convert perl script to vba macro? Or is there any links where we can get the vba equavalent of perl statements. Corey Cole Assuming you've got access to a machine that can run Perl, you could try using the PAR Packer utility (pp) . % pp -o hello hello.pl # Pack 'hello.pl' into executable 'hello' # (or 'hello.exe' on Win32) If you have enough permissions to run VB scripts, you should also have permissions to install the Perl interpreter and just run your script natively. 来源: https://stackoverflow.com/questions/8323811