Posts

Showing posts from May, 2011

c# - Similar to Extension Methods Functionality - Can we extend properties -

extension methods great way extend functionality of type. there ways similar can used extend properties of class without inheriting new class. no extension properties do not exist . you can't via properties without inheriting new class. there extension methods, not extension properties ( it may added @ future date ). if don't want alter original class should inherit original class , add properties derived class.

Python shutil copyfile - missing last few lines -

i routinely missing last few kb of file trying copy using shutil copyfile. i did research , see asking similar here: python shutil copy function missing last few lines but using copyfile, seem use statement... with open(src, 'rb') fsrc: open(dst, 'wb') fdst: copyfileobj(fsrc, fdst) so perplexed more users aren't having issue, if indeed sort of buffering issue - think it'd more known. i calling copyfile simply, don't think possibly doing wrong, doing standard way think: copyfile(target_file_name,dest_file_name) yet missing last 4kb or of file eachtime. i have not touched copyfile function gets called in shutil is... def copyfileobj(fsrc, fdst, length=16*1024): """copy data file-like object fsrc file-like object fdst""" while 1: buf = fsrc.read(length) if not buf: break fdst.write(buf) so @ loss, suppose learn flushing, buffering, or statement, or ....

sas - Report using data _Null_ -

i'm looking report using sas data step : i have data set: name company date x 199802 x 199705 x d 199901 y b 200405 y f 200309 z c 200503 z c 200408 z c 200404 z c 200309 z c 200210 z m 200109 w g 200010 report i'm looking for: name company x 1997/05 1998/02 d 1998/02 1999/01 y b 2003/09 2004/05 f 2003/09 2003/09 z c 2002/10 2005/03 m 2001/09 2001/09 w g 2000/10 2000/10 thank you, tried using proc print not accurate. looking data null solution. data _null_; set salesdata; name company date; array x(*) from; from=lag(date); if first.name count=1; i=count dim(x); x(i)=.; end; count+1; if first.company do; from_date1=date; end; if last.company to_date=date; if from_date1 ="" , to_date="" delete; run; data _null_; set yourevents; name ...

Data matching with jquery -

i have values find , match on data table. http://jsfiddle.net/hhkd4ygu/ can see, there 3 values , if groups of 3 values present altogether on given row of data table, next row (present) should highlighted; green present, red color not present. note: 3 values should present on row , values may not in adjacent cells. i've been trying solve problem on excel , did of code obtained vba forum here. realized running vba code large data set extremely slow , freezing computer. so created simple table exemplify i've been working on. .table.table { border: 1px solid #ccc; font-family: arial, helvetica, sans-serif; font-size: 12px; text-align: center; } .table td { padding: 4px; margin: 3px; border: 1px solid #ccc; width: 40px; } .table th { background-color: #e99d79; color: #fff; font-weight: bold; } .yes { background: green; } .no { background: red; } <table class="table"> <tr class="firstrow"...

javascript - Not clear about Usage of change() function as described in the example - Jquery -

i read example here change() event, didn't quite follow double use of change() here. docs says explains "attaches change event select gets text each selected option , writes them in div. triggers event initial text draw." please elaborate last line!! <html lang="en"> <head> <meta charset="utf-8"> <title>change demo</title> <style> div { color: red; } </style> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> </head> <body> <select name="sweets" multiple="multiple"> <option>chocolate</option> <option selected="selected">candy</option> <option>taffy</option> <option selected="selected">caramel</option> ...

android - App Crashes On Startup Due To java.lang.IllegalArgumentException: column '_id' does not exist -

whenever start app, java.lang.illegalargumentexception: column '_id' not exist error in logcat. have created column '_id' , still throws this. here main .java: package com.gantt.shoppinglist; import android.app.dialog; import android.app.listactivity; import android.database.cursor; import android.os.bundle; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.edittext; import android.widget.listview; import android.widget.simplecursoradapter; public class shoppinglist extends listactivity { private datahelper datahelper; /** called when activity first created. */ @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); datahelper = new datahelper(this); cursor c = (cursor) datahelper.selectall(); long id = c.getlong(c.getcolumnindex("_id")); startm...

python - Adjust field size in Flask-Admin w/ Bootstrap3 -

