converter

Excel (XLS) to CSV with UTF-8

此生再无相见时 提交于 2019-12-11 02:30:39
问题 I have read the following advice for converting UTF-8 encoded(Hebrew) XLS to CSV via Google Docs, and it worked. When I open the CSV in Sublime2 with UTF8 encoding the Hebrew is showing correctly. But then, when I try to import the Data to My DB using SQLyog, after making sure that both my target table and the import definitions are set to UTF8, I get Jibrish, like: מדרשות Where did I go wrong? 回答1: The best way to export from excel to csv is: Open the excel file and click on "Save as..

Converting InkCanvas Strokes to a Byte Array and back again

我是研究僧i 提交于 2019-12-11 02:19:07
问题 I am working on a program which converts the inkcanvas strokes to a byte array for encryption and then saves it in a txt file. Essentially I need to convert a byte array to inkcanvas strokes. I have the first half of the code done (which converts the inkcanvas strokes to a byte array): private byte[] InkCanvasToByte() { using (MemoryStream ms = new MemoryStream()) { if(myInkCanvas.Strokes.Count > 0) { myInkCanvas.Strokes.Save(ms, true); byte[] unencryptedSignature = ms.ToArray(); return

selectOneMenu shows after submit always the last item in the list as selected item

可紊 提交于 2019-12-11 02:15:15
问题 Info JSF 2.0 Primefaces 3.4 Both objects are People objects I have a simple drop down menu that is contained within a form that submits the selection on form submit (AJAX call): <h:form> .... <p:selectOneMenu converter="personconverter" value="#{searchperson.viewPerson.relatedTo}" filter="true" filterMatchMode="startsWith"> <f:selectItems value="#{searchperson.people}" var="person" itemLabel="#{person.fullName}" itemValue="#{person}" /> </p:selectOneMenu> .... <p:commandButton value="Save"

primefaces' selectOneMenu with converter not working with my backingBean

两盒软妹~` 提交于 2019-12-11 02:03:55
问题 I got a problem using selectOneMenu, it can clearly convert the Suppliers to SupplierBean (my boss use to call it that way-he was the one who set it up), and display it correctly on the page, but the moment i save it, it returns a null value. My code in XHTML: <p:selectOneMenu value="#{itemSupplierController.supplierBean}" converter="supplierConverter"> <f:selectItem itemLabel="Select..." itemValue="" /> <f:selectItems value="#{supplierController.suppliersBean}" var="s" itemValue="#{s}"

JSF Custom Converters

◇◆丶佛笑我妖孽 提交于 2019-12-11 01:59:49
问题 I have a custom converter like this: @Override public Object getAsObject(FacesContext facesContext, UIComponent component, String str) { System.out.println("vadeConverter before getAsObject(" + str); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd"); String values[] = str.split(":"); Vade vade = new Vade(); if (values.length > 1) { vade.setId(Integer.parseInt(values[0])); vade.setEtiket(values[1]); try{ vade.setTakasTarihi(dateFormat.parse(values[2])); }catch (Exception e){ e

Converting Julian date to Java date but still cannot get Month

限于喜欢 提交于 2019-12-11 01:47:45
问题 I am trying to get day ,month and year from a Julian date. String date = "13136";//Julian date Date convertedDate = new SimpleDateFormat("yyDDD").parse(date); System.out.println(convertedDate); It prints Thu May 16 00:00:00 BST 2013 which is correct. Now I want to get Day , Month and Year from it Calendar cal = Calendar.getInstance(); cal.setTime(convertedDate); System.out.println(cal.get(Calendar.MONTH)); It prints 4 . It should print 5 instead of 4 . Why is it not printing as correct ? What

Data Trigger using Converter not working

拥有回忆 提交于 2019-12-11 01:31:54
问题 I am trying to update the color of textblock depending on it value. Seems simple however not working. Here's the textblock xaml. <TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding Path=GL, StringFormat={}{0:N0}}" HorizontalAlignment="Left" FontFamily="Verdana" Foreground="Tomato" FontWeight="Bold" VerticalAlignment="Center" Margin="5,2,5,0" FontSize="18" > <TextBlock.Resources> <converters:ColorConverter x:Key="CoConverter"></converters:ColorConverter> </TextBlock.Resources> <TextBlock

Convert SQLite database to XML

一笑奈何 提交于 2019-12-11 01:08:43
问题 Is there any way to convert a .sqlite file to XML? There exist tools that convert from XML to SQLite, but does are there tools that convert the other way, too? 回答1: After some experimentation, I found a converter solution using sqlite3 : #!/bin/bash SFILE="$1" [ ! -f "$SFILE" ] && echo "$SFILE doesn't exist" 2>&1 && exit 2 for i in $(sqlite3 "$SFILE" '.table'); do echo -e ".mode csv\nselect * from $i;" | sqlite3 "$SFILE" > "$i".csv done start the script with ./script database.sqlite Creates

Unable to find org.springframework.format.datetime.standard.DateTimeConverters

守給你的承諾、 提交于 2019-12-10 23:45:47
问题 There is a Spring class, org.springframework.format.datetime.standard.DateTimeConverters , with some useful converters, that I am not able to find. It is documented in the 4.1.0.RC1_to_4.1.0.RC2 javadoc but not in the 4.1.0.RELEASE. Note the @UsesJava8 annotation in the javadoc. Of course I am using Java 8 as I need to convert between the new types. The class has its source code in GitHub with the 4.1 tag and I add the project by Maven using the following xml to my pom.xml. <dependency>

How to evaluate LaTeX formula in javascript?

纵然是瞬间 提交于 2019-12-10 23:19:24
问题 I have javascipt string in LaTeX format. For example: \frac{y^2}{2}x-\frac{2}{\sqrt{y}}+2(x-y)^2 I want to be able evaluate it with defined variables. Does anyone know framework or lib for this purpose? I've tried to find it in google and stack but without success. If you suggest to evaluate it using replace/eval - please answer without evaluating example above. Do not waste your strength =) Sorry, if I duplicate someone question - I will be grateful for link. 回答1: I think you'd need to get