Posts

Showing posts from July, 2015

xcode - LayerKit iOS: Cannot request authentication nonce because client is already authenticated -

i working on app , trying integrate layerkit it. after every 10 minutes, layer has authenticated again every nonce valid 10 minutes. when trying authenticate it, error: cannot request authentication nonce because client authenticated 123456 (123456 userid). but when send message, status stuck "pending". can't send or receive message. have close app , open again resume communication. i using swift 2.2 , not using parse. using api acquire identity token layer. can't reauthenticate layer. everytime showing same error. i have reset network settings iphone, still no luck. appreciated. i had same issue. you need deauthenticate before request authentication nonce: - (void)deauthenticatewithcompletion:(nullable void (^)(bool success, nserror * _nullable error))completion;

javascript - owl slider 2 show next slide cropped -

i trying add mobile optimized slider website. therefore don't want show next / prev buttons. want show first / current slide in total , second / next slide cropped. i have seen owl slider gives option have stagepadding: http://www.owlcarousel.owlgraphic.com/demos/stagepadding.html is possible have padding on right side, idea of slider real. don't want show previous , next slide cropped, next slide. hope guys (and girls) can me. thankyou you can resolve adding negative right: of stagepadding's value on .owl-stage class. (not tested) example, if stagepadding: 20: .owl-stage { right: -10px; } originally answer: https://github.com/owlcarousel2/owlcarousel2/issues/172#issuecomment-62762886

php - similar route names in different namespace -

so in routes.php have route::group(['namespace' => 'cp', 'prefix' => 'cp'], function() { route::get('/shop' , 'shopcontroller@index')->name('shop_index'); }); route::get('/shop' , 'shopcontroller@index')->name('shop_index'); basically 2 similar address 1 admin area in cp namespace , directory , other clients so in admin viwe when want link page have <a href="{{route('shop_index')}}"> shop </a> which wouldn't work becuz have 2 different routes same name have change 1 of names shop_index_cp is there anyway somehow use namespace in there , avoid ? like <a href="{{route('cp\shop_index')}}"> shop </a> namespace attribute used tell router base namespace controllers. doesn't affect route names or way can reference them. there no way use namespaces refer similar routes - exact name used making names u

ubuntu - Wso2 Data Service Not Running -

im new linux. want run wso2 data service in ubuntu im having trouble. when try run wso2server.sh, says wso2server.sh command not found, did wrong? can't start wso2. best way run it? thank you. start server "sh wso2server.sh" in bin directory

java - Scala and @Inject annotation -

