Questions tagged [converters]

Converters can change data from one type to another, translate data based on cultural information, or modify other aspects of presentation.

Value converters are culture-aware. Both the Convert and ConvertBack methods have a culture parameter that indicates the cultural information.

Ref: IValueConverter

5697 questions
753
votes
10 answers

How to convert an int value to string in Go?

i := 123 s := string(i) s is 'E', but what I want is "123" Please tell me how can I get "123". And in Java, I can do in this way: String s = "ab" + "c" // s is "abc" how can I concat two strings in Go?
hardPass
  • 19,033
  • 19
  • 40
  • 42
661
votes
23 answers

Convert Int to String in Swift

I'm trying to work out how to cast an Int into a String in Swift. I figure out a workaround, using NSNumber but I'd love to figure out how to do it all in Swift. let x : Int = 45 let xNSNumber = x as NSNumber let xString : String =…
Steve Marshall
  • 7,919
  • 4
  • 16
  • 17
470
votes
34 answers

Correct way to convert size in bytes to KB, MB, GB in JavaScript

I got this code to covert size in bytes via PHP. Now I want to convert those sizes to human readable sizes using JavaScript. I tried to convert this code to JavaScript, which looks like this: function formatSizeUnits(bytes){ if (bytes >=…
l2aelba
  • 21,591
  • 22
  • 102
  • 138
367
votes
12 answers

Convert xlsx to csv in Linux with command line

I'm looking for a way to convert xlsx files to csv files on Linux. I do not want to use PHP/Perl or anything like that since I'm looking at processing several millions of lines, so I need something quick. I found a program on the Ubuntu repos called…
user1390150
  • 3,679
  • 3
  • 14
  • 3
234
votes
11 answers

Calendar date to yyyy-MM-dd format in java

How to convert calendar date to yyyy-MM-dd format. Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, 1); Date date = cal.getTime(); SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd"); String date1 =…
skmaran.nr.iras
  • 8,152
  • 28
  • 81
  • 116
224
votes
19 answers

Converting XML to JSON using Python?

I've seen a fair share of ungainly XML->JSON code on the web, and having interacted with Stack's users for a bit, I'm convinced that this crowd can help more than the first few pages of Google results can. So, we're parsing a weather feed, and we…
Pete Karl II
  • 4,060
  • 3
  • 21
  • 27
197
votes
1 answer

ffmpeg - Converting MOV files to MP4

I have just installed ffmpeg and I am trying to encode all my uploaded videos to .mp4 file. Most of the users currently upload .mov and I want to convert every video to .mp4. I am running the command as follows: ffmpeg -i movie.mov -vcodec copy…
user1503606
  • 3,872
  • 13
  • 44
  • 78
147
votes
8 answers

Convert .flac to .mp3 with ffmpeg, keeping all metadata

How can I convert .flac to .mp3 with ffmpeg, keeping all metadata (that is converting Vorbis comment in .flac files to ID3v2 metadata of .mp3)?
Vito Gentile
  • 13,336
  • 9
  • 61
  • 96
142
votes
14 answers

How to convert a String into an ArrayList?

In my String, I can have an arbitrary number of words which are comma separated. I wanted each word added into an ArrayList. E.g.: String s = "a,b,c,d,e,.........";
Sameek Mishra
  • 9,174
  • 31
  • 92
  • 118
119
votes
3 answers

How to convert LocalDate to SQL Date Java?

How do I convert a LocalDate to a java.sql.Date? Attempt: Record r = new Record(); LocalDate date = new Date(1967, 06, 22); r.setDateOfBirth(new Date(date)); This fails (won't compile) and all I can find is Joda time stuff. I'm using Java 8
Gemtastic
  • 6,253
  • 6
  • 34
  • 53
111
votes
12 answers

How can doc/docx files be converted to markdown or structured text?

Is there a program or workflow to convert .doc or .docx files to Markdown or similar text? PS: Ideally, I would welcome the option that a specific font (e.g. consolas) in the MS Word document will be rendered to text-code: ```....```.
Lorenz Lo Sauer
  • 23,698
  • 16
  • 85
  • 87
107
votes
2 answers

How Convert VB Project to C# Project

I have a project written in VB, and I need to convert the whole project to C# project. I don't want to do it file by file, I found some online converters, but they convert only lines of code, not the whole project. I found on researches, and here…
Romo Daneghyan
  • 2,099
  • 3
  • 18
  • 23
92
votes
2 answers

Built-in WPF IValueConverters

Ok, it was a nice surprise (after writing it several times) to find that there already is a BooleanToVisibilityConverter in System.Windows.Controls namespace. Probably there are more such hidden time-savers. Anyone got some?
cz_dl
  • 1,350
  • 1
  • 9
  • 11
85
votes
3 answers

Validation Error: Value is not valid

I have a problem with a p:selectOneMenu, no matter what I do I cannot get JSF to call the setter on the JPA entity. JSF validation fails with this message: form:location: Validation Error: Value is not valid I have this working on several other…
klonq
  • 3,535
  • 4
  • 36
  • 58
85
votes
10 answers

No converter found capable of converting from type to type

I am getting the following stacktrace: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [referencedata.ABDeadlineType] to type [referencedata.DeadlineType] at…
Menelaos
  • 23,508
  • 18
  • 90
  • 155
1
2 3
99 100