Posts

Showing posts from August, 2012

jenkins - Automatically remove Sonarqube branch projects when git branch merged / removed -

we have jenkins pipeline using multibranch workflow plugin . each git branch execute sonarqube analysis creating sonarqube project using sonar.branch property. useful because each branch being analyzed before merge it, problem appear when branch merged master , disappear on git, project continues on sonarqube , need deleted manually. there way automatically? or other recomendation? the best way remove sonarqube branch projects not push them server in first place. here options: use sonarlint spot issues directly in ide if you're using github, use github plugin if you're using bitbucket, use this plugin or this one at sonarsource, use sonarlint , github plugin on daily basis. 1 last solution delete manually project using api/projects/delete web service.

android - Search nearby places using AutoCompleteTextView -

i want show list of nearby places using autocompletetextview https://www.google.co.in/maps/@12.9539974,77.6309395,11z?hl=en , want show icon of places facebook checkin, when search word atm shows nearby atm in list , icon, possible implement in app? if yes how? can me? my code below: findplaces.java public class findplaces extends appcompatactivity implements locationlistener, googleapiclient.onconnectionfailedlistener { private googleapiclient mgoogleapiclient; private static final latlngbounds bounds_greater_sydeny = new latlngbounds( new latlng(23.0396, 72.566), new latlng(23.0396, 72.566));//23.0396,72.566 private autocompletetextview mautocompleteview; private activity mactivity; private imageview imgsearchclear; private string searchaddress = ""; private placeautocompleteadapter madapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate);

mongodb - mongo query - return the values of field 1 where value of field 2 is x -

i want return name values document id = 10 below data: { "_id" : objectid("1"), "document id" : 10, "name" : "peter", date" : "01/1/2016" } { "_id" : objectid("2"), "document id" : 10, "name" : "mary", date" : "02/1/2016" } { "_id" : objectid("3"), "document id" : 10, "name" : "kate", date" : "03/1/2016" } { "_id" : objectid("3"), "document id" : 20, "name" : "bob", date" : "03/1/2016" } { "_id" : objectid("3"), "document id" : 20, "name" : "sam", date" : "03/1/2016" } { "_id" : objectid("3"), "document id" : 30, "name" : "jenny", date" : "03/1/2016" } here query tried run: db.collection.fi

Combinations by group in R -

