Posts

Showing posts from January, 2014

html - Prevent scroll in textbox -

if textbox happens focused , use scroll within it, page scroll gets bugged. in other words, looks scrolling within textbox rather page, causes me have reload page if want remove bug. the work around have once textbox focused , want scroll page have click body of page unfocus. not every user know issue , cause page scroll bug. there way prevent scroll on textbox ? not sure feature called. fyi: tried bug scroll still happens textbox { position: fixed; white-space: nowrap; overflow: hidden; } jsfiddle https://jsfiddle.net/nmbga0nu/3/ it not run code in snippet shows css. using asp.net textbox/label shouldn't affect why scroll happens. has css or bootstrap. try overflow: hidden; on textbox , let me know if worked. you post code can have context.

javascript - ExtJS GridHeaderFilters not a constructor -

i'm trying add row filters in extjs , i'm getting error in firefox: typeerror: ext.ux.grid.gridfilters not constructor i'm going off of this model. there better way add row filters xmlstore? fiddle plugins: [new ext.ux.grid.gridheaderfilters()], columns: [{ text: 'title', width: 150, dataindex: 'title', filter: [{xtype:"textfield"},{xtype:"textfield"}] }, { text: 'description', flex: 1, dataindex: 'description', filter: [{xtype:"textfield"},{xtype:"textfield"}] }, { text: 'modified', width: 90, dataindex: 'modified', xtype: 'datecolumn', format: 'm/d/y' }], filter: { xtype: "com...

c++ - How to correctly notify in QQmlListProperty properties? -

whenever creating q_property later use in qml created notify signal tell qml data changed , needs reevaluated. now having q_property of type qqmllistproperty<t> how can signalize item has been modified, added or removed? is possible? if have list there can't propertychanged() signal, because object reference stored remain same. within list there won't properties, no signal emitted. you instead use descendent of qabstractlistmodel designed handle problem, wrapping methods append, insert etc. in own methods, emit datachanged signal carries information necessary find changes. of course implement similar wrapping qlist in object, has signal inform of data change. won't integrate nicely qml real model, @ least view update automatically, when datachanged signal received, , update necessary. not so, if model of view changed directly, might happen, if manually call modelchanged() . in case, view miss information changed parts, recreate compl...

Windows XP + playing HTML5 audio problems -

i published new application, full of audio tags, , it´s working fine in browsers. unfortunately, there customers windows xp , chrome version 49 (because there no chrome support winxp anymore). when hearing audio in application, there very, poor sound , breaks often. tried adding 3 formats (mp3, ogg, wav), still same. tried other browsers on winxp (firefox, chrome, opera, iron...), again same. weird - if open audio file right click in new tab, plays perfectly! can code cause? how write audio tags: <div id="playerarea" class="row playerarea animated fadein"> <audio id="dolphinaudio" controls="controls" preload="auto" onvolumechange="volumechangedevent()"> <source src="filename.mp3" type="audio/mpeg" /> <source src="filename.mp3" type="audio/mp3" /> <source src="filename.ogg" type="audio/ogg" /> ...

ios - Trying to add an overlay for controls to a PDFPage in PDFKit but without adding it to the pdf itself -

i integrate bookmark button directly @ top of pdf page overlay scrolls page. know can override pdfpage's draw function , include button there shown in wwdc 2017 session on pdfkit doesn't seem optimal solution , means overlay added pdf want avoid. ideas on how accomplish this?

javascript - jQuery SmartMenus special functionality -

i implementing smartmenus on website , need add advanced functionality when in mobile-state. the default behavior of smartmenus expand item on first click no matter click , collapse when clicking minus button; if click anywhere else activate link. below desired effects: expanding 1 menu item should collapse other open items expanding/collapsing should activated only using plus or minus buttons; clicking anywhere else should take url expanding menu item should keep within view user on mobile in js code see comments such // 1 // correspond items listed above. i have been trying quite time , have been able achieve functionality of 1+3 or 2+3. 1+2 seem conflicting somehow cannot figure out smartmenus architecture , it's expectations. any guidance @ appreciated. do note stackoverflow code snippet seems prevent going of urls clicked in smartmenu might need bring code computers local environment. $(function() { // start smartmenu var $mainmenu = $(...

asp.net core mvc - IdentityServer4 with multiple clients -

i have multiple front facing web apps identityserver4 (micro-service) app, running on .net core mvc. given user may have multiple accounts on each of app1 , app2. once user logs in select account accessing. if user logs in on app1 , selects account, should able log in app2 , select account without losing identity on app1. when returning app1 selected identity should still persist (no re-login required). additionally, if user goes through entire login process on app1, if hit app2 w/o app2 identity, should not have enter initial credentials, go straight account selection. the issue i'm having once try log user in on app2, lose app1 identity. things i've tried: i set separate scopes 2 sites , can manage site gets info, great, doesn't solve overall issue. i've attempted set separate authenticationschemes sites far has been unhelpful, leading unhelpful "server_error" message (no stack trace, nothing in logs). does know how accomplish this? ...

