conversion

Variable containing a path as a string to multi-dimensional array?

I'm looking to take a string such as /var/www/vhosts and turn it into a multi-dimensional, nested array such as: array( 'var'=>array( 'www'=>array( 'vhosts'=>array() ), ), ); Anyone got any pointers? I've had a look through Google and the search here, but I've not seen anything. Thank...

Convert a 4 char string into int32

Is there a fast way to convert 4 chars into a 32bit int? I know i can loop through it like : string key = "ABCD"; int val = 0; for (int i = 0; i < 4; i++) { int b = (int)key[i] * (int)Math.Pow(256, i); val += b; } // val = 1145258561 I would like something lower level, I know the chars are stored as bytes. I don't mind if it...

how to convert (jpg+mp3) into mp4 or mp4 into (jpg+mp3) in xcode programming

hi everyone, Is is possible to convert (jpg+mp3) into mp4 or mp4 into (jpg+mp3) in xcode programming? The file type is not necessary to be jpg or mp3, it could be any possible photo file type like jpg, png or bmp, and could be any possible audio file type like wav, caf or mp3. Coud anyone give me a sample code or the reference documents...

Fastest possibility of listing a directory and getting the URLs of every file in Java

Hi guys, i am planning to perform a standard list command to get a vector or a list of the content of a directory. I know this is easy by using File f = new File("C:/testDir"); File[] files = f.listFiles(); The problem is that I need a list/array/vector of URLs. So my thoughts were to convert the files to URL. With the org.apache.co...

Converting Actionscript syntax to Objective C

I have a game I wrote in Actionscript 3 I'm looking to port to iOS. The game has about 9k LOC spread across 150 classes, most of the classes are for data models, state handling and level generation all of which should be easy to port. However, the thought of rejiggering the syntax by hand across all these files is none too appealing. A...

ESRI's shapefile to Matlab

I am looking for a function to read/write points, lines and polygons from ESRI's shapefile format (as used in Arcview) for use in Matlab ...

How does one convert a .NET tick to a python datetime?

I have a file with dates and times listed as huge numbers like 634213557000000000. I believe this is a .NET tick. That's the number of 100 nanosecond increments since midnight on January 1, 1 A.D. What's a good way to read that into a python datetime object? ...

How can I convert an Excel table into Trac Wiki Table format?

I've seen copy & paste converters to MediaWiki or HTML format. But I could not find one that converts to the Trac Wiki format (WikiFormattting) which uses pipes to separate cells, such as: ||Cell 1||Cell 2||Cell 3|| ||Cell 4||Cell 5||Cell 6|| ...

Convert XSL working draft to current version

Hi, I'm converting an old website which uses clientside XSLT based on an old working draft: <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"&gt; It looks like IE is the only browser who can manage to transform the HTML client side. When transforming is done serverside with .net code, it will throw an error: System.Xml.Xsl.X...

Converting MIDI byte array to MP3 byte array

Converting MIDI byte array to MP3 byte array Does someone know how to convert a MIDI file (average playback time of 30 seconds) which is represented in a byte array to an MP3 byte array. So ideally i need to have a C# function which accepts a MIDI byte array and returns a MP3 byte array. The conversion should not take more than 2 - ...

Questions regarding object type conversion in Java

Hi, I have a question regarding type conversion in Java as follows: suppose I have a class: class A { public void m() } Now I do: A a1 = new A(); // (1) a1.m(); // (2) Object o = new A(); // (3) o.m(); // (4) We can say line (1) as: a1 contains the memory address of the new object A() (created in ...

converting Java code to Android

Hi I Have a Java application and I need to convert it to an Android application is there any resources to show how ? in Android developer site I didnt found anything like that! I need to use the Java methods and classes in android ,How it can be done? ...

How to Convert Long to Guid and Vice Versa?

Is this even possible? I don't even think it is, but I saw some code that was trying to do it. However, my unit tests showed that it was not working. I did see some similar thoughts: http://stackoverflow.com/questions/401480/converting-guid-to-integer-and-back http://stackoverflow.com/questions/3563830/converting-system-decimal-to-s...

Convert time and date from one time zone to another in PHP

Basically what I need is an script that, when provided with a time and a timezone can return the time in another time zone. My main issues are: Where to get the time offset from GMT from - is there a public database available for this? How to also take into consideration the daylight saving time (DST) differences as well. How to nice...

How to Convert a 12-bit Image to 8-bit in C/C++?

All right, so I have been very frustrated trying to convert a 12-bit buffer to an 8-bit one. The image source is a 12-bit GrayScale (decompressed from JPEG2000) whose color range goes from 0-4095. Now I have to reduce that to 0-255. Common sense tells me that I should simply divide each pixel value like this. But when I try this, the ima...

Silverlight 4 WriteableBitmap to Bitmap

This is my first Silverlight app and my first go at C#. I have a C# class library that I access from Silverlight using COM. The C# library has a method that takes a Bitmap as an argument, however from what I can see Silverlight only has a WritableBitmap. Is there a way to convert a WritableBitmap to a Bitmap in Silverlight? Some other...

yaml2xml/xml2yaml implementation available?

What yaml2xml and xml2yaml is available? I googled this, but it's not working correctly. ...

R Programming: Merging two variables to create frequency table

Hi again all, I have another newbie question; lets say i have a set of numbers graph_val <- c(4,2,3,4,1,1,9) and i need to create a frequency table of them against this scale 1 2 3 4 5 9 "Very Poor" "Poor" "Average" "Good" "Very Good" "Don't Know" ...

Java int to String - Integer.toString(i) vs new Integer(i).toString()

Sometimes java puzzles me... I have a huge amount of "int" initializations to make. What's the "real" difference? Integer.toString(i) new Integer(i).toString() Thanks. ...

OSX Application or Web App for converting text to plain text (unicode)

I am looking for ways to quickly converting blocks of text created in Word, etc. into plain text (i.e. turning right and left quotation marks into "plain text" quotation marks) for quickly transferring content to code with as few headaches as possible. I came across this: http://www.softpedia.com/get/Office-tools/Other-Office-Tools/Kei...