Posts

Showing posts from April, 2010

AngularJS 1.5 scope in directive ng-include -

here's code http://jsfiddle.net/miuosh/n6yppypj/ uploadfile directive. problem use this <input type="file" file-model="myfile" /> <button ng-click="uploadfile()">upload me</button> in ng-include="'views/uploadfileform.html'". in directive add "myfile" scope. turns out angular create new scope myfile. add "myfile" "rootscope" need use modelsetter(scope.$parent.$parent.$parent[..],element[0].files[0]) which inconvenient because need know how many parent scope have. i have faced similar problem dealing file input angular. can create directive listen file change , call controller function file. here jsfiddle it. var app = angular.module('app', []); app.controller('yourctrl', function() { $scope.image; $scope.imagechanged= function (files) { $scope.image = files; }; }); app.directive('customonchange', function() {

asp.net mvc - How to make FedAuth cookies unique for each application in on solution? -

i using system.identitymodel , claim based authentication authenticating mvc app. in login page after checking username , password uses approach create fedauth cookie(s) : var token = new sessionsecuritytoken(mycustomclaimsprincipal.getinstance(username, roles,claims) ); token.ispersistent=rememberme; var sam = federatedauthentication.sessionauthenticationmodule; sam.isreferencemode = true; sam.writesessiontokentocookie(token); everything works fine problem when use same approach in 2 other applications in same solution going published on different domains; in localhost fedauth cookies conflict each other. when log in 1 app, cookies not valid in other apps , should login again. in fact can work 1 app @ same time. think on localhost , there no problem on different domains after publish. prefere make fedauth cookie unique each application in 1 solution. possible? , how? maybe possible context or contextid in constructor of sessionsequritytoken.

go - Combining net/http and fasthttp -

i looking fast framework go , stumbled upon fasthttp https://github.com/valyala/fasthttp according developer , benchmark 10x faster golang net/http package. i'm familiar gorilla toolkit , other net/http based frameworks gin-gonic, goji, , gocraft. my question is: possible mix net/http framework / toolkits fasthttp example use gorilla packages echo / iris (fasthttp frameworks)? i checking iris framework , saw in documentation https://kataras.gitbooks.io/iris/content/using-native-httphandler.html it's possible use net/http framework. framework using https://github.com/valyala/fasthttp/fasthttpadaptor convert native net/http handler fasthttp handler.

jquery - is there any way to find the row number where I am selecting in dropdown in Kendo grid? -

