Tuesday, 8 April 2014

c# Parsing strings controlling Expressions

I have a following formula in a Windows C# form that parses a textbox
string. The customary twine would feeling something like: z5 100c x87.50.
Another instance competence be:m5 100c vs z5 100c. In both examples, we
have several attributes that are important, "z5', "100", "c", "x",
"87.50". From this twine we am feeding it into several functions (these
functions are reduction important). we found several samples and have a
next code, though when we run a formula it will wholly parse a initial
found countenance and not iterate by and arrangement all found
expressions. For example, "z5 100c x87.50" advantage 5 and c. Is there a
improved slight for reading a whole string, afterwards parsing and
extracting a applicable information?private vacant
toolStripButton2_Click(object sender, EventArgs e){ twine agreement =
toolStripTextBox1.ToString(); twine contractConvert =
contract.ToLower(); Regex re = new
Regex("c$\\.?|p$\\.?|s$\\.?|f$\\.?|cs\\.?|ps\\.?|vs\\.?|x\\.?"); Regex
rePrice = new Regex("[0-9]{1,4}(\\.[0-9]{1,2})?"); Match m =
re.Match(contractConvert.ToString()); Match mPrice =
rePrice.Match(contract.ToString()); if (m.Success) {
MessageBox.Show(string.Format("Structure: " + m.Value)); } else {
MessageBox.Show("Structure incorrect!"); } if
(mPrice.Success) { MessageBox.Show(string.Format("Strike: " +
mPrice.Value)); } else { MessageBox.Show("Structure
incorrect! Requires a strike."); }}

Friday, 4 April 2014

how to get checkbox value of checkbox that is a outcome of mysql query

i have a series of checkbox that are a outcome of fetch query and .html()
to insert in a div . My problem is that i can't get a value of a
checkboxesany thought how can i get this finished would be unequivocally
many appreciatedHere's how i fetch my checkbox

Tuesday, 1 April 2014

Map estate in pointy 2.0

I know there are other questions in smoke-stack overflow, though None of
them works for me.I'm perplexing to map a rudimentary estate in pointy
projectionI try hundreds of combinations, we can't make this compile. we
finish of with a follow formula and a blunder bellow. we foster a box
classes since they have many some-more data. Without estate my other
layers (controllers, services and interface) will have to understanding
with complexity, since in this box a denote represents genuine objects
that are in trisect inherited, there is no improved illustration that
estate for this classes. In a use and controller covering we make a Json
illustration of a classes be exacted what we need, we can send and devour
a Json API that represents my model, a wholly thing in a proceed is
nutritious this illustration in relational database, my relational denote
is able of insist this entities in an unparalleled list inheritance,
though interpret rows to relational is a pain.I'm controlling scala 2.10.3
+ sbt 0.13.1 summary category Pessoa2(val nome:String, val
tipo:String)case category PessoaFisica2(override val nome:String, val
cpf:String) extends Pessoa2(nome,"F")case category
PessoaJuridica2(override val nome:String, val cnpj:String) extends
Pessoa2(nome, "J")class PessoaTable(tag: Tag) extends Table[Pessoa2](tag,
"PESSOAS"){// def id = column[Int]("ID", O.PrimaryKey, O.AutoInc)def
nome = column[String]("nome")def tipo = column[String]("tipo")def cpf =
column[String]("CPF", O.Nullable)def cnpj = column[String]("CNPJ",
O.Nullable)def * = (nome, tipo, cpf.?, cnpj.?) <> ({ box
(nome:String,"F",cpf:Option[String],_) => new PessoaFisica2(nome,
cpf.get):Pessoa2 box (nome:String,"J",_,cnpj:Option[String]) => new
PessoaJuridica2(nome, cnpj.get):Pessoa2 },{ box PessoaFisica2(nome,
Some(cpf)) => Some((nome, "F", cpf, "")) box PessoaJuridica2(nome,
Some(cnpj)) => Some((nome, "J", "", cnpj)) })}This ends with a error: The
justification forms of an opposite duty contingency be entirely known.
(SLS 8.5)[error] Expected form was: ? => ?[error] def * = (nome, tipo,
cpf.?, cnpj.?) <> ({[error]
^[error]
/Users/giovanni/Projetos/atende/clientes/app/model/Pessoas.scala:158: form
mismatch;[error] found : Any[error] required: String[error]
box (nome,"F",cpf,_) => new PessoaFisica2(nome, cpf):Pessoa2[error]
^[error]
/Users/giovanni/Projetos/atende/clientes/app/model/Pessoas.scala:158: form
mismatch;[error] found : Any[error] required: String[error]
box (nome,"F",cpf,_) => new PessoaFisica2(nome, cpf):Pessoa2[error]
^[error]
/Users/giovanni/Projetos/atende/clientes/app/model/Pessoas.scala:159: form
mismatch;[error] found : Any[error] required: String[error]
box (nome,"J",_,cnpj) => new PessoaJuridica2(nome, cnpj):Pessoa2[error]
^[error]
/Users/giovanni/Projetos/atende/clientes/app/model/Pessoas.scala:159: form
mismatch;[error] found : Any[error] required: String[error]
box (nome,"J",_,cnpj) => new PessoaJuridica2(nome, cnpj):Pessoa2[error]
^[error]
/Users/giovanni/Projetos/atende/clientes/app/model/Pessoas.scala:160:
blank parameter form for stretched function[error] The justification forms
of an opposite duty contingency be entirely known. (SLS 8.5)[error]
Expected form was: ? => Option[?][error] },{[error]
^[error]
/Users/giovanni/Projetos/atende/clientes/app/model/Pessoas.scala:157: No
relating Shape found.[error] Slick does not know how to map a given
types.[error] Possible causes: T in Table[T] does not review your *
projection. Or we use an unsupported form in a Query (e.g. scala
List).[error] Required level: scala.slick.lifted.ShapeLevel.Flat[error]
Source type: (scala.slick.lifted.Column[String],
scala.slick.lifted.Column[String],
scala.slick.lifted.Column[Option[String]],
scala.slick.lifted.Column[Option[String]])[error] Unpacked type:
(String, String, String, String)[error] Packed type: Any[error]
def * = (nome, tipo, cpf.?, cnpj.?) <> ({[error]
^[error] 7 errors found