converter

How to bind imageSource to ImageView in MvvmCross

此生再无相见时 提交于 2019-12-02 03:24:24
I'm having trouble to bind a source with converter to an imageview in my Touch project. I found here and here how to make it in Android public class TypeToSourceConverter : MvxValueConverter<int, string> { protected override string Convert (int value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { var assetName = ((AppConstants.Type)value).ToString ().ToLower (); return "Images/" + assetName + ".png"; } } But I'm having trouble in how to use this converter in iOS, i just found samples with ImageURL, I'm starting in iOS now, so I have some stupid questions as how

How to convert Hex string to Decimal

怎甘沉沦 提交于 2019-12-02 02:30:00
When I try this, Decimal m = Decimal.Parse(columns[1], System.Globalization.NumberStyles.AllowHexSpecifier); I get an ArgumentException saying this, The number style AllowHexSpecifier is not supported on floating point data types. and columns[1] = 4B414D000000011613C3 btw. what am I doing wrong and how do I fix it ? Decimal is floating point type, like Single , Double and so you can't parse by standard means strings like 4B414.D000000011613C3eAF // <- '.' decimal point; 'e' exponent sign On the other hand, Decimal is close to int128 and we don;t have that super long int . If your value is not

java.io.NotSerializableException - org.omnifaces.taghandler.Converter

安稳与你 提交于 2019-12-02 02:15:52
问题 I have an application using Primefaces 3.5 with Omnifaces 1.5 on Jboss 6, using myfaces 2.1.5 on trying to use the o:converter I am getting the follow error. org.omnifaces.taghandler.Converter viewId=/xhtml/propelModules/initiatePropel.xhtml location=C:\jboss-6.1.0.Final\server\default\deploy\PropelEAR.ear\PropelWeb.war\xhtml\propelModules\initiatePropel.xhtml phaseId=RENDER_RESPONSE(6) Caused by: java.io.NotSerializableException - org.omnifaces.taghandler.Converter at java.io

JSF converter with null value

五迷三道 提交于 2019-12-02 02:12:40
问题 I need to convert null property values of type java.math.BigDecimal to 0.00 everywhere with a specified number of decimal places (only for displaying ( <h:outputText> ) thus, not for input components). The basic converter expected to do this job is given below (currency, percentage, locale etc have been excluded completely for brevity). @FacesConverter("bigDecimalConverter") public final class BigDecimalConverter implements Converter { private static final int SCALE = 2; @Override public

JSF converter with null value

廉价感情. 提交于 2019-12-02 02:12:23
I need to convert null property values of type java.math.BigDecimal to 0.00 everywhere with a specified number of decimal places (only for displaying ( <h:outputText> ) thus, not for input components). The basic converter expected to do this job is given below (currency, percentage, locale etc have been excluded completely for brevity). @FacesConverter("bigDecimalConverter") public final class BigDecimalConverter implements Converter { private static final int SCALE = 2; @Override public Object getAsObject(FacesContext context, UIComponent component, String submittedValue) { if (submittedValue

Qt Converting base64 to QImage returns null

被刻印的时光 ゝ 提交于 2019-12-02 02:02:23
I have problem. I've to convert base64 to QImage, but after that image is always null. Here's code: void convertAll(QString path) { QDir *dir = new QDir(path); QDirIterator *iter = new QDirIterator(*dir); QVector<QFile*> files; QTextStream cout(stdout); cout << "Finding files...\n"; cout.flush(); while (iter->hasNext()) { iter->next(); if (iter->fileInfo().completeSuffix() == "txt") files.push_back(new QFile(iter->filePath())); } delete iter; cout << "Converting files to images...\n"; cout.flush(); foreach (QFile *file, files) { QString filename = QFileInfo(*file).fileName(); filename.remove("

How to send a person to a 404 page if f:viewParam / converter returns null?

做~自己de王妃 提交于 2019-12-02 01:11:48
Lets say you had a page with a view param, like /widgets?widgetId=1 <f:metadata> <f:viewParam name="widgetId" value="#{widgetIdMB.widgetId}" converter="#{widgetIDConverter}" /> </f:metadata> So, less say your converter throws a ConverterException , because someone tried to navigate to /widgets?widgetId=1000000 , which doesn't exist in the database. Is there a way to send the person to the 404 page when that happens? EDIT: I used a converter to convert the value. If the value can't be looked up in the database, the converter returns null, rather than throwing a ConverterException. Then I use a

java.io.NotSerializableException - org.omnifaces.taghandler.Converter

允我心安 提交于 2019-12-01 23:42:39
I have an application using Primefaces 3.5 with Omnifaces 1.5 on Jboss 6, using myfaces 2.1.5 on trying to use the o:converter I am getting the follow error. org.omnifaces.taghandler.Converter viewId=/xhtml/propelModules/initiatePropel.xhtml location=C:\jboss-6.1.0.Final\server\default\deploy\PropelEAR.ear\PropelWeb.war\xhtml\propelModules\initiatePropel.xhtml phaseId=RENDER_RESPONSE(6) Caused by: java.io.NotSerializableException - org.omnifaces.taghandler.Converter at java.io.ObjectOutputStream.writeObject0(Unknown Source) The code concerned is ... <p:selectManyCheckbox value="#

How to solve “Conversion Error setting value '2013-10-26' for 'null Converter'” in h:inputText with Date value?

送分小仙女□ 提交于 2019-12-01 23:08:07
问题 when I press the insert button, I get the error indicated on the title Conversion Error setting value '2013-10-26' for 'null Converter' <h:form id="formulario"> <h:outputLabel for="date">Plazo</h:outputLabel> <h:inputText id="date" required="true" requiredMessage="Campo Obligatorio" value="#{aaaNewDetalles.criterioAaa.plazo}"/> <h:message for="date" style="color: red;"/> <h:commandButton actionListener="#{aaaNewDetalles.add()}" value="Ingresar"/> </h:form> the form is managed by this class:

Error calling LibreOffice from Python

回眸只為那壹抹淺笑 提交于 2019-12-01 22:05:21
Calling LibreOffice to convert a document to text... This works fine from the linux command line: soffice --headless --convert-to txt:"Text" document_to_convert.doc But I get an error when I try to run the same command from Python: subprocess.call(['soffice', '--headless', '--convert-to', 'txt:"Text"', 'document_to_convert.doc']) Error: Please reverify input parameters... How do I get the command to run from Python? This is the code you should use: subprocess.call(['soffice', '--headless', '--convert-to', 'txt:Text', 'document_to_convert.doc']) This is the same line you posted, without the