convert

How to determine whether an object can be convert to meaningful string in C#

Hi all, I need to determine whether the ToString() method of an object will return a meaningful string instead of its class name. For example, bool, int, float, Enum, etc. returns meaningful string, instead an instance of ArrayList will return "System.Collections.ArrayList". If there a simple way to archive that? Thanks in advance. Reg...

Convert Seconds Integer To HH:MM, iPhone

Hi there, I am struggling with this. I have a value in seconds that I want to display in a label in HH:MM format. I have searched the internet for ages and found some answers, but either not fully understood them, or they seem like an odd way of doing what I want. If someone could help me out on this one that would be great! Bear in min...

How to convert MySQL field types?

I have already come across the convert funtion. As I understand it, the basic syntax is: select convert(columnName, targetFieldType) as newColumnName from table; Running this command doesn't give me any errors, but when I check the data types they are unchanged. Even when I use commit; the data remains unchanged. In particular, I'm tr...

Condensing Stock Data

I have a data set that is composed as such: 2009,11,01,17,00,23,1.471700,1.472000 2009,11,01,17,01,04,1.471600,1.471900 2009,11,01,17,01,09,1.471900,1.472100 2009,11,01,17,01,12,1.472000,1.472300 2009,11,01,17,01,13,1.471900,1.472200 2009,11,01,17,01,14,1.471600,1.471900 2009,11,01,17,01,18,1.471700,1.472000 2009,11,01,17,01,18,1...

Get video dimension in C#

I'm working on asp.net using C#. My problem is I can use command line program to convert those video but I don't know how to get the dimension of the video to decide the bitrate of video. Plz help me out of this problem. ...

convert currency from xml + php

Hi friends, I have an xml source for daily currency http://www.tcmb.gov.tr/kurlar/today.xml and i need to make a currency optional search for a portal. how can I get a specific data and convert from xml source? :/ i have a search form with: price input currency list box (euro, dollar) and I need to convert the value from form for...

How to convert NSInteger to int

hi, e.g. NSInteger called a [a value] is a EXC_BAD_ACCESS how to convert NSInteger to int ? (only small numbers < 32 are used) ...

How do I convert a MySQL function result to tinyint(1)

Here's the problem. In MySQL's Connector/NET a TINYINT(1) field properly translates back and forth into a .NET bool value. If I select from a table with a TINYINT(1) column, everything is golden. However, when you use built-in MySQL v5.0 functions like: SELECT (3 BETWEEN 2 AND 4) AS oddly_not_boolean; The actual return type from the d...

Converting from prototype to jQuery - javascript / ajax

I'm looking for some help converting this from prototype to jQuery. I'm doing some free work for a charity and updating a system they use to track and assign volunteers. I've managed to convert everything else so far, however, this has me stumped. Please excuse the spelling mistakes, the code is verbatim what I've been given. I've had ...

How to calculate difference in hours (decimal) between two dates in SQL Server?

I have to calculate the difference in hours (decimal type) between two dates in SQL Server 2008. I couldn't find any useful technique to convert datetime to decimal with 'CONVERT' on MSDN. Can anybody help me with that? UPDATE: To be clear, I need the fractional part as well (thus decimal type). So from 9:00 to 10:30 it should return m...

Tutorial for converting PHP applications to Cocoa?

I do a lot of coding in PHP and MySQL, but I'm looking at moving my applications to a desktop environment in order to allow users to access the data offline, and periodically receive updates from a central online database. For the time being, however, I'm looking for a decent tutorial on how to convert PHP applications to Cocoa, and how...

Python2.x to 3.x conversion

Is there any tool available to automatically convert Python 2.x scripts to Python 3.x? Or do you still have to convert it manually? 2.x-3.x auto-converter would be really helpful (to everyone else too, I guess). Ofcourse I'm not looking to convert large programs, just about 8-10 modules. Thanks ...

I need to convert a returned number in a report with text?

I have a value in a report that is returned as a number for example 1 - What i am trying to do is whenever 1 is displayed in the report i want it to show text such as Program Live. I am using crystal 9, any help would be appreciated. ...

What is the fool proof way to convert some string (utf-8 or else) to a simple ASCII string in python

Inside my python scrip, I get some string back from a function which I didn't write. The encoding of it varies. I need to convert it to ascii format. Is there some fool-proof way of doing this? I don't mind replacing the non-ascii chars with blanks or something else... ...

PHP Print_r to AS3 Array conversion

I find myself frequently outputting PHP Array data into AS3 applications and I'm always having to do it the hard way - comma delimated, base-64 converted data with custom packers/unpackers on either end. I'd really like an AS3 function that takes the default output of PHP's print_r and converts it to a (potentially nested) AS3 array. Is...

php convert date to datetime

hi, i need to convert a date in this format: November 28, 2009 to a mysql date format: 2009-28-11 what's the best method to convert the date using php?> thanks. ...

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...

Properly Converting NSString to CGFloat, NSInteger, etc.

I have a question about safely or properly converting an NSString into types such as CGFloat and NSInteger, considering that these are simply wrapper types that Apple created to use different primitives depending on certain factors (e.g., NSInteger is typedef'd to int on 32-bit architectures and long on 64-bit architectures). For exampl...

Library or code to convert digit in letters

Could you suggest me a code or a library (possibly java) to convert digits (e.g. 24) in letters (e.g. twenty-four)? Obviously I need to change locale (from English to Italian). Thank you in advance and sorry for my English... Fabio ...

Convert TIFF to PostScript

I'm writing .net code (Windows Forms Application) which reads a TIFF image (CMYK) and sends it to printer (using WritePrinter). Before I send it, I need to convert the TIFF image to PostScript. Could any of you share the code how to create PostScript out of TIFF image? I appreciate it! ...