Posts

Showing posts from May, 2011

typeahead.js - Pass value from DOM element into typeahead with bloodhound -

i pass value hidden input field search remote url parameter in bloodhound. the variable dynamic , updated every time modal popup gets open. initial value null , believe that's why not working @ all: url: url + 'equipment/getsuggestions/' + $('#equipment-type-input').val() + '/%query', as can see i'm getting jquery value empty. because getting once when plugin initialized? here full script: // instantiate bloodhound suggestion engine var suggestions = new bloodhound({ datumtokenizer: function (datum) { return bloodhound.tokenizers.whitespace(datum.value); }, querytokenizer: bloodhound.tokenizers.whitespace, remote: { url: url + 'equipment/getsuggestions/' + $('#equipment-type-input').val() + '/%query', wildcard: '%query', filter: function (movies) { // map remote source json array javascript object array return $.map(movies, function (movi

python - Solving overdetermined system in numpy when the value of one variable is already known -

i'm trying solve overdetermined system in python, using numpy.solve function. know value of 1 of variables , know in theory can find unique solution system if can somehow plug in known value. my system of form axc=b . variables split 2 groups, 1 group of n variables , 1 of t variables (although not matter math). (t*n x t+n) matrix, c variables vector, of length (t+n) , , b vector of length (t*n) . how tell numpy.solve (or function in python, please don't recommend least squares, need unique, exact solution, know exists) use known value of 1 of variables? a simple example of system be: |1 0 0 1 0| |n1| |b1| |1 0 0 0 1| |n2| |b2| |0 1 0 1 0| x |n3| = |b3| |0 1 0 0 1| |t1| |b4| |0 0 1 1 0| |t2| |b5| |0 0 1 0 1| |b6| the values of elements of b of course known, value of 1 of variables, let's know t1=1 . dots don't mean put them there characters wouldn't bunch up. say need solve |1 0 0 1 0|

python - Verbatim-tag in Google App Engine not working -

i want serve polymer -code via django in google app engine . the problem is, polymer uses double curly braces, django . in newer django versions, 1 can use verbatim-tag , in version used in google app engine , this tag not implemented . is there alternative? i ended using jinja2 instead

javascript - How to implement groups in Angular.js -

i have 2 lists, 1 names of "groups" , names of "items". should change contents of list of items when group selected. <div class="headers"> <div id="header-1">header 1</div> <div id="header-2 selected">header 2</div> </div> <div class="contents"> <div id="contents-2-1">Сontents 2.1</div> <div id="contents-2-2">Сontents 2.2</div> </div> currently i've monkey-coded 2 controllers interacting via service, it's not angular-idiomatic way that. it solvable if each #header-n contained #contents-n-* inside of it, scoping rules enough implement required behaviour. problem it's impossible so. another way in angular todomvc example via list filtering. combined quantity of items on groups high enough discard option. how implement such group selection in idiomatic way? upd. data looking this: var groups

How to append Git commit information the built website -

i use automated script latest (or specific) git commit, build , deploy platform. want append commit details upon each build, possible see commit used build platform. what strategy achieve that? thank in advance eduardo this command can current commit digest. git rev-parse --short head output: 3ba7598 you can save digest upon each build.

javascript - jQuery getting data attribute not working -

i have script produces number of buttons class , want alert data attribute on click it's not working. here output of html <button class="request box-button" data-value="18492500814">request</button> jquery code $(document).ready(function(){ $('.request').each(function () { var photoid = $(this); photoid.click(function () { alert($(this).data('value')); }); }); }); since elements don't exist when page loads, event won't bound them. fix using event delegation : $(document).ready(function(){ $(document).on('click','.request', function () { alert($(this).data('value')); }); }); js fiddle demo dynamically generated elements note: here, used $(document).on() because don't have page's structure. if insert buttons in container exists in html, use instead: $('#mycontainer').on() . won't noticeable, be

ifndef - Conditional exclusion of code in Swift -

