convert

Convert a Mercurial Repository to Git

Hi, I've already tried hg2git through fast-export and I've already tried hg-git. Both with no success. hg2git actually worked, but I had to ask a friend who runs a Unix machine to do it. And that messed up all the linefeeds throughout the files. hg-git simply failed with some libzip compression error. Has anyone had any success conv...

WDSaveFormat value for .odt

Hello. I am trying to convert .doc files into multiple office types (docx,txt,pdf,odt) from doc. Based on a previous post #35639, I found a sample in the microsoft script library: With that information and this link to MSDN I found the values for office formats, but my question, is there a value for .odt using the WDSaveFormat value?...

Haskell converting Float to Int

I'm still new and trying to create a list for use in a function and want to keep it as small as possible which happens to be logBase x y. but I'm having trouble getting logBase into something I can use in this list. [1 .. (logBase x y)] Any suggestions? ...

Test if Convert.ChangeType will work between two types

This is a follow-up to this question about converting values with reflection. Converting an object of a certain type to another type can be done like this: object convertedValue = Convert.ChangeType(value, targetType); Given two Type instances (say FromType and ToType), is there a way to test whether the conversion will succeed? E.g...

Python: convert free text to date

Hi, Assuming the text is typed at the same time in the same (Israeli) timezone, The following free text lines are equivalent: Wed Sep 9 16:26:57 IDT 2009 2009-09-09 16:26:57 16:26:57 September 9th, 16:26:57 Is there a python module that would convert all these text-dates to an (identical) datetime.datetime instance? I would like to...

PHP GD2, Convert resource image to 24-bit BMP

Hi. I need to convert resource image to 24-bit BMP image with GD2. This code creates 32-bit BMP image, but I need 24-bit. Help please. function imagebmp(&$im) { if (!$im) return null; $w = imagesx($im); $h = imagesy($im); $result = ''; if (!imageistruecolor($im)) { $tmp = imagecreatetruecolor($w, $h);...

C# to Java: Base64String, MemoryStream, GZipStream

I have a Base64 string that's been gzipped in .NET and I would like to convert it back into a string in Java. I'm looking for some Java equivalents to the C# syntax, particularly: Convert.FromBase64String MemoryStream GZipStream Here's the method I'd like to convert: public static string Decompress(string zipText) { byte[] gzipB...

How to convert number to natural language string?

Is there any existing builtin (or third party) Java class or library that can convert numbers to natural language strings; e.g. 1 -> "one", 2 -> "two", 1256 -> "a one thousand two hundred and fifty-six", etc.? ...

Method to convert from Hex to Integer in C, can't get lowercase!

Hey everyone, just a quick thing, I have the hex to integer working, but I need to get the numbers lowercase. Here's what I have, any ideas to get to get the A thru F case insensitive? int htoi(char f[]) { int z, n; n = 0; for (z = 0; f[z] >= '0' && f[z] <= 'F'; ++z) if (f[z] >= 'A' && f[z] <= 'F') n ...

pythonic way to convert variable to list

I have a function whose input argument can either be an element or a list of elements. If this argument is a single element then I put it in a list so I can iterate over the input in a consistent manner. Currently I have this: def my_func(input): if not isinstance(input, list): input = [input] for e in input: ... I a...

Java: Remove double from string and store in array

Hi folks, I have a string that will be different each time but follow the form of -3.33,-46.53,37.39,26.55,97.11,68.46,-32.46,-5.89,-62.89,-7.9, and i want to remove each number and store as an double in an array. even pseudocode would be great i'm drawing a blank. Cheers ...

Java: Parsing a string to a double

Hi folks, I'm reading a file into an array and trying to take out the numbers and put them as a double in an array of their own. And apparently my middle name must be "Error". From what I can tell the code is ok....at least theres nothing jumping out at me. Here it is in all it's glory. import java.io.BufferedInputStream; import java.io...

C# Hashset conversion to Lists

I have looked this up on the net but I am asking this to make sure I haven't missed out on something. Is there a built-in function to convert HashSets to Lists in C#? I need to avoid duplicity of elements but I need to return a List. ...

NHibernate: Convert Guid to string in query

Using NHibernate with Linq or Criterion, is it possible to do a LIKE query on a GUID column? In T-SQL this is easy: *select * from mytable where id like '0ae%'* NHibernate won't convert the Guid to a string though. ...

how to convert byte[] to an ArrayList of Hashtables ?

Could someone please give me an example on how can I convert a byte[] to an ArrayList of Hashtables with C# ? (the byte[] represents the ArrayList of Hashtables that was previously serialized) Note: I'm running under Windows Mobile, which does not provide BinaryFormatter. ...

convert bytes to GB in php

Hi there, I want to convert bytes to GB. value= 8587321344 So it should be 8587321344/1024/1024/1024 But whenever I go to divide, the value is wrong... If I cast it into integer, it will be limited to 2147.... Can't find any type cast to long data type... Funny enough... How to perform this calculation to show correct output... Th...

T-SQL: Convert datatime2 to datetime for all columns of type datetime2

I've got a database full of datetime2 columns than needs to be moved to a SQL 2005 database. So, I need to convert all these datetime2(7) columns to datetime. How can I go about doing this? Right now I've managed to select the table name and column name for all columns with the datetime2 datatype like this: SELECT t.name, c.name, i.DA...

How do I convert an HttpRequestBase into an HttpRequest object?

Hi folks, inside my ASP.NET MVC controller, I've got a method that requires an HttpRequest object. All I have access to is an HttpRequestBase object. Is there anyway I can somehow convert this? What can/should I do?? ...

Archiving from mySQL to Sybase using Powercenter, problem converting varchar to bit

I have to different databases one is mySQL and the other is Sybase IQ. Both have the same table layout and datatypes. One of the fields has a bit datatype. Unfortunately when I pull the mySQL table into Powercenter it makes it converts it to a string(1). Now when I am trying to write the data from Powercenter to the Sybase IQ table u...

Convert a hex string to a byte in Java

Let's say I have the string "1e". In Java, how can I convert it to the byte 0x1e? ...