json - Testing Api call from mobile app -

i need tool allow me test , verify api calls coming mobile app. tool needs able receive api calls, match specs make sure corrects. i'm not looking server response postman. i'm thinking of using fiddler proxy, can't find tool macthing expectation. do have ideas ? thank you

orientdb - How Do I Call SQL Function inside SQL Query -

i have 2 orientdb questions. for example have function called getall "select v name =:name" i wish retrive result in simple sql query liket his select type (getall("test")) how can accomplish ? is possiable run new sql select query new parameters based on previous queries? example select $c v let $a = (select v name = 'test1') , $b = (select v type = 'type1') , $c = (select v type = $b , name = $a) this case working takes lot of time (as understands happens because runs on content of v) thanks in advance. to call function try this: select getall("test") with retrieve rid, if want properties try this: select expand(getall("test")) if want retrieve type property, can in 2 ways: select type from(select expand(getall("test"))) modify function in way select type v name = :name for second question pretty close, i've modify little bit: select $c v let $a = (select v nam...

c# - SetExcelDocumentProperties not in Output Selector VS2015/ISLE -

Image
in previous versions of visual studio (2013 , below can tell on this document :) in application files page, choose add project outputs button. visual studio output selector dialog box appears. under setexceldocumentproperties node , select primary output check box, , choose ok button. in visual studio 2015 / install shield limited edition visual studio output selector shows dialog box: i dont have lower versions of vs verify if have dropped this, equivalent now. i trying setup vsto installer 64 bit excel add in.

spring - DeferredResult Empty Body -

i've seen this , having issue now. if change controller return responseentity<?> body comes through fine, if returns deferredresult<responseentity<?>> headers , status code no response body. any appreciated use of deferredresult not matter of changing controller's response type. controller returns deferredresult delegate handling of request thread pool (or async mechanism) , whatever performs request must set response on deferredresult . this: in controller: deferredresult deferredresult = new deferredresult<>(); // pass deferredresult runnable task (or similar) // scheduled execution via thread pool (or similar) return deferredresult; in task executes request on behalf of controller: // work // ... deferredresult.setresponse(responsebody);

chart.js - Chartjs: How to create padding between ticks and scale label -

i'm using chartjs-node create graph, , use label y-axis. my problem distance between y-axes ticks , label minimal , not good. i've gone on docs , couldn't find useful scenario... there's option under options -> scales -> yaxes -> ticks -> padding doesn't give desired effect. currently have workaround under options -> scales -> yaxes -> ticks -> callback manually insert spaces: callback: (val) => ` ${val}%` this works, not correct usage, , believe if scale linear approach prohibit me using of features available linear scale. anyone knows how can create separation between ticks , label in more elegant way? this can achieved using afterfit callback function of y-axis : scales: { yaxes: [{ afterfit: function(scale) { scale.width = 80 //<-- set value wish }, ... }] } ɪɴ ᴀᴄᴛɪᴏɴ var chart = new chart(ctx, { type: 'line', data: { labels: ['jan...

Angular filter for last element -

how can write filter , returns last element of list / how can write filter returns last element. background: i'm having list of items, last item should editable. therefor need filter it. you use pipe filter array pipe @pipe({name: 'lastitem'}) export class lastitempipe implements pipetransform { transform(items: any[], exclusive: boolean): { if (exclusive) { return items.slice(0, items.length - 1); } return [items[items.length - 1]]; } } template <h2>list without</h2> <div *ngfor="let item of items | lastitem:true">{{item}}</div> <h2>list with</h2> <div *ngfor="let item of items | lastitem:false">{{item}}</div> live plunker example

exception - TYPO3 PHP Runtime Deprecation Notice: -

i have problem old typo3 stuff, tried make old typo3 website run on ubuntu system. , sorry if somethings not clear understand me, new in cms's , forced change stuff on old page. problems are: 1. backend seems working, half. if enable ext. templavoila page module shows me white page. on tv disable, page module, seems working gives me strange error messages inside content fields. if try @ front-end gives me exception: 1: php runtime deprecation notice: non-static method tx_ttnews_div::getsubcategories() should not called statically, assuming $this incompatible context in /var/www/projectfolder/projectfolder-typo3/typo3conf/ext/tt_news/pi/class.tx_ttnews.php line 3740 just apart this, read removed php feature in update 5.6 using currently. things checked already: -correct php -v -database import correct -localconf correct (took live server , changed localhost) -checked install-tool , rm -rf * inside typo3temp folder thanks help your php vers...

c++ - Casting Pointer of Stack Objects -

