porting

Problem porting PHP crypt() function to C#

懵懂的女人 提交于 2019-11-29 17:54:38
Im working on porting some old ALP user accounts to a new ASP.Net solution, and I would like for the users to be able to use their old passwords. However, in order for that to work, I need to be able to compare the old hashes to a newly calculated one, based on a newly typed password. I searched around, and found this as the implementation of crypt() called by PHP: char * crypt_md5(const char *pw, const char *salt) { MD5_CTX ctx,ctx1; unsigned long l; int sl, pl; u_int i; u_char final[MD5_SIZE]; static const char *sp, *ep; static char passwd[120], *p; static const char *magic = "$1$"; /*

Is there an xhtml.xsd equivalent available for HTML5?

梦想与她 提交于 2019-11-29 17:37:14
问题 I am developing an appplication based on Mozilla XULRunner. I am using the xhmtl1-strict.xsd provided by the W3C to fetch the attribute. Now the requirement came to add the <video> tag to my application, but my application is not supporting any HTML5 elements or attributes. So, any suggestions? 回答1: HTML5 does not have a doctype definition or an XML schema definition. This is because, although it shares the same syntax as its predecessor HTML 4, HTML5 itself is neither based on SGML nor XML.

Porting GCC to new architectures [closed]

六月ゝ 毕业季﹏ 提交于 2019-11-29 13:04:33
How do I go about porting gcc to a new architecture? I am specifically interested in the following architectures: ARM (TI OMAPs) TI MSP430 x86 but guidance on how to port to any architecture would go some way to solving my problem. Learning to port gcc is going to be a significantly non-trivial task. As a rough guide of what to expect, you will need to know: The target architecture inside out. Literally, otherwise how else will you know how to convert C to it? The C standard, so C89, C99 etc. How compilers work. There are whole books on this. In order to start the process, you would typically

compiling a C++ class in Xcode: error during compilation: stl vector

狂风中的少年 提交于 2019-11-29 09:49:21
I have a C++ class that compiles fine on linux with gcc and on widows in visual studio. boid.h: #ifndef BOID_CLASS_HEADER_DEFINES_H #define BOID_CLASS_HEADER_DEFINES_H #include "defines.h" class Boid { public: // Initialize the boid with random position, heading direction and color Boid(float SceneRadius,float NormalVel); ..... protected: ... }; #endif and in boid.cpp: #include "Boid.h" // Initialize the boid with random position, heading direction and color Boid::Boid(float SceneRadius,float NormalVel) { .... } However, I get the following error when I compile this code in Xcode: Compiling

Migrating a project from C# to Java

陌路散爱 提交于 2019-11-29 09:41:35
With some changes in the staffing at the office, the levels of C# expertise has dropped off precipitously and there are now more Java developers. It has gotten to the point where the higher-ups are considering moving an existing .NET project written in C# into the Java world. Aside from the obvious problem of starting completely from scratch what are the possible ways that this company can accomplish a successful move of development on a project from .NET C# into Java? Here are things to consider: Is this big project? If Yes, try to stick with C# Is this medium sized project with components?

Flutter - Import from existing android project

跟風遠走 提交于 2019-11-29 07:24:54
问题 I am currently working on an android project which is ~75% complete. I need a similar application for iOS. Can I import this project to flutter? How? Also, will flutter supports the libraries I have used in this project? 回答1: Flutter applications work completely different , i.e. not like Android nor like iOS. Flutter has its own architecture and therefore own plugins etc. Summary No , you cannot convert your existing Android code into Dart code for Flutter, which is necessary to enable cross

32 bit Windows and the 2GB file size limit (C with fseek and ftell)

会有一股神秘感。 提交于 2019-11-29 04:52:24
I am attempting to port a small data analysis program from a 64 bit UNIX to a 32 bit Windows XP system (don't ask :)). But now I am having problems with the 2GB file size limit (long not being 64 bit on this platform). I have searched this website and others for possible sollutions but cannot find any that are directly translatable to my problem. The problem is in the use of fseek and ftell. Does anyone know of a modification to the following two functions to make them work on 32 bit Windows XP for files larger than 2GB (actually order 100GB). It is vital that the return type of nsamples is a

Java Equivalent of Reflection.Emit

守給你的承諾、 提交于 2019-11-29 01:17:47
As far as I can tell, Java has no such equivalent of C#'s Reflection.Emit stuff. Are there any additional libraries for Java that provide similar functionality? What are the differences (to reflection emit )? Besides Darin's excellent answer (+1), ASM is worth checking out too. The Byte Code Engineering Library (BCEL) 来源: https://stackoverflow.com/questions/2259323/java-equivalent-of-reflection-emit

Why does malloc not work sometimes?

ぃ、小莉子 提交于 2019-11-28 23:26:36
I'm porting a C project from Linux to Windows. On Linux it is completely stable. On Windows, it's working well most times, but sometimes I got a segmentation fault. I'm using Microsoft Visual Studio 2010 to compile and debug and looks like sometimes my malloc calls simply doesn't allocate memory, returning NULL. The machine has free memory; it already passed through that code a thousand times, but it still happens in different locations. Like I said, it doesn't happen all the time or in the same location; it looks like a random error. Is there something I have to be more careful on Windows

Porting std::map to C?

[亡魂溺海] 提交于 2019-11-28 20:29:12
I am porting some c++ code to c. What is a viable equivalent of std::map in c? I know there is no equivalent in c. This is what I am thinking of using: In c++: std::map< uint, sTexture > m_Textures; In c: typedef struct { uint* intKey; sTexture* textureValue; } sTMTextureMap; Is that viable or am I simplifying map too much? Just in case you did not get the purpose its a Texture Map. Many C implementations support tsearch(3) or hsearch(3). tsearch(3) is a binary tree and you can provide a comparator callback. I think that's about as close as you're going to get to a std::map. Here's some c99