conversion

What Encoding is this: <ESC>[00p<ESC>(1*259*01/26/10*11.05*<CR>

I've got a .txt file given to me to parse through to pull out certain information and i'm not really wanting to write a scanner to do this. It resembles ANSI to me, with maybe a little more added to it. I don't know. It's automatic output from some hardware that's years and years old. Here is some more just to get a good idea of what i'm...

Specify a date in another timezone C#

I've got an asp.net application that must run some code every day at a specific time in the Eastern Time Zone (DST aware). So my first thought is, get the eastern time value and convert it to local server time. So I need something like this: var eastern = DateTime.Today.AddHours(17); // run at 5pm eastern var timeZoneInfo = TimeZoneIn...

convert double value to binary value

How can i convert double value to binary value. i have some value like this below 125252525235558554452221545332224587265 i want to convert this to binary format..so i am keeping it in double and then trying to convert to binary (1 & 0's).. i am using C#.net ...

ast of c source code in xml?

i'm looking for a software which converts a c source code program to a xml-based ast representation? some sort of markup language. example: [function name="set_foo"] [parameters] [parameter name="bar" type="string" /] [/parameters] [return> ...

Static Constructor in VB .Net

I am rewriting a C# class in VB. The C# class has a static constructor in it: static Class() { ... } which, through the Call Stack, I found is called by the main window's InitializeComponent() method. Everywhere I've looked has told me that the corresponding static constructor in VB is just: Shared Sub New() ... End Sub b...

Invalid conversion char to char* - Copying char in string array to another string array

Hi all, I'm a beginner in C++ Programming language. I wanted to write a program that take the alphabets in a string array called str, and copy it in a new array called str_alpha. And the same goes to numbers, the program copies it from str array to str_digit array. There's my humble code, it might be full of errors and stuff. But this...

Fastest way to convert 16.16 fixed point to 32 bit float in c/c++ on x86?

Most people seem to want to go the other way. I'm wondering if there is a fast way to convert fixed point to floating point, ideally using SSE2. Either straight C or C++ or even asm would be fine. ...

scala way to define functions accepting a List of different numeric types

I have the following problem: I have a function which takes a List[Double] as parameter, performs some arithmetic operations on the elements of the list and than return the result. I would like the function also to accept List[Int]. Here is an example: def f(l: List[Double]) = { var s = 0.0 for (i <- l) s += i s } ...

XSLT conversion of string representation of date (01 Jan 00) into xs:date

Hello, I'm stuck with a string conversion to xs:date. I would really appreciate any help and tips! I have a string that represents date in the format of "01 Jan 00", which I need to convert to xs:date, so that I can manipulate it further. Is there a function or something already there so that I can convert my so ever difficult string ...

variable conversion and explaination in php and vb.net

hi I have some php code as below. <?php $value = -1924050635; echo "before:".$value; echo "<br/>"; $value = sprintf('%u', $value); echo "<br/>"; echo "after:".$value; ?> Before value is -1924050635 after value is 2370916661 My problem is that what the sprintf is doing here. What i need to do if i want ...

Converting HTML table data to CSV and XML

Hi, I'm building a table script and one of the functionalities is to convert XML, CSV data to HTML and vice-versa. I found some similar scripts on the web, that converts CSV to HTML and vice-versa but didn't find for XML. I'm writing the script from scratch, but I thought I'd better read few scripts before I write my own, to avoid mis...

How to produce struct addrinfo from struct sockaddr?

I have a struct sockaddr and need to make a struct addrinfo (specifically that, because that's what some other API wants). The IP address may be IPv4 or IPv6. What's the best way to handle that? ...

AS3: How do I check and reset variable on the main timeline from inside a movieclip

I'm converting an old AS2 file into AS3 (and trying to learn AS3 at the same time). A movie clip contains a number of different animated sequences and buttons within the application trigger these different sequences. The buttons are functional only when an animation has completed playing. In AS2, I achieved this with a var called _root....

Make my own video conversion program? Viable?

How are video conversion programs made? Do they seriously understand every single file format of every single type they implement or is it using direct show filters or something? Basically i am interested in making my own but if i actually have to research every single file format to convert then i think ill pass O_O So whats the go, di...

Convert 32 bit CGImage to 24 bit?

Trying to convert a 32 bit CGImage to 24 bit and would like to avoid packing it byte-by-byte. Surely there must be a more efficient way ...? Have tried a couple of things like creating a 24 bpp NSBitmapImageRep like this: NSBitmapImageRep* image24 = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:nil pixelsWide:width ...

Convert.ToSingle rounding problem

Hi, this is my issue: I made a query to SQL server to get some data via a Stored Procedure, the returned value was this: 10219150 Then, on an assembly (I don't have the source code of that assembly, I reflected the file to view the code) someone made this: Ammount = Convert.ToSingle(10219150); //the value from the stored procedure ...

How to pass a pointer to a struct via Pinvoke?

I am trying to write the C# equivalent to the following: typedef struct BATT_ID { UINT8 nBattID[8]; } BATT_ID, *PBATT_ID; HANDLE g_hDevice; // Connect to the driver g_hDevice = CreateFile(L"BAT1:", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); void GetB...

Substituting Groovy for Java Little By Little

I have been checking out Groovy a bit and I feel that moving a Java program to Groovy little by little -- grabbing a class and making it a Groovy class, then converting the method guts a bit at a time -- might be a relatively sane way to take advantage of some of the Groovy language features. I would also do new classes in Groovy. Quest...

[objective-c] getting integer from string with formatted number

I have a string representing a number, and I want to convert it an NSInteger. The problem is, that the string is formatted with thousand separators: "1,234" when using [value intValue], I get 1 as the value. Is it because it thinks the thousand separator is a decimal separator? (my locale uses comma as decimal separator and a space o...

Converting System::IntPtr to HINSTANCE

I'm grabbing the HINSTANCE of a c# form using: IntPtr hinstance = Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()[0]); I'm then trying to pass it on to a C++/CLI component. I'm pretty sure this is a dumb question, but how in C++ CLI do you convert from an IntPtr to an HINSTANCE? ...