i'm building messaging queue , have 2 types of messages 1 uses template class. class message { public: message() : m_imessagetype( message_undefined ) {} message( int imessagetype ) : m_imessagetype( imessagetype ) {} int gettype() { return m_imessagetype; } void settype( int imessagetype ) { m_imessagetype = imessagetype; } private: int m_imessagetype; } template<typename t> class datamessage: public message { public: datamessage() : message(), m_odata( t() ) {} datamessage( int imessagetype, t odata ) : message( imessagetype ), m_odata( odata ) {} t getdata() { return m_odata; } void setdata( t odata ) { m_odata = odata; } } which allows me send messages this message tomessage( message_get_name ); datamessage<std::string> frommessage(); messenger::getmessenger()->sendmessage( &tomessage, &frommessage, consumer ); std::cout << "consumer name: " << frommessage.getdata() << std::endl; ...

encode - sharepoint online rest api java encoding issue -

i'm trying save file in sharepoint online , contains % in it's name. i'm using java url encoder encode it. urlencoder.encode(url, "utf-8"); this rest api i'm using store file in sharepoint. post https://(root_url)/_api/web/getfolderbyserverrelativeurl('(url/folder)')/files/add(url='(file name)',overwrite=false) http/1.1 but instead of saving % , file name saved in encoded format.(i.e.) %25 . if file name test%.xlsx , in sharepoint saved test%25.xlsx this issue arises % , other special characters saving fine. is rest api defect? solutions??

twitter bootstrap - Need to align a button next to text box in form-group -

Image
i new bootstrap. as seen in picture trying use form-group , form structure given button doesn't seem align textbox. please current code <div class="form-group"> <span for="artistname" class="control-label">enter artist name</span></br> <input id="artistname" type="text" ng-modal="artist1" class="form-control text_element_width" placeholder="enter artist name." /> <button type="button" class="btn btn-default glyphicon glyphicon-plus" ng-click="addartistchoice()">add artist</button> </div> <div data-ng-repeat="artist in artists" class="form-group"> <input type="text" ng-modal="{{artist.artistname}}" class="form-control text_element_width" placeholder="enter artist name."> <a href="">...

javascript - Change pinch-zoom sensitivity in fabric.js -

i have custom built fabric.js bundle touch support. can scale object pinch-zoom gesture. problem zoom really sensitive, barely move fingers , object hugely scaled. i couldn't find information in documents how can change sensitivity. know event.js used handle touch events within fabric.js . there way can change sensitivity?

Is there a simple PHP way to minimize the class name in serialization? -

i have group of objects need serialize, class names long, example: "\namespace1\subnamespace\dataobjecta" "\namespace1\subnamespace\dataobjectb" "\namespace1\subnamespace\dataobjectc" "\namespace1\subnamespace\dataobjectd" using serialize function on objects, get: "o:41:\"namespace1\subnamespace\dataobjectc\":1:{s:4:"data";s:9:"some data";}" the serialization string contains full class name bigger data :) i'm familiar __sleep() ans __wakeup() functions, not useful here. i understand king of lookup table required my question is: is there simple php way minimize class name in serialization any suggestion welcome i have answer, bad answer, , answer addresses question. good answer if can take somewhere else entirely: don't want @ all. mention class names longer actual data. if case, overall have no data in serialization. unless have ridiculously long namespaces...

Structure a Keras Tensorboard graph -

Image
when create simple keras model model = sequential() model.add(dense(10, activation='tanh', input_dim=1)) model.add(dense(1, activation='linear')) model.compile(loss='mean_squared_error', optimizer='adam', metrics=['mean_squared_error']) and callback tensorboard tensorboard = tensorboard(log_dir='c:/temp/tensorboard/run1', histogram_freq=1, write_graph=true, write_images=false) model.fit(x, y, epochs=1000, batch_size=1, callbacks=[tensorboard]) the output in tensorboard looks this: in other words, it's complete mess. is there can make graphs output more structured? how can create histograms of weights keras , tensorboard? you can create name scope group layers in model using k.name_scope('name_scope') . example: with k.name_scope('customlayer'): # add first layer in new scope x = globalaveragepooling2d()(x) # add second connected layer x = dense(1024, activation='relu')(x)...

rest - Oauth2 PHP no data returned -

i have trouble getting access token from: api.hybrid.ru/token documentation api in russian ( link ) , says: headers post /token http/1.1 host: api.hybrid.ru content-type: application/x-www-form-urlencoded data: grant_type=client_credentials&client_id={client_id}&client_secret={client_secret} i have valid client_id , client_secret (hybrid.ru techs gave me those), won't return error message. use curl , there goes code: <?php error_reporting(e_all); ini_set('display_errors',1); $ch = curl_init(); $url = "https://www.api.hybrid.ru/token"; $post_data = array( 'grant_type'=> 'client_credentials', 'client_id'=>'********', 'client_secret'=>'********' ); curl_setopt($ch, curlopt_httpheader, array( "post /token http/1.1", 'content-type: application/x-www-form-urlencoded', "host: api.hybrid.ru" )); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curl...

