converter

EBNF grammar to ANTLR3?

这一生的挚爱 提交于 2019-12-12 05:50:01
问题 I have this EBNF grammar for the Jass scripting language. What needs to be done to convert it to work with ANTLR 3.5? Furthermore, are there any sort of tools available to aid me in doing so? //---------------------------------------------------------------------- // Global Declarations //---------------------------------------------------------------------- program ::= file+ file ::= newline? ( declr newline )* func* declr ::= typedef | globals | native_func typedef ::= 'type' id 'extends' (

Retrieving the value of the selected item in a SelectOneMenu List

百般思念 提交于 2019-12-12 05:27:13
问题 i just want to retrieve the login of the selected User in the SelectOneMenu List here's the code : My xhtml page : <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> <h:head> <title>JSF

Datepicker and allowing multiple input formats

℡╲_俬逩灬. 提交于 2019-12-12 04:34:09
问题 I've got a Datepicker and I'd like to allow multiple formats for users. For example, for the date January 5th 2014 I want to allow the following formats: 05-01-2014 : dd-MM-yyyy 5-01-2014 : d-MM-yyyy 5-1-2014 : d-M-yyyy 5-01-14 : d-MM-yy 5-1-14 : d-M-yy 05-1-2014 : dd-M-yyyy 05-1-14 : dd-M-yy 05-01-14 : dd-MM-yy 05012014 : ddMMyyyy 050114 : ddMMyy 512014 : dMyyyy 5114 : dMyy I did create the following test-converter: public class DatepickerConverter : IValueConverter { public object Convert

Weird phenomenon when converting RGB to HSV manually in Matlab

雨燕双飞 提交于 2019-12-12 04:23:09
问题 I have written a small Matlab funcion which takes an image in RGB and converts it to HSV according to the conversion formulas found here. The problem is that when I apply this to a color spectrum there is a cut in the spectrum and some values are wrong, see images (to make the comparison easier I have used the internal hsv2rgb() function to convert back to RGB. This does not happen with Matlabs own function rgb2hsv() but I can not find what I have done wrong. This is my function function [ I

PHP Convert string into array

谁都会走 提交于 2019-12-12 04:22:27
问题 How to convert a string $string = 'array(array("a"=>"content"))'; (<-- this is string) into array like this: array(1) { [0]=> array(1) { ["a"]=> string(7) "content" } } I am going to build a function to run serialize online: Input: $string = 'array(array(1))'; echo serialize($string); Result: a:1:{i:0;a:1:{i:0;i:1;}} NOT s:16:"array(array(1)))"; You call: $returnValue = serialize('array(array(1))'); 回答1: You /could/ use eval(): $string = 'array(array("a"=>"content"))'; eval("\$array = $string

Validation Error: Value is not valid

╄→гoц情女王★ 提交于 2019-12-12 03:37:25
问题 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 class of the same type (ie, join table classes) but cannot for the life of me get this one working. If anyone can throw some troubleshooting/debugging tips for this sort of problem it would be greatly appreciated. Using log statements I have verified

Apache PIG - Get only date from TimeStamp

家住魔仙堡 提交于 2019-12-12 03:37:17
问题 I've the following code: Data = load '/user/cloudera/' using PigStorage('\t') as ( ID:chararray, Time_Interval:chararray, Code:chararray); transf = foreach Source_Data generate (int) ID, ToString( ToDate((long) Time_Interval), 'yyyy-MM-dd hh:ss:mm') as TimeStamp, (int) Code; SPLIT transf INTO Src25 IF (ToString(TimeStamp, 'yyyy-MM-dd')=='2016-07-25'), Src26 IF (ToString(TimeStamp, 'yyyy-MM-dd')=='2016-07-26'); STORE Src25 INTO '/user/cloudera/2016-07-25' using PigStorage('\t'); STORE Src26

What is the purpose of converters in jsf? [duplicate]

心已入冬 提交于 2019-12-12 03:29:13
问题 This question already has answers here : Conversion Error setting value for 'null Converter' - Why do I need a Converter in JSF? (2 answers) Closed 3 years ago . It appears that a converter usually has two methods getAsObject() and getAsString() , which will convert Object into or from strings. Why do we need to do this? For example, in dataTable we can always bind an object with var . Why can't we do similar things here? 回答1: In the end the client (usually a browser) will receive a rendered

Convert VERY large ppm files to JPEG/JPG/PNG?

为君一笑 提交于 2019-12-12 02:54:30
问题 So I wrote a C++ program that produces very high resolution pictures (fractals). I use fstream to save all the data in a .ppm file. Everything works fine, but when I go into really high resolution (38400x21600) the ppm file has ~8 Gigabytes. With my 16 Gigabytes of Ram, however, I am still not able to convert that picture. I downloaded couple of converters, but they couldn't handle it. Even Gimp crashed when I try to "export as...". So, does anyone know a good converter that can handle really

LaTeX to png conversion

拥有回忆 提交于 2019-12-12 02:05:39
问题 Following this previous question, I thought I could first convert the output of stargazer (latex code for summary statistics table) to png, using R commands (like dvi, dvips, ...) inside an R chunk or, in the worst case, invoking system commands (see this post), and then import the produced png into my Rmd file, using a command like ![alt text](summary_lm.png) Do you think this is possible? Could you show me how to do it, because I had no luck? 回答1: You can use the object tag to embed a PDF