i have question combinations group. my mini-sample looks this: sample <- data.frame( group=c("a","a","a","a","b","b","b"), number=c(1,2,3,2,4,5,3) ) if apply function of combn to data frame,it gives me following result, combinations of values under 'number' column regardless of group value belongs to: [,1] [,2] [1,] 1 2 [2,] 1 3 [3,] 1 2 [4,] 1 4 [5,] 1 5 [6,] 1 3 [7,] 2 3 [8,] 2 2 [9,] 2 4 [10,] 2 5 [11,] 2 3 [12,] 3 2 [13,] 3 4 [14,] 3 5 [15,] 3 3 [16,] 2 4 [17,] 2 5 [18,] 2 3 [19,] 4 5 [20,] 4 3 [21,] 5 3 the code used results above follows: t(combn((sample$number), 2)) however, combination results within group (i.e., "a", "b"). therefore, result want should this: [,1] [,2

node.js - MongoDb: How to merge contents of two documents in mongoDB? -

i allow user skip login or login using fb. when user logs in create user in user collection using fb profile id , when skips still create user using unique client id. in client app, user can bookmark articles , sync server. user can login using fb @ time later. once user logs in using fb have merge user created using fb , user created using client id stored data maps perfectly. what have tried: consider user skipped login , create user in user collection. user logs in using fb in between life time of app , search fb id in collection. if id not exist update skipped user document fb id. if exist merge data fb user document skipped user document , delete fb user document. another method: i don't sync bookmark server until user logs in. once logs in sync data @ once. what efficient way of doing kind of operation? if understand correctly, need find document same clientid , , add facebook user document. you can mongo update command, using $set merges new docume

Reading data from multiple data source type solution -

i have data in different data souses sql server, oracle , web service. want access them new application. there data connector can me doing without writing code creating/changing data structure? project in visual studio (c#) can write different adapters myself have write methods each entity , keep them date if there change. i've looked @ kafka (confluent platform) seems suitable streaming. there data connectors written telerik has limitations cannot use compound primary keys. i appreciate suggestions i've searched lot , did not find solution answer needs. there data connectors teleriks data connector can use use adapter sql data base, etc. in all, think makes sense write own adapters of times. collecting data, recommend use message broker in between since connecting external systems

java - Oauth2 / Password flow / check permission for a specific entity -

Image
the main data information , information in api linked project(entity), approach password flow: manage specific permission linked project with spring security , oauth2? in application have 5 micro service : uaa microservice : authorization server catalog microservice order microservice invoice microservice customer microservice zoom permission : each user can have many project, , can have permission each project: can_manage_catalog can_view_catalog can_manage_order can_view_order can_manage_invoice can_view_invoice ... i have many idea not sure if have approach : use case : want securise endpoint : http://catalog-service/{project_key}/catalogs only user have permission view_catalog or manage_catalog project {project_key} can list catalog present in project my first idea : use projectaccessexpression preauthorize catalogcontroller.java @controller public class catalogcontroller { @preauthorize("@projectaccessexpression.haspermission(

jquery - Populated Selectbox option hide not working in IE & Safari -

i have populated selectbox. default when page has loaded options in selectbox should hide. tried hide css, output not working in ie & safari. alternately used jquery not working in ie & safari. can please help css way select#curriculumid option { display: none; } jquery way jquery('#curriculumid option').css("display","none"); jquery('#curriculumid option').hide(); my html looks like <select data-placeholder="program of interest" data-placeholder-alternate="program of interest" data-validate="required" id="curriculumid" name="curriculumid" title="program"></select> selectbox option populated backend

C# Moving Transparent PictureBox -

Image
i'm tryin make picbox2 color transparent when picbox1 pass on picbox2. code namespace gioco { public partial class form1 : form { image img; image tmpsx; image tmpdx; image tmpup; image tmpdw; public form1() { initializecomponent(); panel1.controls.add(picturebox1); picturebox1.parent = panel1; img = picturebox1.image; tmpsx = (image)img.clone(); tmpsx.rotateflip(rotatefliptype.rotatenoneflipx); tmpdx = (image)img.clone(); tmpdw = (image)img.clone(); tmpdw.rotateflip(rotatefliptype.rotate90flipnone); tmpup = (image)img.clone(); tmpup.rotateflip(rotatefliptype.rotate270flipnone); } private void form1_keydown(object sender, keyeventargs e) { if (e.keycode == keys.d) { picturebox1.image = tmpdx; picturebox1.location = new point(picturebox1.location.x + 3, picturebox1.location.y); picturebox1.sendtob

python - raise ValueError(item) when trying to display table in SparkSQL -

i have following code using pyspark , sparksql trying create dataframe, save table , show table: schema = structtype([structfield("int_field", integertype()), structfield("string_field", stringtype())]) dfrow = sqlcontext.createdataframe(simulation, schema) dfrow.registertemptable("myrow") sqlcontext.table("myrow").show() however, when try display error: <ipython-input-18-9105248af2c0> in runsimulationjob(job) 15 dfrow = sqlcontext.createdataframe(simulation, schema) 16 dfrow.registertemptable("myrow") ---> 17 sqlcontext.table("myrow").show() 18 19 /databricks/spark/python/pyspark/sql/dataframe.py in show(self, n, truncate) 255 +---+-----+ 256 """ --> 257 print(self._jdf.showstring(n, truncate)) 258 259 def __repr__(self): /databricks/spark/python/lib/py4j-0.9-src.zip/py4j/java_gateway.p

php - custom wordpress post type hierarchical alternative -

Image
i have inherited wordpress project uses custom post type 'project' $args = array( 'public' => true, 'hierarchical' => true, 'labels' => array( 'name' => __( 'projekte' ), 'singular_name' => __( 'projekt' ), 'add_new' => __( 'neues projekt erstellen' ), 'add_new_item' => __( 'neues projekt erstellen' ), 'edit' => __( 'bearbeiten' ), 'edit_item' => __( 'projekt bearbeiten' ), 'new_item' => __( 'neues projekt anlegen' ), 'view' => __( 'projekt anzeigen' ), 'view_item' => __( 'projekt anzeigen' ), 'search_items' => __( 'projekt suchen' ), 'not_found' => __( 'kein projekt gefunden' ), 'not_found_in_trash' => __( 'kein

single sign on - Android pass credentials to other app -

currently searching possible ways of passing credentials other application without specifying uri. let me describe flow: user opens application , login view displayed user enters his/her credentials form (e.g. email / password) my application finds desired app (lets assume facebook), finds com.facebook.katana package , prepares intent it. here comes answer question: how pass credentials? or put credentials intent specific intent action facebook app opened , users credentials passed facebook login form , user authenticated. please, not provide answers related sdk usages (e.g. "use facebook sdk authenticate facebook). need generic solution authenticating applications selected user provided credentials user. let me know if possible , how achieve without changes on partners app handle specific uri. thanks!

Batch File creation - Change extension, remove line -

i have files in directory c:\dir a\folder files have extension abc , xml files line @ top. line reads "abc0.0.01" using batch file process want to 1) copy files directory c:\dir b\folder b 2) remove text "abc0.0.01" top of copied files 3) change file extension on copied/edited files .abc .xml is can done? @echo off cd "c:\dir a\folder a" %%a in (*) ( more +1 "%%~a" > "c:\dir b\folder b\%%~na.xml" ) see for /? , more /? details.

ios - How can I receive update status(data) when I request ride with UBSDKRideRequestViewController (Uber SDK) -

i have added uber sdk in application. didn't request project request full access . it's on development. , have issues can't find answer (i'm using sandbox mode.) q. need test. if requested , driver accepted. how can know time arrive or other status e.g. arrived . , how can send notification user in application when driver arrived. see ubsdkriderequestviewcontrollerdelegate response error case. this's code. ubsdkrideparametersbuilder *builder = [[ubsdkrideparametersbuilder alloc] init]; [builder setpickuptocurrentlocation]; [builder setdropofflocation:dropofflocation]; ubsdkrideparameters *parameters = [builder build]; nsarray<ubsdkridesscope *> *scopes = @[ubsdkridesscope.ridewidgets,ubsdkridesscope.profile,ubsdkridesscope.request]; ubsdkloginmanager *loginmanager = [[ubsdkloginmanager alloc] init]; ubsdkriderequestviewcontroller *vc = [[ubsdkriderequestviewcontroller alloc] initwithrideparameters:parameters loginmanager:loginmanager]; vc.title

python - What is the difference between 0:: and 0: when filtering a numpy array? -

this question has answer here: python: single colon vs double colon 5 answers i trying follow kaggle titanic tutorial solving problem using python , numpy. having difficulties understanding difference between data[0::, ] , data[0:, ]. copy paste relevant code snippet below: for in xrange(number_of_classes): #loop through each class j in xrange(number_of_price_brackets): #loop through each price bin women_only_stats = data[ # element (data[0::, 4] == "female") & # female , (data[0::, 2].astype(np.float) # ith class == i+1) & # , (data[0:, 9].astype(np.float) # greater

loops - Simple arithmetic average in Python -

i'm total newbie on python , calculate arithmetic average. a = [int(i) in input().split()] average=sum(a)/len(a) print('the average is:' ,average) i'm aware such code solve problems not i'm looking for. i want user able type number of terms of arithmetic average , him able of typing them separatley on different lines. thought right thing use loop. came out this: n = input('number of terms') in range (1,int(n)+1): a=input('term number '+str(int(i))+': ') i know need know find way sum values of typed on each loop , divide number int(n) have no idea how that. can guys me that? thanks everyone! n = input('number of terms') acc = 0 in range(1,int(n)+1): a=input('term number '+str(int(i))+': ') acc += float(a) print('the average ',acc/int(n)) the idea create accumulator variable acc entered numbers added. after loop acc equal sum of numbers entered. divide number of ter

docusignapi - DocuSign Envelope Custom Fields -

i looking @ automatically sending document signing using api , using http listener docusign connect receiving status of document. in envelope, need parse in information (eg. unique identifier applications use) need retrieve in xml message docusign connect. i looking @ using envelope custom field purpose, advisable? i agree envelope custom fields meet requirement. 1 thing keep in mind docusign supports document level custom fields, per recipient level custom fields.

ios - Am I using AutoLayout correctly? (Screenshots inside) -

Image
so i'm designing layout app , have difficulties adjusting layout iphone 4. example @ these screenshots: as can see barely fits on iphone 4 , iphone 6 has blank space on bottom. using auto layout incorrect or intended behaviour? i struggled not being able make text fields smaller fit iphone 4 screen in layout. help appreciated! if embed views in uiscrollview (with autolayout set), content visible(scrollable) if use size classes , can set specific ux iphone4

javascript - Jquery - having to add surplus [0] to Jquery objects -

i've come across problem several times, , @ first tried ignore it. have select element: html: <div class="col-sm-10"> <select class="form-control input-sm" id="my_select" name="contracting_party_legal_entity"> </select> </div> now want, say, populate select programmatically options. looks should use $('#my_select').appendchild($option) achieve this, no! unless write $('#my_select')[0].appendchild($option) , error appendchild not function . why reason necessity use surplus [0] ? smth wrong syntax ? $ jquery function. returns array of matching elements. therefore select particular element need choose index of array. you may use $('#my_select').get(0).appendchild($option) , appendchild vanilla javascript function works on element not on jquery object. try jquery append function. example of jquery append function: $("#test").append("<opt

Android support repository path for manual copy -

due internet speed problems, android studio had problem downloading file https://dl.google.com/android/repository/android_m2repository_r32.zip i download file manually, should copy (or extract) file? inside android sdk installation there folder called extras android-sdk\extras inside extras extract zip files android_m2repository_r41.zip , support_r23.2.1.zip , rename these folders m2repository , support at end should android-sdk\extras\m2repository , android-sdk\extras\support

Opening a PDF embedded in iframe in chrome with content security policy > plugin-types -

i have csp (content-security-policy) plugin-types policy set white-list pdf type below. when trying open pdf file in iframe src attribute, working browsers ie 11, , firefox 47+ failing in chrome 50+. else required make working in chrome? content-security-policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; object-src 'self'; style-src 'self'; frame-src 'self' plugin-types application/pdf; error in chrome console resource interpreted document transferred mime type application/pdf refused load 'http://127.0.0.1/module123/open.do?id=10000' (mime type '') because violates following content security policy directive: 'plugin-types application/pdf'. when enforcing 'plugin-types' directive, plugin's media type must explicitly declared 'type' attribute on containing element (e.g. '<object type="[type goes here]" ...>'). i had si

xml - pdf/a validation: pdfaExtension:schemas/*[1] :: Missing required field 'valueType' in value type 'Schema' -

i have created pdf/a-1b in php tcpdf library, not pass validation ( http://www.pdf-tools.com/pdf/validate-pdfa-online.aspx ) these errors: pdfaextension:schemas/ [0] :: missing required field 'valuetype' in value type 'schema'. pdfaextension:schemas/ [1] :: missing required field 'valuetype' in value type 'schema'. pdfaextension:schemas/*[2] :: missing required field 'valuetype' in value type 'schema'. <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="adobe xmp core 4.2.1-c043 52.372728, 2009/01/18-15:08:04"> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/"> <dc:format>application/pdf</dc:format> <dc:title> <rdf:alt> <rdf:li xml:lang="x-default">pdf test</rdf:li> </rdf:alt

Python: Create Array Objects Dynamically -

this question has answer here: creating multiple variables [duplicate] 2 answers i want dynamically create arrays variable names array. have: array1 = ['a', 'b', 'c'] i want programatically create new array each value in array1 (where not know how many values in array1 , not know names in there) using names provided in array1. give me: = [] b = [] c = [] when array1 = [a,b,c] , lose information names of variables used instantiate array, i'll assume meant array1=['a','b','c'] . in python, use dict ionary solve issues related this. using dictionary, can have mapping 'a' empty list so: array1 = ['a','b','c'] dicty = {} in array1: dicty[i] = [] if doesn't solve problem, please give me more information problem trying solve.

java - Struts tag lib errors while deploying on JBOSS -

all, i have application using struts 1.1 trying migrate jboss weblogic. i see below errors in log unable resolve. 17:39:37,317 warn [org.jboss.as.ee] (msc service thread 1-1) jbas011006: not in stalling optional component org.apache.struts.taglib.forwardtag due except ion (enable debug log level see cause)** 17:39:37,320 warn [org.jboss.as.ee] (msc service thread 1-1) jbas011006: not in stalling optional component org.apache.struts.taglib.hiddentag due excepti on (enable debug log level see cause) 17:39:37,321 warn [org.jboss.as.ee] (msc service thread 1-1) jbas011006: not in stalling optional component org.apache.struts.taglib.multiboxtag due excep tion (enable debug log level see cause) 17:39:37,322 warn [org.jboss.as.ee] (msc service thread 1-1) jbas011006: not in stalling optional component org.apache.struts.taglib.checkboxtag due excep tion (enable debug log level see cause) 17:39:37,378 warn [org.jboss.as.ee] (msc service thread 1-1) jbas011006: not in stalling op

java - Markups in src/main/resources cannot be found in Wicket 7.3.0 project running on Jetty -

i have created wicket 7.3.0 project using quick start wizard. i have moved file homepage.html src/main/resources , achieved following directory structure: image this part of generated pom.xml : <build> <resources> <resource> <filtering>false</filtering> <directory>src/main/resources</directory> </resource> <resource> <filtering>false</filtering> <directory>src/main/java</directory> <includes> <include>**</include> </includes> <excludes> <exclude>**/*.java</exclude> </excludes> </resource> </resources> // etc... </build> yet when start application on jetty server, following error: root cause: org.apache.wicket.markup.markupnotfoundexception: can not determine

Datepicker Angularjs startWeek on Monday -

i've problem angular md-datepicker. it's start default on sunday, need start on monday. i've been tried add option controller, doesn't work. can me please? this code: $scope.dateoptions = { formatyear: 'yy', showweeks: false, firstdayofweek : 1 }; <md-datepicker ng-model="desdedate" md-placeholder="enter date" options="dateoptions"></md-datepicker> use following code configure first day of week in md-date angular.module('myapp').controller('appctrl', function($scope) { $scope.mydate = new date(); }).config(function($mddatelocaleprovider) { // can change week display start on monday. $mddatelocaleprovider.firstdayofweek = 1; // optional. }); below link working example. link example you need change start day of week using $mddatelocaleprovider.

c# - Index is out of range -

i getting error @ getproxy() , error index outofbounds. error: an unhandled exception of type 'system.argumentoutofrangeexception' occurred in mscorlib.dll additional information: index out of range. must non-negative , less size of collection. code: static list<string> proxies = new list<string>(); private static string getproxy() { lock (proxies) { return proxies[new random().next(0, proxies.count)]; } } it not empty, has proxy inside, error not in loading function, here. i have added breakpoint , debugged it, proxies has value of count = 3 , proxies.count has value of 3. the answer @gendolkari: if proxies contains no elements @ all, trying access first element of empty list , throw exception. return proxies[new random().next(0, proxies.count)]; ==> return proxies[new random().next(0, 0)]; ==> return proxies[0]; this causes argumentoutofrangeexception stated in documentation list(t).item bec

How to execute maven plugin execution directly from command line? -

i have plugin (antrun) execution configured has id , not bound phase. can execute execution directly command line? <plugin> <artifactid>maven-antrun-plugin</artifactid> <executions> <execution> <id>my-execution</id> ... </execution> </executions> </plugin> an run like: mvn my-execution or @ least mvn magicplugin:execute -dexecutionid=my-execution this functionality has been implemented mng-5768 , , available in maven 3.3.1. the change will: extend direct plugin invocation syntax allow optional @execution-id parameter, e.g., org.apache.maven.plugins:maven-remote-resources-plugin:1.0:process@executionid. so, in case: mvn antrun:run uses default-cli execution id, and: mvn antrun:run@my-execution uses execution configured in pom.

Chrome pop up instead of login page after wordpress installation -

Image
so installed wordpress (in subfolder if matters). after installation want log in admin page (by going /wp-login.php). instead of login page, expect it, chrome login pop-up. login data installed wordpress not work. as correctly surmised, not wordpress login screen. this login popping because password protection set on folder installed wordpress in. it depends on server setup, being controlled file on server called .htaccess . find inside subfolder installed in, or possibly in root folder of site. if open file , lines similar following, removing them remove password protection, , let log in wordpress usual. authtype basic authname "password protected area" authuserfile /path/to/.htpasswd require valid-user although - might want find out added there , why added it, before removing it!

c# - Get endpoint from CreateDBInstanceResponse class in AWS RDS .NET SDK -

i have following method: public string add(string tenant, string databasename, string username, string password) { using (var client = new amazonrdsclient()) { var instance = new createdbinstancerequest(); instance.dbinstanceidentifier = tenant; instance.dbinstanceclass = defaultmysqlsettings.dbinstanceclass; instance.allocatedstorage = defaultmysqlsettings.allocatedstorage; instance.dbname = databasename; instance.engine = defaultmysqlsettings.engine; instance.engineversion = defaultmysqlsettings.engineversion; instance.masterusername = username; instance.masteruserpassword = password; instance.licensemodel = defaultmysqlsettings.licensemodel; instance.port = defaultmysqlsettings.port; instance.autominorversionupgrade = true; createdbinstancer

C++ Assigning heap memory to each element(struct) in array of structs -

i confused allocating memory struct. consider this. struct { .... } a* array = new a[5]; // here trying assign memory array[0] &(array[0]) = new a; << error but give me error lvalue required left operand of assignment` i not sure on how assign memory struct a array[0] . thank in advance. a type a* doesn't hold pointers should allocated individually new . a* contiguous block of memory holds 1 or more complete instances of a. this means that a* array = new a[3]; will allocate like | | | | and each "cell" large sizeof(a) bytes. in case have 5 a instances, constructed. if want have indipendent instances allocated on heap don't need a* a** . a** array = new a*[3]; this creates contiguous array of 3 a* elements, pointers a sort of: | a* | a* | a* | ad each cell large sizeof(a*) . now can assign element of array specific instance of allocated on heap. eg: array[0] = new a(); which yie

javascript - Add smooth effect on hiding a list -

i have simple hide , show script list. ideally have smooth effect on it. there way make similar to: https://jqueryui.com/accordion/#sortable here js: function togglea() { var list = document.getelementbyid("lista"); if (list.style.display == "none") { list.style.display = "block"; } else { list.style.display = "none"; } } have had @ jquery animate? http://api.jquery.com/animate/

skip/ignore array index that contain value in c -

my goal create c function finds minimum value of array , set zero. far, function ignore/skip indexes zero. void find_minimum(double a[], int n) { int i, index; double low; index = 0; low = a[0]; (i = 1; < n; i++) { if ( a[i] < low && a[i] != 0.0) { low = a[i]; index = i; } } a[index] = 0.0; } i tried using continue statement this: void find_minimum(double a[], int n) { int i, index; double low; index = 0; low = a[0]; (i = 1; < n; i++) { if(a[i] == 0.0){ continue; } if ( a[i] < low) { low = a[i]; index = i; } } a[index] = 0.0; } what missing or messing up? your problem is, code ignores case when a[0] zero. try assign low constant double_max , iterate through whole array instead ( i = 0 in for initialization statement instead of i = 1 ). void find_minimum(double a[

ubuntu - Xen hypervisor: not booting -

so i'm new xen hypervisor , i'm trying install on ubuntu 16.04 vm on computer. i've done following sudo apt-get install xen-hypervisor-amd64 sudo sed -i 's/grub_default=.*+/grub_default="xen 4.1-amd64"/' /etc/default/grub sudo update-grub sudo sed -i 's/toolstack=.*+/toolstack="xm"/' /etc/default/xen sudo reboot when starts scrolls through lines of code showing it's booting xen goes black unresponsive screen here i'm getting i'm not sure how solve issue advice welcome!!!! thank in advance! it seems ubuntu 16.04 doesn't support xen. installed ubuntu 12.04.4 vm , works

android - layout_weight doesn't take effect -

Image
i'm trying split vertical space between views evenly using layout_weight reason doesn't work. followed this answer , still views's spaces aren't effected that. doing wrong? <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <space android:layout_width="1dp" android:layout_height="0dp" android:layout_weight="1" > </space> <android.support.design.widget.textinputlayout android:layout_width="match_parent" android:layout_height="wrap_content"> <autocompletetextview android:background="@drawable/rounded_corners_white" andr

c# - Get the Class name in a class with atribute inside a attribute method -

i'm doing custom authorize attribute. want use attribute in class , controller level. this code work on method level public class customauthorizeattribute : authorizeattribute { public customauthorizeattribute([callermembername] string callername = null) { callername = callername; } public string callername { get; set; } protected override bool authorizecore(httpcontextbase httpcontext) { if (httpcontext.user.isinrole("admin")) return true; ... if (callername == something) { } ... return base.authorizecore(httpcontext); } } like that [customauthorize()] public actionresult index() { return view(); } but want use globally in controller [customauthorize()] public class usuarioscontroller : controller { salusdbcontext db = new salusdbcontext(); // get: usuarios public actionresult index() {

ssl - openssl connection on a self-cerficated server -

i'm performing command in order check whether i'm able create ssl connection: openssl s_client -connect private-server:5000 private-server server i've set self-generated certificate. the output is: connected(00000003) 140180300502672:error:140790e5:ssl routines:ssl23_write:ssl handshake failure:s23_lib.c:177: --- no peer certificate available --- no client certificate ca names sent --- ssl handshake has read 0 bytes , written 308 bytes --- new, (none), cipher (none) secure renegotiation not supported compression: none expansion: none no alpn negotiated ssl-session: protocol : tlsv1.2 cipher : 0000 session-id: session-id-ctx: master-key: key-arg : none psk identity: none psk identity hint: none srp username: none start time: 1467812448 timeout : 300 (sec) verify return code: 0 (ok) --- what need connection right? thanks. ssl handshake has read 0 bytes , written 308 bytes the client has sta

Dispatching an action makes react-router-redux change router props -

i'm witnessing behavior fail understand , not seems right. when dispatch action, components re-render because this.props.location (and others, params or routeparams) changes, , when "changes", mean pointer different, inner properties same. the dispatched action not change route in way, data in redux store (on it's own mounted key). consequently, shouldcomponentupdate (not overridden) detects change , forces re-rendering. there no change @ all! that's annoying because have setinterval routine dispatches action call server every 30 seconds fetch data. , yet, connected components not care state change still re-rendered. redux panel shows action dispatched, no location_change. if unplug react-router-redux (removing use of synchistorywithstore ), behavior stops. is expected behavior, or did miss something? i'd not have override shouldcomponentupdate in of connected components. could point me react router props being injected in components?

Dojo aspect inheritance -

i'm having trouble dojo aspect , how behaves inheritance. i have class called child1 , class called child2. both classes inherit parent. child1: return declare("child1", [parent], ... child2: return declare("child2", [parent], ... the implementation of child1 , child2 different. parent has method child1 needs aspect to: this.own(aspect.before(this, "_onchange", lang.hitch(this, "_onrowselected"), true)); everything works fine child2 until child1 called. @ point whenever _onchange method called parent, function child1._onrowselected run.... regardless of call originated from. i think aspect involve object created aspect call in child1, , wouldn't affect child2 whatsoever. the thing can think of, looks instantiation of child1 , child2 done within html template. if use inheritance, why use aspect ? not necessary in such case. in child1 , create method _onchange this: _onchange: function() { this._