conversion

Need help in Timezone in Rails ActiveRecord

Hi, I am faced with a peculiar issue with respect to Timezone in Ruby. I want to convert the following Sat Sep 11 15:15:00 +0530 2010 to Sat Sep 11 15:15:00 -0400 2010 As you can notice, only the time zone has been converted and no other part has changed. How to do this in Ruby. ...

Convert Date Format

User updated in Excel as 01-03-2010 (as in DD-MM-YYYY). How do I covert this into YYYYMMDD in SQL? I have tried using FromDate=Format(Sheet1.Range("A3"),"yyyymmdd") and when I executed the SQL statement, it doesn't show any result. ...

Pull out 2 numbers from a char string?

I'm trying to write a method to set 2 variables to the numbers in a char string. The string would look something like: [-][1][ ][ ][ ][ ][2][.][0][4] Where the numbers -1 and 2.04 could be extracted. I know the method signature could look something like this: sscanf(array[i],"%d%f",&someint,&somedouble) But I'm honestly not sure ho...

Converting to and from datetime adds an hour?

Hi, I am writing a fairly large webapp in asp.net / c# with mssql 2008 r2 serving the database. The program needs to convert date/time strings (in ISO date format) to DateTime where they are used and later stored as smalldatetime in sql. When the strings are converted to datetimes, an hour is mysteriously added to the result. I underst...

C++ to C conversion

Hi, I have a working C++ source code but I need it to be in C. Can anybody tell me what conversions must be made in order to make it work in C. Please help me... TNX. I can email the source code if it would help... ...

convert unix timestamp php

Hi, I have a database that stores the time for me. I insert it from PHP using date( 'Y-m-d H:i:s'); I then use this function to convert it to a unix timestamp in PHP function convert_datetime($str) { list($date, $time) = explode(' ', $str); list($year, $month, $day) = explode('-', $date); list($hour, $minute, $second) = explode('...

prevent copy if pdf document (generated from word)

I'm a converting my Word document into pdf using the built-in microsoft office converter (save as--> pdf). I want my pdf to be protected (users cannot copy text from it). i can't seem to find any options for this when converting to pdf. Any hint? Thanks. ...

Converting a WSDL to IDL

I'm working on a device that uses Java ORB for communicating with SOAP web services. Our SOAP web service is hosted via WCF and exposes its interface via a WSDL. The example I have for the device suggests looking at the WSDL and manually converting it to an IDL which can then be consumed by jidl to generate the required Java stubs. Is...

HTML webpages to Wiki pages translator

I am looking for a HTML to wiki website translator. Basically I want to publish the coverage reports generated by cobertura to my google code website. But google code only suuports wiki pages, so if someone can point me to a HTML website to wiki pages (linked together) translator I can publish my coverage reports. ...

What is the right way to avoid shamap corruption when converting mercurial repositories?

I'm trying to build a pruned Mercurial repository from a larger one and need to pull in changes from several branches. I want to use hg convert, but I am getting errors like abort: unknown revision '81b79760e1350d185dbf645ab67633eda9d52ada'! when try to use convert to get changes from a related branch. Here's what I did. I star...

Help with translating a PHP method to C#

Can anyone help? I have a PHP method that sends an http post: <?php // API URL $api_url = "url_of_the_API "; // Apache auth $api_user = "user"; $api_pass = "pass"; // Request $xml = ""; $context = stream_context_create( array ( 'http' => array( 'method' => 'POST', 'header' => sprintf("Authorization: Basic %s\r\n", base64_encode($api_use...

boost::interprocess::string conversion to char*

Is it possible to convert a boost::interprocess::string to an std::string or to a const char*? Something like c_str()... E.g.: boost::interprocess::string is = "Hello world"; const char* ps = is.c_str(); // something similar printf("%s", ps); I could even get a copy of the string in a non-shared memory block. E.g.: boost::interp...

char and initializer lists

I'd like to pass some numeric byte values via an initializer list a variadic template into an array. Is that possible? template < int N > struct a { char s[N]; template < typename ... A > a (A ... _a) : s {_a...} {} }; int main () { // g++-4.5: error: narrowing conversion of »_a#0« from »int« to »char« inside { } a < 3 > x { ...

Read an Excel field as string even though there are only numbers in this field

I have an Excel spreadsheet with, among onther things, numbers that are identifiers. My odbc reader should return me something like '55201562000016', but too often it returns me something like '5.52016e+008'. I only do the following, but apparently it does not suffice to tell the reader that it should be treated as a string and not an e...

How to display NSTimeInterval binding as NSDate in InterfaceBuilder?

I handle a lot of time stamps that I store as NSTimeInterval. NSDateComponents* comps = [[NSDateComponents alloc] init]; [comps setYear: .... NSDate* date = [gregorian dateFromComponents:comps]; NSTimeInterval timeStamp = [date timeIntervalSinceReferenceDate]; Interface Builder has a table view binding to the variable of the time stam...

HTML2RTF. Easy way to convert HTML to RTF. Is there any?

I found this nice article about Writing Your Own RTF Converter. It converts rtf into html But there is nothing about backward conversion. How can I do that without any third-party components and additional libraries? ...

cos of degrees not matching the cos of equivalent radians

All math functions in JavaScript use radians in place of degrees. Yet they are either unequal, or I am way off base. The conversion from degrees to a radian is: var rad = angle * Math.PI / 180 A 90 degree angle equals 1.57079633 radian The cosine of a 90 degree angle equals 0. The cosine of a 1.57079633 radian equals -3.20510345 × 1...

Conversion between numeric objects in Java

I am looking for a simple, concise way to convert a given Number object to an object of a given numeric type. Loss of precision due to narrowing conversions is fine I prefer not to go through strings. I need something like: private static Number convert(Number num, Class<? extends Number> targetType) Is there a way to do it withou...

Ruby To Python Syntax Confusion

I'm trying to convert someone's Ruby code into my Python code. The originally developer is no longer with us and I don't know Ruby. Most of his code is easy enough to follow, but some of the following syntax is tripping me up. Example: myTable = '' myTable << [ 0, 1, 0, 0, 0, 300].pack('vvvvvv') ...

Can I export from actuate 8 to jasper reports

Is there a way to export from an older version of actuate (actuate 8) to jasper reports which offers much nicer features. The problem is rewriting/redeveloping all the reports would take so much time the cost savings is not there. The format of the reports is in the proprietary binary format. ...