conversion

A tidy solution for using static JSON data

I'm developing a simple JavaScript (jQuery) slide show. I wanted to use JSON to store some some static parameters about the content of each slide. Since I like to keep my data separate from my code, is there anyway to have JavaScript evaluate a .json file? AJAX seems a bit overkill - it just needs to evaluate it at run-time, nothing ...

Convert HTML to Textile in Ruby?

Is there a ruby library like RedCloth that converts HTML to Textile? ...

What strategy should be used for converting real world measurements to WPF units?

We have an application that will be reading real world dimensions from the DB in milimetres, these values will then be presented to the user in WPF. Currently I'm using the following strategy when reading objects from the data store by multiplying MilimetresPrWpfUnit in the following example. public const double MilimetresPerInch = 25.4...

How Decimal places are converted using FLOAT in SQL Server 2000/2005/2008

Hi, in this SO question the OP wanted to drop the 0's in the decimal places for his results. Now the example I gave (below) to get around this was to CAST with DECIMAL, then CAST with FLOAT. e.g. SELECT CAST(0.55 AS FLOAT) Using the example above and running it in SQL Server 2005/2008 would seem to bring up the correct result of 0.5...

In SQL Server change column of type int to type text

I would like to change a column in SQL Server from type int, to type text, while maintaining the column name. The table with this column has lots of data, and I do not want to lose it. SQL Server doesn't seem to support implicit or explicit casts from int to text, otherwise this would be pretty simple. So, how would you do it using on...

Converting a string formatted YYYYMMDDHHMMSS into a JavaScript Date object.

Hello, I have a string with a date in it formatted like so: YYYYMMDDHHMMSS. I was wondering how I would convert it into a JavaScript Date object with JavaScript. Thanks in advance! ...

Using PHP to Convert ASCII Character to Decimal Equivalent

Can someone suggest a (preferably) graceful way to convert an ASCII character to its decimal equivalent using PHP? ...

How To Remove Characters?

I'm start(really starting) an Assembly tool, at the time it only converts a decimal to a hexadecimal, but I want to remove the zeros from the result. Here is the code: // HexConvert.cpp #include <iostream> using namespace std; int main() { int decNumber; while (true) { cout << "Enter the decimal number: "; cin...

Convert unsigned char * to int * in Objective-C

I am trying to convert a unsigned char* to int * on in Objective-C on the iPhone. Is there any API that can help with the conversion? Here's my best attempt: -(BOOL)MyFunc:Version:(int *)nVer { unsigned char * uszVerSize; //trying to assign string to int nVer = uszVerSize[0] ; } ...

Convert a video to MP4 (H.264/AAC) with ffmpeg

Hi everybody, If I don't make a mistake, Safari currently need MP4 (H.264/AAC) video encoded for the HTML5 <video> element. So I tried to convert a video to this format with ffmpeg. However when I enter the shell command ffmpeg -i video.flv video.mp4, the returned error is : Seems stream 0 codec frame rate differs from container ...

What is the easiest way to convert a char array to a WCHAR array?

In my code, I receive a const char array like the following: const char * myString = someFunction(); Now I want to postprocess it as a wchar array since the functions I use afterwards don't handle narrow strings. What is the easiest way to accomplish this goal? Eventually MultiByteToWideChar? (However, since it is a narrow string w...

Running hg convert on Linux

I would like to convert a remote Perforce repository into a Mercurial repository on Linux. So I have installed Python and Mercurial on a Linux box. Then I test few hg (Mercurial's drive program) commands. All are working fine. Now without creating any hg repository on the Linux box I want to run hg convert on Linux, so that a Mercurial...

Converting Generic Dictionnary<> to ICollection<> problem

Here is an exemple of the situation: public class ScheduleArea : IArea<Schedule> { //.... private Dictionary<int, ScheduleArea> subArea; //.... #region IArea<Schedule> Members public ICollection<KeyValuePair<int, IArea<Schedule>>> SubArea { get { return (Collection<KeyValuePair<int, IArea<Schedule>>>)this.subArea;//Error...

time convert in javascript

How does one convert the following to seconds in JavaScript? mm:ss.sss ? What is the .sss? ...

How to determine UTC offset from server timezone?

I've found many examples about UTC tables and php date methods to convert it, but I still miss a simple way after got server date, to converting it into an user timezone selection on my web page. On this page http://vkham.com/UTC.html I've found a clear guide to understand the range, but I don't know how to connect for example "Europe/R...

Java:Convert long to String?

Hello friends, I am absolutely new to Java and Blackberry development. I've started learning Java and Blackberry development. I just created sample BB app, which can allow to choose the date. DateField curDateFld = new DateField("Choose Date: ", System.currentTimeMillis(), DateField.DATE | DateField.FIELD_LEFT); After choosing the ...

C#- How to handle string terminator in the conversion

I have a binary array. In the process of conversion it into string,due to some data my string gets terminated. and it ignores next data.Have a look on my code. Is there is any mistake?? str += (char)chunkData[index].ToString(); Later on i want to display it on textbox. My array contains following data as display in hex editor. xÚb``...

C# TypeConverters and IsValid

I am trying to use System.ComponentModel.TypeConverter to cast a bunch of System.Strings to different types. These Strings may or may not be in a valid format for the TypeConverter, so I'd like to find a way to check their validity before attempting the type conversion (to avoid having to rely on catching a System.FormatException to indi...

SWF reading/rendering (outside of Flash Player)?

I would like to use SWF files as source video data within a tool chain I am developing. The problem is, I can't seem to find a consistent way to convert them, and I'm concerned about the loss of quality that the conversion will introduce. I actually even have Flash CS3, but the export process to anything other than swf is flaky at best....

How to convert Javascript to C#

I have got some javascript code and I'd like to convert this to C#. I have no idea of the best way to structure this or if there is an easy way to convert the code. A sample of this code is shown below. // ellipse parameters var e = { WGS84: { a: 6378137, b: 6356752.3142, f: 1/298.257223563 }, Airy1830: { a: 6377563.39...