Posts

fluentvalidation - AbstractValidator : showing error messages with property values -

i use following pattern when importing "unknown" data. public class mycustomobject { public string mycustomdateasstring { get; set; } public datetime? mycustomdate { { datetime? returnvalue = null; datetime parseresult = datetime.minvalue; bool parseattempt = datetime.tryparse(this.mycustomdateasstring, out parseresult); if (parseattempt) { returnvalue = parseresult; } return returnvalue; } } public string mycustomintasstring { get; set; } public int? mycustomint { { int? returnvalue = null; int parseresult = 0; bool parseattempt = int.tryparse(this.mycustomintasstring, out parseresult); if (parseattempt) { returnvalue = parseresult; } return returnvalue; } } } i have working. public...

html - aligning elements in their containers and the containers on the line -

i've got several elements trying group , center them on page so: | | username: | ________________ | img 1 password: | ________________ | img 2 login | | | i don't want username , password centered, still want @ left side of input boxes. right looks this: | username im|g 2 | _______________ | img 1 _______________ pass|word: | ...

javascript - Watch ng-model whilst using minlength? -

i'm trying watch value of ng-model whilst using minlength validation. problem model value remains empty/undefined until validation criteria met. html <input ng-model="xyz" minlength="8" /> js $scope.$watch('xyz', function(val) { // either undefined or // string bigger or equal // 8 characters. console.log(val); }); i know substring element's value, code implemented in directive uses $compile , ideally i'd prefer watch model value. any thoughts on how resolve this? https://docs.angularjs.org/api/ng/directive/ngmodeloptions allowinvalid: boolean value indicates model can set values did not validate correctly instead of default behavior of setting model undefined.

excel - Simple VBA to inserting row at an increment -

it has been awhile since start use vba again. i have 1 question regarding inserting row @ increment of "0.1" the increment applies case when length > "0.1" ==================================================== when new row has been insert write id , route_id , new begin_point, new end_point, new length (new end_point - new begin_point) insert row until length < "0.1" ==================================================== please me out on or address me vba code done. specify question format desire answer below. i appreciate help! question id | route_id | begin_point | end_point | length | 1105 | a_st | 1.166 | 1.271 | 0.105 99 | c_blvd | 0 | 0.08 | 0.08 24 | b_ave | 0.447 | 0.627 | 0.18 desired answer id | route_id | begin_point | end_point | length | 1105 | a_st | 1.166 | 1.266 | 0.1 1105 | a_st | 1.266 | 1.271 | 0.005 99 | c_blvd | 0 | 0.08 ...

java - Selenium Doc - How to use? -

i'm using following selenium doc ( http://selenium.googlecode.com/git/docs/api/java/index.html ),however not sure how can use effectively. example: if have use class keyboard , method presskeys(), per document class should import use presskeys() method. here code not working import org.openqa.selenium.webdriver; import org.openqa.selenium.webelement; import org.openqa.selenium.support.ui.expectedconditions; import org.openqa.selenium.chrome.chromedriver; import org.openqa.selenium.interactions.keyboard; public class myclass { public static void main(string[] args) { system.setproperty("webdriver.chrome.driver", "c:\\selenium-java-2.35.0\\chromedriver_win32_2.2\\chromedriver.exe"); webdriver driver = new chromedriver(); //open gmail driver.get("http://www.gmail.com"); driver.findelement(by.id("email")).presskeys } } error msg i'm getting last line : "presskeys cannot resolved or not ...

Scala macros: Is it possible to pass a class body as parameter? -

i'm trying make macro accepts block , uses class description. thought may work: class c def makec(body: =>unit): c = macro makecimpl def makecimpl(c: context)(body: c.tree) = { import c.universe._ val q"..$lines" = body q"new c{..$lines}" } but yields following error when trying use it: scala> val c = makec{var x = 6} java.lang.assertionerror: assertion failed: var x: int = 6 while compiling: <console> during phase: globalphase=typer, enteringphase=namer library version: version 2.11.8 compiler version: version 2.11.8 reconstructed args: -deprecation -feature -bootclasspath /usr/lib/jvm/jdk1.8.0_31/jre/lib/resources.jar:/usr/lib/jvm/jdk1.8.0_31/jre/lib/rt.jar:/usr/lib/jvm/jdk1.8.0_31/jre/lib/sunrsasign.jar:/usr/lib/jvm/jdk1.8.0_31/jre/lib/jsse.jar:/usr/lib/jvm/jdk1.8.0_31/jre/lib/jce.jar:/usr/lib/jvm/jdk1.8.0_31/jre/lib/charsets.jar:/usr/lib/jvm/jdk1.8.0_31/jre/lib/jfr.jar:/usr/lib/jvm/jdk1.8.0_31/jre/classes...

asp.net mvc - No parameterless constructor defined for this object. (Debug never reaches any controller action?) -

i hate these kind of errors. i have asp.net core mvc form. when submit form dreaded "no parameterless constructor defined object." error. i can't seem hit in debugger me find have went wrong. my controller: using brand.extensions; using brand.models; using microsoft.aspnetcore.http; using microsoft.aspnetcore.mvc; namespace brand.controllers { public class contentcontroller : controller { public iactionresult index() { return view(); } [httpget] public iactionresult upload() { return view(); } [httppost] [validateantiforgerytoken] public iactionresult upload(uploadedcontentmodel uploadedcontentmodel, formcollection formcollection, iformfilecollection uploadedfiles) { contentextensions contentextensions = new contentextensions(); fileextensions fileextensions = new fileextensions(); filemodel file = ...