this similar this solution seems bootstrap2 , has no affect on code. would know how customize field width in flask-admin? know has form_widget_args haven't figured out right combination yet. thanks! edit: i able solve of problem adding following in view: form_widget_args = { asset_tag:{'class': 'form-control', 'style': "width: 40%", 'placeholder':'ex. m132 or t456' } this uses css override bootstrap formatting. hoping able use bootstrap grid formatting (i.e. .col-md-8 )

php - update from select incremental mysql -

i've been trying find solution , found several similar posts none of them answer question. i have badly designed table stores sorting index. programatically update index people sort data. problem indexes 1, 2, 2, 3, 6, 6, 7, 8, 8, etc i'm tasked fixing problem. fixed code doesnt happen anymore how update db? have table: +---------+-------+---------+ | otherid | index | product | | 3423 | 1 | zbhdfji | | 63453 | 3 | fgdfgr | | 75454 | 3 | drhfef | +---------+-------+---------+ i need like: +---------+-------+---------+ | otherid | index | product | | 3423 | 1 | zbhdfji | | 63453 | 2 | fgdfgr | | 75454 | 3 | drhfef | +---------+-------+---------+ i tried like: update table set index = @rownum otherid in (select other_id table index <= 200 order index asc ); but not liking i'm pulling same table , i'm not sure if work. ideas? set @row_num := 0; update `table` set index = @row_num := @row_num + 1 order...

php - MySQL: Android real device not able to connect mysly in PC. Emmulator is able to connect -

