convert

Convert XML to Object using reflection

Hi guys, If you like problems to resolve, here a big one :D First, It isn't about serialization, ok? Well, my situation... I am writting a function that I will pass as parameter a Xml (XmlDocument) and an object (Object) as reference. It will return to me a object (object that was referenced) filled with the values from the Xml (XmlDo...

Convert vm to native/dual-boot

Long shot: I run an ubuntu 10.4 machine under VMware, Windows 7 host. I use it more and more as my primary machine, and wish now that I had installed it as a dual boot system, since the sluggishness of the vm is a continual irritation. So -- is it possible somehow to convert the ubuntu system to run natively? If not, are there any to...

How to convert JSON to XML? (preferably with Yahoo Pipes or Ruby).

There is plenty of information on XML to JSON conversion... But I would like to convert a JSON result into XML. For example the iTunes Search API only provides output in the JSON format. http://itunes.apple.com/WebObjects/MZStoreServices.woa/ws/wsSearch?term=jack+johnson&country=US&media=music&entity=musicArtist&limit=6...

Converting form CharField type to string in Django

Hi, I have created a form class which is used to generate a formset. I can easily generate the formset with initial data in it. However, I need to write the value of one of my CharField elements in my form as the label for another field. In order to do get this dynamic name, I wrote {{ form.field }} as the value for label. But since fie...

how to convert sound wave to midi in c#

Does anyone know how to convert an analog sound wave to a midi file. I know that differs from wav to mp3 but thats not important for now. I only want to learn the basic logic of the conversion. if anyone can give me some article or some source code about it, I will appriciate it. ...

Convert datatable to excel 2007(.xlsx)

Hi, I have an DataTable I need to put into Excel 2007 format and save it as an excel file(.xlsx) 2007. Can anyone help me to achieve this? ...

Migrating SVN to GIT: Incorrect filenames with special characters

I'm trying to convert an existing SVN repository to GIT using git-svn clone but versioned files with special characters in the filename like "ö" are showing as "ö" after migration. Obviously, git-svn saves the filenames "as is" - I assume that SVN stores filenames in UTF-8 (as done with the logs), but my Windows uses windows-1252 encodi...

Trouble with strings passed as parameters from command line

I'm trying to convert a flat file into an Excel-readable format. We receive the text file that uses the tilde (~) as a field delimiter, and I want to convert it into one that uses the Tab character. I'm interested in running this from the command line, and I need to be flexible with the filenames, so I want to use parameters. The VBScrip...

how to convert a databound zero double value to an empty string?

Hi Guys, I have this Payment object public class Payment { public Guid Id { get; set; } public double Amount { get; set; } } which is data bound to a TextBox <TextBox x:Name="_AmountTB" Text="{Binding Path=Amount, Mode=TwoWay}" /> I require that whenever the Amount is 0, then I don't show anything in the TextBox, how can...

Convert a Python snippet to PHP?

Can anyone translate my small Python snippet to PHP? I'm not a familiar with both languages. :( matches = re.compile("\"cap\":\"(.*?)\"") totalrewards = re.findall(matches, contents) print totalrewards Thank you for those who'd help! :( ...

Convert JSON string into "complicated" class?

I have this JSON string: { "success":true,"user_id":"309","id":"309","sessId":false,"email":null,"name":"Mai Van Quan","username":"quanmv","role":"Reseller Admin","messages":"","org_name":null,"microPayNumber":"4949","microPayWord":"neocam","mobile":null,"permissions":{"ADD_CAMERA":true, "REMOVE_CAMERA":true, "EDIT_CAM_GENERAL"...

How do I convert this VB code to C#?

I'm having trouble converting this piece of code (originally in VB) to C#. In particular, how does one apply a negative to an int. Private Declare Function GetWindowLong Lib "user32" Alias _ "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_MAXIMIZEBOX = &H10000 dim...

C: save received Winsock packet to file as hex

I need to do what most packet monitoring programs do (Wireshark, tcpdump, etc.). When data is received through Winsock, I just need to convert the packet to a hex representation and save it to file. The data is just a simple char array. I've tried lots of things like sprintf but with no luck. I also don't want to use itoa since it's no...

PHP - What is a good way to produce an short alphanumeric string from a long md5 hash?

This is for the purpose of having a nice short URL which refers to an md5 hash in a database. I would like to convert something like this: a7d2cd9e0e09bebb6a520af48205ced1 into something like this: hW9lM5f27 Those both contain about the same amount of information. The method doesn't have to be direct and reversible but that w...

C# Get VolumeSerialNumber

I am working on my HWID code. I recently tried converting this code from VB.net to C#. I have this one error which I can't seem to figure out. 'dsk' is a 'variable' but is used as a 'method' Here is my code string returnString = null; string systemDisk = Environment.GetEnvironmentVariable("windir", EnvironmentVariableTarget.Ma...

Trying to convert an int[] into int[,] using C#

Hi, I would like a function to convert a single dimension array int[480000] into a 2d array of size int[800,600]. Can you please help me how this can be done? ...

Runtime Revolution simple but hard question...

Can anyone convert this RunRev function to a usable PHP function? I'm not an expert when it comes to PHP so I hope somebody helps me... Here is the RunRev code snippet, -> http://paste-it.net/public/n8a6437/ I hope somebody helps me... ...

Bitmap <-> JPEG Conversion

I have an application that use the image captured by the mobile camera and sends it to a webservice. Currently I am putting the image in a byte[] which then will be transmitted. This is done by: filename = cameracapturedialog.FileName; FileStream fs = new FileStream(filename, FileMode.Open); byte[] ImageByte = new byte[fs.Length]; //fi...

VB.net Regex to C#

How would I convert this to C# from VB.net. I tried the online converters but I got errors when I put it in my project. Dim regexinfo As String = String.Empty Dim p = "\[news\](?<info>.*?)\[/news\]" Dim Matches = Regex.Matches(response, p, RegexOptions.IgnoreCase Or RegexOptions.Singleline) If Matches IsNot Nothing AndAlso Matches.Count...

Random afconvert errors in custom build rule of XCode

Hi I have an iPhone project which heavily uses sound samples and Open AL. Sound samples in it's original form are aifs. For Open AL I need cafs. So to keep things simple I've decided to move conversion procedure into custom build rule of XCode project. There is a brilliant article right about this task http://www.henryflurry.com/news/fil...