Image
in kendo grid want find row number making selection in dropdown. cauld change datepicker editable , focused. attaching pic reference. this code kendo field { field: "md_of_iss", title: "mode of issue", template: "#= modename(md_of_iss) #", editor: function (container) { var input = $('<input id="md_of_iss" name="md_of_iss">'); input.appendto(container); input.kendodropdownlist({ datatextfield: "rsrc_description", datavaluefield: "md_of_iss", datasource: array, change: function (e) { } }).append

android - Display Progress bar while delay? -

in app want have delay of 5 seconds , in 5 seconds user should see progress dialog tried progressdialog.show(); try { thread.sleep(5000); } catch (interruptedexception e) { e.printstacktrace(); } progressdialog.dismiss(); but while thread sleeping progessdialog wont show . new countdowntimer(6000, 1000) { public void onfinish() { mprogressdialog.dismiss(); // whole code } public void ontick(long millisuntilfinished) { mprogressdialog.show(); } }.start(); this works fine

visual studio 2010 - How do I get Python controls into the toolbox in VisualStudio -

i want create winforms ironpython app. i have installed ironpython, toolbox empty. how add python controls it? the toolbox available if create ironpython wpf application. unfortunately there no designer support ironpython windows form applications. windows form has written in python. source: https://github.com/microsoft/ptvs/wiki/projects#project-types . (read "ironpython windows forms application" section)

vbscript - How to verify that all required included files exist on startup -

does still work classic asp vbscript , know if possible verify on startup included files exist? large project , requires refactoring before moving files subfolders i'd have test in place ensures includes still pointing correct files. not i've ever tried , here's why in classic asp can have 2 types of #include ssi directives; relative path includes, path current directory. <!-- #include file = "subfolder/file.asp" --> virtual path includes, take path root of containing web application. <!-- #include virtual = "/toplevelfolder/subfolder/file.asp" --> if have enable parent paths set in web application can use ../ traverse parent folders when using #include file . with in mind, think have minute. first need identify #include directives using loop iterate through web application , find .asp files example , use regular expression pull out path. there complications. you have distinguish both file , virtual ty

How to apply project template to existing projects in SonarQube -

i have several existing projects in sonarqube , trying sort them more permission groups 1 (which current setup). however, when create new project template specific key, template applied projects if click "bulk apply template" example project name: myadmin project key: cz.mycompany.console:myadmin project template name: myadmin project key pattern: cz\.mycompany\.console\:myadmin the above should match 1 project. , still, when click "bulk apply template" above template assigned all other projects (which have different names). i clueless doing wrong. should change make template match specific projects? the project key pattern used assign new projects as they're created . when bulk apply you're getting result you're asking for: apply template current selection of projects. instead, try using search feature @ top of project page (note searches against project name, not key) narrow current list of project, , then use bulk ap

python - How can I fix these errors when I run manage.py -

i moving python django project 1 server server. using debian 7, has python 2.7.3 installed standard on target server (the original server using debian 7). the project trying move has following directories in it's parent folder: - -env -src it has file install.pip the apps running on new webserver, have configured uwsgi, use manage.py project source folder. when run following command: python manage.py changepassword user i following error file "manage.py", line 8, in <module> django.core.management import execute_from_command_line importerror: no module named django.core.management to try resolve this, installed virtualenv, , pip , built new virtual environement. ran following command: pip install -r /sourcefolder/install.pip when did received error failed building wheel pillow i researched online , determined possible solution install libjpg, did following command apt-get install libjpeg8-dev i ran pip install -r /sourcefolder

php - can use orWhere and Where functions with delete -

yii2 framework why cant use this? $rows = new query; $rows->createcommand() ->delete('friends') ->where(['userid' => 1 ,'userid' => 2]) ->orwhere(['userid' => 2 ,'userid' => 1]) ->execute(); in where() , or orwhere() function using hash format (['key'=> 'value']) hash format hash format best used specify multiple and-concatenated sub-conditions each being simple equality assertion. written array keys column names , values corresponding values columns should be. lookin code equivalent userid = 1 , userid = 2 look na useful guide http://www.yiiframework.com/doc-2.0/guide-db-query-builder.html second important .. in yii2 have delete() , deleteall() delete() deletes table row corresponding active record. deleteall() deletes rows in table using provided conditions.

base64 - Create X509 certificate and save as Base-64 -

i have been following guide covers signing authorization tokens web api security. 1 of aspects storing x509 certificate base-64 string in web.config. however, steps necessary on how x509 certificate , convert base-64 string not explained. found guides on how generate x509 certificate using openssl remain confused on parts use , how convert base-64. here want end with. a base-64 representation of certificate can store in web.config a password goes along certificate the code want use in authentication server .. signingcertificate = new x509certificate2(certificate, password); where certificate base 64 encoded representation of certificate , password signing certificate password. so openssl tool able generate 2 files ... cert file - mycert.pem key file - mykey.pem question #1 - need use mycert.pem file when converting base-64? or both files need combined both files single pfx file before representing base-64? question #2 - there utility can use accepts file

c# - WebAPI HTTPDelete method not found via request but found in Swagger -

i have api controller method: [route("campaigns")] [httpdelete] public async task<ihttpactionresult> delete(string brandid,string campaignid) { try { var merchantid = currentuserinfo.getmerchantid(); await _service.deleteasync(merchantid, brandid, campaignid); return statuscode(httpstatuscode.nocontent); } catch (exception e) { log(e); return badrequest(e.message); } } and angularjs app sending request: $http.delete(config.resourcenames.campaign, { params: { brandid: brandid, campaignid: campaignid } }) .then(function (response) { return response; }, function (error) { return error; }); config file: var resourcenames = { campaign: '/api/campaigns' }; so routing valid. request return 404 not found . i checked via swagger , delete method visib

xml - Solr with normalized document structure -

i have solr document this, fields mapped single document. <doc> <int name="id">7</int> <str name="name">personname</str> <str name="address">address line 1, address line 2, city</str> <str name="country">india</str> <str name="imageurl">0000028415.jpeg</str> <arr name="category"> <str>student</str> <str>group a</str> </arr> </doc> we normalize , have separate doc type person, country , category. <doc> <int name="pid">7</int> <str name="name">personname</str> <str name="address">address line 1, address line 2, city</str> <str name="countryid">91</str> <str name="imageurl">0000028415.jpeg</str> <arr name="categoryid">

png - generating design with java -

Image
i trying generate following given sateen design of java code code not creating png file named sateen import java.awt.*; import java.awt.image.bufferedimage; import java.io.*; import javax.imageio.imageio; import javax.swing.jframe; public class sateen { bufferedimage image; int width; int height; int red,green,blue; public sateen() { try { file input = new file("n.png"); image = imageio.read(input); width = image.getwidth(); height = image.getheight(); //n png file white pixels for(int i=0; i<height; i++){ for(int j=0; j<width; j++){ color p = new color(image.getrgb(j, i)); color g = new color(image.getrgb(j+5, i)); //getting (j,i) coordinate pixel value , comparing next 5th pixel if(p.getred()==255&&p.getblue()==255&&p.getgreen()==255&&g.getred()==255&& g.getblue()==255&&g.getgreen()==255) {

Java Log4j2 Syslog Appender doen't send messages -

i'm trying use log4j2 syslog appender no messages sent. i'm monitoring environment using wireshark , no messages detected. running on windows 7. when use kiwi syslog, messages arrive fine. here log4j2 xml configuration file: <?xml version="1.0" encoding="utf-8"?> <configuration status="warn" name="myapp" packages=""> <appenders> <console name="console" target="system_out"> <patternlayout pattern="%d{hh:mm:ss.sss} [%t] %-5level %logger{36} - %msg%n"/> </console> <syslog name="rfc5424" format="rfc5424" host="localhost" port="514" protocol="udp" appname="myapp" includemdc="true" facility="user" enterprisenumber="18060" newline="true" messageid="audit" mdcid="mdc" id=&q

vba - Error message in Access form with both manual and calculated data entries -

my access 2010 form used input data. fields manually (type in or choice dropdownlist), other fields precalculated values depending on input data. additional code controls enabling or disabling input fields dependent input data (ensuring data consistency). my problem : when choose value (from dropdownlist) in field switch next field (any method: mouse/tab/code) , try enter value, [erroneous] error message "another user" (obviously own vba code) has modified record , saved before own changes saved. ok , second trial input data successful. i tried me.recalc , me.refresh @ different positions in code without eliminating nasty error. how can tell access 2010 save input data in field before starting running code [mypreviousfield_afterupdate()] ? docmd.runcommand accmdsaverecord unfortunately not work @ all, problemativ fields unbound. it's mix of related bound , unbound fields access not handle 1 expect. disabling error messages or record lock, or me.undo or me

xml - Excel Custom Ribbon Screentip -

Image
is there way can remove highlighted 'tell me more' portion of screentip per example below? here code: <customui xmlns="http://schemas.microsoft.com/office/2009/07/customui"> <ribbon> <tabs> <tab id="custommantis" label="mantis" insertaftermso="developer"> <group id="mantissheetfunctions" label="sheet functions"> <button id="custombutton3" label="insert rows" screentip="insert rows" supertip="insert rows @ current cursor position. max 1000 rows @ 1 time." size="large" onaction="irinsertnewrows" imagemso="cellsinsertdialog" /> <button id="custombutton4" label="delete rows" screentip="delete rows" supertip="delete rows current cursor position down. max 1000 rows @ 1 time." size="large" onacti

ios - convert Stream object to an ArrayList C# -

let me explain whole scenario first. code on ios side. nsmutablearray * myarr= [[nsmutablearray alloc]init]; nsstring *str1=@"hello"; nsstring *str2=@"waleed"; nsstring *str3=@"whatsup"; nsdata *mydata=[str1 datausingencoding:nsutf8stringencoding]; nsdata *mydata2=[str2 datausingencoding:nsutf8stringencoding]; nsdata *mydata3=[str3 datausingencoding:nsutf8stringencoding]; [myarr addobject:mydata]; [myarr addobject:mydata2]; [myarr addobject:mydata3]; nsdata *bigdata = [nskeyedarchiver archiveddatawithrootobject:myarr]; nsstring *urlstring = @"http://192.168.249.1/service/getemployees.svc/arrayupload/"; nsmutableurlrequest *request = [[nsmutableurlrequest alloc] init]; [request seturl:[nsurl urlwithstring:urlstring]]; [request sethttpmethod:@"post"]; nsmutabledata *postbody = [nsmutabledata data]; //add image data post [postbody appenddata:[nsdata datawithdata:bigdata]]; [request sethttpbody: postbody]; // connect web nsdat

web services - Using TLS 1.1/1.2 in WSO2 ESB out-going request -

i'm trying consume web service on https using wso2 esb (4.7.0). web service requires callers use tls version >1.0 (1.1 or 1.2). i'm using java 1.7. i've added following line passthroughtransportsender (and receiver) definition no avail: <parameter name="httpsprotocols">tlsv1.2</parameter> how can make wso2 callout , send mediators use newer tls versions (preferably tls 1.2)? open axis2.xml file resides under $esb_home/repository/conf/axis2 directory. add <parameter name="httpsprotocols">tlsv1</parameter> entry inside passthroughhttpssllistener , passthroughhttpsslsender elements. note if using older version of esb not support passthrough transport may need add above tag inside httpcoreniossllistener , httpcoreniosslsender elements.you may more information in blog post [1] [1] http://ravindraranwala.blogspot.com/2014/11/ssl-debugging-in-wso2-esb.html

ios - How to get the short display name from a language and region code? -

when use displaynameforkey , language, returned string long , different native language settings in ios settings app. example: let locale = nslocale(localeidentifier: "zh-hant") let key = nslocaleidentifier print(locale.displaynameforkey(key, value: "zh-hans")!, locale.displaynameforkey(key, value: "zh-hant-hk")!) // return 中文(簡體)and 中文(繁體,中華人民共和國香港特別行政區) // want native language settings: 簡體中文 , 繁體中文(香港) how can short language name? in ios10, can use localizedstring(forlanguagecode:) method of nslocale short language name. in swift 3 let langname = nslocale.preferredlanguages[0] let locale = nslocale(localeidentifier: "zh-hant") let fullname = locale.localizedstring(forlanguagecode: lang)!

python - Changing the format of a column of Data frame from Str to Date in specific format -

i have 2 data frames have merge on date. type of data isn't same. date , of str format. print(visit_data.iloc[0]['visit_date']) 2016-05-22 type(visit_data.iloc[0]['visit_date']) out[40]: datetime.date print(holiday_data.iloc[0]['visit_date']) 1/1/2016 type(holiday_data.iloc[0]['visit_date']) out[46]: str so type , formats. using merge. data_store = pd.merge(data_store, holiday_data, how = 'left' , on = ['visit_date','state']).reset_index(drop=true) merge happening there 2 keys data not coming in output due different format of visit_date. so, tried change this. holiday_data['visit_date'] = pd.to_datetime(holiday_data['visit_date'], format = 'format="%m/%d/%y') but gives print(holiday_data.iloc[0]['visit_date']) 2016-01-01 00:00:00 type(holiday_data.iloc[0]['visit_date']) out[54]: pandas.tslib.timestamp which not want. i changing data type of holiday_data

vbscript - How to read a text file to numbers and then get the total value of those numbers -

i'm working on script find out how free storage there is. script checks database find out store names queries these using cmd. outputs file remaining storage. cannot seem find way combine these values , bring total amount. script: dim objfilesys set objfilesys = createobject("scripting.filesystemobject") if objfilesys.fileexists("a.txt") objfilesys.deletefile "a.txt" wscript.echo ("old file found , deleted") else wscript.echo ("old file not found, script continue") end if wscript.sleep 500 set objconnection = createobject("adodb.connection") set objrecordset = createobject("adodb.recordset") set oshell = wscript.createobject ("wscript.shell") dim strres dim strdc dim strspc objconnection.open _ "provider=sqloledb;data source=dls-bsp-sdb;" & _ "initial catalog=dom_site;" & _ "user id=*****;password=*****" objrecordset.open "

php - CodeIgniter error 403 Access forbidden on Ubuntu -

i've been working on not-much-complicated projects using codeigniter on windows, first time launch php file in ubuntu. i copied codeigniter project /opt/lampp/htdocs working on windows doesn't work on ubuntu. gave me 403 error. solved: set permission command line: sudo chmod 777 -r /opt/lampp/htdocs sudo chmod 777 -r /opt/lampp/htdocs/ project_folder project_folder name of project directory. make sure controllers' name capitalized. in addition comments, apache needs execute access on every folder root project in order traverse file system. sudo chmod +x / sudo chmod +x /opt sudo chmod +x /opt/lampp

php - Laravel 5 command - Mandatory options -

i trying write laravel command can't have options mandatory. i understand concept of option being "optional" i'd have command in clear input inserting , in no particular order. i.e. achieve this, par2 , par 2 mandatory $command-abc --par1=value1 --par2=value2 instead of: $command-abc value1 value2 so far signature used: protected $signature = 'dst-comparison:analyse {--client : client name} {--clientid : client id} {--recordingid : client recording id} {--csvfile : path downloaded csv file spotify analytics} {--dataupdateto=null : csv data truncated date onwards}'; following laravel documentation ( https://laravel.com/docs/5.1/artisan ) , guide: http://code.tutsplus.com/tutorials/your-one-stop-guide-to-laravel-commands--net-30349 seemed overwriting getoptions method doing trick, not working me. /** * console command o

sublimetext3 - Python 3.4.2 on Sublime text 3 -

i've installed python 3.4.2 , sublime text 3 on mac. when go build simple program .pyc file being created. creates on desktop , have no idea why. i have noted post few years ago suggesting full path python 3 needs provided can use sublime text 3. tried 2 listed solutions last being following { "shell_cmd": "/library/frameworks/python.framework/versions/3.4/bin/python3 $file", "selector": "source.python", "file_regex": "^(...*?):([0-9]*):?([0-9]*)", "working_dir": "${file_path}", } i go run simple print ("hello someone") and completes task without showing "hello someone". removed test file accident , threw message python 2.7.

unity3d - How do I remove the Unity Splash Screen from my iOS builds? -

Image
i have unity plus account says in it's checklist 1 of things can customise or remove splash screen can't life of me find out how. removing ios splash screen unity build the animated image below show steps on how remove completely. can put custom 1 the-same place.

angular - Radio button for boolean property -

i have simple boolean property valid in object document , need bind radio-inputs. this have far: <input type="radio" name="valid" id="validtrue" (click)="document.valid = true" [checked]="document.valid"/> <input type="radio" name="valid" id="validfalse" (click)="document.valid = false" [checked]="!document.valid"/> at least setting property on click works state no displayed radio-inputs. looking in developer console of browser found out property ng-reflect-checked set doesnt seem have impact on html radio-input. what doing wrong? have working "angular2-boolean-radio-input" snippet? in new forms module might want <input type="radio" name="food" [(ngmodel)]="document.valid" [value]="true"> <input type="radio" name="food" [(ngmodel)]="document.valid" [value]=&

android - Microsoft Band Microphone -

i have android application uses microsoft band 2's sensors , displays data processed. the app works fine, want add voice commands app via microphone of band. possible? i using microsoft cognitive services, speech recognition service voice command, transform text process it. know api works fine android microphone, know if possible use band's mic or maybe integrate cortana. thanks. access microphone of band not supported microsoft's sdk. band 2 work cortana on android. so, while not familiar cortana android's capabilities are, best bet see if there way work application in way.

haskell - An array of triplets in repa checked at compile time -

first of all, i'm total newbie in repa , still consider myself beginner in haskell in general. i need effective array of triplets of doubles. naïve approach [(double, double, double)] that's not effective. thought use repa supposed effective. however, don't know how should define array of triplets. i array u dim2 double , store elements of triplets in second dimension (i.e. first index index of triplet , second index element of triplet). there nothing forces second dimension of size 3. i need array u dim1 vec3d that's not possible vec3d not instance of data.vector.unboxed.base.unbox . i may reading documentation wrong, think array u dim1 (double,double,double) want (why don't try it?). before tell me inefficient: as far can tell, there no way of introducing array u sh u without constraints shape sh and unbox u . therefore, array u sh u efficient , unboxed. in unbox notice instance (unbox a, unbox b, unbox c) => unbox (a, b, c) , u

ios - how to avoid reusable custom cell from overwriting data when scrolling? -

this code using , works fine until scroll in table view, cells overwrite each others , repostedfromlabel hidden. func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecellwithidentifier("feedstableviewcell", forindexpath: indexpath) as? feedstableviewcell if (arrayofpostsfeed[indexpath.row].postedbyuser!.nickname!) != arrayofpostsfeed[indexpath.row].ownedbyuser!.nickname! { cell!.repostedfromlabel.text! = "reposted \(self.arrayofpostsfeed[indexpath.row].postedbyuser!.nickname!)" } else { cell!.repostedfromlabel.hidden = true } } how should prevent reusable cells override each others? you can implement prepareforreuse function in feedstableviewcell reset hidden property of repostedfromlabel. this: override func prepareforreuse() { self.repostedfromlabel.hidden = false } at moment not resetting value, mixed when reusing

android - java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer) is occures when using mobile data -

i have android application use http request communicate through server blow lines. httpparams httpparams = new basichttpparams(); httpconnectionparams.setsotimeout(httpparams, time_out); httpclient httpclient = new defaulthttpclient(httpparams); ((abstracthttpclient) httpclient).sethttprequestretryhandler(new defaulthttprequestretryhandler(num_retries, true)); try { stringentity se = null; try { se = new stringentity(params.tostring(), "utf-8"); se.setcontenttype("application/json; charset=utf-8"); } catch (unsupportedencodingexception e) { e.printstacktrace(); } httppost httppost = new httppost(uri); httppost.setentity(se); httpresponse response = httpclient.execute(httppost); httpentity resentity = response.getentity(); } when use wifi send http request fine , i'll response. when using cellular mobile data break in line httpresponse response = httpclient.execute(httppost); , gives following error

php - Possibilities to mark only one entry in database table -

i working on kind of topiclist. can have multiple topics , each topic can have multiple subtopics. can vote each subtopic if or not, don't think relevant question. so 2 relevant database tables topics , subtopics . here simplified versions of them: create table topics ( id integer primary key auto_increment not null, name varchar(1000) not null ); create table subtopics ( id integer primary key auto_increment not null, title varchar(1000) not null, topic_id integer not null, foreign key(topic_id) references topics(id) ); i want add possibility mark subtopic, prioritized, there should 1 prioritized subtopic each topic. do have suggestions how realize that? my idea add field subtopics timestamp, gets updated current time, when mark prioritized. when select entries, have recent timestamp. are there other (better) possibilities? i working php , mysql you have add 3 field priority,vote,timestamp subtopics table. priority fiel

java - Spring 4.3.0.RELEASE + 5.2.0.Final, org.springframework.transaction.interceptor.TransactionInterceptor#0 -

i have exaption , after search in google there no spsific solution fr version of hibernate , spring. please try if can :) ok thank @m. deinum changed hibrnate 5 , build new tomcat server looking , log now: see more problems in work? the console log: יונ 29, 2016 2:45:03 pm org.apache.tomcat.util.digester.setpropertiesrule begin warning: [setpropertiesrule]{server/service/engine/host/context} setting property 'source' 'org.eclipse.jst.jee.server:searcher' did not find matching property. יונ 29, 2016 2:45:03 pm org.apache.catalina.startup.versionloggerlistener log info: server version: apache tomcat/8.0.36 יונ 29, 2016 2:45:03 pm org.apache.catalina.startup.versionloggerlistener log info: server built: jun 9 2016 13:55:50 utc יונ 29, 2016 2:45:03 pm org.apache.catalina.startup.versionloggerlistener log info: server number: 8.0.36.0 יונ 29, 2016 2:45:03 pm org.apache.catalina.startup.versionloggerlistener log info: os name:

linux - Concept of Virtual Environments -

hope question belongs here. as linux noob, sure question sounds confusing , heavily non-technical, please me understand this. anaconda python distribution comes concept of creating environments can maintain variety of python versions , specific packages based on need. without disturbing other versions , modules! rbenv same thing ruby . i guess nvm nodejs . in fact, simplest examples python's virtualenv , virtualenvwrapper i need or resource read , understand how these things work exactly. learning whole concept of virtualization way? i sure has (everything?) os, esp. linux. make these things clearer in head, best try things @ os level. there resource can find such help/tutorial/etc.? you might find these links useful. realpython.com dabapps.com

java - Autowired field is null in filter that extends GenericFilterBean -

this question has answer here: why spring @autowired field null? 11 answers i'm trying autowire service request filter. gives me null pointer exception , i'm not quite sure why. i've used exact same autowire class in controller , works expected! @component(value="jwtfilter") public class jwtfilter extends genericfilterbean { redisclient redisclient = new redisclient(); @autowired jwttokenservice jwtserv; // null reason??!! @override public void dofilter(final servletrequest req, final servletresponse res, final filterchain chain) throws ioexception, servletexception { // springbeanautowiringsupport.processinjectionbasedoncurrentcontext(this); // doesnt fix issue system.out.println("\nmaking request..."); final httpservletrequest request

java - Data get from ajax null in jsp -

i able data ajax using system.out.println. however, unable pass data servlet. shows null always. here jquery: function expresscheck(number) { var self=[]; for(i=1;i<=<%=itemcodelist.size()%>;i++) self[i-1] = document.getelementbyid("qtyguestnumber_" + i).value; $.ajax({ url: "viewcategories.jsp", data: {"expressdata" : self[number-1]} }); };

windows runtime - [UWP]Using Frame control in PivotItem -

don't know uwp/winrt control navigation within pivot? have pivot control 4 pivotitems. when have selected 1 of them, need navigate within pivotitem. pivot control stay on top, in pivotitem navigate. use frame control in pivotitem? if need navigate within pivotitem in right direction. can use frame in pivotitem . frame displays page instances, supports navigation new pages, , maintains navigation history support forward , backward navigation. ref frame class : you use frame control support navigation page instances. create many different page types needed present content in app, , navigate pages calling navigate method , passing in type of page navigate to.

CSS: Spinning letter within Spinning Text? -

i have codepen spinning sentence on hover, "powered coindesk" @ base of page. http://codepen.io/teeke/pen/xoqmpd i put spans around letters can style them individually. i want add spinner class letter p, spinning letter within spinning text. .spinner:hover { animation-play-state: running; animation-duration: 5s; animation-iteration-count:10; animation-delay: 0s; cursor:crosshair; } i can add blur class span, adding spinner not change anything. have hit limits of css or there can try won't jittery? thanks. a span inline element, , transforms don't apply them. change span's display attribute inline-block , work. span.spinner { display: inline-block; }

java - How to programmatically configure custom host in jetty server (8.1.8.v20121106) with SslSelectChannelConnector? -

i want access servlet https connection following address " https://ip-address:port/servletpath " . using sslselectchannelconnector jetty server (version 8.1.8.v20121106). i generated self signed certificate using keytool following information, cn=localhost, ou=<myorg>, o=<myorg>, l=trivandrum, st=kerala, c=in i have configured jetty server - sslselectchannelconnector follows, sslcontextfactory sslfactory = new sslcontextfactory(); sslfactory.setkeystorepath("<path of generated key store keytool>"); sslfactory.setkeystorepassword("mypassword"); sslfactory.setkeymanagerpassword("mypassword"); sslfactory.settruststore("<path of signed trust store keytool>"); sslfactory.settruststorepassword("mypassword"); sslselectchannelconnector sslselectconnector = new sslselectchannelconnector(sslfactory); sslselectconnector.setport(5443); registered servlet path =>

python - Move scientific notation exponential to right side of y axis in matplotlib -

Image
i have plotted figure this now want move scientific notation offset 1e4 right of right y axis, best move upper right of 1.8 label. how can this? this should work: t = ax.yaxis.get_offset_text() t.set_x(1.1) with ax right axis. however, cannot change y position, if not satisfied it, can hide offset text , create manually @ right position (x,y): ax.yaxis.get_offset_text().set_visible(false) text(x, y, "1e4")

python - Return the column name(s) for a specific value in a pandas dataframe -

where have found option in other languages such r or sql not quite sure how go in pandas. so have file 1262 columns , 1 row , need column headers return every time specific value appears. say example test dataframe: date col1 col2 col3 col4 col5 col6 col7 01/01/2016 00:00 37.04 36.57 35.77 37.56 36.79 35.90 38.15 and need locate column name e.g. value = 38.15. best way of doing so? thanks seeing have single row can call iloc[0] on result , use mask columns: in [47]: df.columns[(df == 38.15).iloc[0]] out[47]: index(['col7'], dtype='object') breaking down above: in [48]: df == 38.15 out[48]: date col1 col2 col3 col4 col5 col6 col7 01/01/2016 false false false false false false false true in [49]: (df == 38.15).iloc[0] out[49]: date false col1 false col2 false col3 false col4 false col5 false col6 false col7 true name: 01/01/2016, dty

java - Elastic Beanstalk logs security credentials -

we using aws elastic beanstalk our java/tomcat application. how can prevent multiple secure credentials printed in log file in plain text? have several environment variables, shouldn't in log files , database password (rds) automatically in log file. possible obfuscate passwords automatically? e.g.: info [main] org.apache.catalina.startup.versionloggerlistener.log command line argument: -drds_password=xxxxx

java - The method is undefined for the type JFrame -

i encountering 2 problems eclipse! worked fine months ago before replacing broken hardware, used play lot eclipse , learnt new stuff. however, seems nothing works. i followed tutorial: https://www.youtube.com/watch?v=1gir2r7g9ws , copy pasted , getting error: error: not find or load main class then started google solution 2 days, suggested check classpath wasn't sure type in cmd since have laptop borrowed school , has restrictions access areas in computer , workspace in folder requires administrator's priviledges. tried make normal helloworld class , worked without not find main class errors. so guess problem in code, or it? anyways, script here, window class: package gamepackage; import java.awt.canvas; import java.awt.dimension; import javax.swing.jframe; public class window extends canvas { private static final long serialversionuid = 4882660542739611206l; public window(int width, int height, string title, game game) { jframe frame