Posts

Showing posts from April, 2010

javascript - extjs cellediting event passing activecolumn as null -

this happens extjs versions 6.2+. have cellediting plugin has listener event on edit. when onedit called, trying check xtype of edited cell , fails since active columns passed nulls. works fine earlier versions. per research, bug never got fixed in extjs versions , don't see workaround yet. if come across this, please advise. problem : on cellediting, editor.activecolumn null. works fine earlier versions. looks extjs 6.2 cellediting plugin editor.el.dom passes null. panel layout : hideheaders: false, sortablecolumns: false, rowlines: true, collapsible: false, titlecollapse: true, layout: 'auto', title: 'test page', selmodel: 'cellmodel', plugins: { ptype: 'cellediting', clickstoedit: 1, listeners: { beforeedit: 'iseditable', edit: 'onedit' } } above code trigger onedit , below function: onedit: function(editor, c, e) { // combobox check if (editor.activecolumn.config.edito

google chrome - CSS filter breakes overflow:hidden in Webkit -

so i've come across weird css-issue in webkit-based browsers (chrome, opera, ...). when apply overflow:hidden on parent div , filter:grayscale(100%) (or other kind of filter), overflow breaks. elements not hidden anymore reason. i've tested on chrome, firefox, edge , opera. edge , firefox don't seem have issue, chrome , opera have it. guess may issue webkit-based browsers. i've made small video better illustrate issue (images in video may differ ones in post, effect same. cursor appears on wrong places, it's clicking on arrows , hovering/clicking on icons. sharex not high-dpi displays, apparently.) does have idea how can work around this? html <div id="projects"> <img id="left" src="https://i.imgur.com/8u7kir7.png"> <div id="scroller"> <figure><a id="portfolio1"><img src="https://i.imgur.com/ou2vsum.png" alt="breakingbook">&l

Linear regression gradient descent algorithms in R produce varying results -

i trying implement linear regression in r scratch without using packages or libraries using following data: uci machine learning repository, bike-sharing-dataset the linear regression easy enough, here code: data <- read.csv("bike-sharing-dataset/hour.csv") # select useable features data1 <- data[, c("season", "mnth", "hr", "holiday", "weekday", "workingday", "weathersit", "temp", "atemp", "hum", "windspeed", "cnt")] # split data trainingobs<-sample(nrow(data1),0.70*nrow(data1),replace=false) # create training dataset trainingds<-data1[trainingobs,] # create test dataset testds<-data1[-trainingobs,] x0 <- rep(1, nrow(trainingds)) # column of 1's x1 <- trainingds[, c("season", "mnth", "hr", "holiday", "weekday", "workingday", "weathersit", "t

How to generate NES like noise for openAL? -

as far remember nes has 16 predefined noise samples. guess there might kind of logic behind samples generated fitting code. so far tried white , pink noise, hear reminds me more of rusty horn static. i'm looking sound in video: https://www.youtube.com/watch?v=oofsrgwig8k

gmail api - Getting incorrect sent date/time from google api -

i wrote app calls google's api list of threads users inbox. of emails i'm getting incorrect sent time. example, queried user , it's 3:55pm est here , yet date header has value of mon, 11 sep 2017 19:14:53 +0000 - 7:14pm est. each time i've encountered time in future has +0000 @ end of string. i'm assuming that's timezone offset, if was, wouldn't have value other 0?

angularjs - Display nested data from all object using ng-repeat -

hey have database many products , in every products has comments , display every comments using ng-repeat. data.data.products there object in database , comments comment every object. e.g. have 5 object in database , 6 comments every in. , question how dispaly comments objects? try use this: user.getproducts().then(function(data){ for(i=0; < data.data.products.length; i++) app.usercomments = data.data.products[i].comments; }) html <div ng-repeat="comment in main.usercomments" class="item"> <blockquote> <p>{{comment.body}}</p> </blockquote> </div> schema var productschema = new schema({ comments: [{ body: { type: string, trim: true, }, author: { type: string, }, date: { type: date, } }] }); just assign returned data web service controller variable, , then, using 'controller as' syntax, iterate through them in view ng-rep

php - Yii2 sphinx query not works after deployment on client server -

i use yii2-advanced sphinx on server , works fine, after website deployment on client server exception when trying query result. both servers has php5.6 version. sphinx config: source investmo_index { type = mysql sql_host = localhost sql_user = user sql_pass = password sql_db = database sql_port = 9306 sql_query_pre = set names utf8 sql_query_pre = set character set utf8 sql_query = \ select \ id, \ title, \ slug, \ header, \ content ,\ created_at \ page \ is_active='1'; sql_field_string = title sql_field_string = slug sql_field_string = header sql_field_string = content sql_attr_timestamp = created_at sql_ranged_throttle = 0 } index investmo_index { source = investmo_index path = /var/www/sphinx/investmo_index docinfo = extern mlock = 0 morphology = stem_enru min_word_len = 1

Trouble reading created sockets (php) -

i pretty new how sockets work. in learning process there things i'm not able understand no matter how search. i made simple script today: <?php $ip = gethostbyname(gethostname()); //get ip of machine $address = $ip; $port = 34242; echo "starting data processing server...\n"; $socket = socket_create(af_unix, sock_stream, 0); if($socket === false){ echo "socket failed connect.\n"; exit(1); } socket_set_nonblock($socket); $stopped = false; $lastread = microtime(true); while($data = socket_read($socket, 4) && !$stopped){ $lastread = microtime(true); } echo("closing data processing server, bye!\n"); ?> now when run in console (local host) error: warning: socket_read(): unable read socket [57]: socket not connected in /users/***/desktop/sockt.php on line 22 what doing wrong? intensions create socket data can funneled through give clients. you need socket_connect , create not enough (that's setti

sql - what is the best and fastest way to get the row number -

Image
suppose have data in below format in table, have fetch decile, best , fastest query in sql server correct decile. suppose have 2 parameters in scalar function, performancevalue measureid suppose pass 11.22 in performance value parameter , 3 in measureid, scalar function should return 3 suppose pass 85.54 in performance value parameter , 4 in measureid returns 10 suppose pass 54.00 in performance value parameter , 4 in measureid return 7.2 the table need contains measureid , number range (e.g from_value , till_value ) , decile . use simple where clause: select decile mytable measureid = 4 , 54.00 between from_value , till_value;

ios - Prevent multiple devices from using the same Firebase account through Swift -

i'm building ios app using swift , firebase authentication needs avoid multiple connections of same account different devices. i've read other posts on here haven't found definitive answer why isn't working. first tried checking see if current user nil below code (which shows nil due async calling). if auth.auth().currentuser == nil { // ... } i tried using addstatedidchangelistener() callback function in viewdidload() , while fire when sign in occurs, still doesn't return connected sessions or show current user signed in when login same credentials on different device. auth.auth().addstatedidchangelistener { (auth, user) in // ... } is there better way check if account i'm trying sign firebase signed in (or not signed out of previous session)?

ruby - Codefights No implicit conversion of String into Integer -

here code: def alllongeststrings(inputarray) array = array.new inputarray.each |i| if inputarray[i].length == inputarray.max.length array << inputarray[i] end end return array end inputarray = ["aba", "aa", "ad", "vcd", "aba"] it says "no implicit conversion of string integer" , can't figure out. doing wrong? error here: if i.length == inputarray.max.length # instead of inputarray[i] array << end but suggest use select: input_array = ["aba", "aa", "ad", "vcd", "aba"] max_length = input_array.max.length input_array.select { |el| el.length == max_length } #=> ["aba", "vcd", "aba"]

mongodb - Querying RESTHeart for over 100X100 parameters values -

i trying query mongodb via rest heart. trying filter parametrs each parameter having 100s of values. example param={1,2,4,.....100}&param2={1,2,3...100}. if put on rest api call using method there chances run url limit. does, restheart handle such scenarios?

css - how to create bullet dotted slider -

ho create slider bullet indicator? i have something menu slider .menu { position: absolute; bottom: 0; width: 100%; height: 10vh; text-transform: uppercase; ul { margin: 0 auto; color: red; height: 100%; width: 80%; display: flex; justify-content: space-around; align-items: center; li { height: 100%; display: flex; align-items: center; } } } ho make bullet dotted slider in mobile version instead of menu? here: https://tympanus.net/development/dotnavigationstyles/

java - O-notation with for-loop with modulo condition -

my question how calculate o-notation operation, 2 outer loops go o(n^3) times. question o-notation going when modulo used in condtion , inner for-loop runs when factor in j. for(int = 1 ; <= n ; i++) { for(int j =1; j <= ∗ ; j++) { if(j % == 0 ) { for(int k = 0 ; k < j ; k++ ){ sum++; } } } } it o(n^4) . the trick 1 if (j % == 0) . since i pretty n , j going range n^2 know statement true n + (n-1) + ... + 1 times going simplify (n+1)(n+2)/2 or o(n^2) in turn run loop runs n^2 times. need treat addition, have n^3 + n^2 * n^2 , simplifies o(n^4) . if there fault in reasoning please point out, little rusty.

r - merge two daily time series after summarising on shifted hours -

i have measurement (for instance solar radiation) indexed datetime variable, @ hourly timestamp. want sum measurement value each day of year, , match source of data @ daily scale (let's mean outdoor temperature). although, second source of data agregated 8:00am 8:00am next day . know how summarise first variable standard day, need 8 8 in order match both measurements. an example of data set.seed(1l) # create reproducible data hourly = data.frame(datetime = seq(from = lubridate::ymd_hm("2017-01-01 01:00"), length.out = 168, = "hour"), value = rpois(168, 10)) daily = data.frame(datetime = seq(from=as.date("2017-01-01"), length.out = 31, by="day"), value=rnorm(31)) expanding my comment answer, it's worth note op has emphasized words aggregated 8:00am 8:00am next day . mapping not aligned 24 hour periods dates if 24 hour period not aligned midn

nginx not executing basic html file -

i learning use nginx , following tutorial http://nginx.org/en/docs/beginners_guide.html . did installed nginx (at least thats when go localhost/index.html ). doesnt show content of index.html file, when lookup errors in log file not logging error. don't know doing wrong here config file user nik; worker_processes 1; error_log logs/error.log; error_log logs/error.log notice; error_log logs/error.log info; pid /usr/local/nginx/logs/nginx.pid; events { worker_connections 1024; } http { access_log /usr/local/nginx/logs/access.log; error_log /usr/local/nginx/logs/error.log; server{ location / { listen 80; root /data/www; server_name localhost; index index.html; access_log on; } } } p.s. index.html file present inside /data/

Generically associate pages in Confluence -

good day, know stack more programming, that, there's no other q/a board (that find) on network ask question too. please bear me here. much in jira 1 can specify "relates to" association ticket anywhere in database, wondering if confluence (or plugin) can pages? as of right i'm not worried cross-space functionality, interspace fine. what i'm trying accomplish here making bit of dynamic documentation based on associations. example, creating page particular website's profile, , in right sidebar flat list of associated pages regarding technology runs site, , list of associated pages in same right sidebar lists microservices uses. , when click on profile 1 of microservices on page, go microservices profile page in right column lists websites it's associated with. but (ideally) had on either page set "relates to" association between them, , "list" widget "associated pages : filtered label" disclosure: way have set

Swift 3 delete nodes from singly linked list -

i trying remove elements linked list of integers have value val. necessary set removed nodes nil free memory? func removeelements(_ head: node?, _ val: int) -> node? { var first = head var current = head var prev: node? while current != nil { if current?.val != val { prev = current } else if current?.val == first?.val { var oldfirst = first first = current?.next oldfirst = nil // line necessary? } else { prev?.next = current?.next // need set current nil? } current = current?.next } return first } oldfirst = nil sets variable in current scope nil. again, current variable in local scope, gets dereferenced , cleaned once leave scope. if have no strong references object anymore released because swift uses automatic reference counting (arc: https://en.wikipedia.org/wiki/automatic_reference_counting ) i not sure why have 2nd case in code. guess

android - iOS extend controller and miniplayer won't handle event using chromecast receiver based on shaka player -

i'm using https://github.com/google/shaka-player/tree/master/demo/cast_receiver with ios client , android client. ios it's base on: https://github.com/googlecast/castvideos-ios with android there no problem doing seek, pause, play on miniplayer or extended controller provided google, when cast video on shaka player receiver. in ios receive messages: -[gckmediacontrolchannel mediasessionid] calling method requires media status no media status, ignoring; make sure media loaded, media channel has received status, , method not being called while device manager attempting reconnect and other logs: -[gckuimediacontroller updatetransportcontrols] updatetransportcontrols; mediaclient , mediastatus , _currentrequest -[gckuimediacontroller request:didfailwitherror:] request 15 failed error error domain=com.google.gckerror code=32 "no media session available" userinfo={nslocalizeddescription=no media session available}

git - Build doesn't trigger on merged pull request -

there drone ci connected our git repository (based on gitea). while drone triggers build , deployment on each direct commit master , isn't case merged pull requests issued via web interface. interestingly, these prs tested (not deployed) drone while not merged yet. if 1 presses merge pr button, there's no specific build & deploy process triggered. result: merged pr won't deployed if there's no direct commit master afterwards. this last pr still not deployed. this commit merged pr master. , this latest drone build testing pr before has been accepted. i tried include pull requests list of triggers ( full .drone.yml file ): deploy: when: event: [push, pull_request, tag, deployment] branch: master what wrong?

authentication - VS2017 Azure Function Project - Azure AD B2C Tenant - Configure EasyAuth locally -

i have azure ad b2c tenant, 2 applications created , configured work front-end , back-end. front-end application single-page node.js app corresponding msal.js library configured login azure ad b2c tenant, tokens generated validated back-end. back-end application azure function app running in cloud (httptrigger functions), works azure ad b2c tenant authorization/authentication through easyauth. functions in azure function app required authorization header. currently, front-end can b2c login, acquire silently token, call azure function in cloud, passing in token obtained, function validating token , function runs smooth. so now, want create azure function project in vs 2017 , make sure can develop/test locally deploy later azure functions cloud. created azure function project in vs2017 targeting .net framework 4.6.1 , created 1 azure function. added application in azure ad b2c tenant , configure it. have in project 3 files, function1.cs, host.json , local.settings.json. how can

elasticsearch - Kibana public IP site cannot be reached -

cannot kibana's public ip work google compute engine. says site cannot reached, though elasticsearch works through public ip if change elasticsearch.yml localhost 0.0.0.0 turned off nginx test kibana. running on: ubuntu 16.04, elasticsearch 5.6.0, kibana 5.6.0 firewall allowed port 5601 kibana firewall screenshot the kibana.yml file has following: server.port: 5601 server.host: "0.0.0.0" elasticsearch.url: "http://localhost:9200" elasticsearch.ssl.verificationmode: none running netstat -natp | grep 5601 , get: (not processes identified, non-owned process info not shown, have root see all.) tcp 0 0 0.0.0.0:5601 0.0.0.0:* listen - and running sudo netstat -tupln returns: active internet connections (only servers) proto recv-q send-q local address foreign address state pid/program name tcp 0 0 0.0.0.0:22 0.0.0.0:* listen 19

Where can I download the bootstrap.js of bootswatch? -

i can't find bootstrap.js , jquery of https://bootswatch.com/ theme using. if press download, shows css , no js javascript written , part of bootstrap, need import it. line should trick you, assuming have file in bootstrap folder. <script type="text/javascript" src="bootstrap/bootstrap.js" charset="utf-8"></script> to download jquery , include in page this: <script type="text/javascript" src="jquery/jquery.js" charset="utf-8"></script> you can download jquery here.

Conditionally Exclude Child Property in Entity Framework Query -

given following object graph public class bar { public guid id {get;set;} public string somebar {get;set;} } public class foo { public guid id {get;set;} public string foostring {get; set;} public ilist<bar> bars {get;set;} } how conditionally exclude bars property entity framework doesn't load entire object graph? // thoughts public task<foo> getfoobyidasync(guid id, bool includebars) { var query = _db.foos.where(f => f.id == id); if(!includebars) { return query.select(f=> new foo{ id = f.id, foostring = f.foostring }).tolistasync(); } else { return query.tolistasync(); } } just conditionally add include(f => f.bars) query expression. this: using system; using system.collections.generic; using system.componentmodel.dataannotations.schema; using system.data.common; using system.data.entity; using system.data.entity.modelconfiguration; using system.da

java - JavaMail with IMAP getting “A1 NO LOGIN failed” exception -

this question related following question: using javamail connect imap getting "a1 no login failed" exception i stumbled upon above thread since same problem using javamail 1.6.0. trying connect exchange mailbox imap. thunderbird connects , suppose cause other issue related javamail. @bill shannon: have done things have highlighted above, except fact using starttls since ssl support disabled in exchange server (thunderbird uses starttls , connects correctly). any on matter appreciated. info | jvm 1 | 2017/09/07 20:59:02 | debug: setdebug: javamail version 1.6.0 info | jvm 1 | 2017/09/07 20:59:02 | debug: getprovider() returning javax.mail.provider[store,imap,com.sun.mail.imap.imapstore,oracle] info | jvm 1 | 2017/09/07 20:59:02 | debug imap: mail.imap.fetchsize: 16384 info | jvm 1 | 2017/09/07 20:59:02 | debug imap: mail.imap.ignorebodystructuresize: false info | jvm 1 | 2017/09/07 20:59:02 | debug imap: mail.imap.statuscachetimeout: 1000

html - h2 elements all bunched up on top image on iOS & Firefox -

on site codexr.io noticing while h2 elements work on size browser chrome, seeing ios safari , firefox, of h2s on top of 1 in 1 of main images. here's html: <div class="content"> <p><a href="http://codexr.io/collaborative"><img alt="" height="450" src="/sites/default/files/workplace-1245776.jpg" width="800"></a></p> <h2 class="top-area-text">collaborative</h2> </div> and css: #top-area .top-area-text, #top-area .region-top-fifth h2, #top-area .region-top-fifth h2 { left: 0; text-align: center; top: 4em; width: 100%; color: white; font-size: 3em; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; text-transform: uppercase; } #top-area .top-area-text { position: absolute; } is there i'm missing? why chrome working firefox , ios not? malf

ios - Firebase, Swift: Create a time checker in the background similar to the Snapchat streak system that performs an action when the time runs out -

i'm creating app (in xcode using swift) has streak system similar snapchat's. user completes daily task , can repeat daily task in 24 hours. there way create sort of countdown in firebase (the database i'm using) or in xcode can create 24h countdown in background , update ui when time next daily task. i'm new xcode , firebase , have searched on answer have never found one. ideas? red button clicked , turns green -> creates 24h countdown user can see timer update on hourly basis -> countdown reaches 0 , green button turns red user click again thanks again! no need make use of timer or when user press button reactivated after 24 hours . save timestamp in reference node , overtime when user open app compare time stamp stored in reference , make green red if time exceeds more 24 hours . hope give brief idea how do. need save timestamp when user click , compare saved time +24 hours timestamp , result achieved. hope helps

Unit testing redux-saga task cancellation -

i wondering if had tips on how unit-test following redux-saga login/logout flow: let pollingtask = null function * handlelogin () { try { const token = yield call(loginhandler) pollingtask = yield fork(handlepolls, token) yield put('login_succses') } catch (e) { yield put('login_failure') } } function * handlepolls (token) { while (true) { try { yield call(pollhandler, token) yield put('poll_success') } catch (e) { yield put('poll_failure') } { if (yield cancelled()) { yield call(pollcancelled) } } } } function * handlelogout () { try { yield call(logouthandler) yield cancel(pollingtask) yield put('logout_success') } catch (e) { yield put('logout_failure') } } since need cancel pollingtask on logout, tried using createmocktask() in tests value undefined when invoke handlelogout() saga, although know handlelogin() started

osx - Shell Script Find and Copy from txt file -

i'm wanting read line line text file recursively find files in target folder. if found copy file directory. script below executes doesn't perform find or copy when running sh script.sh terminal. no errors displayed, echo $line variable string correctly each loop iteration. running same find terminal using actual filename instead of $list variable complete task successfully. script: script.sh #!/bin/bash file="filenames.txt" while ifs= read line find /volumes/share/all-files-location -name "$line" -print -exec cp {} /volumes/share/found-files-location \; done < "$file" list of file names, plain text: a1037_mg_1262.jpg a1037_mg_12621.jpg a1037_mg_1263.jpg [11,000 more entries] thoughts? since input file in crlf, , unix uses lf line ending, bash script sorting lines occurrence of lf character, , consequently each of filenames had \r appended end of it. since disk didn't contain filenames containing \r , find tool di

excel - Deleting duplicates of multiple Columns -

i trying delete multiple columns (5) in excel vba. below code works 4 columns though anymore , seems not work. dim wb1 excel.workbook set wb1 = workbooks.open("c:\poke.xlsm") wb1.sheets("sheet1").columns(2).resize(, 4).removeduplicates columns:=array(2, 3, 4), header:=xlno wb1.savecopyas "c:\poke\zz" + wb1.name wb1.close end sub any ideas? have tried adjusting columns , resize values though seems leaving , adjusting column array 4 works. though data 5 columns. thanks you should in habit of explaining own code can benefit it. helps others read it. broken down code is: wb1.sheets("sheet1").columns(8).resize(, 4).removeduplicates columns:=array(1, 2, 3, 4), header:=xlno ''columns = starting column , columns array specifies columns array want , resize specifies how many blanks once know that, try out , see if works. news code works fine. need interpret correctly. happy vba-ing.

datetime - MATLAB: Read Excel file and find zeroes for a specific time range -

i need read excel file table this: name | time | score ------ | ------ | ------ bill | 11:15 | 2.4 bill | 13:00 | 0 bill | 20:00 | 0 steve | 6:00 | 4.7 steve | 13:45 | 0 steve | 17:45 | 3 jack | 9:00 | 0 jack | 13:30 | 7.2 jack | 19:30 | 0 and return names of people score 0 between 13:00 , 14:00. correct answer in example be: name | ------ | bill | steve | this current code: x = xlsread(filename); [row,col] = size(x); = 1:row j = 1:col if x{i,2} == '13:00' && x{i,3} == 0 y = x{i,1}; end end end i'm not sure how solve multiple 'hh:mm' values on requested time range. appreciated. first, need use additional outputs xlsread text , numeric data: [score, textdata] = xlsread('temp.xlsx'); next, you'll want convert second column of text (your time data) format easier comparisons on, serial date number : timedata = datenum(textdata(2:end, 2)); now c

ajax error response in xamarin.ios -

i make app ios using xamarin.ios , use webview in .chtml file call webservice using ajax following code <script> $(document).ready(function () { $.ajax({ type: "get", url: 'http://www.chc-sa.com/webservice/aboutus', error: function (xhr, status, error) { //do error document.getelementbyid("net").textcontent = "network error"; }, success: function (response, $id) { //do response document.getelementbyid("details").innerhtml = response.details.replace(/(?:\r\n|\r|\n)/g, '<br />'); } }); //----------------------------------- }); </script> code fire error not excute success , code work fine in xamarin.android or windowsphone in xamarin .ios when run in simulator mac show error is there configuration in xamarin.ios execute ajax code co

jquery - JavaScript Draggable Library for Inline Elements -

all of established javascript libraries controlling dragging , dropping , elements (e.g. jquery ui draggable) focus on dragging non-online elements (by setting top/left position style attributes. this fine in circumstances, creating wysiwyg editor users can insert images paragraphs inline elements. able make dragging of these elements work better - lot of features of ondrag , related events don't work cross-platform. is there library out there allows have nice dragging of inline elements (like images) inside paragraphs inside of contenteditable container?

python - SQLAlchemy - count status is true -

i have 2 tables in db. 1 named company, other named company_map. company table like: c_id name contact 1 12334 2 b 12335 3 c 12336 4 d 12337 5 e 12338 company_map table like: m_id c_id status 1 1 true 2 1 false 3 1 true 4 3 true 5 3 true i need count number status true in company_map table, group c_id. example, need number of c_id 1 , status true, should 2. can number of c_id now, use func.count(company_map.c_id), 3. how count status == true()? try method, none work. i got idea sqlalchemy func.count on boolean column .having(func.count(case([(company_map.status, 1)])) < func.count(company_map.c_id)) if sqlalchemy latest version, can use .having(func.count(1).filter(company_map.status)) which cleaner old.

go - Understanding golang date formatting for time package -

so have function performing well. func today()(result string){ current_time := time.now().local() result = current_time.format("01/02/2006") return } prints mm/dd/yyyy , thought more readable if had value greater 12 in days position make clear mm/dd/yyyy changed following func today()(result string){ current_time := time.now().local() result = current_time.format("01/23/2004") return } which chagrin caused bad results. prints mm/ddhh/dd0mm realizing mistake see format defined reference time ... mon jan 2 15:04:05 -0700 mst 2006 i'm wondering if there other instances moment being used formatting reference date times, , if reference moment has nickname (like null island )? the values in date string not arbitrary. can't change 02 03 , expect work. date formatter looks specific values, , knows 1 means month, 2 means day of month, etc. changing 01/02/2006 01/23/2004 changing human-readable form says f

java - TextIO.Read GCS folders into pipeline with past 30 days date as name -

i want read rolling window of past 30 days pipeline e.g. on jan 15 2017, want read: > gs://bucket/20170115/* > gs://bucket/20170114/* >. >. >. > gs://bucket/20161216/* this says ("*", "?", "[..]") glob patterns supported similar question, no example i trying avoid doing 30 text.io.read steps flattening pcollections one, causes hot shards in pipeline. when reading files gcs, textio supports same wildcard patterns gcs, described here: wildcard names . in answer question linked , bullet #2 suggests forming small number of globs represent full range: for example 2 character range "23 through 67" 2[3-] plus [3-5][0-9] plus 6[0-7] textio has new api readall() allows specify input files dynamically data. allows pass in exact set of filenames need: private static list<string> generate30dayfileglobs(datetime now) { // .. } public static void main() { pipeline p = // .. p.apply(c

android - Espresso Testing Multiple Activity -

i have apps, consist of 3 activites. first activity when can see list of data, second activity can see detail of data, , third can edit data. time wanna make instrument test using esspresso. case : show list, click 1 data detail data show on next activity choose edit button (edit button appear if check shared preferance login state) i build apps using mvp , dagger. provide data test using dagger , mocking presenter. when move activity, cannot access shared preferance. looks injection work first activity. here code: @before public void setup() throws exception { app = (mainapplication) instrumentationregistry.getinstrumentation() .gettargetcontext().getapplicationcontext(); mainapplication.setappcomponent(daggertestappcomponent.builder() .testappmodule(new testappmodule(app)).build()); ((testappcomponent) app.getappcomponent()).inject(this); } @test public void editdata() { //it click , move activity onview(withid(

scala - getter for type parameter with more than one type for case object -

i want have method below code return case object sealed trait myconstants[t] extends mytrait[t] case object extends myconstants[string] {val value = "abc"} case object b extends myconstants[int] {val value = 10} val list = seq(a, b) i have tried def getvalue[t](value: t): option[myconstants[t]] = list.find(_.value == value) not work. first compiler has know extends myconstants has value member. sealed trait myconstants[t] {val value:t} now can find() or filter() values match parameter. def getvalue[a](value: a) = list.find(_.value == value) note: you're mixing types in list making getvalue() return type equally complex.

node.js - High memory/performance critical computing - Architectural approach opinions -

i need architectural opinion , approaches following problem: intro: we have table of ~4m rows called purchases . we have table of ~5k rows called categories . in addition, have table of ~4k subcategories . using t-sql store data. at users request ( during runtime ), server receives request of 10-15 n possibilities of parameters. based on parameters, take purchases, sort them categories , subcategories , computing. some of process of "computing" includes filtering, sorting, rearranging fields of purchases, subtracting purchases each other, adding other purchases each other, find savings, etc... this process user specific, therefore every user different data back, based on roles. problem: this process takes 3-5 minutes , wanting cut down. previously, process done in-memory, on browser via webworkers (js). have moved away memory started large , of browsers start fail on load. moved service server (nodejs), processed request on

excel - Data import from new reports and automatically update existing records in existing data -

Image
i seek expert advice of of in accomplishing work related task. task : task perform analysis on reports obtained worksafe monthly , weekly , getting valuable information out. for example : number of injuries on monthly basis drilled down department , divisions. total days lost in year count of type of claims possible return date. so receive these reports , add modified columns it. correct employee names , id's create relationship between employee database in powerpivot position, dept , division. now every month in new report there 2 or 3 new claims added it, , existing claims updates info. updated return work date, short term disability days etc. currently go through them manually , it's time consuming , tiring. if there there older claims weren't getting updates could've imported folder using power query , added steps remove duplicates. however, if remove duplicate claims using powerquery now, i'll removing same claims updated info. cou

python - Sort QTableView QDateTime Column instead of string sort -

in qtableview there 4 column. 0th col date in dd-mm-yyyy format. , other 3 column contains string them sorting not problem (can done using qsortfilterproxymodel class) col 0 want sorting right left ( both ascending , descending order). here simple example of customsortingmodel self.tableview = qtgui.tableview(self) self.table_model = qtgui.qstandarditemmodel(0, 0) self.proxymodel = customsortingmodel(self) self.proxymodel.setsourcemodel(self.table_model) self.tableview.setmodel(self.proxymodel) class customsortingmodel(qtgui.qsortfilterproxymodel): def lessthan(self,left,right): col = left.column() dataleft = left.data() dataright = right.data() if col == 2: dataleft = float(dataleft) dataright = float(dataright) elif col == 3: dataleft = qtcore.qdatetime.fromstring(dataleft, "d/m/yy").addyears(100) dataright = qtcore.qdatetime.fromstring(dataright, "d/m/yy&q

bash - Scrolling through array positively and negatively -

i'm creating script the user presented 10 files , give user option scroll next page using 1 , 2 on keyboard input. have written following script can't achieve seem happen. in regards appreciated! example: 1) previous page 2) next page 3) contact details 4) main menu those options user use or enter when prompted. have written sample script doesn't give me result because of logical error , index counter go negative (i'm assuming passes through first if ) declare -a manual=("$pg1" "$pg2" "$pg3" "$pg4" "$pg5" "$pg6" "$pg7" "$pg8" "$pg9" "$pg10") x=0 while [ $x -lt "10" ] read if [ -eq 1 ]; echo ${manual[$x-1]} x=$(($x-1)) elif [ -eq 2 ]; echo ${manual[$x+1]} x=$(($x+1)) elif [ -eq 3 ]; echo ${manual[10]} else [ -eq 4 ]; bash mainmenu.sh fi done i'm new scripting , answers helpful! you need rep

jasper reports - JasperReport Server - Interactively Filtering with own Java Data-Type doesn't work -

i have created own java class (type) have life little easier when displaying money (euro)-values in jasper reports. public class euro extends number implements comparable<euro> { @override public string tostring() {...} @override public boolean equals(object obj) {...} @override public int hashcode() {...} } the data displayed in table , works fine. sorting whole column works great. but, if want filter column "is greater than" - no data displayed after filtering. when changed type of data bigdecimal sorting works. what i'm doing wrong? or can tell me exaclty jasper when tries filter data?

node.js - Sequelize query to group and limit base on a forign key -

i'm using sequelize postgresql database. messages data structure looks this: id message status sernderid receiverid reservationid createdat i'm trying group messages related reservation , return latest message index them. current query looks this: message.findall({ where:{$or:[{senderid:user.id}, {receiverid:user.id}]}, group: 'reservationid', order: [['createdat', 'desc' ]], limit: 1 }) the query changes case on reservation id , gives me following error: message:"column "reservationid" not exist" name:"sequelizedatabaseerror" first, how prevent query change case , second, there better way write query?

reactjs - Image tag is not rendering with 'react-native-web' -

i new react. have use case have cache image @ third party server.(want avoid many server calls render image every second) this, using react-native-web my application react web application. code snippet is: import { image } 'react-native-web'; class imagecomponent extends component { componentwillmount() { const interval = setinterval(() => { this.timer(); }, 2000); this.setstate({ interval }); const urlofimages = ['https://homepages.cae.wisc.edu/~ece533/images/mountain.png']; const prefetchtasks = []; urlofimages.foreach((url) => { prefetchtasks.push(image.prefetch(url)); }); } render() { const images = ['https://homepages.cae.wisc.edu/~ece533/images/mountain.png']; const text = 'something'; return ( <div> <span>{ text }</span> <image source={{ uri: images[0] }} alt="banner" title="banner" border="0&q

php - Opening Google Maps with 'a href' Location -

in olx.in, can browse ads , click on ad location. if clicks 1 ad location, google maps opened in small screen on current tab, in smartphones, google maps app opened. logic behind this? how show location in google maps while clicking on location name given in 'a href' using php , html? in olx.in, users have select location ads. location seeing in google maps. therefore can't write location code directly inside 'a href'. how open google maps window in current tab olx.in? url: https://www.google.fr/maps/place/your+adresse +here example : <a href="https://www.google.fr/maps/place/7+impasse+de+l'Épi,+84000+avignon" > adresse .....</a>

can't see the HTML of a popup window how to interact with it from selenium -

Image
i trying select status form new windows popup. after clicking select status button opens dialog page can't see html of page. not sure how interact dialog page selenium. nb: have switched new window can't proceed there. html looks this.. after clicking select status button following dialog page opens. but can see html of dialog page how interact form selenium? update -14/09/17 when click on select status call below url. opened url in separate tab , able see html. http://xxx.xxx.xxx.int/tasks/status.aspx?currfilters=open tried select values new windows below... public void selectstatus() { _selectstatus.click(); browser.switch_to_child_page(); _container.findelement(by.cssselector("input[onclick^='selectall']")).click(); } getting following error. test 'x.regressionsuite.testcases.xtest.tc_x' failed: openqa.selenium.staleelementreferenceexception : element no longer valid

dump - File conversion using Salome python plugin -

i have .dat file contains elements , co-ordinates data, these data should convert format (.txt) file. perform operation have wriiten c-code. my question is; whether python plugin call c-code , perform operation in salome. please let me know , give valuable suggestion. thank you

nginx serving django static and media files 403 forbidden -

first try find solution other questions, can't working me, create new one. the detail below: 1 try change user in nginx.conf #user www-data; user me; worker_processes 4; pid /run/nginx.pid; .... 2 add , link conf on sites-available , sites-enabled server { add_header access-control-allow-origin *.mysite.com; add_header access-control-allow-headers x-requested-with; add_header access-control-allow-methods get,post,options; listen 80; server_name mysite.com; access_log /var/log/nginx/hitek.access.log; error_log /var/log/nginx/hitek.error.log; location / { proxy_pass http://127.0.0.1:8010; proxy_set_header host $host; proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; } location ~ ^/media/ { #alias /var/www/html/mysite/media; alias /home/me/website/mysite/media; #alias /home/www-data/website/website/mysite/media; e

android - My RecyclerView activity displays blank activity -

i have developed application displays list made using recyclerview , card view viewing tutorials(simplified coding).the cardview has 2 text views , 1 image view.i want data mysql databse , image url loaded image view using picasso. application running not displaying , comes error response. my app gradle file is apply plugin: 'com.android.application' android { compilesdkversion 24 buildtoolsversion "26.0.0" defaultconfig { applicationid "com.example.selvam.listapp" minsdkversion 14 targetsdkversion 24 versioncode 1 versionname "1.0" testinstrumentationrunner "android.support.test.runner.androidjunitrunner" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'libs', include: