porting

glibc not supported by Cygwin

送分小仙女□ 提交于 2019-12-04 11:35:01
Cygwin FAQ has the following info for 'Where is glibc?' : Cygwin does not provide glibc. It uses newlib instead, which provides much (but not all) of the same functionality. Porting glibc to Cygwin would be difficult. I was surprised and checked out the release packages as i had earlier used it. While i checked the repositories, it appears that glibc was actually indeed part of cygwin until version 2.10. Can anyone tell of the porting difficulty for the subsequent versions of glibc ? The Cygwin FAQ is correct, of course; glibc has never been part of Cygwin. The C library on Cygwin is cygwin1

When porting Java code to ObjC, how best to represent checked exceptions?

非 Y 不嫁゛ 提交于 2019-12-04 10:52:23
问题 I am working on porting a Java codebase to Cocoa/Objective-C for use on desktop Mac OS X. The Java code has lots and lots of methods with checked exceptions like: double asNumber() throws FooException { ... } What's the best way to represent these in Objective-C? Exceptions or error out-parameters? - (CGFloat)asNumber { ... // possibly [FooException raise:format:]; } or - (CGFloat)asNumberError:(NSError **)outError { ... } I have the sense that out-errors are generally the better solution for

Porting time APIs from Linux to Visual Studio 2008

限于喜欢 提交于 2019-12-04 10:43:02
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 directory If I change the include to just time.h I get a different error with timeval not being defined:

_wfopen equivalent under Mac OS X

三世轮回 提交于 2019-12-04 10:14:13
问题 I'm looking to the equivalent of Windows _wfopen() under Mac OS X. Any idea? I need this in order to port a Windows library that uses wchar* for its File interface. As this is intended to be a cross-platform library, I am unable to rely on how the client application will get the file path and give it to the library. 回答1: POSIX API in Mac OS X are usable with UTF-8 strings. In order to convert a wchar_t string to UTF-8, it is possible to use the CoreFoundation framework from Mac OS X. Here is

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

巧了我就是萌 提交于 2019-12-04 09:09:27
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 etc. Progress Report After a bit of digging I've found javax.sound.sampled , which looks like it might

Phonegap code as a web app

核能气质少年 提交于 2019-12-04 08:23:14
问题 I am thinking of re-using my phonegap html, css and js code as a web app. I would be going through and removing any mobile only functionalities. The purpose is to have a web app which offers some of the mobile apps functionality, I use very little mobile device features currently. But I am guessing maintaining with each release of my mobile app code will be troublesome. Any of you guys tried this before ? Any tips ? 回答1: With a responsive design your phonegap code should run on almost any

Resources for Python Programmer [closed]

蹲街弑〆低调 提交于 2019-12-04 07:42:38
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I have written a lot of code in Python, and I am very used to the syntax, object structure, and so forth of Python because of it. What

How to implement language level events similar to C# in Java

喜你入骨 提交于 2019-12-04 07:01:14
C# has the notion of events on a language level , using the reserved keywords event and delegate to define publisher and subscriber methods. It has been asked if Java has native support for that but the answer is obviously no. There are several alternatives , which include using AWT/Swing styled events, building my own Observer pattern or using other means of publish/subscribe. It is possible but as one answer said, "just requires a bit more legwork." In general any implementation follows the same typed approach and could be automated. Java has different mechanisms for meta programming, e.g.

Help with understanding C# code and porting to Objective-C

送分小仙女□ 提交于 2019-12-04 04:36:03
问题 Ok, I have this prototype that was written by someone else in C# and I'm trying to put it into Objective-C. Now, I haven't had any formal experience with C# yet, so I don't know everything about it yet. I understand what the first three variables are, but I'm running into problems with what the fourth and fifth lines (c_data) are doing. Is the fourth declaring a method and then the fifth defining it or what's happening? Thanks for your help! public class c_data { public double value; public

How to print message from caught exception?

ⅰ亾dé卋堺 提交于 2019-12-04 03:42:55
问题 I have a very simple question. Would really appreciate if a C++ programmer can guide me. I want to write the C# code below in C++ dll. Can you please guide? C# code to be translated: void someMethod{ try { //performs work, that can throw an exception } catch(Exception ex) { Log(ex.Message);//logs the message to a text file } } //can leave this part, i can implement it in C++ public void Log(string message) { //logs message in a file... } I have already done something similar in C++ but I can