Posts

Showing posts from January, 2010

Python datetime weekday number code - dynamically? -

to weekday no, import datetime print datetime.datetime.today().weekday() the output integer within range of 0 - 6 indicating monday 0 @ doc-weekday i know how values python i wish create dictionary dynamically such as, {'monday':0, 'tuesday':1,...} the following code create dict d required values >>> import calendar >>> d=dict(enumerate(calendar.day_name)) >>> d {0: 'monday', 1: 'tuesday', 2: 'wednesday', 3: 'thursday', 4: 'friday', 5: 'saturday', 6: 'sunday'} edit: comment below @mfripp gives better method >>> d=dict(zip(calendar.day_name,range(7))) >>> d {'monday': 0, 'tuesday': 1, 'friday': 4, 'wednesday': 2, 'thursday': 3, 'sunday': 6, 'saturday': 5}

wordpress - Timeout while performing the DNS lookup -

i trying verify website on google webmaster show message ( connection server timed out ) use methods , failed note: when making page speed test using ( pagespeed insights tool ) return message ( timeout while performing dns lookup. ensure page loads in browser , try again. ) website working fine bad performance nescot.ic.edu.sa i found problem routing problem cause many hops becuase of wrong routing domain configuration tracepath website.domain show there many hops no replay routing cross long way reach server cause time out problem

Covariance for classes with list members in C# -

