conversion

WPF Pixels to desktop pixels

I've been linked in the past to this response to a similar question on converting WPF pixel coordinates to desktop ones, however I'm not sure I understand the maths involved. Astonish' answer states that "Pixels per WPF Unit = ConstantWPFUnit size * monitor DPI;" and that "The constant WPF unit size is 1/96." In my case, I've taken the...

quick linux question

I'm trying to do the following: $OOOPYTHON DocumentConverter.py .odt .pdf for all of the ODT files i have in a particular document and looking for the right syntax to convert all odts to pdfs. Thanks! Jake ...

Converting a 16 bit luminance value to 32 bit RGB

I have a 16 bit luminance value stored in two bytes, and i want to convert that to R, G, and B values. I have two questions: how do i convert those two bytes to a short, and assuming that the hue and saturation is 0, how do i turn that short into 8 bits per component RGB values? (apologies if this sounds like a dumb question, i just can...

Classic ASP App CINT failure - twitpocalypse v2

Due to a qty value exceeding what a VBScript INT can store, I'm getting a pretty nasty error message (actually the users are)... This is totally a case of twitpocalypse. Since CINT() will not work in this situation, what is the best workaround? requestqty = 40200 CInt() max = 32767 CInt(requestqty) EDIT CLng() seems to do the ...

Convert a single hex character to its byte value in C#

This will convert 1 hex character to its integer value, but needs to construct a (sub) string. Convert.ToInt32(serializedString.Substring(0,1), 16); Does .NET have a built-in way to convert a single hex character to its byte (or int, doesn't matter) value that doesn't involve creating a new string? ...

General way to manipulate the times (between timezones) in C ?

After writing a sample code for the question about converting between timezones, one of the comments to it was the need for more general method for converting from timezone A to timezone B. I was curious myself too to have a more high-level primitives for such a manipulations, so I wrote the below code. One drawback I see is that it con...

cvs2svn conversion ?

Hi I converted my CVS repository into SVN repository. It worked great, but one problem had occured.... I converted using a dumpfile, and the command was: cvs2svn –encoding=( ) –sort=(PATH TO sort.exe) --default-eol=native –dumpfile=PATH\name.svn_dump –svnadmin=(PATH TO SVN ADMIN) (PATH TO REP) loading the dump file: svnadmin l...

Error when converting XML from a CLOB column to XMLType colum

I'm trying to convert some xml data coming from a CLOB to a XMLType column. The XML have some accentuated characters as values (documents are written in french). Here is what the instruction looks like : insert into mytable (id, xmldata) values (p_id, xmltype(p_xmldata)); p_id and p_xmldata are variables previously extracted from th...

Construct PHP strings to time from XML

I'm trying to convert the following XML into a Time: <time hour="18" minute="05" timezone="Eastern" utc-hour="-4" utc-minute="00" /> I'm parsing the XML using SimpleXML, and storing that in a class. I also tried printing out the following: print strtotime($x->time->attributes()->hour . ":" . $x->time->attributes()->minute) . "<br>\...

Curvilinear perspective: Convert 3D to 2D

Hi all, I'm looking for the mathematical expression converting a 3D coordinate (x0,y0,z0) to a 2D (x1,y1) coordinate in a curvilinear perspective of radius R where the values of x1 and y1 are the angles of views {-90° .. +90°} of the original point. (image via http://www.ntua.gr/arch/geometry/mbk/histor.htm ) Thanks ! ...

Import SocialText wiki into MediaWiki

Does anyone have any experience converting a SocialText wiki into a MediaWiki? Is there any utility or script to perform the conversion? ...

How do I TryParse in SQL 2000?

I have a stored procedure in an old SQL 2000 database that takes a comment column that is formatted as a varchar and exports it out as a money object. At the time this table structure was setup, it was assumed this would be the only data going into this field. The current procedure functions simply this this: SELECT CAST(dbo.member_cate...

How to render the following asp.net mvc c# code snippet as vb.net code

Hello, Working through Pro ASP.NET MVC book and I got the following code snippet that appears in an aspx (view) page... <%= Html.DropDownList ("WillAttend",new[] { new SelectListItem { Text = "Yes, I'll be there",Value=bool.TrueString}, new SelectListItem { Text = "No, I can't come",Value=bool.FalseString} },"Choose an option"); %> ...

How to programmatically generate an EMF model (.ecore, .genmodel) from XSD schema?

I have been trying to do this as the last stage in a standalone application to convert from the file format used by a modeling program to an EMF model. I am able to convert the original format to XSD, which I can manually convert to an EMF model using the Eclipse importer, but I do not know how to do this programmatically to automate the...

Fastest base conversion method?

Right now I'm working on a project which requires an integer to be converted to a base 62 string many times a second. The faster this conversion is completed, the better. The problem is that I'm having a hard time getting my own base conversion methods to be fast and reliable. If I use strings, it's generally reliable and works well, bu...

Cannot convert object, recieved from ajax call, into a long

I'm using Asp.Net-Mvc, I have this method in my controller: [AcceptVerbs(HttpVerbs.Post)] public ActionResult LinkAccount(string site, object id) { return this.Json(id); } Here's the ajax method that calls it: $.post("/Account/LinkAccount", { site: "Facebook", id: FB.Faceboo...

Methods to migrate SQL Database(mdf) to SQL Compact Edition(sdf)

I have 4 SQL Server 2005 db's that I want to move to SQL CE. I know I cannot keep the SProcs,Views, and Functions(Differences Between SQL Server Compact and SQL Server) but I would like to keep everything else. I have tried this app, SQL Server to SQL Server Compact Edition Database Copy but it errors out on me. I have the source and ...

Python library for converting files to MP3 and setting their quality

Hello, I'm trying to find a Python library that would take an audio file (e.g. .ogg, .wav) and convert it into mp3 for playback on a webpage. Also, any thoughts on setting its quality for playback would be great. Thank you. ...

How to convert int to currency?

Hello, I'm working with Delphi 2009,I binged my question,but the answers I've gotten are outdated since It doesn't recognise StrtoFloat in Delphi2009. I'm asking how to convert an integer ,for example, '1900000' to '1,900,000'? ...

To convert RGB 12 bit data to RGB 12 bit packed data

Hello, I have some RGB(image) data which is 12 bit. Each R,G,B has 12 bits, total 36 bits. Now i need to club this 12 bit RGB data into a packed data format. I have tried to mention the packing as below:- At present I have input data as - B0 - 12 bits G0 - 12 bits R0 - 12 bits B1 - 12 bits G1 - 12 bits R1 - 12 bits .. so on. I ...