conversion

Xcode 'invalid conversion' when using objective-c++

So if I run my program with the implementation as .m it works fine. Just changing it to .mm causes this line… CGContextRef myContext = [[NSGraphicsContext currentContext] graphicsPort]; to throw this error… error: invalid conversion from 'void*' to 'CGContext*' Anyone have any ideas why just changing that would make it blow up, or ...

Any good references or tools available for converting ASP to ASP.NET?

What tools, practices, or documentation have you used in your conversion process that you would recommend to others? ...

Is there a way to convert from a string to pure code in C++?

I know that its possible to read from a .txt file and then convert various parts of that into string, char, and int values, but is it possible to take a string and use it as real code in the program? Code: string codeblock1="cout<<This is a test;"; string codeblock2="int array[5]={0,6,6,3,5};}"; int i; cin>>i; if(i) { execute(codeblo...

Is there a function that returns the character/string at a point in a .txt? (C++)

I know its possible to get a part of a .txt, then convert it to an integer, then store it in a variable, but is it possible to to that in a single declaration. (The variable needs to be global). Ie: [data.txt] 1020 [convert_data.cpp] #include<fstream> fstream convert("data.txt"); //way to declare something equal to A PARTICULAR POINT i...

function for converting kilograms to pounds and ounces

I'd like to convert kilos into pounds and ounces e.g. if a user enters 10 kg then the function should return 22 lb and 0.73 oz Any ideas? ...

Why doesn't this C# code compile?

double? test = true ? null : 1.0; In my book, this is the same as if (true) { test = null; } else { test = 1.0; } But the first line gives this compiler error: Type of conditional expression cannot be determined because there is no implicit conversion between '<null>' and 'double'. ...

Converting from bandwidth to traffic gives different results depending on operators position?

Hi. This must be a stupid question, but nevertheless I find it curious: Say I have a steady download of 128Kbps. How much disk space is going to be consumed after a hour in Megabytes? 128 x 60 x 60 / 8 / 1024 = 56.25 MB But 128 x 60 x 60 / 1000 /8 = 57.6 MB So what is the correct way to calculate this? Thanks! ...

Converting int to char in java

This has probably been answered else where but how do you get the character value of an int value? Specifically I'm reading a from a tcp stream and the readers .read() method returns an int. How do I get a char from this? ...

JSONobject to JSONtext

how can i convert a JSON Object to JSONtext in a javascript function. i should pass the JSONtext as a string to JSP. ...

How should I convert a number with a text suffix to an integer in c#?

What's the cleanest/best way in C# to convert something like 400AMP or 6M to an integer? I won't always know what the suffix is, and I just want whatever it is to go away and leave me with the number. ...

convert PHP(JSON) to ASP code

Can someone convert below code to ASP format? <?php $data = ' [ { "A": "test", "B": "test", "C": "test" }, { "A": "test", "B": "test", "C": "test" } ] '; print($_GET['callback'] .'('. $data .')'); while I was testing cross domain restriction workaround, this code works fine with PHP server (of course)...

Automatically expand C# 3 syntactic sugar

Hello I'm in trouble with SlimDX samples, which just pretend to support VS 2005. Well there are VS2005 solution/project files but source code itself contains C# 3.0 new language features (mostly automatic properties). It would be hell to convert this stuff to C# 2.0 by hand. Is there any tool, which does it automatically? Thanks! ...

Is there a tool to convert ANSI C code to C#?

I need to import some ANSI C code into a project I'm working on. For reasons I prefer not to go into, I want to refactor the code to C# rather than trying to wrap the original code. It will take me perhaps a couple of days to do the work by hand, but before I start, is there an automated tool that can get me most of the way there? I'm a ...

convert std::string to const BYTE* for RegSetValueEx()

I have a function that gets a std::string. That function calls RegSetValueEx the 5th parameter is the value of the registry value and expects a variable of type const BYTE*. So I have to convert the std::string to const BYTE* and also give the length of the resulting array as the 6th parameter. I have found a way to do it, but it feel...

any PHP or Ruby library to convert Tranditional Chinese to Simplified Chinese or vice versa?

any PHP or Ruby library to convert Tranditional Chinese to Simplified Chinese or vice versa (Big5 <--> GB)? the iconv library won't do it as it merely convert the encoding -- the glyph stays the same. ...

any good alternative to Iconv library for encoding conversion?

i was using Iconv library on Ruby to convert encoding from UTF-8 to UTF-32, UTF-16 etc and it was quite good. However, I do see an issue when converting from Big5 to UTF-8 -- an exception is thrown for invalid sequence... and the problem goes away when it is converting from CP950 to UTF-8, of which CP950 is essentially Big5... so I wo...

How to convert an arbitrary large integer from base 10 to base 16?

The program requires an input of an arbitrary large unsigned integer which is expressed as one string in base 10. The outputs is another string that expresses the integer in base 16. For example, the input is "1234567890987654321234567890987654321234567890987654321", and the output shall be "CE3B5A137DD015278E09864703E4FF9952FF6B62C1CB1...

how to convert this line into vb.net

from the free dinner book for asp.net MVC [AcceptVerbs(HttpVerbs.Post)] public ActionResult Edit(int id, FormCollection formValues) { Dinner dinner = dinnerRepository.GetDinner(id); UpdateModel(dinner); dinnerRepository.Save(); return RedirectToAction("Details", new { id = dinner.DinnerID }); } how to convert this line...

Convert .caf to .mp3 on the iPhone

Hello, is there a way to convert my recorded .caf files to .mp3 using the iPhone SDK / Core Audio, something else? I've been looking around for a while, but all I've found was a command line uitility (which isn't allowed to run on the iPhone). Regards ...

Porting a Web Application to Desktop Application

I have a web app in production that is used for typical data entry,retrieval, and reporting type functions. For reasons of mobility(field access required) I have been tasked with porting that Web App to a Desktop App. The structure of the existing app, which I did not design or code, is thus: 3 Individual Projects each with there ow...