i trying exclude parts of swift file specific target. yet did not find replacement of #ifndef objective-c directive , if use form of kind: #if taxi_coops func pippo(){ println("pippo"); } #else func triggeractivelocationupdate(entering:bool){} #endif the preprocessor totally ignores directive , tries compile triggeractivelocationupdate. please note #if taxi_coops directive respected in other parts of same file. is there way exclude pieces of code in swift and/or why fix not work? in swift, use #if ! replacement #ifndef , e.g.: #if !os(osx) // compiled when not on os x #endif

r - Pretty printing zeros in data.frame with integers and doubles to CSV -

i have following data.frame: q <- data.frame(a = rep(0,12), b = rep(c(0,1),6), c = 0:11, d = c(rep(0.0,10),0.003579535,0.045418328), e = c(rep(0.0,10),0.001716128,0.057440227)) > q b c d e 1 0 0 0 0.000000000 0.000000000 2 0 1 1 0.000000000 0.000000000 3 0 0 2 0.000000000 0.000000000 4 0 1 3 0.000000000 0.000000000 5 0 0 4 0.000000000 0.000000000 6 0 1 5 0.000000000 0.000000000 7 0 0 6 0.000000000 0.000000000 8 0 1 7 0.000000000 0.000000000 9 0 0 8 0.000000000 0.000000000 10 0 1 9 0.000000000 0.000000000 11 0 0 10 0.003579535 0.001716128 12 0 1 11 0.045418328 0.057440227 i save in csv following format: "a","b","c","d","e" 0,0,0,0.000000000,0.000000000 0,1,1,0.000000000,0.000000000 0,0,2,0.000000000,0.000000000 0,1,3,0.000000000,0.000000000 0,0,4,0.000000000,0.000000000 0,1,5,0.000000000,0.000000000 0,0,6,0.000000000,0.000000000 0,1,7,0.000000000,0.000000000 0,0,8,0.000000000,0.

java - Hide View other than Gone -

does know if way hide view other view.gone , view.invisible? if (isavailable) { layout.setvisibility(view.visible); } else { layout.setvisibility(view.gone); } i'm dynamically setting 1 fragment show , disappear in view , view.gone , view.invisible leave behind space, sometimes, , looks glitching fragments , action bar, making fragment content disappear. there no other option hide view you can use below parameters only view.setvisibility(view.gone / view.visible / view.invisible)

javascript - Angular, ternary in ng-click -

i have ternary inside ng-click swap value between 'bookmarks' , 'none'. first click change bookmarks works great second 1 not. think have wrong in syntax or logic. here code: ng-click="current = 'bookmarks' ? current = 'bookmarks' : current = 'none' " i print {{current}} on screen , change bookmarks once i've toggled that. appreciate help. thanks! your ternary expression wrong. bookmarks ( string ) evaluated true so, current assigned bookmarks . seems work first time. however, next clicks assigned bookmarks . use following expression: ng-click = "current = (current == 'bookmarks') ? 'none' : 'bookmarks'"

dns - How to set up a simple docker-contained reverse-proxying (nginx) server? -