consider class hierarchy looks below. in essence, there abstract complexbase fields common classes. there complexclass derived complexbase that, among other things, holds collection of complexelement s derived complexbase . public abstract class complexbase { internal abstract string identifier { get; } } public abstract class complexclass<t> : complexbase t : complexelement { internal sortedlist<string, t> elements { get; set; } } public abstract class complexelement : complexbase { } implementations of abstract classes complexclassa , complexclassb . complexelement collection of former contains instances of complexelementa , of latter complexelementb . public class complexclassa : complexclass<complexelementa> { public complexclassa() { elements = new sortedlist<string, complexelementa>(); } } public class complexelementa : complexelement { } public class complexclassb : complexclass<complexelementb> { public complexclas

java - How to track database changes dynamically using spring? -

i using spring , spring-data , spring-cronjobs , java-mail . have requirement of instantly scanning changes in table present in my-sql database , fire mail admin regarding changes. all doing achieve running cronjob scan changes in table, heavy process table related monetary transaction , consumes lot of resources result application becomes slow. so, there better process can track current changes in database. example if there method set watchers in spring trigger process on database change helpful. the following sample of entity of table scanning. /** import statements **/ @entity public class userwallettransaction { @id @generatedvalue private long id; private string toaccount; @manytoone(fetch = fetchtype.lazy) user user; @manytoone(fetch = fetchtype.lazy) wallet wallet; private string senderormobile; private string benificiaryname; private string benimobile; private double transferamount; private double stax; pri

why forwarding of custom domain not work to g cloud compute engine -

forwarding of custom domain not work g cloud compute engine.as can access application external ip address , port http:x.x.x.x:8080/ when go go-daddy forward domain g cloud compute engine doesn't show , not work, how it get google cloud dns - hanging off networking on google dashboard console create zone domain supply ns type record typical values ns-cloud-c1.googledomains.com. ns-cloud-c2.googledomains.com. ns-cloud-c3.googledomains.com. ns-cloud-c4.googledomains.com. get godaddy , update domain's nameservers above values once deploy , have valid ip put type record on google cloud dns clicking on add record set ... value change ipv4 address field

php - Validate twitter usename using twitter api version-1.1 -

i want validate twitter usename. referred link it returns twitter json array when tried in local (xampp) server. returns empty in server. fyi: curl enabled in server. how solve this. updates: protected function buildbasestring($baseuri, $method, $params) { $r = array(); ksort($params); foreach($params $key => $value){ $r[] = "$key=" . rawurlencode($value); } return $method."&" . rawurlencode($baseuri) . '&' . rawurlencode(implode('&', $r)); } protected function buildauthorizationheader($oauth) { $r = 'authorization: oauth '; $values = array(); foreach($oauth $key=>$value) $values[] = "$key=\"" . rawurlencode($value) . "\""; $r .= implode(', ', $values); return $r; } public function returntweet(){ $oauth_access_token = "mytoken"; $oauth_access_token_secret = "mysecrekkey"; $consumer_key = "my consumer key"; $co

sql - Insert data in ssrs table in the query -

Image
i insert data in ssrs table. show here: how can add these data in query in ssrs. have no possibility change in database. | p1|p2 |p3 |p4 |p5 |p6 |p7 |p8 group a|84%|87%|81%|81%|79%|96%|86%|88% group b|66%|22%|79%|64%|53%|94%|5% |23% the problem is: last week on wednesday database did not recorded data group , group b. , have no possibility correct/add missing data in database. , thats why add these missed data in query , show in report. my query: select * ( select intervaldate datum ,tsystem.name name ,team group ,sum(goodunits) goods ,sum(theoreticalunits) units tcount inner join tsystem on tcount.systemid = tsystem.id intervaldate >= @startdatetime , intervaldate <= @enddatetime group intervaldate ) c inner join ( select sh.date datum, sc.name name thistory sh inner join tschedule sc on (sc.id = sh.scheduleid) scheduled != 0 ) p on p.name = c.name when realized data not recorded did written down da

url - How can I deal with child route with params in angular 2? -

when i'm in videocomponent url looks : app/video/9 here problem, want reach editcomponent when click tag (with routerlink) , rewrite url : app/video/9/users/3 this route config : @routeconfig([ { path: '/video/:video_id/users/:user_id', component: edit, name: 'edit'}, { path: '/video/:video_id/', component: video, name: 'video'} )] and routerlink : [routerlink]=" ['edit',{user_id:1}]" what missing ? ok, forgot directives in child editcomponent : directives: [routeroutlet, routerlink]

How to mock a java.net.Socket using wiremock? -

Image
i need mock java.net.socket class using wiremock technique... possible wiremock socket class? even if bit late, in case question raised later somebody: i in same situation. implemented separate junit @rule starts/stops serversocket , accepts socket requests test cases. i'm not allowed share code because belongs company. i'm allowed share powerslide surely how achieve it. in junit using client/service establish socket communication given port (in case: 9999). wiremock responses sockets written in same style http requests/responses. simplified example "any" method: wiremock.giventhat(wiremock.anyurl()).withrequestbody(wiremock.containing("blah blah")).willreturn(wiremock.aresponse().withbody("hello world!"))); in case socket/client sending body "blah blah" wiremock return "hello world!" http entity , content of http entity forwarded socket/client socket proxy. hope helps, chris

Recommended way to switch tile urls in mapbox-gl-js -

situation we render raster layer map. layer's source has initial tile-url. want change tile-url of source , trigger reload new tiles. e.g. have tiles different points in time , want step through different time steps. what can done in mapbox-gl@0.21.0 map.addsource('tile-source', {...}); map.addlayer('tile-layer', {source: 'tile-source', ...}); // react button click or ever trigger tile url change ... const source = map.getsource('tile-source'); source.tiles = ['new-tile-url']; source._pyramid.reload(); this works fine. but, of course, using private methods bad practice; see reason below: what can done current version github (latest commit b155118, 2016-07-28) // init map, add layer, add source, above const source = map.getsource('tile-source'); source.tiles = ['new-tile-url']; map.styles.sources['tile-source'].reload(); it has done way, because former tilepyramid has been refactored sourcecache .

Python NameError: name 'encrypt' is not defined -

when attempt run says nameerror: name 'encrypt' not defined. max_key_size = 26 def getmode(): while true: print('do wish encrypt or decrypt message?') mode = input().lower() if mode in "encrypt" 'e' 'decrypt' 'd'.split(): return mode else: print('enter either "encrypt" or "e" or "decrypt" or "d".') from understand of code, 'encrypt' string value. need create list required string values , check whether mode variable matches value in list. max_key_size=26 def getmode(): while true: mode=input().lower() if mode in ['encrypt','e','decrypt','d']: return mode else: print('enter either "encrypt" or "e" or "decrypt" or "d".') if want use .split() method, followi

How can I turn csv file row column value into (row, column, value) in Python -

for example, read 3x3 csv file. 01 02 03 01 | 11 | 22 | 33 | 02 | 44 | 55 | 66 | 03 | 77 | 88 | 99 | then ,i want output new textfile photo. → (row, column, value) → (01, 01, 11) → (01, 02, 22) → (01, 03, 33) → (02, 01, 44) i want use python array or loop ~~ like ~ for x in range(len(row)) suppose have example.csv file this: 11|22|33 44|55|66 77|88|99 with open("example.csv") handler: r,l in enumerate(handler): col, e in enumerate(l.split('|')): print('row: %s, col %s, value: %s' % (r+1, col+1, e))

c# - Add and subtract simultaneously in one formula -

i have 3 columns in details section: s.no balance type i want formula field total subtract value if type debit , add value when credit . logic in c++. how can rewrite in crystal syntax? if(type=="credit") total = total+balance else if((type=="credit") total = total-balance; you can try crystal report formula if {type} = "credit" {total} := {total} + {balance} else if {type} = "debit" {total} := {total} - {balance} alternately can write case statement in sql query updated_total select type, total,balance....., case when type ="credit" (total + balance) when type ="debit" (total - balance) end updated_total datatable ;

Running a timer for function which will be called later (python) -

def child_thread(i): global lock while true: try: lock.acquire() f1() f2() f3() : lock.release() thread1 = threading.thread(target=child_thread, args=(0,)) thread1.start() here need timer f2 function called.were thread should wait time. dont want use sleep. the function call after 30.0 seconds from threading import timer def hello(): print "hello, world" t = timer(30.0, hello) t.start()

maven - Jenkins build common module before build WAR file -

Image
i have maven project structure module below :- parent common report in common module, once compiled jar file final output execute report module using common jar inside war file. i wanted use jenkins compile common update jar file compile report module build war , deploy tomcat ( using jenkins ) is there can done using report pom.xml (single pom file ) build common , report ? is there better approach? please advise you can have 1 job builds common module , report. in report job specify should triggered after common built.

json - Exception in thread "main" org.apache.spark.SparkException: Task not serializable" -

iam getting above error while running below code. observed there serializable problem cudn't trace out exactly. can 1 explain can here. in advance. enter code here def checkfortype(json:string):string={ val parsedjson = parse(json) val res=(parsedjson \\ "head" \\ "type" ).extract[string] (res) } val dstream = kafkautils.createstream(ssc, zkquorum, group, map("topic" -> 1)).map(_._2) val ptype = dstream.map(checkfortype) ptype.map(rdd => { val pkt= rdd.tostring() if(pkt.equals("p300")) { val t300=dstream.map(par300) t300.print() }else if(pkt.equals("p30")) { val t30=dstream.map(par30) t30.print() }else if(pkt.equals("p6")) { val t6=dstream.map(par6) t6.print() } }) thi

xamarin - Generic in custom page (XAML) -

i have issue xamarin , have found similar issue on xamarin forum. here is, enter link description here . didn't solution this. can me issue. another forum link is: another xamarin forum link -- update here autogenerated code namespace mydemo.app.views { using system; using xamarin.forms; using xamarin.forms.xaml; public partial class signinview : global::mydemo.app.views.baseview { [system.codedom.compiler.generatedcodeattribute("xamarin.forms.build.tasks.xamlg", "0.0.0.0")] private void initializecomponent() { this.loadfromxaml(typeof(signinview)); } } } if understood correctly, suggest use: public class somepage : somegenericpage<someviewmodel> { } public partial class someanotherpage : somepage { public someanotherpage() { initializecomponent(); } } my somepage has generic t property viewmodel , reach someanotherpage . viewmodel property have typ

c# - Get value of property in dll -

i have project using object dll. namespace xxx.xxx.xxx.nsi { [serializable] [datacontract] [maybeamplified] public class gnginfo { public gnginfo(); [maxlenvalidator(1000)] public string name { get; set; } } } i need find name specific value example "cargo". ways exist this? modify huge dll , replace it. not have source code of dll. rewrite places used gnginfo object implemented not in dll. what other ways? you can implement class mygnginfo inherits gnginfo , implement custom logic. when done, replace gnginfo usages mygnginfo usages.

reactjs - Handling multiple onChange callbacks in a React component -

this how i'm handling scenario 2 input boxes. separate update method each one. can/should done single handlechange method instead? https://codepen.io/r11na/pen/bzkopj?editors=0011 class app extends react.component { constructor(props) { super(props); this.handlechange1 = this.handlechange1.bind(this); this.handlechange2 = this.handlechange2.bind(this); this.state = { name1: '', name2: '' }; }; handlechange1(e) { this.setstate({ name1: e.target.value }); }; handlechange2(e) { this.setstate({ name2: e.target.value }); }; render() { return ( <div class="row column"> <label name={this.state.name1}/> <input onchange={this.handlechange1} /> <label name={this.state.name2}/> <input onchange={this.handlechange2} /> </div> ); }; } const label = props => ( <p {...props}>hello: <

excel - How to use a variable in a linked cell reference? -

very new vba, use matlab , python. i've got following section of code sub example dim num integer num = 62 activesheet.checkboxes.add(23.25, 595.5, 101.25, 18.75).select selection .name = "newcheckbox" sheets("ipt data").select .caption = cells(num, "c") end sheets("ipt chart").select activesheet.checkboxes("newcheckbox").select selection .value = xloff .linkedcell = "'ipt data'!$a$num" .display3dshading = false end end sub i want linked cell refer anum. there way this? later num used in loop can't use standalone. like say, new , basic stuff, apoligse. had search around , have tried use both cells , range no avail. thanks use .linkedcell = "'ipt data'!$a$" & num but can avoid selecting , write: option explicit sub example2() dim num integer num = 62 worksheets(&q

How to debug Notifications on iOS With Firebase -

i have followed tutorial setup notifications on ios , have checked in application(application: uiapplication, didregisterforremotenotificationswithdevicetoken token: nsdata) function fcm token available firinstanceid.instanceid().token() . from firebase console tried send notification (status completed ) no notification received on ios device. in order check 'apple side', have uploaded y push notification certificates push notification service provided , works. so know how can debug application?

R data.table - how to interpolate missing values over FIXED rows in multiple columns -

a = data.table(c(2,na,3), c(5,na,1)) when try interpolate on missing lines a[, approx(x = 1:.n, y = .sd, xout = which(is.na(.sd))), .sdcols = 1:2] gives following error: error in xy.coords(x, y) : 'x' , 'y' lengths differ i wish following: > v1 v2 1: 2.0 5 2: 2.5 3 3: 3.0 1 it seems x , y (first 2 arguments) should numeric vectors. you'll need loop through each column.. here use set() along for-loop update original data.table by reference . len = 1:nrow(a) (col in names(a)) { nas = which(is.na(a[[col]])) set(a, i=nas, j=col, value=approx(len, a[[col]], xout=nas)$y) } # v1 v2 # 1: 2.0 5 # 2: 2.5 3 # 3: 3.0 1

actionscript 3 - Stop embedded music AS3 -

n.b. : called sound variables in different way 1 suggested duplicate. that's why it's not same structure follow start of question, in application, have used following lines embed music , run in on actual devices through adobe air : [embed(source = '/inspiration.mp3')] private var myback:class; private var back:sound; later on, whenever want play it, use following code : back = (new myback()) sound; back.play(0,9999); it works perfectly, problem when want stop music! i've used back.stop(); it's telling me 1061: call possibly undefined method stop through reference static type flash.media:sound. what doing wrong? you should store resultant soundchannel object , use 1 stop playing sound. var backplaying:soundchannel; .... backplaying=back.play(0,9999); .... backplaying.stop(); of course, make backplaying persistent, aka define in class aside back .

ionic framework - Modals not showing when I use soundcloud api with typings in my Ionic2 project -

problem: no modals showing , no dom update automatically triggered (i need call changedetectorref.detectchanges() ), when import and use soundcloud api typings in ionic2 project. how importing soundcloud api ionic2 project: in command prompt: npm install soundcloud typings install soundcloud --save in ts: import * sc 'soundcloud'; or import sc = require('soundcloud'); the soundcloud api works (audio streaming, tracks listing). but, no modal show in ionic2 project while code inserted in ts file of project. also, no dom update automatically triggered. my ionic info: cordova cli: 6.3.0 gulp version: cli version 3.9.1 gulp local: local version 3.9.1 ionic framework version: 2.0.0-beta.10 ionic cli version: 2.0.0-beta.32 ionic app lib version: 2.0.0-beta.18 os: node version: v6.2.2 note: if remove soundcloud code, modals show again. also, dom updates triggered again. no errors/warnings shown in console. any ideas?

How can i get the r_contactinfo from linkedin -

hi have done basic app can company page details of user. have email ids of user who..? liked page , post of particular company page, there api details. how r_contactinfo linkedin if use in api call shows error. in linkedin have mentioned tat have permission this, how that. have tried below url user details. returns error. https://api.linkedin.com/v1/people-search:(people:(id,first-name,last-name,headline,picture-url,industry,positions:(id,title,summary,start-date,end-date,is-current,company:(id,name,type,size,industry,ticker)),educations:(id,school-name,field-of-study,start-date,end-date,degree,activities,notes)),num-results)?first-name=parameter&last-name=parameter you can company followers segment. refer https://developer.linkedin.com/docs/company-pages#get_followers for getting user's liked specific update company, check https://developer.linkedin.com/docs/company-pages#get_update_likes r_contactinfo available through "apply linkedin" partner p

c# - How to convert string to a activation key(format xxxx-xxxx-xxxx-xxxx-xxxx) and extract original string from activation key -

i looking way create string in format of xxxx-xxxx-xxxx-xxxx-xxxx string , if have string can extract original string string in c#. have search on google found solution convert string required format don't original string output. there way achieve it. i found below sample of md5 converts string in desired format can't convert orignal string. private static string gethash(string s) { md5 sec = new md5cryptoserviceprovider(); asciiencoding enc = new asciiencoding(); byte[] bt = enc.getbytes(s); return gethexstring(sec.computehash(bt)); } private static string gethexstring(byte[] bt) { int tmp = (int)'a'; string s = string.empty; (int = 0; < bt.length; i++) { byte b = bt[i]; int n, n1, n2; n = (int)b; n1 = n & 15; n2 = (n >> 4) & 15; if (n2 > 9) { tmp = 0; tmp = (n2 - 10 + (int)'a'); s += ((char)(n2 - 10 + (int)&#

SonarQube analysis of C++ code using sonar-cxx and gradle -

i looking example of how run sonarqube analysis on c++ code using sonar-cxx plugin , gradle build system. pointers? tia. i not using gradle may following link can help? http://docs.sonarqube.org/display/scan/analyzing+with+sonarqube+scanner+for+gradle ps: have no idea why received down vote, question seems valid , appears gradle plug-in moved official sonarqube plug-in...

Slice on Django Model Queryset -

i try run query paged results, model.objects.all()[start: start+page_size] . i want know whether there more pages load, say, want know whether start+page_size < model.objects.all().count(). my question is, if call all() twice here, whether django executes same query twice (one slice operation [] , 1 count() ). another question if slice on model.objects.all() model.objects.all()[2:9] whether django fetch data db , slice python, or django fetch sql limit limit 2 9 yes, makes 2 queries, these not "same query" @ all. 1 select * mymodel limit <page_size> offset <start> , other select count(*) mymodel . if want avoid 2 queries, simple fix ask 1 more record need: model.objects.all()[start: start+page_size+1] then can iterate page_size, , show next button if record there.

android - How to open URL in my webViewApp from outside -

i created android app, has webview load pages. in app, home page edittext , button, if user enters url in textbox enters button, webview loads webpage. works fine. if user clicks url in whatsapp, mobile has options open url in browsers. i added following code in manifest file, list app along browsers open urls <intent-filter> <action android:name="redacted.mainactivity" /> <category android:name="android.intent.category.default" /> <category android:name="android.intent.category.browsable" /> <data android:scheme="http" /> <data android:scheme="https" /> <action android:name="android.intent.action.view" /> </intent-filter> now, app name available option open urls. when select app open url, doesn't paste url in edit text. what need add more. in mai

rvest - How to save a list of lists in R? -

i stored in list number of web pages collected rvest::read_html . save big list of web pages later use (so don't have scrape data again). i tried saverds , resulting file 1kb , reading data results in crash. suspect dynamic nature of object i'm trying save gets in way. what best way save data? many in advance help! you can convert text corpus of text , write them. easiest package tm in r. check https://cran.r-project.org/web/packages/tm/tm.pdf more details.

javascript - i am trying to fetch data from mysql to node.js here is the issue -

here issue query select * employee_leaves employee_leave_company_name ='$sup_company_name' , leave_status='pending' order employee_leave_id desc"; the problem here employee_leave_company_name stored in php variable $sup_company_name in file require.php how should access variable in javascript this have done far var cmpny_name; var reqdata=["c_name" : "sup_company_name"]; var xhrobj = $.get("require.php",c_name) .done(function( response ) { cmpny_name=response;//the echo text server }) .fail(function() { alert('error'); }); but isnt working.... , here php code require.php $sup_company_name=$_session['employee_company_name']; try this var cmpny_name; var reqdata=["c_name" : "<?php echo $sup_company_name; ?>"; var xhrobj = $.get("require.php",c_name) .done(function( response ) { cmpny_name=response;//the echo text server }) .fail(function() {

java - How to access a String array initialized in one method from another method? -

i have simple requirement have string array declare @ class level can use anywhere in class. string image_url[];//declared outside of methods //initailzed image_url[] img_url[] public void showjson(string json) { parsejson pj = new parsejson(json); pj.parsejson(); image_url= parsejson.img_url; toast.maketext(displaymagazine.this, "image loc"+image_url[1], toast.length_short).show(); } i want use image_url array in following method as:- private arraylist preparedata() { arraylist android_version = new arraylist<>(); (int = 0; < magazine_version_names.length; i++) { magazineversion magazineversion = new magazineversion(); magazineversion.setmagazine_version_name(magazine_version_names[i]); magazineversion.setmagazine_image_url(image_url[i]); android_version.add(magazineversion); } return android_version; } when run code app crash's

python - How to create Json Web Token to User login in Django Rest Framework? -

i want add jwt user login api authenticate. should according codes? create token manuel. must change. how can integrated? thank you. serializers class userloginserializer(modelserializer): token = charfield(allow_blank=true, read_only=true) class meta: model = user fields = [ 'username', 'password', 'token', ] extra_kwargs = {"password": {"write_only": true} } def validate(self, data): user_obj = none username = data.get("username", none) password = data["password"] if not username: raise validationerror("kullanıcı adı gerekli.") user = user.objects.filter( q(username=username) ).distinct() user = user.exclude(email__isnull=true).exclude(email__iexact='') if user.exists() , user.count() == 1: user = user.first() else: raise validationerror(&

r - Using dplyr group_by summarise how to keep a variable occuring at the maximum of another variable? -

for example, using airquality data, want calculate maximum temperature each month. keep day on maximum temperature occurred. library(dplyr) # maximum temperature per month airqualitymax <- airquality %>% group_by(month) %>% summarise(maxtemp = max(temp)) # day of month on max occured airquality %>% left_join(airqualitymax, = "month") %>% filter(temp == maxtemp) now appears day not unique, suppose unique, there way select day on maximum occurs in summarise() directly? we can use slice keep row have maximum 'temp' each 'month' airquality %>% group_by(month) %>% slice(which.max(temp)) a faster option arrange 'temp' in descending (or ascending) , first observation (or last slice(n()) ) airquality %>% group_by(month) %>% arrange(desc(temp)) %>% slice(1l)

GWT, how to fire event from widget or composite using EventBus from HandlerManager -

i have widget. fire event follow: fireevent(new indicatorstartevent("message")); but dosn't work. normally use presenter (gwtp), have regular widget: public class fileuploadwidget extends composite { materialfileuploader uploader = new materialfileuploader(); @inject public fileuploadwidget(string triggerid, eventbus eventbus) { super(); initwidget(uploader); window.alert("test start"); fireevent(new indicatorstartevent("message")); } } here event code: public class indicatorstartevent extends gwtevent<indicatorstartevent.indicatorhandler> { public static type<indicatorhandler> type = new type<indicatorhandler>(); public interface indicatorhandler extends eventhandler { void onindicatorprogressstart(indicatorstartevent event); } public interface indicatorhandlers extends hashandlers { handlerregistration addstartindicatorhandler(indi

javascript - Div closes automatically -

click on button sends value url should open div. opens div , automatically div closes. want prevent closing div automatically button <td><center><button type="button" id="item" class="btn btn-default btn-sm" onclick="myfunction(this)" value="<?php echo $id ;?>"> <i class="icon-pen"></i></button></center> </td> script below works, pick values table , send url, open div, div closes fast. <script> function myfunction(object) { var y = $(object).parent("center").parent("td").parent("tr").find(".nr center").text(); var x = $(object).attr("value"); window.location.href = "korpa.php?w1=" + x + "&w2=" + y; document.getelementbyid('izmjenadiv').style.display = "block"; } </script>

spring security - How to override BasicAuthenticationFilter using the schema configuration? -

we use spring security 4.x , want override basicauthenticationfilter . unfortunately not able find how configure class name basicauthenticationfilter nor in http element neither in http-basic element schema configuration. how override basicauthenticationfilter using schema configuration? i have tried override basicauthenticationfilter using custom filter without success – schema continue create default basicauthenticationfilter . added very strange. configured auto-config="false still can see creation of default basicauthenticationfilter . it should not created according documentation http://docs.spring.io/spring-security/site/docs/4.0.x/reference/htmlsingle/#nsa-http added the configuration w/o beans definitions <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:sec="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.or

ios - Animation: Using Autolayout, Frame.Origin & Broken Constraints, Or 3rd Option? -

Image
i've used auto layout build app layouts adapt iphone , ipad models. auto layout important. however, have keyframe automation view needs animate different location. achieved getting location of other view: let last_pos = destinationimg.superview?.convertpoint(destinationimg.frame.origin, toview: nil) and doing keyframe animation in frames set new coordinates, example: myview.frame.origin.x = targetviews_lastpos!.x this breaking auto layout constraints though. i've read , know many people suggest animating change in auto layout constraints (instead of frame position). isn't there better way? doing nightmare uiview i'm animating has set of complex constraints set right: and view who's location i'm targeting unrelated (they're nested in different superviews). wouldn't require ton of code create animation can in couple of lines frame.origin? , note, make view disappear after reaches destination it's temporary position anyhow. messing 15 c

c - PIC 18F452 Life Timer Storage -

we storing timer in eeprom_write data wipes out due unknown reason. highly appreciated. in short if have code run life-timer ( mileage meter in bike, storage last stage on system poweroff , restore last point ) in pic 18f452, kindly share us. <pre> /* ==============================lcd en rb0 pin # 33 rs rb1 pin # 34 d4 rb4 pin # 37 d5 rb5 pin # 38 d6 rb6 pin # 39 d7 rb7 pin # 40 microchip */ unsigned int time = 0; unsigned int sec=0; unsigned int minutes=0; unsigned int hour=0; char select_mode=0; unsigned int lt_minutes; unsigned int lt_hour; char txt2[]="0000000000"; char txt3[]="000000000000"; char txt4[]="0000000000"; char txt5[]="0000000000"; char txt10[]="000000000000"; char txt11[]="000000000000"; // lcd module connections sbit lcd_rs @ rb1_bit; sbit lcd_en @ rb0_bit; sbit lcd_d4 @ rb4_bit; sbit lcd_d5 @ rb5_bit; sbit lcd_d6 @ rb6_bit; sbit lcd_d7 @ rb7_bit; sbit lcd_rs

php - Error: Column count doesn't match value count at row 1 Error No: 1136 -

i trying upload .xlsx file, products, prices etc, in opencart e-shop. and, getting following error: notice: error: column count doesn't match value count @ row 1 error no: 1136 insert oc_product (product_id,quantity,sku,upc,ean,jan,isbn, mpn,location,stock_status_id,model,manufacturer_id,image,shipping,price,points, date_added,date_modified,date_available,weight,weight_class_id,status, tax_class_id,viewed,length,width,height,length_class_id,sort_order,subtract, minimum) values (5546,999,'','','','','','6.00340.00','',6,'6.00340.00',13, '',1,785,0,'2016-07-27 17:29:43','2016-07-27 17:29:43','2016-07-27',7,7,1,1, 0,0,0,0,0,'1','1','1','1'); in /var/www/vhosts/...... i have checked .xlsx file errors, or mistyped things or things that. but, cannot find problem causes error. any ideas why? appreciated. i see value i

if statement - Programe Not Executing in Correct Order in Android Studio -

i want check whether email id entered user unique or not have variable boolean valid = false; . on clicking button taking email id entered , checking valid email id expression using regular expression , using asyntask check uniqueness. code in onclicklistner is if (emailid.matches(regexp) && emailid.length() > 0) { new validate().execute(); toast.maketext(getapplicationcontext(), valid.tostring(), toast.length_long).show(); if (valid) { data.putstring("eid", eid); data.putstring("firstname", firstname); data.putstring("lastname", lastname); data.putstring("emailid", emailid); intent = new intent(getapplicationcontext(), gamesfragment.class); startactivity(i); } else { toast.maketext(get

php retain session across pages with redirect -

my issue similar displaying user name , user id $_session however, try , detail problem. modifying existing code add "login expiration" , "login page redirection". both modifications are in separate include files. login page redirection works fine if exclude login expiration file. the problem $_session['url'] set in page_one.php doesn't retain session in login.php long timeout.php include active? if comment out timeout.php in requesting page (page_one.php) session works designed. btw: session_id same in pages. login expiration (timeout.php): <?php if(!isset($_session['user_id']) || (time() - $_session['login_time'] > 1200)){ header("location: {$home_url}logout.php"); } else{ $_session['last_login_time'] = $_session['login_time']; // reset timer on page refresh $_session['login_time'] = time(); } ?> page redirection (redirect_login.php): <?php $_session['url'] = "

html - jquery - google analytics not pulling in the footer -

i trying add google anlytics html pages.the below page called rates.html. <html> <head> <title></title> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script> $(function(){ $("#footer").load("footer.html"); }); </script> </head> <body> <div id="footer"></div> </body> </html> on footer.html have following: <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="../css/stylesheet.css" /> <title>footer</title> </head> <body> <p align="center">numbers: +244 (0) 00000000 | lodge: +244 (0) 00000000 <br /> <a href="mailto:lodge@sidney.co.za%20" class="copy_link1"&g

java - which data structure to use to store the entries with their time stamp in sorted order -

i have implement 1 scenario in need store large number of entries timestamps "anystring" "timestamp". now, have check periodically entries timer going expire (let's entries expired timestamp more hour old). so, in order keeping them alive, have filter out entries timer going expire within time , perform operations , reinitialize timestamp. multithreaded environment. in order looking efficient data structure when scan map find out timer going expire, not have traverse entire map. traverse complete map each time filter out expire entries have huge performance impact. i think of using "concurrentskiplistmap" in comparator can used store entries in sorted order of timestamps. each time scan map till netires having timestamp greater required value. is there better way accomplish task? thanks. short: suggest http://netty.io/4.0/api/io/netty/util/hashedwheeltimer.html - want. long: there special kind of structures purpose: timer wheel

android - How to Mock/override/invoke CordovaPlugin's execute Method? -

i developing custom cordova plugin in android. other plugins - plugin consists of exposed js api android classes gets invoked when plugin js api called javascript. now write junit or instrumentation tests native android plugin code. below 1 main class in plugin gets invoked js support cordova public class mainplugin extends cordovaplugin { @override public void initialize(final cordovainterface cordova, final cordovawebview webview) { super.initialize(cordova, webview); } @override public void ondestroy() { super.ondestroy(); myaction1.cleanup(); myaction2.cleanup(); } @override public boolean execute(string action, jsonarray args, callbackcontext callbackcontext) { if (action.contains("action1")) { myaction1.getinstance(cordova).executeaction(action, args, callbackcontext); } else if (action.contains("action2") ) { myaction2.getinstance(c

Getting a string array from strings.xml in xamarin Android -

i have string array in strings.xml looks this: <string-array name="helppages"> <item>hello, dos-bot, , guide through game.</item> <item>in game learn how use computer terminal or console. important tool dealing technical problems on computer.</item> <item>for common user, terminal can useful figuring out problems related internet connectivity, corrupted or damaged files , many more. </item> </string-array> and want access in 1 of activities. i'm doing following: string[] pages = getstringarray(resource.array.helppages); but it's not working. i : string[] pages = getresources().getstringarray(r.array.helppages);

javascript - website gets slow when huge amount of data is being loaded -

i have internal team website build using python django , angularjs . website works fine when there low data/ content on it. when website gets scrolled , more data loaded. becomes slow. major problem occurs when try open modal or try write text in textarea . text lags while writing , modal open slowly. i have used nested ng-repeat there 5 nested ng-repeat . <div ng-repeat="x in xyz"> <div ng-repeat="y in xyz"> </div> <div ng-repeat="img in xyz"> </div> <div ng-repeat="y in xyz"> <div ng-repeat="z in xyz"> </div> </div> </div> above example of structure being used in website. above snippet repeat around 100 times thorughout page. these having images, forms, text, input , user tagging facebook. ngcachebuster,ui.bootstrap, ngtagsinput, ui.mention,monospaced.elastic these external library being used in website. website built using

c++ - CGAL loop over facets sharing an edge -

hello fellow stackers, i write function loops on finite edges of cgal regular 3d triangulation, , calculates angles between pairs of faces (facets) sharing edge. in reference guide found method called incident_facets should give circulator facets incident specific edge. i'm not 100% that method i'm looking for, of all, have no idea how use it. perhaps show me how works in practice? also, know if there built-in cgal method loops on finite facet pairs, don't have write out explicitly? thanks no, there no built-in cgal method loops on finite facet pairs. you can find example use of circulator there http://doc.cgal.org/latest/triangulation_2/index.html#title9 in case, easier iterate on finite cells , @ 6 pairs of facets in each tetrahedron. best,

java - No main manifest attribute after creating jar, Cmd Windows -

i want create jar command line in windows script: cd mongo-sql/src javac -cp "..\\lib\\*;..\\lib\\hapi-lib\\*" *.java fhirtranslate\*.java jar -cvfm ..\\lib\\runsqlsave.jar ..\\meta-inf\\manifest.mf *.class and manifest: manifest-version: 1.0 class-path: ..\\lib\\*.jar ..\\lib\\hapi-lib\\*.jar main-class: main after run script didn't receive error, when want run runsqlsave.jar receive no main manifest attribute, in runsqlsave.jar in manifest file don't have main-class: main . ideas? thanks. you can specify entry point class using -e flag see link

Cassandra AssertionError: length is not > 0 -

running following exception trying start 3.0.5 cassandra cluster. not sure means or how proceed. info 14:14:05 initializing keyspace.table exception (java.lang.assertionerror) encountered during startup: length not > 0: 0 java.lang.assertionerror: length not > 0: 0 @ org.apache.cassandra.utils.bytebufferutil.readbytes(bytebufferutil.java:408) @ org.apache.cassandra.io.sstable.metadata.compactionmetadata$compactionmetadataserializer.deserialize(compactionmetadata.java:93) @ org.apache.cassandra.io.sstable.metadata.compactionmetadata$compactionmetadataserializer.deserialize(compactionmetadata.java:73) @ org.apache.cassandra.io.sstable.metadata.metadataserializer.deserialize(metadataserializer.java:123) @ org.apache.cassandra.io.sstable.metadata.metadataserializer.deserialize(metadataserializer.java:94) @ org.apache.cassandra.io.sstable.metadata.metadataserializer.mutatelevel(metadataserializer.java:133) @ org.apache.cassandra.db.compaction.levele

ios - How to automatically update the child view when the parent view's frame changes? -

i revising custom keyboard application. first attempt using stack views layout views had performance hit of 4-6 seconds of delay. so, making new custom keyboard using custom view , calling layoutsubviews() well, layout views. now, have made custom view represents keyboard. way, hardcoding values keyboard size. so, 1 work iphone 5 , 5s only. ( i'm checking view's frame width this.) now, want make keyboard's view controller update custom view's frame whenever view controller bounds update! how set custom view parent fill parent width , height such updates custom view's bounds/frames whenever view controller's bound change? here's code far. import uikit class keyboardviewcontroller: uiinputviewcontroller { var keyboardview: keyboardview? override func updateviewconstraints() { super.updateviewconstraints() // add custom view sizing constraints here } override func viewdidload() { super.viewdidload