Scheme Double All List Values and Write Mapping Function -

Image
i have question on homework assignment follows: i have first part ( double-list-elements ) complete (define (double-list-elements s) (if (null? s) '() (cons (* 2 (car s)) (double-list-elements (cdr s))))) but have absolutely no idea how proceed double-list-elements-one . pointers appreciated. close no cigar: (define (double-list-elements s) (if (null? s) '() (cons (* 2 (car s)) (double-list-elements (cdr s))))) (define (custom-map proc lst) (if (null? lst) '() (cons (proc lst) (custom-map proc (cdr lst))))) (define (double-list-elements-one func s) (custom-map double-list-elements s)) (double-list-elements-one double-list-elements '(1 2 3 4 5 6)) output = (list (list 2 4 6 8 10 12) (list 4 6 8 10 12) (list 6 8 10 12) (list 8 10 12) (list 10 12) (list 12)) i need pass double-list-elements double-list-elements-one parameter list. you have write own map , it's very sim...

Apollo GraphQL addMockFunctionsToSchema: Prevent Mocking Certain Fields -

i'm using apollo graphql js library, , in particular i'm using addmockfunctionstoschema function. works great except 1 thing: fills in nulls on non-mocked records. let's have enum options a , b , or c field typeoffoo , , database returns { typeoffoo: null } . if have mocking turned on returned graphql client (say) { typeoffoo: 'b' } . so, i'd tell mocking function not mess typeoffoo , because when it's null want null back. possible, , if how can correct it?

node.js - How to use existing javascript files in typescript files? -

i have existing project in nodejs + express in javascript. working on es5. now added typescript in same project , want new development in typescript. facing issue in accessing existing javascript files. i found can create definition file xx.d.ts (not sure if correct approach) of each existing javascript file , use in typescript files. for example have javscript file myfile.js function myclass(){ //some functions here associated variable } exports.mydata = new myclass(); now want use in new ts file so did in ts file access is declare function require(path: string): any; var auth = require('./myfile').mydata; i not sure if right approach. secondly tried myfile.d.ts file well. i defined file in following way declare module './myfile' { export var mydata: } but gives error of relative path - ts2436 ambient module declaration cannot specify relative module path please let me know if has idea resolve problem or suggest if okay go first appro...

c# - Authentication for the Office365 account for access in docs -

i have .net application in c# send files various office365 services, example: onedrive , email , word , etc. found "authentication oauth" article on msdn site unsure whether application fits purpose of article. in case, make user log in office365 account, , can create access keys onedrive , email , etc or what? and in addition, @ end of article shown xml code inform authenticationtoken , can not done throughout code in c# normally? article: https://msdn.microsoft.com/library/bing-ads-user-authentication-oauth-guide.aspx#registerapplication

How to improve spark perf by joining dataframe on a known key -

i have 2 big parquet dataframe s , want join them on userid . what should high performance : should modify code write files in order : partitionby on userid (very sparse). partitionby on first n char of userid (afaik, if data partitioned on same key, join occur no shuffle) on read side, better use rdd or dataframe ? you can perform bucketby operation before save parquet file. val num_buckets = 20 df1.write.mode(savemode.overwrite).bucketby(num_buckets, "userid").saveastable("bucketed_large_table_1") df2.write.mode(savemode.overwrite).bucketby(num_buckets, "userid").saveastable("bucketed_large_table_2") spark.sql("select * join b on a.num1 = b.num2").collect() doing way prevent shuffle when join operation performed. keep in mind in order need enable hive .enablehivesupport, save parquet operation doesn't support bucketby method.

iOS binary rejected due to crash on launch, cannot recreate, only have error log to go from -

i submitted app ios other day , unfortunately got rejected. apparently crashed on launch. game runs on android, , cannot re-create "crash on launch" on ios. me works. test-environment limited iphone 5 , emulators. could please take @ these error logs , see if can find something? error log: here if know why, or have ideas/suggestion, please let me know. according log exception code 0x8badf00d . code indicates application terminated ios because watchdog timeout occurred. basically, application took long launch, terminate, or respond system events.

javascript - what is the most terse way to return an array of entities in typescript? -

i'm trying figure out terse way return array of objects ts function. following function works expected: getauthors1(): author[] { var authors: author[] = [ { firstname: "john"; mi: "j"; lastname: "smith"; } ]; return authors; } the following function errors out b/c appears ts won't let me return object array directly opposed variable: getauthors2(): author[] { return author[] = [ { firstname: "john"; mi: "j"; lastname: "smith"; } ]; } the following function errors out b/c value isn't provided mi: getauthors3(): author[] { var authors: author[] = [ { firstname: "john"; ...

html - nopin='nopin' code not working on individual images -

having installed own pinterest hover button appear on center of blog post images, have issue on pages/images not want same hover button appear (aren't fussy!). common advice seems to add >> nopin='nopin << specific img src code on page in question. have tried >> data-pin-nopin="true" << neither of working remove/hide pop-up pin-it button. what former is doing, however, disabling pinterest chrome function. ideally don't want pin-it buttons show on these images, disabling center 1 workable solution. tl;dr >> yes custom pin buttons on blog post images, no pin buttons on other images. suggestions? here 1 of pages want hide pop-up button >> http://guplayground.blogspot.ca/p/library.html << thank you! // resolved // add class='nopin' image code, eg: <img class='nopin' src="https://c1.staticflickr.com/5/4319/35968863432_8becca78cb_b.jpg" /> thanks http://www.bl...

node.js - HTTP / HTTPS GET Request Alexa Skill - "The Response is Invalid" Lambda Response -

i building alexa skill tells user closest kaiser permanente hospital, clinic, or pharmacy. when test using 1 of 3 keywords, error: the response invalid. giving invalid (using none of 3 keywords) response gives me error: the remote endpoint not called, or response returned invalid. i @ loss how figure out or issue is, not given details issue. function getwelcomeresponse(callback) { var speechoutput = "welcome kaiser permanente alexa skill. allow me find nearest kaiser hospital, pharmacy, or clinic."; var reprompt = "would me find nearest kaiser hospital, pharmacy, or clinic?"; var header = "kaiser permanente skill"; var shouldendsession = false; var sessionattributes = { "speechoutput" : speechoutput, "reprompttext" : reprompt, }; callback(sessionattributes, buildspeechletresponse(header, speechoutput, reprompt, shouldendsession)); } function handlegetkaiserbuildingintent(intent, session...

Eclipse python debug raise RuntimeError - sys._current_frames not available for this python implementation -

i'm trying write scripts imagej using jython through eclipse oxigen. however, when trying debug script, debugger raises runtimeerror : file"/users/yahel/.p2/pool/plugins/org.python.pydev_5.8.0.201706061859/pysrc/_pydevd_bundle/pydevd_additional_thread_info_regular.py", line 47, in raise runtimeerror('unable proceed (sys._current_frames not available in python implementation).') runtimeerror: unable proceed (sys._current_frames not available in python implementation).` my current versions: eclipse oxigen, python 5.8.0, java 8, jython 2.7.0 i'm working on mac os 10.10.5 when running program have no errors.

bash - sed vs line with spaces -

have such file execute exec java -dcom.sun.management.jmxremote=true \ -dcom.sun.management.jmxremote.port=12345 \ -djava.rmi.server.hostname=127.0.0.1 \ -dcom.sun.management.jmxremote.authenticate=false \ -jar somefile.jar the question how change ip using of sed? for in-place change sed -i 's/127\.0\.0\.1'/new_ip/' file for copy, can use sed -i 's/127\.0\.0\.1'/new_ip/' file > new_file

ruby on rails - Can't bundle install after cloning repo -

here's error when bundle. what's problem? bundle install rbenv: bundle: command not found `bundle' command exists in these ruby versions: 2.3.1 command -v ruby /home/brian/.rbenv/shims/ruby command -v bundle /home/brian/.rbenv/shims/bundle ruby -v ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux] bundle -v bundler version 1.15.3 try: set correct ruby (rbenv) version rbenv global 2.3.1 and rbenv rehash , bundle install . if won't work think should reinstall bundler once again set correct ruby version rbenv global 2.3.1 gem uninstall bundler gem install bundler and rbenv rehash , bundle install .

node.js - NodeJS Buttons, Examples? -

i have been experimenting several days kik bots using nodejs. have not, despite research, been able find examples of implementation of buttons using nodejs. referring keyboard options bot presents choose from, don't have type response in. other info: using ngrok, testing under android kik app, running kik server on linux mint, have tried using on line web services, find overcomplicated things or broken. the feature you're referring called "suggested response" - it's documented here: https://dev.kik.com/#/docs/messaging#keyboards if you're using our node lib: https://www.npmjs.com/package/@kikinteractive/kik#message+addresponsekeyboard hope helps. david @ kik

r - Is it possible to skip NA values in "+" operator? -

i want calculate equation in r. don't want use function sum because it's returning 1 value. want full vector of values. x = 1:10 y = c(21:29,na) x+y [1] 22 24 26 28 30 32 34 36 38 na x = 1:10 y = c(21:30) x+y [1] 22 24 26 28 30 32 34 36 38 40 i don't want: sum(x,y, na.rm = true) [1] 280 which not return vector. this toy example have more complex equation using multiple vector of length 84647 elements. here example of mean: x = 1:10 y = c(21:29,na) z = 11:20 = c(na,na,na,30:36) 5 +2*(x+y-50)/(x+y+z+a) [1] na na na 4.388889 4.473684 4.550000 4.619048 4.681818 4.739130 na 1) %+% define custom + operator: `%+%` <- function(x, y) mapply(sum, x, y, moreargs = list(na.rm = true)) 5 + 2 * (x %+% y - 50) / (x %+% y %+% z %+% a) giving: [1] 3.303030 3.555556 3.769231 4.388889 4.473684 4.550000 4.619048 4.681818 [9] 4.739130 3.787879 here simple examples: 1 %+% 2 ## [1] 3 na %+% 2 ## [1] 2 2 %+% na ## [1] 2 na ...

java - Android - Default Activity Cannot Be Found -

i making basic custom launcher following given instructions on site... instructions app can launched, when try, error saying default activity not found. i looked existing questions on stack overflow none of them helped me. manifest this... <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="omg_its_azzler.launcher"> <activty> <application android:allowbackup="true" android:name="omg_its_azzler.launcher.homeactivity" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundicon="@mipmap/ic_launcher_round" android:supportsrtl="true" android:theme="@android:style/theme.wallpaper.notitlebar.fullscreen" android:launchmode="singletask" android:statenotneeded="true"/> <intent-filter> <action android:name="android....

jsf - What would be a good way to display static message in facelets? -

i came across following managed bean , .xhtml in jsf 2.x application. static variable has long string value , referred bean in .xhtml page display message. armed limited experience of java/jsf, decided improve somehow. take out static first step create proper getter/setter methods load text message properties file. bind loaded value message variable not convinced of myself googled here , found thread: fetching values property file inside xhtml file . sounds promising hoping find best practice in regards load/referring static message in jsf. @managedbean @viewscoped public class foo { private static string message = "....long...message..."; // getter available public string getmessage() { .... } from .xhtml page: <h:outputtext value="#{foo.message}" />

sql - MySQL: Combine union and top 3 count of leads -

i'm trying obtain each campaign type , 3 lead names have (top 3) attendances each campaign type. should looks this: +-------+-----------+ | code | leadname | +-------+-----------+ | wp | lead | | wp | lead b | | wp | lead c | | cf | lead b | | cf | lead c | | cf | lead | | tl | lead b | | tl | lead | | tl | lead c | campaign table: campaignid, campaignname, campaignstartdate, code campaign members table:campaignid, leadid, campaignmemberstatus, campaignmembersignupdate leads table: leadid, leadname, accountid campaignid links campaign --> members, leadid links members --> leads i'm struggling on how union , provide top 3 leadnames. select top 3 abc.code,abc.leadname ( select a.code,c.leadname,count(*) total campaign left join [campaign members] b on b.campaignid = a.campaignid left join leads c on c.leadid = b.leadid group a.code, c.leadname order count(*) ) abc...

flow - Cannot run imagenet download and preprocess script (suggestion in issue 202 did not work) -

i following instruction here: https://github.com/tensorflow/models/tree/master/inception after running bazel-bin/inception/imagenet_train --num_gpus=1 --batch_size=32 --train_dir=/tmp/imagenet_train --data_dir=/tmp/imagenet_data i following error: bazel-bin/inception/download_and_preprocess_imagenet.runfiles/inception/inception/data/download_imagenet.sh: line 105: bazel-bin/inception/download_and_preprocess_imagenet.runfiles/inception/inception/data/imagenet_lsvrc_2015_synsets.txt: no such file or directory" i saw post on in 202 suggestion "add main before /inception" in work_dir did not solve problem. below output of ls -l -r bazel-bin/inception/download_and_preprocess_imagenet.runfiles/ : bazel-bin/inception/download_and_preprocess_imagenet.runfiles/: total 8 drwxr-xr-x 3 parsa parsa 4096 jun 30 14:34 inception -r-xr-xr-x 1 parsa parsa 1737 jun 30 14:34 manifest bazel-bin/inception/download_and_preprocess_imagenet.runfiles/inception: total 4 drwxr-xr...

java - TestNG/Junit configure output style in console -

when write , execute test, feel distracting see lot of noise testng writes on terminal this: [testng] =============================================== [testng] mynamespace.test [testng] tests run: 4, failures: 0, skips: 0 [testng] =============================================== [testng] [testng] this:foo(super=foo(param=abc1234567, name=null, param=null), id=-314151617) [testng] passed: testaverycoolthing on testconstructor(mynamespace.sometest) lines , lines this... i used (not junit/testng) have test output this: .......f....e................................. .............................................. .............................................. so every test passing, write simple dot (it's passing, i'm happy) , failures , errors equivalent letter , later show me output failing tests. achievable testng/junit? just read docs . need override methods testlisteneradapter : (taken docs): here listener displays "." each passed test,...

python - Linear Regression using Scikit-learn vs Statsmodels -

i wanted check if multiple linear regression problem produced same output when solved using scikit-learn , statsmodels.api. did in 3 sections (in order of mention): statsmodels(without intercept), statsmodels(with intercept) , skl. expected, skl coefficients , r(square) same of statsmodels(with intercept) skl mean square error equivalent of statsmodels(without intercept). i going share notebook code; it's basic piece of code, since have started machine learning applications. please go through , tell me why happening. also, if share insights on inefficient piece of code, thankful. here's code: https://github.com/vgoel60/linear-regression-using-sklearn-vs-statsmodel.api/blob/master/linear%20regression%20boston%20housing%20prices%20using%20scikit-learn%20and%20statsmodels.api.ipynb you made mistake, explains strange results. when make predictions linear model scikit-learn, write: predictions2 = lm.predict(xtest2) notice using lm model, 1 resulting first stats...

r - Manipulating dataframe without for loop -

i wrote loop manipulate rather large (~1,000,000 rows) dataframe runs far slow , couldn't find online. df=data.frame(v1=runif(10), v2=runif(10), v3=runif(10), v4=0, v5=0, v6=0, v7=0) for( in 1:dim(df)[1] ) { df[i,4]=length(which(df[i,1:3]>0.00 & df[i,1:3]<0.10)) df[i,5]=length(which(df[i,1:3]>0.10 & df[i,1:3]<0.50)) df[i,6]=length(which(df[i,1:3]>0.50 & df[i,1:3]<0.90)) df[i,7]=length(which(df[i,1:3]>0.90 & df[i,1:3]<1.00)) } i've tried write function this, adds row together: test.fun <- function (df) { df[,4]=length(which(df[,1:3]>0.00 & df[,1:3]<0.10)) df[,5]=length(which(df[,1:3]>0.10 & df[,1:3]<0.50)) df[,6]=length(which(df[,1:3]>0.50 & df[,1:3]<0.90)) df[,7]=length(which(df[,1:3]>0.90 & df[,1:3]<1.00)) return(df) } (test <- test.fun(df)) rowsums condition want main idea. you can use dplyr package make cleaner: df %>% muta...

magento2 - Magento 2: Update qty in product list page like on cart page -

i added qty input on product list (list.phtml) way implement solution update qty on cart page or minicart? not add cart update qty in product list. regards matt you can use this: <?php $postparams = $block->getaddtocartpostparams($_product); ?> <form data-role="tocart-form" onsubmit="return false;" action="<?php /* @escapenotverified */ echo $postparams['action']; ?>" method="post"> <?php echo $block->getblockhtml('formkey')?> <input type="hidden" name="product" value="<?php /* @escapenotverified */ echo $postparams['data']['product']; ?>"> <input type="hidden" name="<?php /* @escapenotverified */ echo action::param_name_url_encoded; ?>" value="<?php /* @escapenotverified */ echo $postparams['data'][action::param_name_url_encoded]; ?>"> <input type=...

sql - Selecting records with the most recent date for each unique identifier -

to start, i've been scouring internet last 4 hours , have come across few similar issues (most here on stack overflow) solutions work, did not (most of them used single table). i have 2 tables - personnel , tests. personnel contains information each person indexed ssn. such as: id ssn personname 101 111-11-1111 joe 102 222-22-2222 bob 103 333-33-3333 jebadiah tests table contains information tests each person has taken. these tests related personnel table ssn. each person can have number of tests: id ssn testdate score 201 111-11-1111 1/1/2013 95.7 202 111-11-1111 2/7/2013 75.2 203 222-22-2222 1/9/2013 85.6 204 333-33-3333 5/6/2013 79.9 205 333-33-3333 4/8/2013 88.8 what need select recent test date , score each person. i'm looking resultset looks this: ssn personname testdate score 111-11-1111 joe 2/7/2013 75.2 222-22-2222 bob 1/9/2013 85.6 333-33-3333 jebadiah 5/6/2013 79.9 i...

azure batch - BlobAccessDenied with Application packages -

i have been having issue application packages there days/times null exit code , blobaccessdenied error exact same application package , exact same command line worked , gave non-null exit code. instance, today, i've been getting error exact same packages , commands ran yesterday. missing? or bug in application packages service? (for vm configuration) i've same problem, asked several days ago on ms forums , glad solving this.

vue.js - Pass data object from parent to child component -

i'm making list of tools. i'm trying pass full tool data object parent component (the tool list) each child component (the tool items), using single file templates. in child component, error: property or method "..." not defined on instance referenced during render. make sure declare reactive data properties in data option. where ... property of tool data object, example title or description . here's setup: tools.vue (parent): <template> <main id="tools"> <tool v-for="tool in tools" :data="tool" :key="tool.id"></tool> </main> </template> <script> import tool './tool.vue' let test = { id: 1, title: 'title', description: 'description' }; export default { data() { return { tools: [ test ] } ...

finance - Python DataFrames Create 'Create/False' Column from 3 other 'True/False' Columns -

i'm working financial dataframe. want create df['lb4'] column, returns true if of lb1, lb2, , lb3 true. date open high low close volume lb1 lb2 lb3 2005-01-03 4.63 4.65 4.47 4.52 173354034 false false false 2005-01-04 4.56 4.68 4.50 4.57 274515332 false false false 2005-01-05 4.60 4.66 4.58 4.61 170210264 false false true 2005-01-06 4.62 4.64 4.52 4.61 176469496 false true true 2005-01-07 4.64 4.97 4.62 4.95 558932752 true true false any ideas? i new python , appreciate help. thank starting (modified example bit): in [1095]: df out[1095]: lb1 lb2 lb3 0 false false false 1 false false false 2 false false true 3 true true true 4 true true true you can use bitwise & : in [1096]: df.lb1 & df.lb2 & df.lb3 out[1096]: 0 false 1 false 2 false...

database - Split Row into multiple Row (events with start time and end time that span multiple days/periods) -

i working in spotfire , looking split "events" multiple rows. data provided start date/time , end date/time. split rows unique date. current data example start date |end date |duration 20/07/17 4:00am |26/07/17 4:00am |144 desired outcome start date |end date |duration 20/07/17 4:00am |21/07/17 12:00am |18 21/07/17 12:00am|22/07/17 12:00am |24 22/07/17 12:00am|23/07/17 12:00am |24 23/07/17 12:00am|24/07/17 12:00am |24 24/07/17 12:00am|25/07/17 12:00am |24 25/07/17 12:00am|26/07/17 12:00am |24 26/07/17 12:00am|26/07/17 4:00am |4

javascript - Unable to retrieve Height from a toggleClass jQuery -

i want height of class toggled. when button clicked, class .category-menu-visible added. if class exists, want it's height. when alert menuheight , 0. small scale jsfiddle example actual code: jquery jquery('.topics-btn').click(function(){ jquery('.category-menu-wrap').toggleclass('category-menu-visible'); if (jquery('.category-menu-wrap').hasclass('category-menu-visible')){ var menuheight = jquery('.category-menu-visible').height(); alert(menuheight); jquery('.sidebar .content-wrap').css('margin-top', menuheight); } else { jquery('.sidebar .content-wrap').css('margin-top', 0); } }); css: .category-menu-wrap { width:100%; height:0px; background-color:#f7d5b6; overflow: hidden; transition: height .5s cubic-bezier(.27,1.76,.95,1.19); } .category-menu-visible { height: 70px; transition: height .3s cubic-bezier(.27,1.76,.95,1.1); } why can't ret...

url rewriting - Nginx rewrite rule: Add subfolder to URI if not there -

hello i'm trying write nginx rewrite rule adds subdirectory url if it's missing. example, need http://example.com re-written (and redirected) http://example.com/legacy-app . can't seem find proper example this. you can use rewrite directive, exact match location block efficient: location = / { return 301 /legacy-app; } see this document more.

regex - How to find all lines with character occuring more than x times, Notepad++? -

i have of consider trivially easy problem solve. i have list formatted so; ?d?d?d?d?l?d?d?d ?d?d?d?d?l?d?d?l ?d?d?d?d?l?d?d?u ?d?d?d?d?l?d?l?d ?d?d?d?d?l?d?l?l there many tens of thousands of lines this. regular expression select of lines contain more 5 occurrences of letter d can removed list. despite searching extensively, have not found solution works. i've found many ways of searching occurrences of characters etc. on , other forums (including spaces , special characters), , have been able conduct search on other lists of words think presence of question marks screws up... can't sure though. i apologise in advance if somehow missed post explains perfectly, have made effort find solution on own , have become exasperated it. many in advance provided! use find , replace , replace lines matching following nothing: ^.*(d.*){6}.*\r\n explanation: ^ - start @ beginning of line .* - skip 0 or more uninteresting characters not past end of line (d. ) -...

html - Bulma css framework columns not stacking on Chrome mobile browser -

Image
i'm trying figure out why small static webpage isn't showing when viewed on mobile (noticed on chrome android app). according docs, columns should automatically stack on mobile. but, when view see normal view of page width fitting correctly screen, columns stay in 1 row. shown in below screenshot. i tested see if it's code resizing page on desktop browser , page responded expected, stacking cards in single column. here's desktop-view imitated on phone. any idea what's going on? doing wrong? here's code <html> <head> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.4.3/css/bulma.css"/> </head> <body style="background-color:#00aced;"> <div class="container"> <div class="notification" style="background-color:#fff"> <strong>remember:</strong> in order continually re...