technically shouldn't asking question able accomplish it, did not record of notes/findings on , forced delete centos vm on not boot properly. fubar , need remember did. the challange me have 3 different docker containers. npm repo container , bower container (link in comment 1), , controlled nginx container . npm repo , bower had able access same ip address down different ports , accessed via special names bower.swig.swag. or npm.swig.swag . port handling have been taken care of nginx container , in turn have containers desiring accessed @ ip address attach --env flag of virtual_host= (as stated docker info on nginx link). so ip desired npm containers , bower containers 10.1.10.1 down ports 8080:8080 , 5678:5678 respectively. think dns server 10.1.10.30 or based on localhost, cant sure @ moment ip's try provide, excluding localhost 127.0.0.1 , 10.0.2.15 not work relationship docker run -p flag (i have no idea why happened. 1 minute, ip provide docker works , after d

javascript - option selected not working from AngularJS template -

i'm new angularjs, simple, can't seem figure out. problem not in angularjs code itself, i'm sure somehow connected, because i've tried in blank pure-html test page, , worked, how it's supposed to. headers.html: <table> <thead> <tr> <td colspan="2" align="right"> sort headers by: <select ng-model="sortheaders"> <option value="rating">rating</option> <option value="id" selected>id</option> </select> </td> </tr> <tr> <th>rating</th> <th>header</th> </tr> </thead> <tbody> <tr ng-repeat="header in headers | filter:search | orderby:sortheaders"> <td>{{header.rating}}</td> <td>{{header.title}}</td> </tr> </tbody&

java - JPA Entity Mapping which is related based on two other entity mappings -

not sure if possible trying map workflowinstanceplayer player related based on 2 other entity mappings, workactionclass , workflowinstance in entity below. public class action implements serializable { @id private long action_id; @manytoone @joincolumn(name = "work_action_class_id", referencedcolumnname = "work_action_class_id") private workactionclass workactionclass; @manytoone @joincolumn(name = "workflow_instance_id", referencedcolumnname = "workflow_instance_id") private workflowinstance workflowinstance; update: how can map workflowinstanceplayer player????? @manytoone @joincolumns( { @joincolumn(name = "workflow_instance_id", referencedcolumnname = "workflow_instance_id", insertable = false, updatable = false), @joincolumn(name = "workactionclass.role_class_id", referencedcolumnname = "role_class_id", insertable = false, updatable = false) }) private workflowinstancepl

Java GUI Scientific Calculator -

i trying code scientific calculator in java. however, having difficulties trying program calculate. can see in code below, have managed gui working numbers printing on gui. have added functionality "+" button in order test first see if program works. public class gui extends jframe { private static jbutton [] button = new jbutton[36]; private static textfield tf; private jpanel panel; private jpanel panel1; public gui(){ super("scientific calculator"); panel = new jpanel(); panel1 = new jpanel(new gridlayout(0,4)); tf = new textfield(20); tf.seteditable(false); panel.add(tf); button[0]=new jbutton("rad/deg"); button[1]=new jbutton("x!"); button[2]=new jbutton("sqrt"); button[3]=new jbutton("sin"); button[4]=new jbutton("cos"); button[5]=new jbutton("tan"); button[6]=new jbutton("ln"); button[7]=new jbutton("log

javascript - Append a div as a parent of an ul -

i have html. <div class="col-xs-6"> <div class="datatables_paginate"> <!-- content here --> </div> </div> having this, want append new div @ top of datatables_paginate new html this. <div class="col-xs-6"> <div class="ui menu pagination"> <div class="datatables_paginate"> <!-- content here --> </div> </div> </div> if try $('.datatables_paginate').parent().append('<div class="ui pagination menu"></div>') this append div dosnt wrapp datatables_paginate div inside new appended div. you can use jquery wrap function this. try code:- $('.datatables_paginate').wrap('<div class="ui pagination menu"/>');

ruby on rails - Access and Delete Dead Jobs in Sidekiq -

i'm running sidekiq inside docker container in production , don't have access web ui. sidekiq workers appear have failed , need check whether have indeed failed , delete or retry them. not hundred percent i'm seeing here having collected workers using workers = sidekiq::workers.new , i'm getting result in rails console leads me believe have dead jobs: workers.each { |process_id, thread_id, work| puts "worker #{work}\n\n" } worker {"queue"=>"default", "payload"=>{"retry"=>1, "queue"=>"default", "class"=>"peopleworker", "args"=>["<arg-1>", "55800c0161616600b5000000"], "jid"=>"08126d4162242a26825ce2d3", "enqueued_at"=>1436800316.1181111, "error_message"=>"error 503: query timed out", "failed_at"=>1436816149.1032495, "retry_count"=>0}, &quo

angularjs - Can we write more than one get/post custom methods in webAPIController?? If so how to pass string parameter to that customized method? -

i new webapi , mvc....please me go forward. below scenario in facing issue. in webapi controller want write custom/userdefined get/post method , want pass string parameter argument. throwing error.... defaultly accepting integer parameter. below method need add webapicontroller. [httpget] public bool isexists(string email) { //code: return true if email exists else returns false. } even added custom routing in webapi.config file before default api routing. routes.maphttproute( name: "customapi", routetemplate: "api/{controller}/{action}/{email:string}", defaults: null ); thanks in advance. :) you use attribute routing if using webapi 2: [route("api/emails/exists/{email}")] [httpget] public bool isexists(string email) { //code: return true if email exists else returns false. } this take value passed in {email} , pass in method.

How to compare html literal using c# -

i need compare 2 htmls. 1 url using webclient.downloadstring method. other have on bucket on amazon s3 . problem when using downloadtext method of amazon sdk, html special characters substituted html codes &quot; double quotes. comparision different. know if theres work around deal problem. if file not in amazon in file system, method file.readtext works charm. if source 'escaped' htmldecode method should trick you: using system.web; string escapedsource = "&lt;p&gt;&quot;some content unescaped&quot;&lt;/p&gt;"; string unescapedresult = httputility.htmldecode(escapedsource); unescapedresult.dump(); result: <p>"some content unescaped"</p>

c# - HTTP POST stuck in an infinite loop until times out? -

i have sent post request using code: var postdatax = new dictionary<string, string> { { "korefor", "new" }, { "korename", "initial" }, { "set_instant", "true" }, { "set_engine", "google" }, { "set_language", "en" }, { "set_location", "uk" }, { "set_mobile", "false" }, { "set_email", "example@mediaworks.co.uk" }, { "set_mainurl", "mediaworks.co.uk" }, { "set_compurls", "google.com, yahoo.com" }, { "koreforname", "mediaworks" }, { "koreforkeywords", "newcastle seo, mediaworks, orm" }

ruby - Setting/clearing AngularJS md-checkbox with Watir -

i'm trying perform automated testing using watir gem. need test whether checkbox works setting , clearing it. the html checkbox is: <md-checkbox aria-label="remove" aria-invalid="false" aria-checked="false" tabindex="0" class="ng-pristine ng-valid md-default-theme ng-touched" role="checkbox" ng-model="user.remove_photo" style="margin-top: 0px;"> <div class="md-container" md-ink-ripple="" md-ink-ripple-checkbox=""> <div class="md-icon"></div> <div class="md-ripple-container"></div> </div> <div ng-transclude="" class="md-label"> <span class="ng-scope">remove</span> </div> </md-checkbox> my test script: require 'watir' require 'watir-webdriver/wait' browser = watir::browser.new :firefox browser.goto '

Sending Emails THrough Codeigniter PHP -

i need send mail after submitting form. below code able error is. redirecting same page.below controller. if use email function inserting database if use mail not inserting. function addparents() { $this->load->library('form_validation'); $this->form_validation->set_error_delimiters('<br /><span class="error"> ','</span>'); $this->form_validation->set_rules('first_name','first name','required|alpha'); $this->form_validation->set_rules('last_name','last name','required|alpha'); $this->form_validation->set_rules('mobile_number','mobile number','required|is_numeric|max_length[10]'); $this->form_validation->set_rules('email_list','email_list','required|valid_email'); $this->form_validation->set_rules('message','message'); if($this->fo

python - I am trying to find xpath for checkbox in a table column -

i trying find xpath checkbox , click using python webdriver script. checkbox in column in table. text checkbox in column. text dm. want click checkbox has text value dm. don't want checkbox has text value ceb07_14_1504_06_52 i need xpath please. the html is: <table cellspacing="0" style="table-layout: fixed; width: 100%;"> <colgroup> <tbody> <tr class="gat4pnufg" __gwt_subrow="0" __gwt_row="0"> <td class="gat4pnueg gat4pnugg gat4pnuhg"> <div __gwt_cell="cell-gwt-uid-139" style="outline-style:none;" tabindex="0"> <input type="checkbox" tabindex="-1"/> </div> </td> <td class="gat4pnueg gat4pnugg"> <div __gwt_cell="cell-gwt-uid-140" style="outline-style:none;"> <span class="linkhover" title="ceb07_14_1504_

c# - StructureMap - Register a singleton for multiple interfaces -

i want register animals singletons, wrote structure map registry following code: this.for<ilion>.use<lion>().singleton(); this.for<ielephant>.use<elephant>().singleton(); ilion , ielephant derive ianimal , want possibility animals @ once. tried: this.for<ianimal>.add<lion>().singleton(); this.for<ianimal>.add<elephant>().singleton(); but gives me 2 different lion instances each interface: public anyconstructor(ilion lion, ienumerable<ianimal> animals) { // lion == animals[0] should true here, false } how can tell structure map instantiate one lion ? if mean getting 2 different lion instances, can use forward<tfrom, tto>() method in registry: this.for<ilion>().use<lion>().singleton(); this.for<ielephant>().use<elephant>().singleton(); this.forward<ilion, ianimal>(); this.forward<ielephant, ianimal>(); then, ianimal instances use getallinstances<t>

javascript - Finding the request is to Script or a .Net request -

in sample application if url clicked 2 requests. one .net application , javascript in application. i had injected code in functions of application. in runtime can find if request java script or .net request. ./rahul you can check via request.headers["x-requested-with"]

Powershell FTP script -

i'm using script in loop download number of files server , works pretty good. $sourceuri = "ftp://ftp.secureftp-test.com/hamlet.zip" $targetpath = "c:\hamlet.zip" $username = "test" $password = "test" # create ftpwebrequest object handle connection ftp server $ftprequest = [system.net.ftpwebrequest]::create($sourceuri) # set request's network credentials authenticated connection $ftprequest.credentials = new-object system.net.networkcredential($username,$password) $ftprequest.method = [system.net.webrequestmethods+ftp]::downloadfile $ftprequest.usebinary = $true $ftprequest.keepalive = $false # send ftp request server $ftpresponse = $ftprequest.getresponse() # download stream server response $responsestream = $ftpresponse.getresponsestream() # create target file on local system , download buffer $targetfile = new-object io.filestream ($targetpath,[io.filemode]::create) [byte[]]$readbuffer = new-object byte[] 1024 # loop throu

SQL Server : Alter View error - no column name specified -

i trying alter view - trying provide complete new definition of select statement runs. my sql statement looks (i've changed cols privacy reasons): alter view dbo.vwviewnamehere select h.batch, h.batch_name collate latin1_general_ci_as, h.serial_from, h.serial_to, h.batch_description (select batch, ltrim(rtrim(name)) collate latin1_general_ci_as batch_name, aa serial_from, bb serial_to, convert(varchar(99), batch) + ' - ' + ltrim(rtrim(name)) collate latin1_general_ci_as batch_description [ipaddress].database.dbo.tablename) h full outer join dbo.othertablename b (nolock) on ltrim(rtrim(b.batch_name)) = h.batch_name collate latin1_general_ci_as , h.serial_from = b.start_serial , h.serial_to = b.end_serial (b.batch_id null) i've confirmed sele

java - Wicket: AJAXDownload - dowload several files -

i using wicket framework. i have requirement send client browser several individual files (a zip file not relevant). i have added page ajaxdownload class extends abstractajaxbehavior - solution sending files client this: download = new ajaxdownload(){ @override protected iresourcestream getresourcestream(){ return new fileresourcestream(file){ @override public void close() throws ioexception { super.close(); file.delete(); } }; }}; add(download); at other point in code trying initiate download of several files client using ajax request whilst looping through arraylist of files , each time triggering ajaxdownload: arraylist<file> labellist = printlabels(); for(int i=0; i<labellist.size(); i++){ file = labellist.get(i); //initiate download download.initiate(target); } how

ios - Update Parse deviceToken AFTER registration -

currently i'm sitting quite few empty devicetoken fields. figured out because there issue adding groups before installation object created - block subsequent creation efforts. what i'm trying devicetoken again , update in parse problem is, didregisterforremotenotificationswithdevicetoken never run again after first time... any way device token after initial call didregisterforremotenotificationswithdevicetoken ? this work ios 8: if ([application respondstoselector:@selector(registerusernotificationsettings:)]) { uiusernotificationsettings* notificationsettings = [uiusernotificationsettings settingsfortypes:uiusernotificationtypealert | uiusernotificationtypebadge | uiusernotificationtypesound categories:nil]; [[uiapplication sharedapplication] registerusernotificationsettings:notificationsettings]; [[uiapplication sharedapplication] registerforremotenotifications]; } else { [[uiapplication sharedapplication] registerforremotenotificationtypes

ios - Code pattern / snippet for retrieving single column from cloudkit -

i'm building app allows users upload / download info common store. thought cloudkit storage ideal this. i'd users able search records in store keyword field, download entire record when select one. in sql terms like: select id,keywords mydb keywords %searchstring% followed by: select * mydb id = selectedid i have been using code pattern retrieve records cloudkit storage: var publicdatabase: ckdatabase? let container = ckcontainer.defaultcontainer() override func viewdidload() { super.viewdidload() publicdatabase = container.publicclouddatabase } func performquery(){ let predicate = nspredicate(value: true) let query = ckquery(recordtype: "library", predicate: predicate) publicdatabase?.performquery(query, inzonewithid: nil, completionhandler: ({results, error in ... [code handle results / error here] ... }) } but returns all content of each record lot of unnecessary info. i'd fetch s

Building iOS project with Jenkins on Ubuntu Linux -

i have installed jenkins in ubuntu , while trying build ios app in jenkins below error occurs: fatal: cannot find xcodebuild configured path /usr/bin/xcodebuild. the xcodebuild tool part of xcode sdk apple — it's available download on mac os x. cannot use official ios tools build on computer isn't running os x. this means that, if have jenkins job builds ios app, must built on mac. this not mean, however, jenkins must installed on mac. jenkins supports distributed builds , whereby can have multiple machines, different operating systems, , can instruct jenkins on machine build should run. for example, have ubuntu machine jenkins master server, can add mac build node . jenkins master communicate build node (mac) via ssh. in configuration build node, should add label, e.g. "xcode", signify xcode sdk installed. in jenkins job configuration, there option called "restrict project can run", can tell jenkins may build job on node

c# - Running Tests in different Assemblies -

when tried run tests vs shows message: "no tests found run." this code: public abstract class mybaseclasstests { protected irepository repository; [testmethod] public void test1 () { var x = this.repository.get("id); assert.areequal(x.id, "id"); } } [testclass] public class implementation1tests : mybaseclasstests { [testinitialize] public void setup() { this.repository= new memoryrepository(); } } [testclass] public class implementation2tests : mybaseclasstests { [testinitialize] public void setup() { this.repository= new sqlrepository("connectionstring..."); } } all implementations in different test projects. (different assemblies) any suggestion? or vs limitation? apparently limitation in visual studio test runner mstest. issue test classes in different assemblies base fixture. my test shows long base test fixture located in same assemb

objective c - RestKit mapping for org.joda.time.Interval obj -

i have working part mapping simple json response. here how like: rkobjectmapping *eventmapping = [event responsemapping]; rkresponsedescriptor *listeventsresponsedescriptor = [rkresponsedescriptor responsedescriptorwithmapping:eventmapping method:rkrequestmethodget pathpattern:nil keypath:nil statuscodes:rkstatuscodeindexsetforclass(rkstatuscodeclasssuccessful)]; [objectmanager addresponsedescriptor:listeventsresponsedescriptor]; and of course event class (dto) #import <foundation/foundation.h> #import <restkit/restkit.h> @interface event : nsobject @property (nonatomic, strong) nsstring *id; @property (nonatomic, strong) nsstring *title; @property (nonatomic, strong) nsstring *detail; @property (nonatomic, strong) nsstring *image; + (rkobjectmapping *) responsemapping; @end @implementation ev

php - REST Resource vs Services -

i have created code make calls external api (that did not create). however, has been described 'service-centric', while rest apis 'resource-centric'. what needs changed turn service based call? don't understand difference is. understand need use http verbs thought doing curl. possible curl? the api have been passed contains bunch of resource urls example; get http://api.privateservice.com/person?id=123 post http://api.privateservice.com/person/savedetails/123 think of resources nouns, ie objects or records in database. think of actions verbs, ie function calls. the first example indeed resource-centric. it's getting resource of type person identified 123. the second example not resource-centric because it's function call. rest , http establish conventions saving resource. in case need put resource's url, ie same url retrieved get. so upload json (or whatever format) using: put http://api.privateservice.com/person?id

encoding - PHP and UTF-8 String functions WITHOUT MB-Functions? -

i try use utf-8 php, output seems okay (display correct äöüß etc, when testing) on site, there problem... when use echo strlen("Ä"); shows me "2"... read topic: strlen() , utf-8 encoding in answer read this: the replacement character gets inserted when utf-8 decoder reads data that's not valid utf-8 data. i wonder, why data not valid utf-8? because: i saved files in "utf-8 no bom" used utf-8 header on first line my browser says "encoding: utf-8" this code: <?php header("content-type: text/html; charset=utf-8"); $test = 'Ä'; echo strlen($test); var_dump($test); ?> my question: can use normal php-functions utf-8 or must use "mb"-functions? if it's possible use normal php-functions, why show me strlen() 2 in code, instead of 1? strlen() return length of string in bytes default, not characters... can change setting mbstring.func_overload ini setting tell php return

android - Google Billing V3 null pointer exception -

basically want static test of google billing v3,before doing real online test using beta version thing. when try run program,i following part of exception... caused by: java.lang.illegalargumentexception: connection null @ android.app.contextimpl.bindservicecommon (contextimpl.java:1935) @ android.app.contextimpl.bindservice(contextimpl.java:1921) @ android.content.contextwrapper.bindservice (contextwrapper.java:529) @ victory.walkto.paymenttestb.mainactivity. oncreate(mainactivity.java:37) @ android.app.activity.performcreate(activity.java:5451) the program wrote following. public class mainactivity extends activity { iinappbillingservice mservice; serviceconnection connection; string inappid = "android.test.purchased"; //replace in-app product id @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main

Prestashop 1.6.1.0 - copied default theme's navbar doesn't work -

hi want create custom theme using default-bootstrap copied whole folder, rename , made changes in css. i install theme via backend, deleted cache files , theme seems working there issue top navbar - isn't in default-bootstrap, check this: default's nav: http://i.imgur.com/mirnm42.png my nav: http://i.imgur.com/mrwzefm.png any ideas why nav isn't lok default? did check css + code typos? might case :) try this: https://validator.w3.org/#validate_by_uri+with_options

ios - How to check an ability of swift to open URL? -

i'm trying images web , can't correctly check validity of url. code: var url = nsurl(string: self.linkurl) if uiapplication.sharedapplication().canopenurl(url!) { errorlabel.hidden = true println(self.resulturl) self.performseguewithidentifier("save", sender: self) } else { errorlabel.hidden = false } it works if user pastes " https://www.google.com " doesn't if it's "www.google.com" or "google.com". i've tried: if var url = nsurl(string: self.linkurl) { errorlabel.hidden = true println(self.resulturl) self.performseguewithidentifier("save", sender: self) } else { errorlabel.hidden = false } it works if enter " https://www.google.com " on "www.google.com" , "google.com" code breaks further when i'm searching images in html. what's best way make work ? www.google.com n

java - PreAuthenticatedAuthenticationProvider UsernameNotFound exception returns 401 instead of denied page -

i use spring 4.1.6.release , spring-security 4.0.1.release. there requestheaderauthenticationfilter , preauthenticatedauthenticationprovider. want application show 'denied' page, if user service throws usernamenotfoundexception. actually, application shows basic http authorization form (simple browser popup credentials) , provides 401 response if cancelled. here configuration: <s:http auto-config="true" use-expressions="true"> <s:intercept-url pattern="/report/**" access="hasrole('role_user')"/> <s:csrf disabled="true"/> <s:custom-filter ref="preauthfilter" position="pre_auth_filter"/> <s:form-login authentication-failure-url="/denied.jsp"/> </s:http> <b:bean id="preauthfilter" class="org.springframework.security.web.authentication.preauth.requestheaderauthenticationfilter"> <b:propert