Posts

Showing posts from August, 2013

glsl - Firefox's shader editor can not get youtube 360 video shader -

Image
the webgl inspector (a tool inspecting webgl commands) , firefox shader editor can inspect 360 video shader in facebook's 360 video player when try inspect youtube page @ it's shader inspector not able inspect though can verify youtube using webgl. why neither of these tools able inspect youtube's webgl 360 video player? or, rather how can inspect 360 video shaders on youtube?

css - How do I make my page layout full-width -

i 've looked on internet , can't seem find answer: how can make wordpress theme full width layout instead of narrow down middle? here's website heatwaveenergydrink.com i cant figure out. i've been @ day. if inspect code you'll find answer there: change width of .dslc-modules-section-wrapper this class has fixed width of 740px , houses primary content.

node.js - Low download speed -

hey guys having big problem , need advice . i have dedicated server informations : atom c2750 8/8t 2,4 / 2,6 ghz 16 gb ram ddr3 1600mhz 12tb 500mbps bandwidth list item 1gbps network burst i running website using nodejs users can download high volume files . the website evolved rapidly , having 10k users per day , average of 1k concurrent users (downloads). the problem server getting lower , lower download speed on client's side have added throttle downloads 800kb/s , did bit problem remains same should ? thanks you have figure out worst bottleneck is. have design measurements , tests , maybe calculations determine bottleneck is. here possibilities: total server bandwidth on server ethernet connection internet. if have 1k users trying download , have 500mbps total bandwidth, you're going 0.5mbps or 500kbps per user. @ point, need either shrink data, reduce number of users or increase server bandwidth. server cpu. should easy detect.

Frontend display var data from jQuery in a php file -