i trying write data on mysql on laplop. below code works on emulator code not work on real device. have wifi , have connected android device through usp testing purpose. please help. @override protected string doinbackground(string... params) { string reg_url = "http://192.168.0.101/kiranapp/register.php"; string method = params[0]; if(method.equals("register")) { string name = params[1]; string username = params[2]; string userpass = params[3]; try { url url = new url(reg_url); httpurlconnection httpurlconnection = (httpurlconnection) url.openconnection(); httpurlconnection.setrequestmethod("post"); httpurlconnection.setdooutput(true); outputstream os = httpurlconnection.getoutputstream(); bufferedwriter bufferedwriter = new bufferedwriter(new outputstreamwriter(os,"utf-8")); string data = urlencoder.encode(...

asp.net mvc 4 - MVC Validations not working when deployed on IIS -

i have deployed mvc project on iis not single validation working there while validations working fine @ localhost.it shows error .live() not method, googled , replaced .live() .on() error not showing validations still not working @ all. please guide me tackle issue. following sample view code <li> @html.labelfor(m => m.accountname) @*@html.dropdownlistfor(x => x.accountid, (viewbag.accountslist) ienumerable<selectlistitem>, new { @class = "", @style = "width:312px; height:31px;" })*@ @html.dropdownlistfor(m => m.accountid, (viewbag.accountslist) ienumerable<selectlistitem>, new { @id = "accountname", @class = "chosen-select", @style = "width:312px; height:31px; float: right;" }) @html.validationmessagefor(m => m.accountid) </li> <li> @html.labelfor(m => m.contactname...

Searching through array integer column with rails -

in app have table users have following column: t.integer "administrations", array: true and have code looks this: user.where("administrations::int[] = array[#{administration_ids.join(',') }]::int[]") but vulnerable sql injection. trying rewrite that: user.where("administrations::int[] = ?", "array[#{administration_ids.join(',') }]::int[]") but not works... it returns: pg::invalidtextrepresentation: error: array value must start "{" or dimension information would user.where("administrations::int[] = array[?]::int[]", administration_ids.join(',')) work?

is it possible to use WHERE criteria stored in a table to make updates in another table in MS Access -

i figure it'll easier explain example. have 2 tables so. +----+--------------------------------+---------+ | table 1 | +----+--------------------------------+---------+ | id | criteria | value | +----+--------------------------------+---------+ | 1 | [table 2].[name] "dingo*" | alpha | | 2 | [table 2].[location] = "here" | bravo | | 3 | [table 2].[active] = true | charlie | +----+--------------------------------+---------+ +----+-------------+----------+--------+-------+ | table 2 | +----+-------------+----------+--------+-------+ | id | name | location | active | value | +----+-------------+----------+--------+-------+ | 1 | dingo bingo | there | false | | | 2 | bob | here | false | | | 3 | bingo | there | true | | | 4 | bingo bob | here | false | | +----+-------------+------...

opengl - GLSL Render to Texture not working -

i'm trying compute pass render texture used in draw pass later on. initial implementation based on shader storage buffer objects , working nicely. want apply computation method going take advantage of blend hardware of gpu started porting ssbo implementation rtt one. unfortunately code has stopped working. when read texture getting wrong values. here texture , frame buffer setup code: glgenframebuffers(1, &m_fbo); glbindframebuffer(gl_framebuffer, m_fbo); // create render textures glgentextures(num_tex_outputs, m_rendertexs); m_texsize = square_approximation(m_numvertices); cout << "textures size: " << glm::to_string(m_texsize) << endl; glenum drawbuffers[num_tex_outputs]; (int = 0 ; < num_tex_outputs; ++i) { glbindtexture(gl_texture_2d, m_rendertexs[i]); // 1st 0: level, 2nd 0: no border, 3rd 0: no initial data glteximage2d(gl_texture_2d, 0, gl_rgba, m_texsize.x, m_texsize.y, 0, gl_rgba, gl_float, 0); // xxx: need this? ...

xmpp - How to join multiple rooms by just sending one <presence> message to ejabberd server -

for example, have 20 rooms join. simple solution send 20 message each room id. considering performance, bad. i want join 20 rooms sending 1 <presence> message, how achieve this? writing module hook custom <presence> message? not know how write kind of module. in xep-0045 multi user chat , there no way defined join 20 chat rooms single presence packet. however, combining other xmpp extension multi user chat, can achieve in pure xmpp, without need write custom ejabberd extensions. you can rely on xep-0033 extended stanza addressing , can send xmpp packet several recipient. works presence shown in example . ejabberd configuration xep-0033 extending stanza addressing supported default since ejabberd 15.04 . make sure have enable feature adding mod_multicast in ejabberd configuration modules section: modules: ... mod_multicast: {} when service enabled, should have new service (as default named multicast.example.net ) on server supporting feature h...

javascript - Using selected for Dynamic options in Angularjs -

i having dynamic list of data showing dropdownlist. want 1 selected when user enters page. <div class="row"> <div class="col"> <select ng-model="item1" style="width:100%;text-align:center;"> <option style="text-indent:30%" ng-repeat="item1 in ideamonthlist" value="{{item1}}" >{{item1}}</option> </select> </div> </div> this how making dropdown list. var ideamonth=["1","2","3","4","5","6","7","8","9","10","11","12"] $scope.ideamonthlist=ideamonth; this array of months.by deafult when user enters page current month should selected in dropdownlist. using can choose option static option. how dynamic options use ngoptions in angularjs. the ngoptions attribute can ...

python - Django REST: serializer field that isn't a model field -

i have 2 models (and matching serializers): class book(models.model): created = models.datetimefield(auto_now_add=true) owner = models.foreignkey(myuser) title = models.charfield(max_length=100, blank=true, default='') author = models.charfield(max_length=100, blank=true, default='') class readby(models.model): created = models.datetimefield(auto_now_add=true) owner = models.foreignkey(myuser) when book has been read it's stored in readby database. when user retrieves books using book model/serializer want field telling me if particular user has read book. i.e. add field model book (pseudo-code): has_been_read_by = if_exists_in_readby display 'true' else 'false' so need check if record exists in readby database , display true or false if so. thanks. the take away in serializer method of book model, have access context provides context['request'].user , obj represents book object i assume read...

android - Genymotion error after windows 10 upgrade -

genymotion giving me error after windows 10 upgrade: unable load virtual box engine how fix this? i solved issue. it's working fine now. i'm using: + window 10 + virtualbox-5.0.2-102096-win + genymotion-2.5.3 step 1 : should set run program administrator & compatibility mode window 7 file. c:\program files\oracle\virtualbox + vboxheadless.exe + vboxmanage.exe + virtualbox.exe c:\program files\genymobile\genymotion + genymotion.exe step 2 : computer -> manage-> device manager-> network adapters remove items name: virtualbox host-only ethenet adapter #... step 3 : open virtual box , go file -> preferences -> network -> host networks remove , create new host information: adapter tab: ipv4 address: 192.168.1.201 ipv4 network mask: 255.255.255.0 dhcp server tab: server address: 192.168.1.100 server mask: 255.255.255.0 lower address bound: 192.168.1.101 upper a...

android - How to add OnItemSelectedListener for one Spinner in multiple Fragments -

in actionbaractivity use viewpager different fragment s. use spinner in supportactionbar populate fragments in viewpager . if write code in 1 fragment application works intended. if add same method in second fragment well, onitemselectedlistener first fragment not called more. @override public void onactivitycreated(@nullable bundle savedinstancestate) { super.onactivitycreated(savedinstancestate); spinner spinner = (spinner) ((actionbaractivity) getactivity()).getsupportactionbar().getcustomview().findviewbyid(r.id.actionbar_spinner_names); spinner.setonitemselectedlistener(new adapterview.onitemselectedlistener() { @override public void onitemselected(adapterview<?> parent, view view, int position, long id) { oncontentchanged(position); } is possible share setonitemselectedlistener of menuitem amonst different fragment s? or there better way share selection of actionbarspinner amongst fragment s of application?...

c# - Disposing my System.IDisposable object in my finalizer -

there several discussions here on stackoverflow if object manages other managed objects implement system.idisposable . note: below not talking unmanaged code. understand importance of cleaning unmanaged code most of discussions if object owns managed object implements system.idisposable , should implement system.idisposable , in case should call dispose() of disposable objects object holds. logical, because don't know whether disposable object own uses unmanaged code. know creator of other object thought wise if you'd call dispose don't need object anymore. a explanation of disposable pattern given here on stackoverflow, edited community wiki: proper use of idisposable interface quite often, , in mentioned link read: "you don't know order in 2 objects destroyed. entirely possible in dispose() code, managed object you're trying rid of no longer there." this baffles me, because thought long object holds reference object x, object x...

machine learning - Encog Neural Network - How to actually run testing data -

i've been able train network, , gotten trained down minimal error want... i don't see anywhere, when looked through guide book, how test trained network on new data... split part of training data apart can test network's results on untrained data since i'm using classification. here code i've got, not sure mldata output. classification, want take output neuron highest value... aka, correct classification node. mldataset testingset = new basicmldataset(testingtraining, testingideal); system.out.println("test results:"); for(mldatapair pair: testingset ) { final mldata output = network.compute(pair.getinput()); //what do output? } (my testing data tagged correct classifications...) well depends on problem have @ hand, idea output should close possible test dataset output, suggest comparing that. example, if classification task, output iterable , should able work out selected output class , compare target. ca...

node.js - &nbsp in jade files shows warnings in node server -

i have many &nbsp; s' in jade file , shows warnings when run node server : warning: missing space before text line 210 of jade file "c:\users\xx\documents\github\xxx\xx\registerpage.jade" this warnings shows wherever there &nbsp; , don't want because logs file generated server filled these warnings. try , replace &nbsp; | (pipeline followed space)

java - need to add only parent class objects in the list and restrict the sub class objects -

i need declare list should accept parent class objects , should not allow sub class objects. parent class: public class parentclass { private string parentattr; public string getparentattr() { return parentattr; } public void setparentattr(string parentattr) { this.parentattr = parentattr; } } sub class: public class subclass1 extends parentclass { private string attr1; public string getattr1() { return attr1; } public void setattr1(string attr1) { this.attr1 = attr1; } } main class: public class mainclass { public static void main(string[] args) { parentclass parentclass=new parentclass(); subclass1 subclass1 = new subclass1(); list<parentclass> list=new arraylist<parentclass>(); // modify declaration such should accept parent class objs list.add(parentclass); list.add(subclass1); // should not happen. parent class objects should added in list } } i tried using generics well. not worki...

android - Gradle build fails with duplicates when adding google-api-client -

i adding code project requires google-api-client, when add via gradle dependency, duplicate error. here gradle dependency list dependencies { compile 'com.adobe.creativesdk:image:4.0.0' // compile project(':showcaseview') compile project(':facebook') compile project(':swipemenulistview') compile 'com.android.support:multidex:1.0.0' compile 'com.android.support:design:22.2.0' compile 'com.google.code.gson:gson:2.3.1' compile 'com.google.android.gms:play-services:7.5.+' compile 'com.google.android.gms:play-services-appinvite:7.5.0' compile 'org.apache.httpcomponents:httpmime:4.3.6' compile 'org.apache.httpcomponents:httpcore:4.3.3' compile 'commons-codec:commons-codec:1.9' compile 'commons-io:commons-io:2.4' compile 'com.google.gdata:core:1.47.1' compile files('libs/tape-1.1.0.jar') compile files(...

ios - Activity indicator acting slow inside PHPhotoLibrary.sharedPhotoLibrary().performChanges -

i'm deleting photo assets , want show activity indicator while assets being deleted , stop when assets have been deleted code acting slow, know wrong? phphotolibrary.sharedphotolibrary().performchanges({ phassetchangerequest.deleteassets(enumeration) self.activityindicator.startanimating() uiapplication.sharedapplication().beginignoringinteractionevents() }, completionhandler: {success, error in if success { self.activityindicator.stopanimating() uiapplication.sharedapplication().endignoringinteractionevents() println("success") } else { self.activityindicator.stopanimating() uiapplication.sharedapplication().endignoringinteractionevents() println("error") } }) i solved myself, here's answer: phphotolibrary.sharedphotolib...

c# - Does base class gets instantiated for every new instance? -

i have been thinking how clr creates new instances. consider code: public class base { public base() { } } public class derived : base { public derived() : base() { } } these questions: does system.object instance created every time line of code, var baseobj = new base(); ? how many instances there in memory? 2 or 1? for line of code: var derobj = new derived(); . how many instances created? 3 or 2? in both samples, there 1 object. there 1 piece of memory allocated , base class 'merges' parents. there 1 class containing methods, fields , properties derived base classes, including base-class-of-all. object . what think happen if var derivedobj = new derived(); creates 2 instances? how refer 1 not assigned baseobj ? there no use in keeping 2 instances of classes alive. 1 do.

html - Adding a favicon - not working -

i try add favicon site. upload favicon directory index , add line header site: <link rel="icon" href="http://example.com/favicon.ico"> maybe chache? me please :) edit: dont see request favicon :o http://i.stack.imgur.com/1det3.png any-asnwer not working.. maybe need clear chache? edit: working now, all! your favicon may wrong bit depth and/or size. save favicon 8bit (jpg 8-bit, png better , can save web 8-bit, doesn't need .ico) image , make sure clear cache. on upload, should show in browsers. save ideally 16x16 pixels

c# - How to pass Configuration to non-controller classes in ASP.NET MVC6 -

i developing application using mvc6. can read json configuration in startup file , dependency inject in controllers. now, requirements want access configuration inside classes not controllers. can't use constructor di in such cases. these classes reside in folder of mvc6 application not model or controller classes. what's best way access configuration in such non-controller classes? thank you. update: just clarify - can't use di these classes. these classes instantiated when needed based on condition , methods called on them. need access json config settings within these classes/methods. so, far know these ways: make configuration property startup static can startup.configuration["..."] . set static properties of custom class startup after reading json config , access static properties. are these alternative (other di of course)? there other ways? what create register service method one: public static void addmytools(this iservic...

java - Building OpenJDK 8 on Tilera Tile-GX -

i trying build openjdk 8 on tilera tile-gx36. downloaded jdk from [ http://openjdk.java.net/][1] followed procedure linux, ran ./configure gives out error configure: error: unsupported cpu tile configure exiting result code 1 kernel , architecture of tile-gx: linux localhost 3.10.42-mde-4.3.0.178115 #1 smp tue jun 16 20:46:32 pdt 2015 tilegx tilegx tilegx gnu/linux is there specific procedure build java jdk on unknown architectures? 1 more thing noted tile-gx has no internet connectivity packages need uploaded connected pc , configured , installed locally on tile-gx. thank you.

java - Why won't gc.clearRect clear the canvas? -

i have code in mazeui class creates couple of fields in javafx entering height , width of maze generated along button , event button. on clicking generate maze code should generate random maze. now works fine. line clear canvas after maze first drawn using gc.clearrect(x, y, z, a) doesn't appear work , maze's re-drawn on top of 1 on subsequent clicks: package dojo.maze.ui; import dojo.maze.generator.mazegenerator; import javafx.application.application; import javafx.event.actionevent; import javafx.event.eventhandler; import javafx.geometry.insets; import javafx.scene.group; import javafx.scene.scene; import javafx.scene.canvas.canvas; import javafx.scene.canvas.graphicscontext; import javafx.scene.control.button; import javafx.scene.control.label; import javafx.scene.control.textfield; import javafx.scene.effect.boxblur; import javafx.scene.layout.gridpane; import javafx.scene.layout.hbox; import javafx.scene.layout.vbox; import javafx.scene.paint.color; import javafx...

javascript - PHP calendar periods (weekly) -

Image
i doing calendar , i'm stacked on week period of event. can't that, works, next month , others months not. $i = 1; $den = $post->day; $mesic = $array['month']; $rok = $array['year']; $minusdays = $this->numdays(date('l', $den.".".$mesi.".".$rok)); $startedweek = date('w', strtotime($den.".".$post->month.".".$post->year)); $actualweek = date('w', time()); $startedweek = $actualweek - $startedweek; for($i; $i<6; $i++){ if($i==1){ $startedweek = $startedweek; }else{ $startedweek = $startedweek+1; } $plusday = date('j', strtotime($den.".".$mesic.".".$rok." + ".$startedweek." weeks - ".$minusdays." days")); $plusweek = date(...

hadoop - IllegalArgumentException The bucketName parameter must be specified. com.amazonaws.services.s3.AmazonS3Client.rejectNull -

running clojure jar on aws-emr cluster using (hfs-textline) , getting: illegalargumentexception bucketname parameter must specified. com.amazonaws.services.s3.amazons3client.rejectnull`. after many different tries solution in case 'aws_access_key' , 'aws_secret_key' values wrong.

Output a "tab" in PowerShell -

a simple syntax question in powershell. i've variable $content provides this: id name when ip msg user_id 50 felix 2015-07-22 12:51:04 10.1.100.6 "ein link":www.link.de 89 i process this: $content -replace '^(.+?)\t"(.+?)"(.+?)$', '$1`t"""$2"$3' i this: id name when ip msg user_id 50 felix 2015-07-22 12:51:04 10.1.100.6`t"""ein link":www.link.de 89 but should this: id name when ip msg user_id 50 felix 2015-07-22 12:51:04 10.1.100.6 """ein link":www.link.de 89 i tried \t , ``t nothing gives real tab back. can me? this because you're using literal quotes '..' backtick won't treated escape character. instead, use "..." , escape additional " characters backtick: $content -replace '^(.+?)\t"(.+?)"(.+?)$', "`$1`t`"`"`"`$2`"`$3" however, may ...

yii2 - How to choose from elasticsearch element that exactly matches the value of the array? -

suppose model has list of fields, , 1 of them - id list related fields: { 'name': 'bla-bla', 'field1': 'value1', 'array': [ 1, 2, 3, 4 ] } necessary select records values coincide array transmits set of id, i.e. if give 1, 2, 3 , or vice versa 1, 2, 3, 4, 5 , row not find, if pass 3, 2, 4, 1 (i.e. order not address), row should found. you can following using script : { "query": { "match_all": {} }, "filter": { "script": { "script": "_source.array == [1, 2, 3, 4]" } } }

html - Repeated clicks on iframe don't register as clicks -

i'm using following code in order check when user clicks (cross-domain) iframe: var myconfobj = { iframemouseover : false } window.addeventlistener('blur',function(){ if(myconfobj.iframemouseover){ console.log('wow! iframe click!'); } }); document.getelementbyid('your_container_id').addeventlistener('mouseover',function(){ myconfobj.iframemouseover = true; }); document.getelementbyid('your_container_id').addeventlistener('mouseout',function(){ myconfobj.iframemouseover = false; }); i'm using check if user clicked google ad, , works fine first time click it. second click on banner doesn't registered (unless refresh page again). what i've noticed, though, if click anywhere outside iframe after first click, , click banner again, click gets registered. what tried use 'window.focus();' on mouseover, doesn't fix it. can me?

java - Why the event AbstractAuthenticationFailureEvent is never triggered in spring security? -

i use spring 4.0.2.release spring security 3.2.5.release, use because when started project spring security 4.0.0 in snapshot. have tried spring 4.2.0.release , spring security 4.0.2.release event abstractauthenticationfailureevent never triggered. this application listener : @component public class authenticationeventlistener implements applicationlistener<abstractauthenticationevent> { /** * */ private static final logger log = loggerfactory.getlogger(cwiconstant.logger_authentication); /** * * constructeur. */ public authenticationeventlistener() { } @override public void onapplicationevent(abstractauthenticationevent authenticationevent) { if (authenticationevent instanceof interactiveauthenticationsuccessevent || authenticationevent instanceof authenticationsuccessevent) { log.info("authentication success."); } else if (authenticationevent instanceof abstractauthentication...

xml - C#: Change default tripple slash (///) tags -

is possible change editor's behavior of tags displayed default when using typing ///? for example, editor add tag <author> , remove tag of <return type> . so instead of: /// <summary> /// summary /// </summary> /// <param name="name">my param description </param> i like: /// <summary> summary </summary> it has been suggested this post duplicate, answer given there vb. comments (in 2013) seems not availalbe in 2013. know if still case vs 2015?

JSTL c:if doesn't work inside a JSF h:dataTable -

i'm trying use <c:if> conditionally put <h:outputlink> inside <h:datatable> when state finished. <h:datatable value="#{bean.items}" var="item" width="80%"> <h:column> <f:facet name="header"> <h:outputtext value="state" /> </f:facet> <c:if test="#{item.state != 'finish'}"> <h:outputtext value="missing value" /> </c:if> <c:if test="#{item.state == 'finish'}"> <h:outputlink value="mylink"> <h:outputtext value="value = #{item.state}" /> </h:outputlink> </c:if> </h:column> </h:datatable> but not work, why , how can fix it? jstl tags evaluated during building of view, not during rendering of view. can visualize follows: whenever ...

ios - Adding Cells to existing UICollectionView (mutating method sent to immutable object) -

i trying find way add cells collection , keeps giving me "mutating method sent immutable object" error. not know why. posted below code working with. self.artistarray = [responseobject objectforkey:@"data"]; self.paginationarray = [responseobject objectforkey:@"pagination"]; //nslog(@"%@", self.paginationarray); if(self.firstrequest){ [self.collectionview reloaddata]; self.firstrequest = false; } else{ nsarray *newdata = [[nsarray alloc] initwithobjects:@"otherdata", nil]; [self.collectionview performbatchupdates:^{ int resultssize = [self.artistarray count]; //data previous array of data [self.artistarray addobjectsfromarray:newdata]; nsmutablearray *arraywithindexpaths = [nsmutablearray array]; (int = resultssize; < resultssize + newdata.count; i++) { [arraywithindexpaths addobject:[nsindexpath indexpathf...

WPF: How do I get X Y position of last character within a TextBox? -

i want have x, y position of last character in textbox. found getcharacterindexfrompoint method reverse approach. => here however, couldn't find appropriate approach getting actual position of last character within textbox. does know how can such information?

swift - JSON request with accents/latin characters -

i'm making request url. one of teams has latin character Ñ appears making json nil , result no data displayed in table exporting data. i've done research , believe need encode nsisolatin1stringencoding. i using swiftyjson parse json. let cuartourl = nsurl(string: cuartourlstring) //initializes request let request = nsurlrequest(url: cuartourl!) nsurlconnection.sendasynchronousrequest(request, queue: nsoperationqueue.currentqueue()) { response, jsondatarequest4, error in if jsondatarequest4 != nil { let datarequest4 = jsondatarequest4 //println(nsstring(data:datarequest4, encoding: nsutf8stringencoding)) //takes data, saves json let cuartojson = json(data: jsondatarequest4) //checks see contents != nil, meaning json file found if cuartojson != nil { equiposlist.removeall(keepcapacity: false) //counts number of teams numerodeequipos = cuartojson["lista-equip...