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
83
votes
3 answers

How to transform an XML file using XSLT in Python?

Good day! Need to convert xml using xslt in Python. I have a sample code in php. How to implement this in Python or where to find something similar? Thank you! $xmlFileName = dirname(__FILE__)."example.fb2"; $xml = new…
aphex
  • 1,147
  • 1
  • 12
  • 17
82
votes
9 answers

Java: How to convert String[] to List or Set

How to convert String[] (Array) to Collection, like ArrayList or HashSet?
Mark
  • 17,887
  • 13
  • 66
  • 93
79
votes
9 answers

How to convert BASE64 string into Image with Flutter?

I'm converting images saved in my Firebase database to Base64 and would like to decode and encode. I've researched similar questions, but am still getting errors. Here is what I have so far? var image1 = String; var pic =…
Charles Jr
  • 8,333
  • 15
  • 53
  • 74
77
votes
1 answer

Convert between LocalDate and sql.Date

What's the correct way to convert between java.sql.Date and LocalDate (in both directions) in Java 8 (or higher)?
maja
  • 17,250
  • 17
  • 82
  • 125
70
votes
4 answers

RGB to HSL conversion

I'm creating a Color Picker tool and for the HSL slider, I need to be able to convert RGB to HSL. When I searched SO for a way to do the conversion, I found this question HSL to RGB color conversion. While it provides a function to do conversion…
akinuri
  • 10,690
  • 10
  • 65
  • 102
68
votes
8 answers

How to convert string to long

how do you convert a string into a long. for int you int i = 3423; String str; str = str.valueOf(i); so how do you go the other way but with long. long lg; String Str = "1333073704000" lg = lg.valueOf(Str);
user1072357
68
votes
4 answers

How to convert a PDF into JPG with command line in Linux?

What are fast and reliable ways for converting a PDF into a (single) JPEG using the command line on Linux?
Soerendip
  • 7,684
  • 15
  • 61
  • 128
63
votes
7 answers

Ruby XML to JSON Converter?

Is there a library to convert XML to JSON in Ruby?
Lance
  • 75,200
  • 93
  • 289
  • 503
61
votes
2 answers

Convert LaTeX to ePub

Update 2012-02-11 : Since my question is quite old but very popular, I'd propose to reopen it. I'd like to know, if more options are available a year later. I'd like to convert some university papers from LaTeX into ePub format - without using PDF…
SteAp
  • 11,853
  • 10
  • 53
  • 88
61
votes
4 answers

Convert between LocalDate and XMLGregorianCalendar

What's the best way to convert between LocalDate from Java 8 and XMLGregorianCalendar?
maja
  • 17,250
  • 17
  • 82
  • 125
60
votes
8 answers

How do I convert a Color to a Brush in XAML?

I want to convert a System.Windows.Media.Color value to a System.Windows.Media.Brush. The color value is databound to a Rectangle object's Fill property. The Fill property takes a Brush object, so I need an IValueConverter object to perform the…
dthrasher
  • 40,656
  • 34
  • 113
  • 139
57
votes
7 answers

How to convert datetime to integer in python

How can I convert YYYY-MM-DD hh:mm:ss format to integer in python? for example 2014-02-12 20:51:14 -> to integer. I only know how to convert hh:mm:ss but not yyyy-mm-dd hh:mm:ss def time_to_num(time_str): hh, mm , ss = map(int,…
Tomáš Konyárik
  • 593
  • 1
  • 4
  • 7
56
votes
2 answers

How to pass specific value to the converter parameter?

I have created a class Person that looks like this: public class Person { public enum GenderType { Female, Male } public string Name { get; set; } public GenderType? Gender { get;…
Boris
  • 9,986
  • 34
  • 110
  • 147
56
votes
12 answers

WPF: how to use 2 converters in 1 binding?

I have a control that I want to show/hide, depending on the value of a boolean. I have a NegatedBooleanConverter (switches true to false and vice versa) and I need to run this converter first. I have a BooleanToVisibilityConverter and I need to run…
Natrium
  • 30,772
  • 17
  • 59
  • 73
55
votes
10 answers

The 'clr-namespace' URI refers to a namespace that is not included in the assembly

I'm trying to include in my XAML some classes which convert values. However, I'm getting the following error when I compile: Undefined CLR namespace. The 'clr-namespace' URI refers to a namespace 'View.Summary.Converters' that is not included in…
Adam S
  • 8,945
  • 17
  • 67
  • 103