i trying devise plan display jquery.post current_date , checkin_date & diff_days php file in plugin. price of rental item calculated using bkap_get_per_night_price ajax code here: jquery.post("'.get_admin_url().'admin-ajax.php", data, function(response) { eval(response); var data = { current_date: jquery("#wapbk_hidden_date_checkout").val(), checkin_date: jquery("#wapbk_hidden_date").val(), attribute_selected: jquery("#wapbk_variation_value").val(), currency_selected: jquery(".wcml_currency_switcher").val(), block_option_price: jquery("#block_option_price").val(), post_id: "'.$duplicate_of.'", diff_days: jquery("#wapbk_diff_days").val(), quantity: quantity_str, variation_id: variation_id, gf_options: gf_options, bundle_optional: bundle_optional, action: "bkap_get_per_night_price", product_type: "'.$produc

objective c - release Vs free - why won’t the ARC version of an iOS audio app exit gracefully? -

i’m revising audio app. when converted arc discovered old code release timer, audio session , devicemotion deprecated. xcode suggests replacing release free i’m having trouble making audio session release properly. edit believe question has been answered here . here code - (void)fromescbutton:(uibutton*)button { [self stopclock]; [self exitgracefully]; [self gotoglobal]; } - (void)stopclock { [_synthlock lock]; [_synth stopallnotes]; [_player stop]; [motionlistener stopmotionlistener]; [_synthlock unlock]; [timer invalidate]; timer = nil; } -(void)exitgracefully { free((__bridge void *)(lasteventchangetime)); // [lasteventchangetime release]; free((__bridge void *)(timer)); // [timer release]; free((__bridge void *)(motionlistener)); // [motionlistener release]; free((__bridge void *)(player)); // [player release]; free((__bridge void *)(_synth)); /

admin on rest - Add current login user name and/or avatar to Appbar -

is there way add current login user full name and/or avatar appbar? i looked @ documentation couldn't find way it. thanks! you'll have make custom app , implement custom appbar yourself. can find more info in documentation here

python - Convert byte array to signed big-endian 16-bit WAV -

i'm uploading pcm16 audio data android device server. in java can this: byte[] bytearray = // ... bytearrayinputstream baiss = new bytearrayinputstream(bytearray); audioformat format = new audioformat(samplerate, 16, 1, true, true); audioinputstream ais = new audioinputstream(baiss, format, bytes.size()); audiosystem.write(ais, audiofileformat.type.wave, new java.io.file(audiofilename)); but in python , audio sounds garbled because cant figure out how convert byte array signed big-endian 16-bit array. how can convert byte array can save wav file?

Android intent.putExtra java.lang.illegalArgumentException -

i have class called adviewed implements parcelable . here code: public class adviewed implements parcelable { protected long timestamp; protected string country, city, lat, lng, ad_id, poster_id, user_id, latlng; public void hydrate(hashmap<string, ?> map){ method[] methodes = this.getclass().getmethods(); iterator = map.keyset().iterator(); while(it.hasnext()){ object key = it.next(); object value = map.get(key); string values = value.tostring(); string method = "set" + key.tostring(); for(method methode : methodes){ if(methode.getname().equals(method)){ try{ methode.invoke(adviewed.this, values); } catch(invocationtargetexception e){ e.printstacktrace(); } catch(illegalaccessexception e){

java - How to reset the last accumulation value in EventStream? -

i have merged eventstream n observable values. values want smallest one. example: var<integer> = var.newsimplevar(2); var<integer> b = var.newsimplevar(3); var<integer> c = var.newsimplevar(4); ... eventstream<integer> m = eventstreams.merge(a.values(), b.values(), c.values(), ...); m = m.filter(integer -> integer > 1).accumulate((i1, i2) -> math.min(i1, i2)); m.subscribe(integer -> system.out.println(integer)); a.setvalue(0); // @ point input filtered , not emitted dont want last value "2" in accumulation. b.setvalue(5); c.setvalue(3); //output "2". my problem want after first filtered value new init value accumulate. in case example "integer.max_value". so next compare in accumulate isn't: "math.min(2,5)" -> "math.min(2,3)" "math.min(max_value,5)" -> "math.min(5,3)". so output shouldn't be: 2, 2, 2, 2,

ios - Getting photos via PHFetchResult extremely slow with lots of photos -

i'm using yangmingshan photo picker, , it's need, i'm running problems when user has lots of photos. i've been testing on phone 25,000+ photos , 250 albums, , when present view controller, app freezes 30 seconds before collectionview loads. here's problematic bit of code, , i'm trying figure out if there's more optimal way fetch results. - (void)fetchcollections { nsmutablearray *allablums = [nsmutablearray array]; phfetchresult *smartalbums = [phassetcollection fetchassetcollectionswithtype:phassetcollectiontypesmartalbum subtype:phassetcollectionsubtypealbumregular options:nil]; __block __weak void (^weakfetchalbums)(phfetchresult *collections); void (^fetchalbums)(phfetchresult *collections); weakfetchalbums = fetchalbums = ^void(phfetchresult *collections) { // create fecth options phfetchoptions *options = [phfetchoptions new]; options.predicate = [nspredicate predicatewithformat:@"mediatype = %

Paypal ipn item_name cannot correctly return my order number -

below html form: <form name="_xclick" action="https://www.paypal.com/au/cgi-bin/webscr" method="post" id="payment_form_paypal" onsubmit="return show_paypal_message()"> <input type="hidden" name="cmd" value="_xclick" /> <input type="hidden" name="bn" value="webasyst" /> <input type="hidden" name="business" value="sales@mycompany" /> <input type="hidden" name="item_name" value="order #12345" /> <input type="hidden" name="amount" value="1.10" /> <input type="hidden" name="currency_code" value="hkd" /> <input type="hidden" name="tax" value="0" /> <input type="hidden" name="quantity" value="1" /> <input typ

r - Show only the first instance of a changepoint label in ggplot -

Image
i have data frame group <- c("pre_analysis","pre_analysis","before","after","after","after","after","after","after","after","after") pdatetime <- c("2016-11-23 06:08:39","2017-02-25 15:31:50","2017-04-06 17:11:57","2017-04-15 01:23:51 cdt", "2017-04-16 15:54:35","2017-04-16 23:48:14","2017-04-18 02:57:41","2017-04-20 05:12:33 cdt", "2017-04-20 14:33:20","2017-04-22 12:33:44","2017-04-23 10:50:49") delta <- c(766.3770,863.8409,893.1615,656.1001,832.9232,912.3867,934.9714,-64.7182,460.3154,949.2538,697.3750) df <- data.frame(group,pdatetime,delta) df$pdatetime <- as.posixct(df$pdatetime,format="%y-%m-%d %h:%m:%s") i trying create new column "ischangepoint" has value "cp detected" first

ruby - Rails - Correct location to place cron jobs -

this question more related code quality , organization. i developing rails application, , have cron jobs execute daily. jogs working, placing them inside models, example: def update_boleto_orders_payment_status orders = order.boleto_unpaid_orders orders.each |o| order = httparty.get("https...", headers: {"authorization" => "basic # {encode_auth_token}"}) order_status = json.parse(order.body).symbolize_keys![:status] o.update_column(:paid, true) if(order_status.eql? "authorized") end end i use method update order status, , method located inside order model. my question is: assuming rails best practices , conventions, correct place jobs inside model? or should place kind of methods somewhere else? creating job class in app/jobs directory pretty common these days.

elasticsearch - Search multiple indices for an ID efficiently? -

i need document have no idea index in. have bunch of indices different days; prefixed "mydocs-". i've tried: get /mydocs-*/adoc/my_second_doc returns "index_not_found_exception" /mydocs-*/adoc/_search { "query": { "bool":{ "filter": [{ "term":{ "_id": ["my_second_doc"] } }] } } } returns docs in index. now, if search specific index can doc. problem don't know index in beforehand. so, i'd have search many, many indices (thousands of indices). get /mydocs-12/adoc/my_second_doc returns desired doc. any ideas on how efficient get/search doc? have tried : get mydocs-*/adoc/_search { "query": { "term": { "_id": "my_second_doc" } } } or more : get mydocs-*/_search { "query": { "bool": { "must": [ {

external - Hard Drive and Android Studio -

Image
i had question using android studio external hard drive on windows 10. if copy full android project computer hard drive can access project hard drive if delete file computer (with hard drive still plugged in)? for experience never delete original project needed @ point. yes can access project hard drive in android studio clicking file > open select drive , file. able see project location running from.

reactjs - Redirecting to route from Node.JS server doesn't render the next page -

hi have react component renders form this: <form onsubmit={this.onsubmit}> <!-- bunch of inputs here --> </form> where function onsubmit() makes post request /results using axios: handlesubmit(e) { var self = this; e.preventdefault(); const {value1, value 2, ....} = this.state; axios.post('/results', { key1 : value1, key2 : value2, etc. }).then(function(response) { if (errors) { self.setstate({errors: response.data.errormessage}); } }).catch(function(error){ console.log(error); }); } i have route handler post request in server.js inserts data form database. if there errors it'll send data client, otherwise should redirect results page. handler looks this: app.post('/results', function(req, res, next) { const reportexists = report.findone({ attributes: ['caseid'], where: {caseid : req.body.caseid}, }).then(report => { if (

Azure keyvault china limitations -

do have limitations azure keyvault in china? earlier have been informed hsm not supported in china region. still true? link/documentation? hsm support not available in china. github.com/azure/azure-powershell/issues/2009

android - Save location data api in firebase -

i querying system without application, location data of devices updated @ times , sent firebase, searching api location has function, how can send captured data , send firebase ??? work sign ??? make 1 child node using device id , set latitude , longitude here, need make 1 model class class model{ public double lat; public double lng; } mpdel m = new model(); m.lat = 23.14578; m.lng = 72.45789; mfirebasedatabase.child(userid).setvalue(m); for update value of latitude , longitude can write like, mfirebasedatabase.child(userid).child("lat").setvalue(<new_value>); mfirebasedatabase.child(userid).child("lng").setvalue(<new_value>); here userid device id or other unique elements.

r - Color scale ignored by ggplot2 geom_point -

ggplot() + geom_point(data=as.data.frame(res), aes_string(x=res$log2foldchange, y=-log10(res$padj)), colour="darkgrey", alpha=6/10, size=2) + geom_point(data=sig_data, aes_string(x=sig_data$log2foldchange, y=-log10(sig_data$padj)), shape = 21, colour=sig_data$basemean, alpha=5/10, fill = na, size=2,stroke=0.75)+ scale_color_brewer(palette="blues") no matter specify color scale, silly rainbow scale used without legend indicating colors mean. my guess syntax wrong. should either aes(x = log2foldchange, y = -log10(padj), color = basemean) or if you're hellbent on using aes_string aes_string(x = "log2foldchange", y = "-log10(padj)", color = "basemean")) here's example library(ggplot2) ggplot(mtcars, aes(x = mpg, y = -log10(wt), color = as.factor(cyl))) + geom_point() ggplot(mtcars, aes_string(x = "mpg", y = "-log10(wt)", color = "as.factor(cyl)")) +

MicroStrategy Object Manager Is Changing Report's SQL Upon Migration -

please help. when using object manager migrate reports 1 environment another, report sql changing, specifically, metrics not aggregating. for example, on source project, reports sql is: select a.customer, a.item, sum(a.price) tbl_prices group a.customer, a.item; but after migration, when check on target project, report sql be: select a.customer, a.item, a.price tbl_prices a; does happen know solution this? best regards, ron

How to use SASS to factor out :host in CSS? -

i have sass code :host { padding:10px; } :host(.headroom) { position: fixed; } but how can turn like :host { padding:10px; &(.headroom) { position: fixed; } } sass complains syntax error if that. (.headroom) not valid selector on own. either go unnested variant or make use of @at-root directive: :host { padding:10px; @at-root #{&}(.headroom) { position: fixed; } } which outputs: :host { padding: 10px; } :host(.headroom) { position: fixed; }

POST encripted request with JSON body on R -

i trying use r post encrypted request api . specifically /v3/orders/ request. it requires use of api key , secret , increasing nonce . using openssl , jsonlite , httr libraries: the body has json encoded: book<-"btc_eth" side<-"sell" major<-"0.1" price<-"100" type<-"limit" payload<-tojson(data.frame(book=book,side=side,major=major,price=price,type=type)) it requires authorization header constructed sha256 encrypted signature . n<-nonce() # "1503033312" method<-"post" path<-"/v3/orders/" signature<-sha256(paste0(n,method,path,payload),secret) header<-paste0("bitso ",key,":",n,":",signature) finally request should this: url<-"https://api.bitso.com/v3/orders/" r<-post(url, body = payload, add_headers(authorization=header)) i have been able post requests empty payload api before, call sends unsuppor

java - SQL Credentials for Bulk Insert -

i built java application on server, uses sql login insert table, activates trigger. trigger bulk insert reading xml files , updating database. xml files live on share on same server. domain user account has full access. in sql same domain user has been added user bulk admin rights. credential linked sql login. sql login has bulk admin rights. application worked fine until checked few months back. on testing see cannot bulk load. file "\gmsrvdev\xml\wr_2279.xml" not exist. clearly permission issue. trigger isn't working permissions/credentials set. appears have changed. ideas?

Getting zoom level of maps using HERE Maps -

we want retrieve visible markers of map section rendered. here maps api offers method requestmarkers() layers. here code snippet how realize it: //get rendered map section var viewbounds = heremap.map.getviewbounds(); //get current zoom level var mapzoom = heremap.map.getzoom(); heremap.allvismarkers = []; //retrieve visible markers on map section heremap.allvismarkers = heremap.layer.requestmarkers(viewbounds,mapzoom); unfortunately getzoom() method of map not return actual zoom level, zoom level defined when creating map. is there way "actualize" zoom level when mouse wheel turned (getzoom() method didn't work standard zoom control either), or using wrong method? thanks in advance, team dg7 we found solution our problem: using sap fpm framework in combination free-style guibb show map. error created map every framework loop. to sum up: getzoom() method works fine.

c# - Disable Property of Azure Functions not working in Visual Studio 2017 -

i have azure function timer trigger. public static void run([timertrigger("0 */15 * * * *"), disable("true")]timerinfo mytimer, tracewriter log) here disable("true") not working. generates function.json "disabled": "true", not correct. should "disabled": true, disable accepts string value. there way change this? or other way disable function? disable properties default values true . use disable() instead of disable("true") . so code like public static void run([timertrigger("0 */15 * * * *"), disable()]timerinfo mytimer, tracewriter log) . if want enable function use disable("false") .

angularjs - mongoose: accessing formData -

this question has answer here: expressjs angularjs post 2 answers i'm building geolocationapi , i'm trying query locations based on min , max distance submitted user. however, i'm not being able read values in controller. my input: <div class="form-group"> <label>min distance</label> <input type="text" class="form-control text-center" ng-model="mindistance"><br> </div> <div class="form-group"> <label>max distance</label> <input type="text" class="form-control text-center" ng-model="maxdistance"><br> </div> i tried this, send controller: $scope.searchlocations = function () { $scope.formdata.mindistance = $scope.mindistance; $sc

Scheduler in Azure Function -

i have following function.json azure function triggers @ particular time set. { "disabled": false, "bindings": [ { "authlevel": "function", "name": "req", "type": "httptrigger", "direction": "in", "schedule": "* 30 10 * * *" }, { "name": "$return", "type": "http", "direction": "out" } ] } i need schedule another trigger different time, same azure function. possible add multiple triggering time same function? if not, please suggest alternative way so. you cannot add more 1 trigger function. however, can solve putting relevant code in helper method, , have 2 different functions call out helper. it's small additional pain, avoid duplicating key logic.

swingx - Java swing Tree table -

enter image description here please in this. stuck! getting data database tree table. have button opens form , new data can added database. after adding, not showing in table on refresh. when close application , reopen, showing. i solved refreshing model. thanks

android - Google API woes -

i new (actually returning) developing android apps. hoping insight problem i've been having. the app made calls google calendar api , displays current appointment , next appointment, along times , color. works fine. problem having this: when pass off person asked app, met unusable app not access calendar i set google calendar api sha1 credentials. if make apk installation, app call google cal of user logged phone or tablet? guess asking is, how make app usable other people , not myself? i know super newbie question , not constructed if has thoughts or advice, eternally grateful. thanks help.

isabelle - How to defined a constructive predicate for a map? -

here 2 simple predicates: definition map_is_empty :: "(string ⇒ nat option) ⇒ bool" "map_is_empty env ≡ ∀x. env x = none" value "map_is_empty map.empty" value "map_is_empty [''x''↦1]" definition map_is_less_5 :: "(string ⇒ nat option) ⇒ bool" "map_is_less_5 env ≡ ∀x. ∃y. env x = y ∧ y < 5" value "map_is_less_5 [''x''↦1,''y''↦2]" value "map_is_less_5 [''x''↦1,''y''↦2,''z''↦7]" the problem value returns errors such as: wellsortedness error (in code equation map_is_empty ?env ≡ ∀x. option.is_none (?env x), dependency "pure.dummy_pattern" -> "map_is_empty"): type char list not of sort enum no type arity list :: enum how define these predicates able evaluate them using value or values ? maybe ~~/src/hol/library/finite_map , ~~/src/hol/library/mapping can help, similar

c# - Selecting an item in listview displays all data in its rows -

i don't know if has been asked before can't find it. have listview , shows id number , date, want happen when click data show ex. id number, date, fname, lname etc. in textboxes beside list view. possible? , if so, how? thank guys in advance

svn - How do I ignore files in Subversion? -

how ignore files in subversion? also, how find files not under version control? (this answer has been updated match svn 1.8 , 1.9's behaviour) you have 2 questions: marking files ignored: by "ignored file" mean file won't appear in lists "unversioned": svn client pretend file doesn't exist @ in filesystem. ignored files specified "file pattern". syntax , format of file patterns explained in svn's online documentation: http://svnbook.red-bean.com/nightly/en/svn.advanced.props.special.ignore.html "file patterns in subversion". subversion, of version 1.8 (june 2013) , later, supports 3 different ways of specifying file patterns. here's summary examples: 1 - runtime configuration area - global-ignores option: this client-side only setting, global-ignores list won't shared other users, , applies repos checkout onto computer. this setting defined in runtime configuration area file: windows (f

objective c - Why POD file cannot import target project header files in Xcode? -

i'm using pods , modify them well. came encounter situation need pod file podtest import file targettest.h main target header file. checked if target files can import header files not vice versa. write below line no compilation error in pod file. @class targettest; but properties created targettest cannot used in pod file podtest.h or podtest.m am doing wrong? go : project->build settings->user header search paths , add ${srcroot} choose recursive. hope you!!

reactjs - How to highlight only selected row in a large table set in React? -

Image
i'm working on table component react , i'm encountering issue large table set (> 500 rows). indeed, when try highlight row clicked on, encounter big leak in performances. in order achieve row selection, i'm holding state containing active row in top component consists of container rows in table. when click on cell, i'm updating state row cell part of. this cause trigger of render() method top component , whole application becomes slow due huge amount of elements re-rendered. how can re-render selected row? there general best-practice avoid re-render of components under top component? what using css? can use :hover property on each row , change background color each time mouse on or clicked. performance stress low if use css property. good luck

reactjs - React App routing -

we changing our react application routing, , dealing question - better update url effect of model change , keep routing in model, or update model based on url , letting browser handle routing itself? experience?

java - update Spring BOOT-INF/lib jars -

i trying update jar in rest-xxxx.jar , rest jar springboot jar , has folder structure of boot-inf/lib/<dependencies.jars> when unpack it. now want replace dependency jar within rest-xxxx.jar , used command: jar uf rest-xxxx.jar boot-inf/lib/new-version-jar-same-name.jar how ever got errors during booting process: exception in thread "main" java.lang.illegalstateexception: unable open nested entry 'boot-inf/lib/new-version-jar-same-name.jar'. has been compressed , nested jar files must stored without compression. please check mechanism used create executable jar file i noticed there's 0 option jar command avoid compression, did: jar u0f rest-xxxx.jar boot-inf/lib/new-version-jar-same-name.jar but got similar compression issue below: exception in thread "main" java.lang.illegalstateexception: unable open nested entry 'boot-inf/lib/new-version-jar-same-name.jar/meta-inf/manifest.mf'. has been compressed , nested ja

php - Laravel model is created with id = 0 -

i having problem eloquent. here's code: $basetask = $taskclass::create([ 'user_id' => $user->id, 'task_type' => $this->task_type, 'name' => $this->settings['name'], 'task_' . $this->social_network . '_list_id' => $task_list_id, ]); $basetask->accounts()->attach($account_id); the problem sometimes last line fails foreign key constraint fails - tries update pivot table query insert pivot ('account_id', 'task_id') values (289530, 0)) so somehow: $basetask->id=0; but have property: $incrementing=true; maybe faced such issue, appreciated! use save() method instead, since don't have many many relationship. if have many many use sync() function then. go database.php file set mysql strict false

Firebase Cloud Messaging limit on number of messages -

i sending push via fcm http api in json, experiencing @ time push not being delivered app while app connected internet , active well. getting success response fcm server our app server. suspecting if not case of messages being blocked due messages being sent in bulk, in case sending around 1000 of push message @ time. not find reference of such limitation wondering might cause of getting success on app server fcm push not being delivered.

how to implement "select/unselect all" checkbox in android -

i want implement 1 code have checkbox's item , if select items checked , wants print checked item on single string. below code checkbox. want add "all" in string employed works select item. public class mainactivity extends listactivity { string array used datasource arrayadapter of listview string[] employed = new string[] { "government", "army officer", "merchant navy", "shipping", "professor", "teacher", "doctor", "dentist", "chartered accountant" }; called when activity first created. @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); defining array adapter store items listview final arrayadapter<string> adapter = new arrayadapter<string>(this, android.r.layout.simple_li

java - How do I delete a log file while using RollingFileAppender in log4j? -

sometimes, while rolling log files, there seems issue occurring like: 'unable delete log file', 'unable move log file'. error: java.nio.file.filesystemexception a.log -> directory\a-2011-08-09-2.log: process cannot access file because being used process. following log4j configuration: <rollingfile name="a" filename="${sys:catalina.base}/logs/a.log" append="true" createondemand="true" filepattern="${sys:catalina.base}/logs/a-%d{yyyy-mm-dd}-%i.log"> <patternlayout> <pattern>%d{iso8601}|%-5p|%i|%t|%s|%r|%t|%c{1} - %m%n</pattern> </patternlayout> <policies> <timebasedtriggeringpolicy /> <sizebasedtriggeringpolicy size="10mb"/> </policies> <defaultrolloverstrategy max="25"/> </rollingfile>

How does python handle a simultaneous reference to a variable via self and as a class attribute(static)? -

more importantly, if can explain output of following code. class myclass: num = 10 def mymethod(self): print("prevvalue of self.num->",self.num) print("prev value of myclass.num->",myclass.num) self.num+=10 myclass.num+=20 print("postvalue of self.num->",self.num) print("postvalue of myclass.num->",myclass.num) obj1 = myclass() obj2 = myclass() obj2.mymethod() obj1.mymethod() the output of above code follows. ('prevvalue of self.num->', 10) ('prev value of myclass.num->', 10) ('postvalue of self.num->', 20) ('postvalue of myclass.num->', 30) ('prevvalue of self.num->', 30) ('prev value of myclass.num->', 30) ('postvalue of self.num->', 40) ('postvalue of myclass.num->', 50) the line 7, i.e self.num+=10 seems refer supposed class attribute num, , add value using self. next line same variable being accessed c

node.js - Why this not working nothing to explain more? -

when open 2 tabs in session after logout in 1 tab when try change data of tab without reload page @ time redirect not working console shows message , after api call. app.use(function(request, res, next) { console.log(req.session.user); if (req.session.user) { next(); } else { console.log("index.html") res.redirect("/"); //res.end (); } });

java - I cant login to application in WebSphere authorization fails -

i have problem when trying connect application deployed in websphere this error showing in console: secj0129e: l'autorisation échoué pour l'utilisateur scexus7:defaultwimfilebasedrealm lors de l'appel de sur default_host:gei/, authorization failed, not granted of required roles: code web.xml: autencometido1 autencometido1 form defaultwimfilebasedrealm /login.xhtml /login.xhtml?error=yes

php - curl and ssl: curl no data over https (GET, or POST) -

i have weird issue curl , ssl. have php script on ec2 amz ami machine: <?php $ch = curl_init(); $url = 'https://rubenortiz.es/'; curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_returntransfer, false); curl_setopt($ch, curlopt_nobody, true); curl_setopt($ch, curlopt_header, 1); curl_setopt($ch,curlopt_failonerror,true); $output = curl_exec($ch); $info = curl_getinfo($ch); if ($output === false || $info['http_code'] != 200) { $output .= "no curl data returned $url [". $info['http_code']. "]"; if (curl_error($ch)) $output .= "\n". curl_error($ch); } else { // 'ok' status; format $output data if necessary here: $output .= 'ok'; } print_r($output); // return or display single string $output ?> error: no curl data returned https this happens when execute script over nginx php-fpm outside ec2, laptop example. but if run same script on php-cli works!!! [root@ ~]# php /home/we

Parsing HTML in an email with PHP -

i have form using capture name , email user. when user submits form email fired specified recipient containing link. i had working realised needed add html footer email being read plain text. after doing digging have tried set footer read html ,but email no longer sends. not php developer. my question have missed or way off? <?php // configure $from = 'ether solutions sales <email@domain.co.uk>'; $sendto = $_post['remail']; $subject = "test email"; $name = $_post['name']; $okmessage = 'your message has been sent successfully, please ask recipient check inbox'; $errormessage = 'there error while submitting form. please try again later'; // send html mail, content-type header must set $headers = 'mime-version: 1.0' . "\r\n"; $headers .= 'content-type: text/html; charset=iso-8859-1' . "\r\n"; // create email headers $headers .= 'from: '.$from."\r\n".'rep

java - Android Snackbar setAction displaying button with text instead just text -

Image
i need create snackbar, text, when click on it, snackbar close. instead of text, action button rendered button action text. i've never seen such problem anywhere. version of android.support.design v7: 25.3.1. min api version 16. snackbar snackbar = snackbar.make(v_osnov, html.fromhtml(" <fontcolor=\"#ffffff\">tag deleted</font>") , snackbar.length_indefinite); snackbar.setduration(5000); snackbar.setaction("dismiss", new view.onclicklistener() { @override public void onclick(view view) { } }); snackbar.show(); this getting instead of action text:

pdf - PHP and FPDI/FPDF: Fatal error: Uncaught Exception: FPDF error: Incorrect output destination -

i have pdf file, , want add new page fpdi/fpdf fatal error: uncaught exception: fpdf error: incorrect output destination: outfiles/111111.pdf in c:\wamp\www\pdf\fpdi\fpdf.php on line 271 ( ! ) exception: fpdf error: incorrect output destination: outfiles/111111.pdf in c:\wamp\www\pdf\fpdi\fpdf.php on line 271 require_once('fpdi/fpdf.php'); require_once('fpdi/fpdi.php'); foreach(glob('infiles/*.pdf') $file) { $filename = basename($file); $fileout = 'outfiles/' . $filename; //echo $fileout; $out = new fpdi(); $pagecount = $out->setsourcefile($file); for($i = 1; $i <= $pagecount; $i++) { $tpl = $out->importpage($i); $out->addpage($format); $out->usetemplate($tpl); if($i < $pagecount) { $out->addpage($format); } } $out->output($fileout); } the output() method requires first parameter destination , snd para

reactjs - React Toolbox icon displays as alternate text -

Image
i trying use button icon. <button icon="add" floating accent mini /> i tried use icons in different components. nothing worked out. <fonticon value='add' /> above code rendered text. import {button, iconbutton} 'react-toolbox/lib/button'; <iconbutton icon="add" floating accent mini /> here complete reference: http://react-toolbox.com/#/components/button

c# - Creating a class from nested unstructured data -

is there way create class kind of data? <condition> <action/> <action/> <condition> <action/> <action/> <condition> <condition> <action/> </condition> </condition> </condition> </condition> the data above intrepreted <condition> condition object , <action> action object . the scenario hierarchy till 1 .. n depth, , n number of nested condition n number of actions inside. this not xml way wanted show how data nested then define 2 properties: class condition { public condition condition {get; set;} // different name? public list<action> actions {get; set;} } how know action under condition you can enumerate nested structure find or add parent information each action: class action { public condition parent { get; } public action(condition parent) {

mysql - Spring Data JPA: @Query gives error java.sql.SQLException: Column 'id' not found -

i trying run following query @org.springframework.stereotype.repository public interface reportingparamrepository extends repository<reportingparamdao, integer> { @query(nativequery = true, value = "select student, avg(height) reportingparams group student") public list<reportingparamdao> getaveragegroupbystudent(); } this dao @entity @table(name = "reportingparams") @namedquery(name = "reportingparams.findall", query = "select r reportingparamdao r") public class reportingparamdao extends basedao<integer, reportingparam> implements dao<integer> { private static final long serialversionuid = 1l; @id @generatedvalue(strategy = generationtype.identity) @column(unique = true, nullable = false) private integer id; @manytoone @joincolumn(name = "student", nullable = true) private studentdao studentbean; @column private long height; public integer geti

javascript - How can I call an external JS function from a jQuery script? -

back time using node.js , used use fs.readfilesync(filename) call external functions, filename name of file load. might weird using jquery , i'm kind of lost... currently gathering 3 different files (one .html , 2 others .js ), , here how : here test.html <body> <button id="submitting_button">valider</button> <!--//////////////////////--> <!-- loads jquery library --> <script src="jquery/jquery.js"></script> <!-- loads jqry script --> <script src="jquery/process.js"></script> </body> here process.js $(document).ready(function(){ $('#submitting_button').click(function(){ $.getscript("./functions/my_function.js"); document.write(calculation()); }); }); and finally, here my_function.js console.log("note : my_function.js has been reached"); function calculation(){ var result = 3+4;

phpunit - Serialization of 'MongoDB\Driver\Manager' is not allowed (php unit) -

i switched mongodb mongodb\driver\manager . re-wrote persistence class , persistencetest class. worked fine. restarted pc , test failed error message: phpunit 5.7.21 sebastian bergmann , contributors. serialization of 'mongodb\driver\manager' not allowed i simplified problem basic class , classtest. the class: class abc { protected $x; public function __construct() { $driveroptions = [ 'typemap' => [ 'root' => 'array', 'document' => 'array', 'array' => 'array' ] ]; $manager = new \mongodb\driver\manager("mongodb://user7:user777@localhost", [], $driveroptions); $this->x = new mongodb\database($manager, 'testdb', $driveroptions); $d = $this->x->{'testcollection'}->find(); foreach ($d $e) var_dump($e); } } $y = new abc(); the testclass: class abctest extends phpunit_framework_testcase { public funct

ios - Undefined symbols for architecture x86_64 with C files -

i have .c , .h file has added in swift project. have created bridging header , included .h file. i'm getting apple mach-o linker error follows: undefined symbols architecture x86_64: "_smooth", referenced from: __rep_count_data_passing_2 in rep.o "_tot_samples_rep", referenced from: __rep_count_data_passing_2 in rep.o "_oldavg_rep", referenced from: __rep_count_data_passing_2 in rep.o "_newavg_rep", referenced from: __rep_count_data_passing_2 in rep.o "_newmin_rep", referenced from: __rep_count_data_passing_2 in rep.o "_count_idle_rep", referenced from: __rep_count_data_passing_2 in rep.o "_rep_count_var", referenced from: __rep_count_data_passing_2 in rep.o "_step_cal_incre_rep", referenced from: __rep_count_data_passing_2 in rep.o "_avgthresh_rep", referenced from: __rep_count_data_passing_2 in rep.o "_avg_r