converter

How to convert csv files encoding to utf-8

人盡茶涼 提交于 2019-11-29 16:32:48
问题 Is it possible to convert csv data that has iso-8859-13 encoding to UTF-8 ? My old system does not have UTF-8 encoding, it uses only iso-8859-13 . The system that I need to import to does not have iso-8859-13 , but has both UTF-8 and UTF-16 . If I try to open the csv file with an encoding other than iso-8859-13 , then some symbols are not recognized. If I try to import such file into the new system, it gives an error that I have wrong encoding. I can only import it using windows-1252 , but

Dynamic TryParse for all data types

别说谁变了你拦得住时间么 提交于 2019-11-29 16:31:56
I have the need to examine to see if an object can be converted to a specific DataType or not, and came up with this : public static bool TryParseAll(System.Type typeToConvert, object valueToConvert) { bool succeed = false; switch (typeToConvert.Name.ToUpper()) { case "DOUBLE": double d; succeed = double.TryParse(valueToConvert.ToString(), out d); break; case "DATETIME": DateTime dt; succeed = DateTime.TryParse(valueToConvert.ToString(), out dt); break; case "INT16": Int16 i16; succeed = Int16.TryParse(valueToConvert.ToString(), out i16); break; case "INT": Int32 i32; succeed = Int32.TryParse

Why Json.net does not use customized IsoDateTimeConverter?

无人久伴 提交于 2019-11-29 15:33:46
I use Json.net to serialize my objects and I want to customize DateTime output: Here is a small example: [DataContract] class x { [DataMember] [JsonConverter(typeof(IsoDateTimeConverter))] public DateTime datum = new DateTime(1232, 3, 23); } var dtc = new IsoDateTimeConverter(); dtc.DateTimeFormat = "yy"; JsonConvert.SerializeObject(new x(), dtc); The result is {"datum":"1232-03-23T00:00:00"} instead of {"datum":"1232"} . This works correctly (returning "32" ): return JsonConvert.SerializeObject(new DateTime(1232, 3, 23), dtc); Where is the catch? The catch is that the converter applied via

Using Sharpen and eclipse : error “Application ”sharpen.core.application“ could not be found in the registry.”

最后都变了- 提交于 2019-11-29 15:28:19
问题 Background I'm currently doing a benchmark of solutions to convert java code to c# We have a fast evolving java software and wan't to port some low level (not ui) apis with a tool, because maintaining all changes between versions could prove really tiresome... Anyway, I've been trying to use Sharpen, as I heard it's a pretty wicked tool used by some mono "freaks" to keep some versions of their tools in check. What I did For this purpose, I tried several tutorials I found on internet, the

h:selectOneMenu generic converter for all entities without calling DB again and again

*爱你&永不变心* 提交于 2019-11-29 15:01:26
I want to get selected object from <h:selectOneMenu> , but the problem is I couldn't find any generic converter for all type of entities. My first question is, is there a generic converter for all type of entities? I don't want to write another converter again for each other entity. My second question is, is there a way to get selected object without any converter? I don't want to call the DB again and again. I have a Car entity with id and name properties. BalusC My first question is, is there a generic converter for all type of entities? This does indeed not exist in standard JSF. The JSF

Binding Visibility Converter in WPF C#

点点圈 提交于 2019-11-29 14:46:10
I have a dependency property of type collection, when its callback fires based on the count I need to set the visibility of some of the controls on the screen. But the controls remains Collapsed all the time. As per the code, one control remains visible all the time. XAML binding is <TextBlock Text="106 search results for 'a'" Margin="5,0,100,0" Visibility="{Binding CountLabelVisibleReverse, Converter={StaticResource VisibilityConverter}}"/> <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,90,0" Visibility="{Binding CountLabelVisible, Converter={StaticResource VisibilityConverter}

How to convert .wav to .mp3 file in php

怎甘沉沦 提交于 2019-11-29 14:36:05
I am currently developing a website using the CodeIgniter framework and in one of the Process I need to download a .wav music file and convert it to .mp3 file. All the coding needs to be done only in PHP and I cannot use Ruby or java to do so. And I am currently hosting on a shared env i.e. Dreamhost. So please let me know how to work out this problem. Use FFMPEG . There is a PHP extension for it , but I've found better success just calling exec() . Most hosts I have used (even shared hosting) will install it if it isn't already available. Edit: Dreamhost provides this for you. See this: http:

convert html to javascript

半腔热情 提交于 2019-11-29 13:49:49
问题 Does anybody know if there is a tool around that can convert html to javascript. For example: <div> </div> would convert to aDiv = document.createElement('div'); document.appendChild(aDiv); etc I'm am doing a few html templates for UI components and am using MooShell for prototyping. It would be great to be able to auto-generate the javascript that will build the component's html. Thanks 回答1: I'd suggest taking a look at John Resig's pure javascript HTML parser. It consists of a SAX style

Is it possible to supply a type converter for a static resource in WPF?

点点圈 提交于 2019-11-29 13:24:17
问题 I have a newbie WPF question. Imagine my user control has a namespace declaration like this: xmlns:system="clr-namespace:System;assembly=mscorlib" And I have resources for the user control like this: <UserControl.Resources> <system:Int32 x:Key="Today">32</system:Int32> </UserControl.Resources> And then somewhere in my user control I have this: <TextBlock Text="{StaticResource Today}"/> This will cause an error because Today is defined as a integer resource, but the Text property is expecting

How do I extractor audio to mp3 from mp4 using java in Android?

守給你的承諾、 提交于 2019-11-29 12:58:54
I want convert mp4 video to mp3 audio file in Android platform? How can I do it? Actually I test some JAR. Firstly, the JAAD lib be used to test. import java.io.File; import java.io.RandomAccessFile; import java.util.List; import net.sourceforge.jaad.aac.Decoder; import net.sourceforge.jaad.aac.SampleBuffer; import net.sourceforge.jaad.mp4.MP4Container; import net.sourceforge.jaad.mp4.api.AudioTrack; import net.sourceforge.jaad.mp4.api.Frame; import net.sourceforge.jaad.mp4.api.Movie; import net.sourceforge.jaad.mp4.api.Track; import net.sourceforge.jaad.util.wav.WaveFileWriter; public class