Posts

facelets - Adding message to faceContext is not working in Java EE7 run on glassFish? -

facelets - Adding message to faceContext is not working in Java EE7 run on glassFish? - i doing tutorial on java ee7 comes glassfish installation. available here. code nowadays in glassfish server installation directory /glassfish_installation/glassfish4/docs/javaee-tutorial/examples/cdi/guessnumber-cdi . the code works fine is. displays correct! when user correctly guesses number not display failed @ end of game. introduced, 1 minor alter display failed message. have added comments right above relevant alter in code. somehow, alter did not help. is, @ end of game, failed message not displayed. game works usual. know why did not work , how right it? thanks public class usernumberbean implements serializable { private static final long serialversionuid = -7698506329160109476l; private int number; private integer usernumber; private int minimum; private int remainingguesses; @inject @maxnumber private int maxnumber; private int maximum; @inject @random inst...

java - matching two strings, one with x, other one with any characters -

java - matching two strings, one with x, other one with any characters - i new regex not getting this. need match 2 string s in java in 1 of them have number of x , other can have character in places. for illustration - string 1 - time xxxx when string 2 - time 0830 when these 2 strings should match , returns true. please suggest. thanks. as many of mentioned question not clear. i'll add together more details - 1. x can appear 2 number of times. 2. strings dynamic, or in other words, they'll passed method - public boolean doesmatch(string str1, string str2) { // matching code homecoming false; } so illustration - this xxxday , xxxx fri , these 2 strings should match. you need rebuild state engine: public boolean doesmatch(string str1, string str2) { if (str1.length() != str2.length()) homecoming false; (int = 0; < str1.length(); i++) if (str1.charat(i) != 'x' && str1.charat(i) != str2....

c# - Transferring a Vector3 variable from one script (WayPointPositioner) to another and change it into a transform (Walking) -

c# - Transferring a Vector3 variable from one script (WayPointPositioner) to another and change it into a transform (Walking) - i'm having bit of problem getting vector3 waypointposition other script called walking , changing transform target. troubles lie in fact i'm trying grab dynamic variable waypointpositioner (it changes depending on object clicked in stage , whether player overlaps waypoint) , import , utilize in script. below code i'm using. waypointpositioner using unityengine; using system.collections; public class waypointpositioner : monobehaviour { public vector3 waypointposition = vector3.zero; private bool checkplayerwaypointcollision; void start() { } void ontriggerstay2d (collider2d other) { // check if collision occuring player character. if (other.gameobject.name == "player") { checkplayerwaypointcollision = true; } else { checkplayerwaypointcollision = false; } } //check if objec...

asp.net - Index was out of range. Must be non-negative and less than the size of the collection - chart databind -

asp.net - Index was out of range. Must be non-negative and less than the size of the collection - chart databind - i'm trying build datatable , bind gridview , chart object. gridview appears fine when build x,y array , bind them chart object error above. i've read many forums understand index looking @ field out of range i've queried in immediate window fields , values there. there error occurs bind chart object , don't know why chart object doesn't display properly. this aspx codebehind: dim dt datatable = new datatable() dt.columns.add("companyname") dt.columns.add("amount") dt.columns.add("proportion") using dbcontext new fundmatrixentities dim queryunits = (from c in dbcontext.units c.savingapplicationid = savappid select new {.loanappid = c.loanapplicationid}).distinct().tolist() dim companyname string = "" dim savingsamount string = "...

javascript - AngularJS ngOptions filter array by boolean field -

javascript - AngularJS ngOptions filter array by boolean field - i have array: this.chapters = { 1: { name: 'chapter 1', show: false }, 2: { name: 'chapter 2', show: true }, 3: { name: 'chapter 3', show: true } }; and want show chapters show value true in select <select ng-model="cart.newchapter" ng-options="v.name (k, v) in cart.chapters"></select> now it's showing chapters, need filter them. i've been trying apply filter didn't work. can help me? oh! can't alter boolean type of. you cannot apply filters objects, arrays. so, have 2 options here, alter chapters array or pre-filter chapters object using function this: $scope.filter = function(chapters) { var result = {}; angular.foreach(chapters, function(chapter, key) { if (!chapter.show) { return; } result[key] = chapter; }); homecoming result; }; and on html: ...

android - Transparent status bar covers Action Mode on Kitkat -

android - Transparent status bar covers Action Mode on Kitkat - i have activity fragment. fragment phone call method show contextual action bar , here problem. styles: <style name="mythemelight" parent="@android:style/theme.holo.light.noactionbar"> <item name="android:actionmodeclosebuttonstyle">@style/myclosebutton</item> <item name="android:actionmodestyle">@style/contextualbar.light</item> <item name="android:actionoverflowbuttonstyle">@style/overflow</item> <item name="android:actionbarstyle">@style/mymainactionbar</item> <item name="android:windowtranslucentstatus">true</item> <item name="android:actionmodeclosedrawable">@drawable/close_white</item> <item name="android:windowactionmodeoverlay">true</item> <item name="android:windowbackground">...

c# - Update multiple entities in MVC4 with LINQ, SQLquery -

c# - Update multiple entities in MVC4 with LINQ, SQLquery - is possible update/remove multiples entities, illustration [httppost, actionname("removeresponsible")] public actionresult removeresponsibleaction(responsible modelo) { responsible responsible = db.responsibles.single(x => x.responsible_id == modelo.responsible_id); db.responsibles.remove(responsible); db.savechanges(); viewbag.responsible = db.responsibles.tolist(); homecoming view("responsiblemanager"); } this code works 1 single responsible unique id, how can if there many responsible same id? example, know sql "delete table responsible_id=3". if using entity framework 6 can utilize removerange method: var responsibles = db.responsibles.where(x => x.responsible_id == modelo.responsible_id).tolist(); db.responsibles.removerange(responsibles); c# asp.net-mvc linq entity-framework asp.net-mvc-4