conversion

testing a string to see if a number is present and asigning that value to a variable while skipping all the non-numeric values?

Hi there, given a string say " a 19 b c d 20", how do I test to see if at that particular position on the string there is a number? (not just the character '1' but the whole number '19' and '20'). char s[80]; strcpy(s,"a 19 b c d 20"); int i=0; int num=0; int digit=0; for (i =0;i<strlen(s);i++){ if ((s[i] <= '9') && (s[i] >= '0')){...

Can we convert all SQL scripts to Linq-to-SQL expressions or there is any limitation?

I want to convert all of my db stored procedures to linq to sql expressions, is there any limitation for this work? you must notice that there is some complicated queries in my db. ...

Converting to Base 10

Question Let's say I have a string or array which represents a number in base N, N>1, where N is a power of 2. Assume the number being represented is larger than the system can handle as an actual number (an int or a double etc). How can I convert that to a decimal string? I'm open to a solution for any base N which satisfies the abov...

Convert RGB value to HSV

I've found a method on the Internet to convert RGB values to HSV values. Unfortunately, when the values are R=G=B, I'm getting a NaN, because of the 0/0 operation. Do you know if there is an implemented method for this conversion in Java, or what do I have to do when I get the 0/0 division to get the right value of the HSV? Here comes ...

Quick question regarding this issue, Why doesnt it print out the second value(converted second value) on the string?

Quick question, What have I done wrong here. The purpose of this code is to get the input into a string, the input being "12 34", with a space in between the "12" and "32" and to convert and print the two separate numbers from an integer variable known as number. Why doesn't the second call to the function copyTemp, not produce the value...

Conversion from string to wstring is causing ú to lose encoding

The variable filepath which is a string contains the value Música. I have the following code: wstring fp(filepath.length(), L' '); copy(filepath.begin(), filepath.end(), fp.begin()); fp then contains the value M?sica. How do I convert filepath to fp without losing the encoding for the ú character? ...

Is there any open source software for converting SQL statements to LINQ?

Is there any open source software for converting SQL statements to LINQ? ...

jquery function to convert datetime, split date time "2010-10-18 10:06" to return "18/10/2010" and "10:06"

Hi I was wondering if there is any jquery function around which can take this dateTime "2010-10-18 10:06" and convert and split it returning "2010/10/18" and "10:06". It would be also nice if the same function could either receive "2010-10-18 10:06" or "2010-10-18" only and return as mentioned above, or different formats besides "2010/1...

Checking range with command line arguments

Working on a simple C program I'm stuck with an if test: int line_number = 0; if ((line_number >= argv[2]) && (line_number <= argv[4])) gcc says: cp.c:25: warning: comparison between pointer and integer cp.c:25: warning: comparison between pointer and integer What can I do to properly check the range of lines I want to deal with?...

Anim8or to Cinema 4D

Is it possible to convert Anim8or to Cinema 4D? Thanks in advance! ...

Jquery DateJs, is there validation for full date?

Hi all, I just find out about the power of date js, And its great!!! As I am a newbie I was wondering if there is any kind of general validitation for different types of full dates. eg. var d1 = Date.parse('2000-10-18, 10:06 AM'); alert(d1.toString('HH:mm')); If date is ('200-10-18, 10:06 AM'), of course it doesn't like it. So my q...

Problem to convert string binary (64 bits) to decimal (c++ in iphone)

Hi I have a problem converting a string binary to a decimal I was using bitset bitstring ="1011010001111111"; unsigned long binToDec( string bitstring){ bitset<32> dec (bitstring); return dec.to_ulong(); } All of this works fine, but !! the problem comes when i try to do the same with a bits string with more of 32 bits. I kn...

how to convert a timedelta object into a datetime object

What is the proper way to convert a timedelta object into a datetime object? I immediately think of something like datetime(0)+deltaObj but that's not very nice... isn't there a toDateTime() function or something of the sort? ...

How to programatically convert a time from one timezone to another in C?

The info pages for the GNU date command contains this example: For example, with the GNU date command you can answer the question "What time is it in New York when a Paris clock shows 6:30am on October 31, 2004?" by using a date beginning with `TZ="Europe/Paris"' as shown in the following shell transcript: $ export TZ="...

How can I convert a php timestamp to the same format as new Date() in javaScript?

I have a time stamp I created with PHP that I would like to convert to the same format as new Date() in javaScript. Here's my code: $current_timestamp = time(); //This returns a value such as 1268214657 I need to create a string using that timestamp that looks like this: Fri Mar 12 2010 01:50:33 GMT-0800 (Pacific Standard Time). ...

SQL Server binary(128) convert from little endian to big endian

how to convert a binary(128) from little endian to big endian in SQL Server? ...

how to convert lambda expression to object directly?

I have to do through Action like this: Action action = () => { ..// }; object o = action; any way to do this: object o = () =>{}; //this doesn't compile ...

How to prevent CAST errors on SSIS ?

Hello, The question Is it possible to ask SSIS to cast a value and return NULL in case the cast is not allowed instead of throwing an error ? My environment I'm using Visual Studio 2005 and Sql Server 2005 on Windows Server 2003. The general context Just in case you're curious, here is my use case. I have to store data coming from ...

oracle sql converter CharacterConverter12Byte problem in jdbc

I was working on a simple GUI script yesterday using jdbc in eclipse. When I went to run the program, I got a pop up screen asking me about character conversion in jdbc. I had no idea what this was and neither did my professor (no surprise there). Now every time I run a program, even one that doesn't use SQL I get the same error. 0 - ...

Converting Milliseconds to Timecode

I have an audio project I'm working on using BASS from Un4seen. This library uses BYTES mainly but I have a conversion in place that let's me show the current position of the song in Milliseconds. Knowing that MS = Samples * 1000 / SampleRate and that Samples = Bytes * 8 / Bits / Channels So here's my main issue and it's fairly simple....