conversion

How to transform latitude and longitude?

How to calculate from these numbers: 51.501690392607,-0.1263427734375 to latitude and longitude? It should be London, England 51° 32' N 0° 5' W ...

What is the process of turning HTML into Postscript programmatically

I am trying to understand what the process is of turning HTML into a PDF/Postscript programmatically All Google searches turn up libraries to do this, but I am more interested in the actual process required. I know you could just set up a Postscript printer and print directly to that, but some of these libraries appear to create the ...

Convert webpage to image from ASP.NET

I would like to create a function in C# that takes a specific webpage and coverts it to a JPG image from within ASP.NET. I don't want to do this via a third party or thumbnail service as I need the full image. I assume I would need to somehow leverage the webbrowser control from within ASP.NET but I just can't see where to get started....

Improving method to read signed 8-bit integers from hexadecimal.

Scenario: I have a string of hexadecimal characters which encode 8-bit signed integers. Each two characters represent a byte which employ the leftmost (MSB) bit as the sign (rather than two's complement). I am converting these to signed ints within a loop and wondered if there's a better way to do it. There are too many conversions and ...

Convert an XML Schema date string to a Javascript Date

I couldn't find a good implementation of this on the internet, so I wrote one. Here's hoping this page becomes the first hit in Google. Enjoy! /** * Return a Javascript Date for the given XML Schema date string. Return * null if the date cannot be parsed. * * Does not know how to parse BC dates or AD dates < 100. * * Valid exam...

What is the rationale to not allow overloading of C++ conversions operator with non-member functions

C++0x has added explicit conversion operators, but they must always be defined as members of the Source class. The same applies to the assignment operator, it must be defined on the Target class. When the Source and Target classes of the needed conversion are independent of each other, neither the Source can define a conversion operator...

How to change handedness of coordinates?

How to convert from Euler's coordinates E1 = (x1, y1, z1, yaw1, pitch1, roll1) to E2 = (x2, y2, z2, yaw2, pitch2, roll2) where x, y, z are the coordinates of a point and yaw, pitch, roll the direction/orientation of a vector which origin is the point. yaw is around y, pitch around x, roll around z. They are performed in that ord...

Convert a ResultSet String Into a Workable Variable to Populate a jTable

I'm building a application that needs to convert a ResultSet String(rs.getString(Names);) into a workable variable to populate a jTable, only one collumn, then the rest I think that I could try by doing a loop. How could I do this? ...

How to pass a const unsigned char * from c++ to c#

So I have a function in unmanaged c++ that gets called when some text happens to have "arrived": #using <MyParser.dll> ... void dump_body(const unsigned char *Body, int BodyLen) { // Need to pass the body to DumpBody, but as what type? ... MyParser::Parser::DumpBody(???); } DumpBody is a static function defined in a C# DLL t...

Characters to Bytes

What's a good estimate/conversion/formula to figure out X# characters = Y# bytes? ...

Query multiple currencies

I need store multiple currencies on my database... Here's the problem: Example Tables: [ Products ] id (INT, PK) name (VARCHAR) price (DECIMAL) currency (INT, FK) [ Currencies ] id (INT, PK) name (VARCHAR) conversion (DECIMAL) # To U$ I'll store the product price with the currency selected by the user... Later I need to search the ...

Convert an ArrayList to an object array

Hello, Is there a command in java for conversion of an ArrayList into a object array. I know how to do this copying each object from the arrayList into the object array, but I was wondering if would it be done automatically. I want something like this: ArrayList<TypeA> a; // Let's imagine "a" was filled with TypeA objects TypeA[] ar...

covert wide character strings to narrow

I have an C++ Windows Mobile 6 application that is converting a wide-character array to a narrow-character array. I have no problems going from narrow to wide, but when I go from wide to narrow, the conversion fails as in the example below: const char* testA = "This is a test"; std::wstringstream testW; testW << testA; NKDbgPrintfW( L"t...

Convert Unix Epoch Time to Seconds in SQL or .NET

First let me thank you all for your help. What I need is a function that takes in a EPOCH time stamp, like 1452.235687 and converts it to a readable timestamp like '01-01-1970 00:00:00'. More specifically I only need the time not the date. If at all possible I would prefer a .NET function instead of a SQL stored procedure. However an S...

casting odd smallint time to to datetime format.

Hello everyone, I'm working with a db (SQL server 2008), and have an interesting issue with times stored in the db. The DBA who originally set it up was crafty and stored scheduled times as smallints in 12-hour form-- 6:00AM would be represented as 600. I've figured out how to split them into hours and minutes like thus: select floor(t...

mysql replace accented characters

Hi, i would like to generate strict alphanumeric character logins from users' first and lastname. Since many of them are foreigners, their names have special characters (é, è, ï, ...). I would like to remove the accents (e,e,i,...) in the logins. Here is my query. Is there a character set that does not contain accents? UPDATE contacts...

Destroy and Show have same url in RoR, is it good?

Hi! Is it good when url to show and destroy are same? How it can be changed in RoR if i want continue use standard tools like script/generate scaffold ? Thanks. ...

Neural Networks test cases

Does increasing the number of test cases training data in case of Precision Neural Networks may led to problems (like over-fitting for example)..? Does it always good to increase test cases training data number? Will that always lead to conversion ? If no, what are these cases.. an example would be better.. Thanks, ...

Conversion of DOM element selection code to jQuery

I have a large Javascript codebase to convert to jQuery. The code is structured such that DOM elements are created in Javascript (using a library called DomBuilder), and saved to variables if they will be needed later, before being added to the DOM. Eg. var inputs = { submitConfirm: INPUT({type: 'button', value: 'Submit'}), su...

Conversion of byte[] into a String and then back to a byte[]

I am working on a proxy server. I am getting data in byte[] which I convert into a String to perform certain operations. Now when i convert this new String back into a byte[] it causes unknown problems. So mainly its like I need to know how to correctly convert abyte[] into a String and then back into a byte[] again. I tried to just co...