conversion

c# Encoding conversion?

Hi, I have a string which looks like: À l'intérieur But it needs to be: À l'intérieur I tried changing the conversion. I know it's read as ASCII encoding. So I tried using the code: ASCIIEncoding ASCII = new System.Text.ASCIIEncoding(); Byte[] BytesMessage = ASCII.GetBytes(Title); Title = Encodi...

How do I convert this object to an array in JavaScript?

How do I convert testObj to an array? function MinEvent(event, width, left){ this.start = event.start; this.end = event.end; this.width = width; this.top = event.start; this.left = left; } var testObj = {}; for (var j=0; j<eventLists.length; j++) { var eve = eventLists[j]; var event = new MinEvent(eventList[j], width, lef...

Changing a spreadsheet formula so it works with PHP

Hello, for years now I have used a math formula to determine relative activity levels for message boards. Now I would like to use that formula in a php search engine to replace the non-functioning Google Page Ranking system. The data items used are: Members (B2), Posts (D2), Topics (C2), and the Boards creation date (E2). In the spreads...

Converting CHM file to another format

I need to convert a chm file to another format, most likely pdf or html. I have tried chm2pdf and other converters but they all do horrific jobs at conversion. Even using a program like htmldoc doesn't do a very good job at converting to html. Is there a way to just print each page of the chm file or taking a image of it and then savi...

Convert a HTML Control (Div or Table) to an image using C#

Hi guys, Is it possible to convert a Html Control to an image in C#? Is there any C# method where I can pass the Html Control object and return an image of that html control? Is this possible, any suggestions? ...

Smallest method of turning a string into an integer(and vice-versa)

Hello, I am looking for an extremely small way of turning a string like "123" into an integer like 123 and vice-versa. I will be working in a freestanding environment. This is NOT a premature optimization. I am creating code that must fit in 512 bytes, so every byte does actually count. I will take both x86 assembly(16 bit) and C code t...

WPF C# string to decimal, decimal to string problem

Please, help me to identify problem in my C# code(WPF, event-handler): private void Discount5Btn_Click(object sender, RoutedEventArgs e) { decimal catPr; decimal salePr; string catPrStr; catPrStr = PriceCatTBox.Text; catPr = decimal.Parse(catPrStr); salePr = decimal.Multiply(ca...

Convert ASP.NET VB.NET code into C#

Does anyone have recommendations on tools to use to convert an VB.NET ASP.NET Web Application Project into C#? The majority of the conversion tools do not support converting ASP.NET-based projects. Even the VBConversions tool (http://www.vbconversions.net) only converts the code-behind, but leaves all the VB.NET code snippets in the actu...

Problem in converting from csharp to vb

I am trying to convert this code from csharp to vb. Tried to use third party tools, but not successful. Can some one help me .Thanks private static string RemoveInvalidHtmlTags(this string text) { return HtmlTagExpression.Replace(text, new MatchEvaluator((Match m) => { if (!ValidHtmlTags.ContainsKey(m.Groups["tag"].Value...

How to convert a date object to a formatted string?

so I have a variable containing a date object. I want to convert it to a string in this format: dd/mm/yyyy. How could this be achieved? ...

Convert an image to RGBA mode with python

I tried the code listed at Using PIL to make all white pixels transparent to convert some .ico files to .png images with transparent background. It doesn't work on all .ico images, some time it just outputs an image with black background. Sample .ico files can be located here ...

Casting between integers and pointers in C++

#include<iostream> using namespace std; int main() { int *p,*c; p=(int*)10; c=(int*)20; cout<<(int)p<<(int)c; } Somebody asked me "What is wrong with the above code?" and I couldn't figure it out. Someone please help me. ...

locale-independent strtod implementation

I have a library which needs to parse double numbers which always use a point '.' as decimal separator. Unfortunately for this case, strtod() respects the locale which might use a different separator and thus parsing can fail. I can't setlocale() - it isn't thread-safe. So I'm searching for a clean locale-independent strtod implementatio...

How do I convert C/C++ string with escape character to a plain (raw) string

The function prototype would be: string f (string s); or char* f (char* s); f would transform a string represented by printable ascii char into a raw string. and it would behaves as in the following examples: f("AAA") = "AAA" f("AA\n") = "AA+line_feed" i.e the input string is 4 char long (+ NULL), the output is 3 char long(+NUL...

Conversion euler to matrix and matrix to euler

I'm trying to convert a 3D rotation described in term of euler angles into a matrix and then back, using .NET/C#. My conventions are: left handed system (x right, y top, z forward) order of rotations: heading around y, pitch around x, bank around z rotations are positive using the left hand rule (thumb pointing to +infinity) My tria...

MS Calculator on windows 7. I need to know how it does its operations.

MS calculator on windows 7 has a "programmers" mode. When I type in (in binary): 1111111111111111111111111111111111111111111111111111111111111111 and then click "Dec", the binary turns into -1. When I click Oct, the value turns into 1777777777777777777777 However, whenever I use an online converter, it doesn't work. I need to know ho...

javascript float from/to bits

Hello, I am trying to perform something that is brain-dead simple in any other language but not javascript: get the bits out of float (and the other way around). In C/C++ it would be something like float a = 3.1415; int b = *((int*) and vise-versa int a = 1000; float b = *((float*) In C# you can use the BitConverter ...floatBits...

Convert List<Cookie> to CookieCollection in C#

Let's say I have List<Cookie> and I want to convert it to a CookieCollection. What's the easiest way to do this? I know I can use a foreach loop, but isn't there a way to instantiate it with code similar to this? List<Cookie> l = ...; var c = new CookieCollection() { l }; When I try to compile that though, I get the error: The be...

Is it possible to convert a Win32 application project into a console application?

Is it possible to convert an existing visual studio project file that creates a Win32 application into a project file that creates a Win32 "Console" application? If so, how is this done? I've googled and found plenty of people doing the opposite, but none this way. ...

java string conversion

Hi All, I have written following java code. It is throwing array index out of range exception Exceptions: exception_name = java.lang.ArrayIndexOutOfBoundsException exception_message = Array index out of range: 1 Can some resolve this issue plz public class UnifiedClus1toNfastfastsamehost extends UnifiedClus1toNfastfastsamehostH...