i know best way deal dependency injection in scala using tools built language, working on project must integrate scala , java code. then, using google guice, implements specification jsr-330 . fortunatly, found no problem during integration of guice , scala. using constructor injection , because have deal immutability. my question is, why in scala have use notation @inject() in front of constructor parameter? why () paranthesis? follows example: class myclass @inject() (val another: anotherclass) { // body of class } otherwise, how tell if (val another: anotherclass) constructor parameter list or arguments @inject ?

Android webview - Set token to post request -

i have problem webview in app. i need set token in order connected automatically. to that, added header first loading page , each loading pages shouldoverrideurlloading method. so here code : final map<string, string> extraheaders = new hashmap<>(); extraheaders.put("authorization", "bearer " + accesstoken); webview.getsettings().setjavascriptenabled(true); webview.setwebviewclient(new webviewclient() { @override public boolean shouldoverrideurlloading(webview view, string url) { extraheaders.put("authorization", "bearer " + accesstoken); view.loadurl(url, extraheaders); return super.shouldoverrideurlloading(view, url); } } this code works : automatically authenticated first display , next pages inside webview. on other side, have problem form. when submit form, redirected login page and, because set token each page, redirected home page of site. the token not set when submit request post done.

mongodb - Pymongo - Fastest way to query all documents -

i have file contain nested dictionary save on computer, when need file, used line of code : u_i = pickle.load(open("f:\\fortestcode\\user_item_21_07.p", "rb")) this type data in u_i : {"bf0e6cf26097ff44b56eba795f25b48a" : {"557252215845" : 1.0}, "9ffa99a1374cd953a30cb1f746f11c6a" : { "978076659142" : 1.0, "622" : 1.0} } and then, inserted nested dictionary mongodb, became : { "_id" : objectid("57971bcffefb610990cc5eaa"), "bf0e6cf26097ff44b56eba795f25b48a" : { "557252215845" : 1.0 } } { "_id" : objectid("57971bcffefb610990cc5ec6"), "9ffa99a1374cd953a30cb1f746f11c6a" : { "978076659142" : 1.0, "622" : 1.0 } } so, if need put documents in mongodb 1 file u_i above need make loop : temp_dict = {} documents_u_i = collection_u_i.find({}) records

php - Compare Multiple coloumns in MySql -

i need compare 2 different columns in table: tbl_try (country, name). if there 2 coloumns same value nothing. if there no same values of these 2 columns same insert. this connection database: <?php require_once("menu.php"); require_once("function.php"); ?> here main code (read comments try understand) <?php $conn = connecttosql(); $query= "select * tbl_countries"; $result = mysqli_query($conn, $query) or die("error in query: ". mysqli_error($conn)); $choose = ''; while ($row = mysqli_fetch_assoc($result)) { $choose .= '<option value = "'.$row['name'].'">'.$row['name'].'</option>'; } ?> <div class="form-group"> <label class="control-label

Clear local maven repository via maven-plugin on install phase -

i'd delete content of entire repository ( .m2/repository ) before installation phase. of course don't want hand looking plugin magic. far came across maven-clean-plugin , trying use follows: <build> <sourcedirectory>src/</sourcedirectory> <plugins> <plugin> <artifactid>maven-compiler-plugin</artifactid> <version>3.2</version> <configuration> <source>${jdk.version}</source> <target>${jdk.version}</target> </configuration> </plugin> <plugin> <artifactid>maven-clean-plugin</artifactid> <version>3.0.0</version> <configuration> <filesets> <fileset> <directory>${settings.localrepository}/</directory> <includes>

javascript - Unable to bind the Calendar value in Angular js -

i new in angular js , trying bind value of calendar date jquery calendar picker not binding accept date other fields binding. here html <input id="company" name="company" ng-model="user.company" type="text" placeholder="" class="form-control" required> <input type="text" name="exdate" ng-model="user.exdate" id="exiprydate" placeholder="dd-mm-yyyy" class="form-control" required> here jquery code $(function () { $("#exiprydate").datepicker({ dateformat: 'dd-mm-yy' }); }); here controller : var app = angular.module('myapp', []); app.controller('admincontroller', function($scope, $http, $location) { $scope.submitloginform = function(isvalid, user) { console.log($scope.user); }); here snap of

java - Gradle - A lot of modules -

i have java project (simplified) looks this: (they not named this, example) core (project 1) core.java utils: util.java anotherutil.java modules (project 2) amodule.java b bmodule.java c cmodule.java ... z zmodule.java i made build.gradle builds core project, works fine. my question: there way make 26 different jars 26 different "modules", without creating 26 different build scripts? when building program don't want run 26 different build scripts every time. fine running 2 scrips, 1 core , on modules. modules depend on core , core softdepends (depends without needing it, has functions when there) on modules. all modules should have own jar looks this: a.jar: (package) amodule.java b.jar: b (package) bmodule.java etc... gradle supports customising multi-project builds, ideal way. all module represented separate jar should separated projects. but in case still want have scenario in want extract

html - Add binding error messages to custom messages in input tag -

i playing spring validating form input example - java spring mvc thymeleaf views. have been able pass messages view without issue. these display example wants them to... e.g. <td th:if="${#fields.haserrors('name')}" th:errors="*{name}">name error</td> i trying find way put them html input validation attributes though have tried following (full page below) <td><input type="text" th:field="*{age}" **required="required" data-errormessage-value-missing="${#fields.errors('age')}" data-errormessage="${#fields.errors('age')}"**/></td> this has done no though , validation message displayed ${#fields.errors('age')} ! there way push binding errors attribute or misunderstanding way works ? thanks in advance. page html <html> <body> <form action="#" th:action="@{/}" th:object="${personform}"

boost msm submachine current_state for accessing sub state -

any idea how, using boost msm 1_60, can current_state(s) of submachine? consider following code, describing outer state machine allows chosing between 2 different traffic lights (standard red, yellow, green 1 , alternating 2 yellow lights instance): class smbigmom : public msmf::state_machine_def<smbigmom> { public: smbigmom() {}; using initial_state = smselectorstate; class smlightbase : public msmf::state_machine_def<smlightbase> { public: smlightbase() {}; using initial_state = basestate; struct transition_table : mpl::vector<> {}; }; using smbasebackend = msm::back::state_machine<smlightbase>; class smcommonryg : public smlightbase { public: smcommonryg() = default; ~smcommonryg() {}; using initial_state = red; // init state struct transition_table : mpl::vector< // start, event, target, action, guard msmf::row< red, evnext, redyellow, msmf::none, msmf::none >, msmf::row< red

oop - Why can't I create a object in a function in Java? -

code works well, think code b can work correctly, in fact, code b doesn't work correctly. why? why can't create object in function- private void setfield(context mcontext,matt afield,string name) ? code a public class murlpar { public matt diskcount=new matt(); public matt diskindex=new matt(); public murlpar(context mcontext){ setfield(mcontext,diskcount,"pardiskcount"); setfield(mcontext,diskindex,"pardiskindex"); } public class matt { public string name; public string value; } private void setfield(context mcontext,matt afield,string name){ int id = mcontext.getresources().getidentifier(name, "string", mcontext.getpackagename()); afield.name=mcontext.getstring(id); } } code b public class murlpar { public matt diskcount; public matt diskindex; public murlpar(context mcontext){ setfield(mcontext,diskcount,"pardiskc

go - Golang: file.Seek and file.WriteAt not working as expected -

i trying make program writes @ provided offsets in file, can start writing 20th offset etc. here 1 of sample code using reference package main import ( "fmt" "io/ioutil" "os" ) const ( filename = "sample.txt" start_data = "12345" ) func printcontents() { data, err := ioutil.readfile(filename) if err != nil { panic(err) } fmt.println("contents:", string(data)) } func main() { err := ioutil.writefile(filename, []byte(start_data), 0644) if err != nil { panic(err) } printcontents() f, err := os.openfile(filename, os.o_rdwr, 0644) if err != nil { panic(err) } defer f.close() if _, err := f.seek(20, 0); err != nil { panic(err) } if _, err := f.writeat([]byte("a"), 15); err != nil { panic(err) } printcontents() } but getting same file content beginning start like 12345a i t

sql - This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. More than 1 value was returned. -

iam trying query , these following errors. error saying primary key constraint pk_itempath has been violated. should inorder rectify error query wont able run use sk_en_userdb go set noexec off go if(db_name() not '%_userdb') begin raiserror ('you must run script in userdb database',18,0) set noexec on end go if(not exists(select * userrights.path pathid = 'myviews')) begin insert userrights.path(pathid, isvendorspecific) values('myviews', 0) end if(not exists(select * userrights.products projectname = 'products')) begin insert userrights.products(productid, projectname) values( (select max(productid) + 1 [userrights].products), 'products' ) end insert userrights.productstopath(productid, pathid) values( (select productid [userrights].products projectname = 'products'), 'myviews' ) insert userrights.modulestoproducts(moduleid, productid) values(

javascript - I want a bootstrap time picker to select start time from drop- down where duration time gap is 30 minutes -

condition: time should between 7.00 9.00 pm too. requirement load table according selected time duration. code not complete , not working. html code following.. <label class="col-md-1 control-label firstcol">reservation time : </label> <div class="col-md-2"> <div class="input-group bootstrap-timepicker timepicker"> <input data-provide="timepicker" class="form-control" name="txtreservetimefrom" id="txtreservetimefrom" readonly="readonly" tabindex="2" data-toggle="tooltip" data-container="body" data-placement="bottom" /> </div> </div> <label class="col-md-1 control-label firstcol "> </label> <div class="input-group bootstrap-timepicker timepicker"> <div class="col-md-1"> <input data-provide="timepicker" class="form-control

Tensorflow: How does tensorflow connect python and C++ in details? -

what i'm trying do i'm trying make modification conv_ops in tensorflow filters used convolution in consist of binary numbers. what have done following suggestion in this tensorflow issue , didn't create custom op. instead, copy code in conv_ops.cc , change names from register_kernel_builder( name("conv2d").device(device_gpu).typeconstraint<eigen::half>("t"), conv2dop<gpudevice, eigen::half>); register_kernel_builder( name("conv2d").device(device_gpu).typeconstraint<float>("t"), conv2dop<gpudevice, float>); to register_kernel_builder( name("binaryconv2d").device(device_gpu).typeconstraint<eigen::half>("t"), binaryconv2dop<gpudevice, eigen::half>); register_kernel_builder( name("binaryconv2d").device(device_gpu).typeconstraint<float>("t"), binaryconv2dop<gpudevice, float>); after modification, have make new op same conv_ops . in o

Correcting dataframe in R -

i have dataframe in elements of second column misplaced . example : "15365","jas online services private limited" "15366","kress italian food specialties private limited" "15367","shatayu criticare hospital , research center pri vate limited" "15368","white hearts foodies private limited" "15369","maahi logistics private limited" ... ... "15376","g s life skills education worldwide private limite d" "15377","red line logistics private limited" and on . here row 15367 , 15376 need editing . there way without doing manually ? simply use quote parameter of read.table . suppose have string in variable ds , want store resulting data.frame in my.df : my.df <- read.table(text=ds, sep=",", quote="\"") if want remove line breaks resulting column can use following code, replace replacement text want repla

PHP json_decode error: Array value found, but an object is required -

i trying decode following json file { "email": "mail@gmail.com", "password": "12345", "languageproficiency": { "language": "english", "proficiency": 4 }, "tags": [ { "name": "singing" }, { "name": "dance" } ] } when this $data = json_decode($jsoncontent, true); echo $data; die(); i have following error: array value found, object required question 1) how can view data json 2) how can access property of each object in tags array i validating json content againsts schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "email": { "type": "string" }, "password"

javascript - event.target not changed during touchmove in chrome -

i have div child elements. in touch move, need target element. target element remains same in chrome fiddle link: https://jsfiddle.net/660rdys9/1/ var parent = document.getelementbyid("parent"); var textbox = document.getelementbyid("textbox"); parent.ontouchmove = function(e){ textbox.value = e.target.id; } div > div{ border:2px solid; } <div id="parent" style="width:500px;height:300px;"> <div style="width:500px;height:200px;" id="first">first span</div> <div style="width:500px;height:200px;" id="second">second span</div> </div> <input type="text" id="textbox"/> replication procedure: 1) goto fiddle in above link using chrome 2) touch 1 of black rectangle(first div) , move finger rectangle(second child div) 3) can see id displayed in text box remains same is behavior of touch move event? not possi

Sparql: getting all politicians who ruled a city -

i'm new sparql , i'm trying understand how resources need building query. started trying politicians ruled city or country, , @ moment following: i started following links in snorql (in prefixes) , looking entity adding "politician" @ end. found 1 : prefix : <http://dbpedia.org/resource/> so wrote http://dbpedia.org/resource/politician , resource exist. tryed use in way: prefix dbo: <http://dbpedia.org/ontology/> prefix dbpedia: <http://dbpedia.org/resource/> select ?thing { ?thing :politician . ?thing dbo:birthplace dbpedia:italy. } limit 50 run in virtuoso . even if remove second line of select , have no results. if change first line with: ?thing dbo:person . or if remove it, people born in italy. not politicians. second problem don't need politicians born ruled place. how or can find kind of "relations/descriptors"? googling , copy-pasting existing examples, understand how more specific things. thanks in adv

python - Creating embeddings and training on embeddings using a bigram LSTM model in Tensorflow -

i'm having trouble figuring out how create , train on bigram embeddings lstms in tensorflow. we given train_data tensor of shape (num_unrollings, batch_size, 27) i.e. num_unrollings is total number of batches, batch_size is size of each batch, and 27` size of one-hot-encoded vector characters "a" "z" , including " ". the lstm takes input single batch @ each time step i.e. takes in tensor of shape (batch_size, 27) characters() function takes in tensor of shape 27 , returns character represents one-hot-encodings. what have done far created index lookup each bigram. have total of 27*27 = 729 bigrams (because include " " character). choose represent each bigram vector of log(729) ~ 10 bits. in end trying make input lstm tensor of shape (batch_size / 2, 10) . can train on bigrams. here relevant code: batch_size=64 num_unrollings=10 num_embeddings = 729 embedding_size = 10 bigram2id = dict() key = "" # build dicti

excel - If the value of a given cell is not blank, then cut and paste the whole row into another worksheet -

i beginner in excel macro. have done few using record macro functions, tweaking them bit etc. this time have start scratch , lost. i looking simple way complete following: if value of given cell (let's cell u) not blank, cut , paste whole row worksheet , save changes. can please me building macro. have short turnaround 1 , having headache already. keen on learning missing basics. planning on taking classes soon. thanks bunch guys! appreciated :) mike as siva stated, isn't me place. being said, happen have old code can copy/paste benefit. works dynamically through rows data column u on sheet 1: sub cutcopypaste() dim x integer dim y integer dim integer x = sheets("sheet1").range("u" & rows.count).end(xlup).row y = sheets("sheet2").range("u" & rows.count).end(xlup).row = 1 x if not range("u" & i).value = "" range("u" & i).entirerow.cut sheets("sheet2&q

Cassandra: how to initialize the counter column with value? -

i have benchmark cassandra facebook linkbench. there 2 phase during benchmark, load , request phase. in load phase, linkbench fill cassandra tables : nodes, links , counts (for links counting) default values(graph data). the count table looks this: keyspace.counttable ( link_id bigint, link_type bigint, time bigint, version bigint, count counter, primary key (link_id, link_type, time, version) my question how insert default counter values (before incrementing , decrementing counter in linkbench request phase) ? if isn't possible cassandra, how should increment/decrement bigint variable (instead of counter variable) any suggest , comments? lot. the default value zero. given create table counttable ( link_id bigint, link_type bigint, time bigint, version bigint, count counter, primary key (link_id, link_type, time, version) ); and update counttable set count = count + 1 link_id = 1 , link_type = 1 , time = 1

how to close inappbowoser in cordova -

apk file <a class='btn btn-primary' onclick="window.open('http://somedomain/payment.php', '_system', 'location=yes');" >payment</a> paymnet.php file <div class="login-wrap"> <div class="login-html"> <input id="tab-1" type="radio" name="tab" class="sign-in" checked><label for="tab-1" class="tab"></label> <input id="tab-2" type="radio" name="tab" class="sign-up"><label for="tab-2" class="tab"></label> <div class="login-form"> <form action="" method="post" class="sign-in-htm"> <input type="hidden" name="furl" value=""> <input type="hidden" name="surl" value="">

html - using dropdown lists to control forms -

i want use dropdown lists control format of menu want create. i've searched web several hours without success. we're looking create form format controllable dropdown menu. i've created simple web form below using html code below demonstrate; what we're looking present form user dependent upon selection of "number of applicants" dropdown. if user selects 1, "applicant 1 title" dropdown presented. should user select 2, both "applicant 1 title" , "applicant 2 title" dropdowns presented user. is has come across on here? <html> <body> <form/> <label for="txt_appnos">number of applicants:</label> <select id="txt_appnos" name="appnos"> <option value="appnos1">1</option> <option value="appnos2">2</option> </select> <br> <br>

Selenium webdriver how to get the enabled status of an angularjs Li element -

i have following angular.js on page. items being displayed angular.js li items. 1 greyed out other enabled. when use selenium webdriver method .isenabled() , both greyed out , enabled items return "enabled". the first question how .isenabled() work type of element? q second question is, assuming webdriver won't , need xpath , guess use this: $x("//li[@class ='ng-scope disabled' , @id='actioncustard']") $x("//li[@class ='ng-scope' , @id='actionrhubarb']") the first returns if given id disabled, second if given id enabled, built java method check given id element enabled or disabled. there easier way of doing this? </li> <li id="actionrhubarb" class="ng-scope" on="deriveinvoketype(action)" ng-switch="" ng-class="{'disabled': false}" ng-repeat="action in getactionlist()"> <!-- ngswitchwhen: link_dynamic -->

spring - Access flashattribute in Springflow -

added value redirectattrs.addflashattribute("some", value); , redirect springflow how access flashattribute some in springflow ? <on-start> <evaluate expression="do.action(???)" result="flowscope.someobject" /> </on-start> try: <evaluate expression="webflowutils.getflashattribute(externalcontext, 'some')"/> with: @component public final class webflowutils { public object getflashattribute(externalcontext context, string attributename) { map<string, ?> flashmap = requestcontextutils.getinputflashmap((httpservletrequest) context.getnativerequest()); return flashmap != null ? flashmap.get(attributename) : null; } }

eval - PHP calculation using variables -

i have 3 variables , formula trusted users need able define via cms. formula change on time , value of variables come database. how can work out answer calculation? assume eval relevant can't quite work $width = 10; $height = 10; $depth = 10; $volumetric = '(w*h*d)/6000'; $volumetric = str_replace('w', $width, $volumetric); $volumetric = str_replace('h', $height, $volumetric); $volumetric = str_replace('d', $depth, $volumetric); eval($volumetric); this gives me: parse error: parse error in /path/to/vol.php(13) : eval()'d code on line 1 you need extremely careful eval you're giving people access run commands directly on server. make sure read documentation thoroughly , understand risks. that said, need assign result variable. can tidy you're doing too, need 1 str_replace . try this: $width = 10; $height = 10; $depth = 10; $volumetric = '(w*h*d)/6000'; $volumetric = str_replace(['w', 'h'

java - Running jar with dependencies from a batch file -

i have generated jar using maven , want execute batch file different directory. jar has few dependencies dscribed in pom file.[but not in jar] wondering there way execute jar without causing classnotfoundexception? if run jar dependencies in runs fine, isn't bit wasteful package external jars in mine? make batch modify classpath add needed jars it. apassembler maven plugin may help.

.net - Custom Control Text Missing -

i have custom control supposed represent label, rounded corners. i've created control drag , drop designer toolbox, rounded top corners, text seems dissapear. i know can add custom property text show @ bottom, text property there , ideally use it. thought using override property, @ minute still doesn't show. any suggestions, i've copied code below... imports system.windows.forms.design imports system.runtime.interopservices imports system.drawing.drawing2d imports system.componentmodel public class customcontrol inherits system.windows.forms.usercontrol private m_radius integer private m_borderwidth integer private m_fillcolor color private m_text string = me.text private m_label label private components system.componentmodel.container = nothing public sub new() mybase.borderstyle = windows.forms.borderstyle.none end sub ''' <summary> ''' indicates radius of control's corne

c# - Xamarin.Forms: Putting A Label Inside A PieChart Layout -

Image
good day. i'm creating xamarin.forms portable application able display there chart using oxyplot. my problem how going put total sales label in there. because if put label in .xaml page, doesn't not appear. i want put label there (inside red border). what think should in order have this? here's code: salesviewmodel.cs using oxyplot; using oxyplot.series; using system; using system.collections.generic; using system.componentmodel; using system.linq; using system.runtime.compilerservices; using system.text; using system.threading.tasks; namespace xamarinformsdemo.viewmodels { public class salesperproductviewmodel : inotifypropertychanged { private plotmodel modelp1; public salesperproductviewmodel() { // pieviewmodel vm = new pieviewmodel(); modelp1 = new plotmodel { title = "sales per product", titlecolor = oxycolors.teal, titlefontsize = 30, textcolor

c# - WCF transaction disappearing between client and server -

i have wcf service. have client makes asynchronous calls service. have 45 test records. client gets each record database , calls wcf service asynchronously. when test each record individually, service processes records expected. when pass 45 @ same time (45 calls made 1 after other in foreach loop) 1 record never makes service. same record, every time not make service. i've enabled trace logging on both client , server side, , on client side can see missing message making call server. on server trace logs can see no sign of record. anyone ideas why/what might happening? suggestions of further steps try , bottom of it? i thought might memory issue of records large (they contain excel data). on passing in subset largest records, process correctly , none go missing! thanks in advance or suggestions.

R identify workspace objects used in source -

is there way identify workspace objects created, modified or referenced in sourced script? have hundreds of randomly-named objects in workplace , 'cleaning house' - able more proactive in future , rm() heck out of sourced script @ end. the simplest way store environment objects in list before sourcing, sourcing, comparing new environment objects old list. here pseudo-code. old_objects <- ls() source(file) new_objects <- setdiff(ls(), c(old_objects, "old_objects")) this identify created objects. identify whether object modified, don't see solution store objects in list beforehand , running identical afterwards. # rm(list = ls(all = true)) <- 1 b <- 1 old_obj_names <- ls() old_objects <- lapply(old_obj_names, get) names(old_objects) <- old_obj_names # source should go here <- 2 c <- 3 # add "old_obj_names" , "old_objects" in setdiff these # created after call ls before source new_objects <- s

android - How to handle only one instance of Activity launched from URL -

my app started customized url schema, built in intent filter documentation datascheme = "mobilepos", datahost = "payment". app starts correctly , receives data url, in cases (example if press button) when go url, android creates new instance of activity. which best way use launch mode (standard/singletop/singletask/singletask) have every time 1 instance of activity? update workaround set launchmode = singletask , overriding onbackpressed call movetasktoback(true). way back/home button pressed sets app in background , oncreate never called when app relaunched.

javascript - cross-site requests & browsers addons -

i'm trying develop basic firefox addon "new" webextensions system. i'd extract text web page ( not owned me) evaluate using remote website post in same page result the problem how make web request addon (point 2). found use xmlhttprequest, imagined security reasons can't access remote paths. that because (i guess) javascript code run inside page, though had thought addon be... external. of course result inside page, assume addon work proxy make request. said have no idea how , should do. i don't want use strange trick (like removing security control), i'd "right" way. what don't understand if addons bounded run within page made for. edit: ok, turns out chrome docs better mozilla one. use xhr cross-site req have put additional line of code in manifest. {... "permissions": [ "http://random.com/" ], }.. i'm still not sure if proper way aim though. to use xhr cross-site req

osx - TCPDF generated PDF shows blank on Mac Preview and Safari -

but has no problem when opened in google chrome. when opened safari/preview, got blank page. zooming in/out nothing. below code used generating pdf files: require_once('../vendor/tecnickcom/tcpdf/tcpdf.php'); class mypdf extends tcpdf { //page header public function header() { // current page break margin $bmargin = $this->getbreakmargin(); // current auto-page-break mode $auto_page_break = $this->autopagebreak; // disable auto-page-break $this->setautopagebreak(false, 0); // set bacground image $img_file = '../assets/img/background.jpg'; $this->image($img_file, 0, 0, 150, 90, '', '', '', false, 150, '', false, false, 0); // restore auto-page-break status $this->setautopagebreak($auto_page_break, $bmargin); // set starting point page content $this->setpagemark(); } } $pdf = new mypdf('l',

Chef - how to avoid duplicating a recipe -

in our chef cookbooks support multiple versions of same software. we've adopted bad practice. each version we've made copy of recipe , changed it's attributes. e.g. remote_file install_file source node['android']['sdk']['23']['source_url'] not_if ::file.exists?(extract_dir) end notifies :run, "execute[extract-sdk-23]", :immediately end becomes remote_file install_file source node['android']['sdk']['24']['source_url'] not_if ::file.exists?(extract_dir) end notifies :run, "execute[extract-sdk-24]", :immediately end this code duplication. it'd cleaner keep attributes same vary values. is possible chef? if matters use chef-client 0 directly. i.e. don't use knife, etc. as @stephenking mentioned, best bet write custom resource abstracts logic. put different sdks in hash in node attributes , iterate on them in single recipe, going less flex

django - NOT NULL constraint failed error -

i want select event , upload photo, when make migrations, gives not null constraint failed: myapp_doc.event error. i'm getting error after deleting view. should ? models class doc(models.model): events = ( (none, "choose 1 of it"), ('bbq', 'barbeque '), ('meet', 'meeting'), ) doc = models.filefield(upload_to='uploads/') user = models.foreignkey(user, null=false, blank=true) event = models.charfield(max_length=15, choices=events, null = true) def __unicode__(self): return unicode(self.user) view def upload_file(request): user= request.user form = uploadfileform(request.post, request.files) if form.is_valid(): doc = form.save(commit=false) doc.user = request.user doc.save() messages.success(request, 'dosya yuklendi') return httpresponseredirect('/uploadnew/') return render(request, 'upload.html&#

linux - Adding -fvisibility=hidden after compilation -

i building shared object (.so), , linking against third party static library. in ideal world, third party library have been compiled -fvisibility=hidden - hasn't been. is there way avoid including symbols defined static library in global symbols exported dynamic library? (i using gcc on linux platform if matters)

javascript - CasperJS doesn't find jQuery -

this question has answer here: pass javascript function parameter 12 answers i'm using jquery selectors casper.js scraping. understand it's necessary place jquery calls inside casper.evaluate() . the problem in last of these following 3 functions, referenceerror: can't find variable: $ raised. first 2 work absolutely fine. // on main page, scrape links sub-pages. function getlinks() { var links = $('li.ds-artifact-item a'); return array.prototype.map.call(links, function(e) { return e.getattribute('href'); }); } // on main page, scrape sub-pages' titles. function gettitles() { var titles = $('li.ds-artifact-item a'); return array.prototype.map.call(titles, function(e) { return e.innerhtml; }); } // on sub-page, scrape document description. function getdescription(){ var descr

netsuite - How to call user event script from net suite suitelet -

can 1 please tell or share snippet on how either call user event script or scheduled script suite passing parameters. have suitelet records , each record have check box prefix, once suitelet loads user can select records checking each check box once selection made , click on submit button need pass selected values script (can user event script or scheduled script). suggestions appreciated. in advance. you use nlapischedulescript() pass parameters on object scheduled script , put scheduling queue. you'd need define parameters in script record in netsuite. can take @ 'scheduling apis' article in netsuite more robust documentation (or @ suiteanswers article 10279). the syntax nlapischedulescript is: nlapischedulescript(scriptid, deployid, params);

javascript - Pass token from FirebaseAuth to Google Cast Custom Receiver in Android -

i'm using firebase , firebaseui android. i want pass login state android application google cast custom receiver. google cast custom receiver written in html , javascript , deployed firebase hosting. how can using firebase sdk? the way communicate cast receiver either through custom message (using custom namespace) or piggy-backing on media control commands can take additional custom data. first approach preferred 1 if want bi-directional communication @ second 1 can job if timing sending message can match when send control command.

javascript - jQuery Having multiple on click events -

i have calendar , running, have more.. button on each day if there more events 3. once button clicked drop-down appears , shows other events in day. its getting correct data each dropdown if click button triggers on click open. jquery: <script> function deselect(e) { $('.pop').slidefadetoggle(function() { e.removeclass('selected'); }); } $(function() { $('[id^=contact]').on('click', function() { if($(this).hasclass('selected')) { deselect($(this)); } else { $(this).addclass('selected'); $('.pop').slidefadetoggle(); } return false; }); $('.close').on('click', function() { deselect($('#contact')); return false; }); }); $.fn.slidefadetoggle = function(easing, callback) { return this.animate({ opacity: 'toggle', height: 'toggle' }, 'fast', easing, callback); }; </script> html + django {% if forloop.c

c# - Doesn't show view from controller even debugger goes inside View -

i new in mvc .net. not able call view controller. have debug flow. goes view doesn't show view on screen. controller name: downloads action name: makepayment redirect view: success //success view of view/downloads/success.cshtml code: downloadscontroller [httppost] public actionresult makepayment(downloads ccm) { if (true) { return view("success"); } else { return view("failure"); } } view @{ viewbag.title = "success"; } <h2>your transaction has been completed successfully.</h2> method use call actionresult makepayment. had use ajax here because wanted call javascript function before form submit. view: index.cshtml @using (ajax.beginform("makepayment", "downloads", new ajaxoptions { httpmethod = "post", insertionmode = insertionmode.replace, onbegin = "paybycreditcard" })) { //submit button } according return view("