conversion

Most efficient way to convert an HTMLCollection to an Array

Is there a more efficient way to convert an HTMLCollection to an Array, other than iterating through the contents of said collection and manually pushing each item into an array? ...

Defaulting WebParts on a Users MySite in Sharepoint

I am working on a project that is replacing an old portal system (Plumtree) with sharepoint and we want to make the transition as smooth as possible. One thing we are look at currently is taking all the gadgets (Plumtree term for WebParts) and making sure they appear in the same place on the users new MySite. Plumtree holds this inform...

Importing extended ASCII into Oracle

I have a procedure that imports a binary file containing some strings. The strings can contain extended ASCII, e.g. CHR(224), 'à'. The procedure is taking a RAW and converting the BCD bytes into characters in a string one by one. The problem is that the extended ASCII characters are getting lost. I suspect this is due to their values me...

Why does Convert.ToDouble(string) round?

For example, Convert.ToDouble("0.1234567890123456789") = 0.123456789012346 What is the maximum number of significant figures? Couldn't find it in the docs. ...

Fortran Array to C array. Stupid macro tricks wanted

I have this 'simplified' fortran code real B(100, 200) real A(100,200) ... initialize B array code. do I = 1, 100 do J = 1, 200 A(J,I) = B(J,I) end do end do One of the programming gurus warned me, that fortran accesses data efficiently in column order, while c accesses data efficiently in row order. He suggested that I t...

How to handle calendar TimeZones using Java?

I have a Timestamp value that comes from my application. The user can be in any given local TimeZone. Since this date is used for a WebService that assumes the time given is always in GMT, I have a need to convert the user's parameter from say (EST) to (GMT). Here's the kicker: The user is oblivious to his TZ. He enters the creation dat...

Conversion tool for MS-Excel spreadsheets with macros and VB to Oracle?

Our users have created MS-Excel spreadsheets which over time have evolved into fairly complex applications. They run their part of the business with them. But, never having been exposed to software development discipline, these spreadsheets are brittle, single point of failure, solutions. Our development group uses Oracle primarily wi...

How to convert (not neccessarily programatically) between Windows' wchar_t and GCC/Linux one?

Suppose I have this Windows wchar_t string: L"\x4f60\x597d" and L"\x00e4\x00a0\x597d" and would like to convert it (not neccessarily programatically; it will be a one-time thing) to GCC/Linux wchar_t format, which is UTF-32 AFAIK. How do I do it? (a general explanation would be nice, but example based on this concrete case would be...

A library to convert ANSI escapes (terminal formatting/color codes) to HTML

I'm looking for a code library that converts ANSI escape sequences into HTML color, via plain tags or CSS. For example, something that would convert this: ESC[00mESC[01;34mbinESC[00m ESC[01;34mcodeESC[00m ESC[01;31mdropbox-lnx.x86-0.6.404.tar.gzESC[00m ESC[00mfooESC[00m Into this: <span style="color:blue">bin</span> <span style="colo...

Matching FORTRAN rounding in C#

FORTRAN provides several functions to convert a double precision number to an integral value. The method used for truncation/rounding differs. I am converting complex scientific algorithms which use these. According to FORTRAN documentation: aint(x) returns the integral value between x and 0, nearest x. anint(x) returns the nearest in...

How to convert UNIX timestamp to DateTime and vice versa?

As the title says really. There is this example code, but then it starts talking about millisecond / nanosecond problems. http://blogs.msdn.com/brada/archive/2004/03/20/93332.aspx Edit: This is what I've got so far: public Double CreatedEpoch { get { DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, 0).ToLoca...

Design Pattern to apply conversion to multiple properties in multiple classes

I am using the WMD markdown editor in a project for a large number of fields that correspond to a large number of properties in a large number of Entity classes. Some classes may have multiple properties that require the markdown. I am storing the markdown itself since this makes it easier to edit the fields later. However, I need to co...

How do you convert an image to black and white in PHP

How does one go about converting an image to black and white in PHP? Not just turning it into greyscale but every pixel made black or white? ...

.htaccess or .htpasswd equivalent on IIS?

Does anyone know if there is an equivalent to .htaccess and .htpassword for IIS ? I am being access to migrate an app to IIS that uses .htaccess to control access to sets of files in various URLs based on the contents of .htaccess files. I did a google search and didn't turn up anything conclusive. Is there a general approach or tool t...

How to Convert CString and ::std::string ::std::wstring to each other?

CString is quit handy, while std::string is more compatible with stl container. I am using hash_map, however, hash_map does not support CString as key, so I wish I could convert CString into std::string, is it possible? Write a CString hash function seems take lots of time. CString ------> std::string ? how can I do? std::string -----...

Converting DTS packages to SSIS

I'm looking for tutorials or walkthroughs for converting DTS packages into the new SSIS 2005. Any one knows. ...

SQL Conversion

I want to port a project from sybase to oracle. I need to port the tables scripts (around 30) and some data in meta data tables(100 rows 2/3 tables). What will the best tool for this work? ...

can we define implicit conversions of enums in c#?

Is it possible to define an implicit conversion of enums in c#? something that could achieve this? public enum MyEnum { one = 1, two = 2 } MyEnum number = MyEnum.one; long i = number; Edit: If not, why not!! :) ...

converting character encoding using a posix c function

Is there a standard posix C function to convert encodings, say from windows-1251 to utf-8 and back? ...

Converting SQL to HQL

I'm trying to convert the below SQL query to HQL and am having a few issues. A straight line by line conversion doesn't work, I am wondering if I should be using an Inner Join in the HQL? SELECT (UNIX_TIMESTAMP(cosc1.change_date) - UNIX_TIMESTAMP(cosc2.change_date)) FROM customer_order_state_change cosc1 LEFT ...