Posts

Showing posts from September, 2011

javascript - How to append an element loaded via ajax to another previously loaded via ajax? -

how can add html element received via ajax html element added via ajax? tried use .append not working: example: $.ajax({ (...), success: function() { $('.padding').append('<div id="request">foo</div>') } }); this above working well, because .padding loaded on page. when try $.ajax({ (...), success: function(data) { $('#request').append('<div class="description">bar</div>') } }); not working. why , how can right way? below, .padding content: <div class="padding"> <!-- below, html result first ajax --> <div class="ui attached segments" id="request"> <div class="ui right center aligned segment" id="header"> <h4 class="ui gray header"> p2017003</h4> </div> <div class="ui stackable 3 item menu segment"> <div style=

Firebase forgot password domain -

i have firebase app offering "forgot password" capability. is there way make link own hosting domain instead of appname-id.firebaseapp.com? i tried adding hosting, , email templates, can't find way reset password link it seems can change action url, to: https://my-hosting-domain/__/auth/action so guess solved

Get checked state of a switchery checkbox in jquery -

i have following code: <div class="form-group col-xs-1"> <label for="closed" class="control-label">hide closed</label> <input name="closed" type="checkbox" id="closed" class="form-group js-switch" checked /> </div> $('#closed').on('change', function() { if ($('#closed').is(':checked')) { closed = 1; } else { closed = 0; } console.log(closed); }); but when change status of checkbox, see false. stupid mistake part, cannot use closed variable. if use different name working. sorry trouble...

jquery - How do I add blank lines into a Bootstrap Tooltip -

i working on website has different features person can order. put bootstrap glyphicon next features , when user rolls on glyphicon tooltip show included in features. having trouble introducing blank lines tooltip. i've tried \n , &#013 (with pre-wrap command in css) here portion of code cooresponding tooltip. <br/>2 printed sheets <a href="#" data-toggle = "tooltip" title = "one printed sheet can include &#013;1 8 x 10 &#013;2 5 x 7 &#013;2 4 x 6 &#013;4 3.5 x 5 &#013;9 wallet photos"> <span style = "color:white" class="glyphicon glyphicon-question-sign white"></span> </a> i'm using following jquery command: <script> $(document).ready(function(){ $('[data-toggle="tooltip"]').tooltip(); }); </script> how can put blank lines &#013 is. worth noting before added in jquery section blank lines did work properly,

How do I merge array of Objects but unshift array in JavaScript -

i merge these 2 array of objects urls use unshift merge arrays instead of replacing. here's example var arr1 = [{ "keyword": "name", "score": 0.8992112752974006, "urls": ["url1"], "ids": ["5748bf9ab58adb2f614da195"] }, { "keyword": "name1", "score": 0.39953909596222775, "urls": ["url2"], "ids": ["5743260055f979a31fa98971"] }, { "keyword": "name3", "score": 0.4960953181766197, "urls": ["url4"], "ids": ["58c04cd5208b4945c3920cad"] }, { "keyword": "name4", "score": 0.3337163443410707, "urls": ["url5"], "ids": ["573628c38e32eeb039377f7e"] }]; var arr2 = [{ "keyword": "name", "score": 0.8992112752974006, "urls": ["url6&q

excel - Trying to border the last row in VBA -

i trying select last row of table , use outside border around whole row until last column. here code cells(application.rows.count, .columns.count).end(xlup).borderaround weight:=xlmedium before had cells(application.rows.count, 1).end(xlup).borderaround weight:=xlmedium my second line of code bordered first cell. need outside border cells in row. have tried different things turning "range" error. these closest attempts. not error not need do. thanks, g the problem in both of code attempts, selecting 1 cell. because using cells method, selecting single cell. need use cells in conjunction range object multicellular region. assuming data starts in cell a1 on sheet1, here working code: sub drawborder() dim rngbottomrowstart range dim rngbottomrowend range dim rngdataupperleftcell range set rngdataupperleftcell = sheet1.range("a1") rngdataupperleftcell set rngbottomrowstart = sheet1.cells(.e

c# - Controller not taking changes -

i have been trying figure out issue. know not error maybe tell me reason might occur. have made changes in controller whenever execute program changes aren't taking effect. have erased what's in bin & obj, additionally have erased generated files microsoft.net , still didn't see changes. if make changes view, i'm able see changes. have checked applicationhost.config file. please can me, have been trying figure out past days. did happen import application different directory or moved it? open controller file , click menu bar: file >> save >> double check directory file being saved to. same application folder current bin?

visual studio - Saving a Set value and using it in get in c# -

i trying simple operation of setting text value , accessing using get(). scenario: working on framework in visual studio. private string savevaluename = ""; public string gettext() { return savevaluename; } public void settext(string output) { dynamicvaluesmanager.instance.savevalue(savevaluename, output, true); } my problem: 1. need save value having in settext , use in next step when call gettext(). would suggest using getter/setter in scenario? private string savevaluename = string.empty; //better practice public string gettext() { return savevaluename; } public void settext(string output) { //save incoming parameter private property: savevaluename = output //this should called input since passing in parameter no biggie //not sure function does? dynamicvaluesmanager.instance.savevalue(savevaluename, output, true); } //sample code retrieve value passed in: tempvariable = yourclassname.

dependency injection - How to create a reusable provider in Angular 4 -

i'm trying replace provider code object can imported components. @component({ selector: 'my-selector', templateurl: './my-selector.component.html', styleurls: ['./my-selector.component.scss'], providers: [ { provide: ng_value_accessor, useexisting: forwardref(() => someselectorcomponent), multi: true } ] }) so, section: { provide: ng_value_accessor, useexisting: forwardref(() => someselectorcomponent), multi: true } would moved kind of class or , imported component like: import { mycustomprovider } './core' is possible in angular2/4?

css - Making HTML Widget resize Dynamically -

i attempting make html widget responsive , resize when browser resized. here html: <nav class="navigation"> <ul class="menu"> <li class="menu__item"> <a href="" class="menu__link" target="_blank"> <span class="menu__title"> <span class="menu__first-word" data-hover="executive"> executive </span> <span class="menu__second-word" data-hover="summary"> summary </span> </span> </a> </li> <li class="menu__item"> <a " class="menu__link" target="_blank"> <span class="menu__title"> <span c

Duplicate Int in Array , Dictionary or Set in SWIFT -

reading on sets , arrays find set cannot, or not able store duplicate values ( ints, strings, etc ). knowing this, if solve finding duplicate int in array , 1 method convert array set, how come don't error once array set? the methods below return bool value if array contains duplicates. import uikit func containsduplicatesdictionary(a: [int]) -> bool { var adict = [int : int]() value in { if let count = adict[value] { adict[value] = count + 1 return true } else { adict[value] = 1 } } return false } containsduplicatesdictionary(a: [1,2,2,4,5]) func containsduplicatesset(a: [int]) -> bool { return set(a).count != a.count } containsduplicatesset(a: [1,2,2,4]) the first function, containsduplicatesdictionary, convert array dictionary, of course takes loop well. set method can done in 1 line, nice. guess since new this, think converting array throw error since theres duplicate value

ios - Swift: making a UIPickerView go round as a loop -

"there's similar question answered, doesn't work on app" is there way can make uipickerview round loop? i've got 0 9 on each column don't want end @ 9. have uibutton thats have func makes numbers skip digit , starts 000 999, if make uipickerview loop don't want make changes or effects on mathematics order here's have far: class viewcontroller: uiviewcontroller, uipickerviewdatasource, uipickerviewdelegate { @iboutlet weak var label: uilabel! @iboutlet weak var pickerview: uipickerview! let numbers = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] func numberofcomponents(in pickerview: uipickerview) -> int { return 3 } func pickerview(_ pickerview: uipickerview, titleforrow row: int, forcomponent component: int) -> string? { return numbers[row] } func pickerview(_ pickerview: uipickerview, numberofrowsincomponent component

c# - Map path to App_Data with HttpContext.Current.Server.MapPath() -

i writing small wpf application use word templates , merge them data. issue trying avoid using absolute path app_data folder in visual studio c# project obvious reasons. i'm trying map path app_data folder can use template there. giving me following error: system.nullreferenceexception occurred: object reference not set instance of object. system.web.httpcontext.current.get returned null. here code: string path = httpcontext.current.server.mappath("/app_data"); path = path + "/acknowledgement_letter.dotx"; you should use ~ before path string path = httpcontext.current.server.mappath("~/app_data");

AngularJS ng-repeat unique is NOT working -

i'm trying print unique values of names i'm unable that. html code: <div ng-controller="myctrl"> <div><input type="text" ng-model="namefilter" placeholder="search..." /></div> <p ng-repeat="contact in contacts | orderby: 'customer.name'| unique:'customer.name'">{{ contact.customer.name }}</p> </div> js code: var myapp = angular.module('myapp',[]); function myctrl($scope) { $scope.namefilter = ''; $scope.contacts = [ { id:1, customer: { name: 'foo', id: 10 } }, { id:2, customer: { name: 'bar', id: 20 } }, { id:3, customer: { name: 'foo', id: 10 } }, { id:4, customer: { name: 'bar', id: 20 } }, { id:5, customer: { name: 'baz', id: 30 } }, { id:5, customer: { name: 'tar', id: 30 } }, { id:5, customer: { name: 'got', id

spatial - How to extract from a .nc file based on a shapefile in R? -

Image
i have .nc file has global data , want extract data within boundary of .shp file. have tried several methods, still have problems. the .nc file can downloaded @ https://www.dropbox.com/s/0ba6v4fnck8wjdm/spei03.nc?dl=0 , .shp file can downloaded @ https://www.dropbox.com/s/8wfgf8207dbh79r/gpr_000b11a_e.zip?dl=0 library(rgdal) library(ncdf4) library(raster) shpfile<-readogr("gpr_000b11a_e.shp", layer="gpr_000b11a_e") g <- sptransform(shpfile, crs("+proj=aea +lat_1=50 +lat_2=70 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0 +datum=nad83 +units=m +no_defs +ellps=grs80 +towgs84=0,0,0")) ncdata = raster(x="spei03.nc",varname="spei") proj4string(ncdata) = proj4string(g) mydata = rastertopoints(mask(x=ncdata,mask = g)) but cannot data. help. to extract values, use extract() function. but, need select time step want use: library(ncdf4) library(raster) shpfile<-shapefile("gpr_000b11a_e.shp") # load shapefile spe

What is better for static messages in Typescript? (performance and memory wise) -

what better static messages in typescript? (performance , memory wise) variables or methods? let's need hundreds of them. msg1 or msg2() import {messages} './messages'; export class messagesen implements messages { readonly msg1 = 'message one'; msg2(): string { return 'hello second!'; } } from point of encapsulation , fields (aka msg1 ) must not visible client, need let client work code methods manipulate data of objects , change objects state. from point of performance accessing field bit faster, because goes , tries find field , returns it. method same thing , goes , call it: 1 operation. in cases functions doesn't change it's context, inlined , allows them accessed faster. if change in function after code execution, compiler can't not optimize , work slower field access. from point of memory wise , method take more memory stack field you can see jsperf property access more faster method access.

memory leaks - geometry::UnionAggregate call causes SQL Server to crash -

Image
i found seems bug in microsoft sql server (v13.0.1601). perhaps mistaken haven't seen reported anywhere else online describe below. one section of our code uses spatial indexing. have table called 'spritepositions' contains polygons , 'sprite' table, each entry of links number of spritepositions. each sprite has polygon populated using geometry::unionaggregate call, combining each of polygons of appropriate spritepositions. rarely, sprite may contain large number of spritepositions , unionaggregate call takes little while complete. interestingly, time not linearly proportionate number of spriteposition polygons. some experiments indicate performing unionaggregate takes around 4 seconds 500 polygons, around 20 seconds 1000 polygons. 10000 polygons sql server this: looks memory leak in sqlserver. never returns - ram usage keeps growing forever , cpu usage sits @ 1 full core. no further sql calls return , solution kill sql server process. so question -

javascript - How can I limit the dates that can be selected in this Date Picker in Qualtrics? -

i need limit dates can selected 2017!? appreciated! <link href="https://ajax.googleapis.com/ajax/libs/yui/2.9.0/build/calendar /assets/skins/sam/calendar.css" rel="stylesheet" type="text/css"/><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/yui/2.9.0 /build/yahoo-dom-event/yahoo-dom-event.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/yui/2.9.0 /build/calendar/calendar-min.js"></script> <script>qualtrics.surveyengine.addonload(function(){var qid =this.questionid; var calid = qid +'_cal';var y =qbuilder('div'); $(y).setstyle({clear:'both'});var d =qbuilder('div',{classname:'yui-skin- sam'},[qbuilder('div',{id:calid}), y ]);var c =this.questioncontainer; c = $(c).down('.questiontext'); c.appendchild(d);var cal1 =new yahoo.

r - How to select specific pixels from raster (slope >=certain value) -

i hope didn´t overlook similar problem somewhere else on side, couldn´t answer on problem yet... i have dem resolution of 10x10m. need find pixels have slope >35° , find out exposition. (after (?) this, need link somehow grid program of 100x100m , further work on them). how can best? what did until now: dem=raster("dem_10m.tif") dem class : rasterlayer dimensions : 2731, 2407, 6573517 (nrow, ncol, ncell) resolution : 10, 10 (x, y) extent : 57495.5, 81565.5, 202547.5, 229857.5 (xmin, xmax, ymin, ymax) coord. ref. : +proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +datum=hermannskogel +units=m +no_defs +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 names : dem_10m values : -32768, 32767 (min, max) slope_aspect <- terrain(dem, opt=c("slope", "aspect"), unit="degrees") slope_aspect$elevation <- dem slope_aspect x y slope

apache poi - POI formula evaluation performance -

i using xls format of excel file consists of formula in it. evaluating formula using formulaevaluator.evaluateformulacellenum() method (i using poi 3.16) taking around 10sec evaluate formula in cell. tried hssfworkbook.evaluateallformulacells degrading performance. there way can improve time taken formula evaluation poi. help. using jdk6 , running on tomcat7. i use formulaevaluator class , works fast , fine, both hssf , xssf. example : formulaevaluator eval = workbook.getcreationhelper().createformulaevaluator(); cellvalue cellvalue = eval.evaluate(cell);

How to use jquery to change class in wordpress -

i'm trying have accordion slider (enfold theme) open specific slide (unfortunately enfold not provide that). i've tried can think of starting code: <script> $( window ).load(function(){ $('.aviaccordion-inner').find('.aviaccordian-slide- 3').addclass('aviaccordian-active-slide'); }); </script> then tried code: <script> jquery(document).ready(function( $ ) { $( window ).load(function(){ $('.aviaccordion-inner').find('.aviaccordian-slide- 3').addclass('aviaccordian-active-slide'); }); }); </script> i used "(window).load" etc. because had no luck either simple "(document).ready". made sure loading after slider , jquery load. tried putting in body before slider loads. have ideas on how can load particular slide on 'load'? the url website is: http://www.twinsupplies.net/2017/ this correct syntax target element class , add class in jquery. please give

exchangewebservices - The enduring saga of when to use EWS vs the Rest API in an Outlook Add-in -

this question based on previous question asked bit more detail , experience since. first background, have outlook addin should forward users message , move message specific folder. needs work in both owa, , outlook 2016 environments on prem exchange. should work in both of former clients, outlook mobile app o365 users. my specific question comes down detecting when use ews vs rest api (or ms graph api). here snippet of of code: office.initialize = function() { $(document).ready(function() { $('#forward').click(forwardmessage); }); }; function forwardmessage() { if(office.context.mailbox.resturl) { // problem child forwardews(); // works charm } else { forwardrest(); // works fine o365 users } } function forwardrest() { var resthost = office.context.mailbox.resturl; var restid = getitemrestid(); office.context.mailbox.getcallbacktokenasync({isrest: true}, function(result){ if (result.status === &quo

java - is it possible to cycle multiple sub activities on android -

Image
is possible code this, have main activity 1 start button , ten sub activities, run countdown timer , show picture, ten different picture , time, when click has run a1 a2, a1 , a2 again, a1, a3, a4 , a5 , a4 again, , on,i added flow chart below there no such thing "subactivity" in android. activities can started @ time, other activity. want easy enough, need each activity other a1 activate a1 after timer, , need a1 keep track of last/next activity activated was, knows 1 activate next on its timer.

phpunit testing a json object for one of two values -

how use php unittest check json object has 1 of 2 values {"option":valule} ... value can either 0 or 1 i want like $optionvalue = {"option":0}; $data = json-decode($optionvalue); this->containonly(0,1, $data) $this->assertthat ($data["option"], $this->logicalor ($this->equalto (1), $this->equalto (0)));

Rolling Average in Microsoft Data Lake Analytics -

i running rolling average on value1 field. window of size 11 , centered. code below (i have omitted output statement). have included input file . declare @window_size int = 11; declare @window_lag int = (@window_size - 1) / 2; @data = extract timestamp datetime, site string, value1 double @input using extractors.csv(quoting : true, skipfirstnrows : 1, silent : false); // adjust timestamp utc @data = select timestamp.touniversaltime() timestamp, site, value1 @data; @avgdata = select timestamp, site, value1, avg(value1) over(partition site order timestamp rows between @window_lag preceding , @window_lag following) rolling_avg @data; the calculated values seem ok. match in r ( d data frame containing loaded value of input file): window_size = 11 d %>% group_by(site) %>% mutate( rolling_avg = zoo::rollapply(data = value1, fun = mean, align = "center", width = window_size,

java - Why does NavigableSet (which extends SortedSet) declare subSet(E fromElement, E toElement) again? -

this question has answer here: in java when 1 interface extends another, why 1 redeclare method in subinterface? 5 answers the interface navigableset<e> extends interface sortedset<e> declares method sortedset<e> subset(e fromelement, e toelement) . however, when @ navigableset's api , see has declared same method (with same signature). see says inherits methods (first, last, comparable) sortedset . since definition, interfaces contain method signatures, why child interface redeclare same method parent interface has declared (and there's no difference in semantics, in api javadoc)? edit: came across relevant , nice discussion here - in java when 1 interface extends another, why 1 redeclare method in subinterface? doing allowed in java. here source code: /** * {@inheritdoc} * * equivalent {@code subset(fromelement,

R leaflet highlight options -

i highlighting line on r leaflet using following command library(leaflet) m = leaflet() %>% addtiles(group = "openstreetmap") x <- c(1,5,4,8) y <- c(1,3,4,7) data = sp::spatiallines(list(sp::lines(sp::line(cbind(x,y)), id="a"))) addpolylines(smoothfactor = 0.4, map = m, data=data, opacity = 0.3, weight = 2, color = "black", label = "text", popup = "text1", highlightoptions = highlightoptions(bringtofront = true, opacity = 1, weight = 5, sendtoback = false, color = "white")) is there way ensure line stays white until click somewhere else (either on line or on somewhere else on map)?

Replaying http traffic using gor / nginx(post_action) shows broken pipe error in tomcat logs -

we trying replay live http production traffic pre-prod environment using gor / nginx(post_action / mirror). requests see below error : 2017-09-14 11:56:30 error [dataprovidercontroller.getdata] au.gov.nsw.transport.gtfs.controller.dataprovidercontroller:136 clientabortexception: java.io.ioexception: broken pipe @ org.apache.catalina.connector.outputbuffer.realwritebytes(outputbuffer.java:413) @ org.apache.tomcat.util.buf.bytechunk.append(bytechunk.java:371) @ org.apache.catalina.connector.outputbuffer.writebytes(outputbuffer.java:438) @ org.apache.catalina.connector.outputbuffer.write(outputbuffer.java:426) @ org.apache.catalina.connector.coyoteoutputstream.write(coyoteoutputstream.java:91) @ org.apache.catalina.connector.coyoteoutputstream.write(coyoteoutputstream.java:84) @ org.apache.commons.io.ioutils.write(ioutils.java:631) @ au.gov.nsw.transport.gtfs.controller.dataprovidercontroller.getdata(dataprovidercontr

php - Is there any other way to refresh div to all members without timer? -

i have chat script made scratch. works fine, have fell site getting many requests timer. can see when inspect element on google chrome (network), timer calling function every single second. need that, make chat update members, want make other way if it's possible. function chat_send(){ $("[data-toggle='popover']").popover('hide'); var value=$.trim($("#message").val()); //if input empty if(value.length>0){ $.ajax({ type: 'post', url: 'load.php?chat_send', data: "message=" + $('#message').val(), }); $('#message').val(''); $('#message').attr("disabled", "true"); $('#mybutton').attr("disabled", "true"); settimeout(enableme, 1000); $("#chatbox").animate({ scrolltop: $(this).height() }, "fast"); return false; } }

visual studio - c# scale entire form based on screen resolution -

i have application full screen , has multiple panels , layouts works fine. when testing on screen resolution things go wrong. far have been able adjust based on resolution width height has become issue. began scaling , realized have re-adjust of fonts based on new label sizes. there quite few labels , textboxes lot of work of them. have been searching , found windows wpf, i've never used , don't want have move on it. wondering if there easier way without starting over.

ruby - How do I write a regex that eliminates the space between a number and a colon? -

i want replace space between 1 or 2 numbers , colon followed space, number, or end of line. if have string like, line = " 0 : 28 : 37.02" the result should be: " 0: 28: 37.02" i tried below: line.gsub!(/(\a|[ \u00a0|\r|\n|\v|\f])(\d?\d)[ \u00a0|\r|\n|\v|\f]:(\d|[ \u00a0|\r|\n|\v|\f]|\z)/, '\2:\3') # => " 0: 28 : 37.02" it seems match first ":" , second ":" not matched. can't figure out why. excluding third digit can done negative lookback, since other 1 or 2 digits of variable length, cannot use positive lookback part. line.gsub(/(?<!\d)(\d{1,2}) (?=:[ \d\$])/, '\1') # => " 0: 28: 37.02"

jquery - HTML table with 100% width, with vertical scroll inside tbody without td wdth -

Image
i have tried solution posted hashem qolami in post html table 100% width, vertical scroll inside tbody , having issues. let me fill in, in case require additional details. i've tried multiple posts. everywhere have found fixed width td in tbody . require dynamic width, according data in tbody . it working in sites when there different sections of js, css. not working when combine single html. html image: html image // change selector if needed var $table = $('table.scroll'), $bodycells = $table.find('tbody tr:first').children(), colwidth; // adjust width of thead cells when window resizes $(window).resize(function() { // tbody columns width array colwidth = $bodycells.map(function() { return $(this).width(); alert("hii"); }).get(); // set width of thead columns $table.find('thead tr').children().each(function(i, v) { $(v).width(colwidth[i]); }); }).resize(); // trigger resize handle

Storing Authentication Token at application level which expires after certain time interval in spring -

i have spring rest application. application, giving call few rest apis. these apis need authentication token , there service call latest token. authentication token valid few hours , again expires , fresh token provided. need store token in memory , use calling apis. if tokenexpiredexception, giving call token generating method , retrieve new token , store in memory again use. please suggest best place store token can have readily available number of user.

google spreadsheet - Retrieving top unique values from large list -

i have list of data have 3 columns. a = name b = item c = value a group of people have filled out. retrieve top 150 results, taking top 5 value items each name , not repeating items. for example, if have item 1 value 5, joe has item 1 value 3, mine return not. once, had contributed 5 items list, "disqualified" list, regardless of whether item had higher value. having trouble building query complex. possible in google sheets?

How to write reserve word in xml text part using python -

i tried write cdata xml, < , > change &lt; , &gt; . how can correctly write cdata xml file? here parts of code. script = '<![cdata[echo "something..."]]>' xroot = etree.parse(xmlfile) xpath = '//a:profile/a:scripts/a:post-scripts/a:script/a:source' code = xmlroot.xpath(xpath) code[0].text = script the result "&lt;![cdata[echo "something..."]]&gt;" i tried method such as using xml.sax.saxutils.escape , xml.sax.saxutils.unescape add \ before < , > both methods not working. thanks help.

Amazon Glue Crawler Not Crawling All the Data -

in data below, crawler on amazon ( plan push data s3 using crawler), crawls 10th row stops, though there more data. my data looks this: {"fullreferrer":"(direct)","jscountry":"malaysia","medium":"(none)","campaign":"(not set)","operatingsystem":"(not set)","devicecategory":"desktop","datasource":"web","country":"china","sessions":"2","users":"2","newusers":"2"} {"fullreferrer":"(direct)","jscountry":"malaysia","medium":"(none)","campaign":"(not set)","operatingsystem":"(not set)","devicecategory":"desktop","datasource":"web","country":"malaysia","sessions":"2","users":"2

c++ - Getting "inf" and "nan" values in Scatter Matrices in fisher face algorithm -

i using opencv , c++. have 50 patterns , 10 classes fisher face recognition algorithm. in calculation of scatter matrices, getting "inf" , "nan" values. using cv_32f data type mat. mat sb = mat(totalpattern, totalpattern, cv_32f); sb = sb + temp; where temp temporary mat of multiplication of each column , it's transpose.

javascript - Action Automation with Server Side Clock Timestamp JS PHP -

i need time server-clock in js or php, think js it's better server-side. aniway have php page includes rows in table "rows" of database. table "rows" have 3 columns: id(consecutive), date(m-d-y), time(h:i). the script need have check current server time, if between last rows published , current time minimum 10 minutes, creates row in database current date , current timestamp. obviously thought js's getdate(); function maybe both js , php user needs open page in order start clock, need server counts no visits. way should making client script , start process execute locally on machine script check if timestamp higher every x mins it's not clean work. thanks guys! :)

powershell - Get -ChildItem length error -

i've search search_string present in all_files/folder/sub_folder on particular drive i've below command, giving me error of folder/files length because must less 260 characters, , directory name must less 248 characters command : get-childitem d: -recurse | where-object {(select-string -inputobject $_ -pattern "search_string" -quiet) -eq $true} | foreach-object {write-output $_} i've tried get-alphafschilditems instead of get-childitem didn't work. https://gallery.technet.microsoft.com/get-alphafschilditems-ff95f60f please me find way-out.

javascript - Uncaught Syntaxerror: invalid or unexpected token for Unicode line separator \u2028 -

Image
does knows how javascript processes unicode character , decides invalid? shown in attached image, has entered text has \u2028 character in <textarea> . now throws error when page opened , goes responsive. can check text such characters @ compile time? i can't use regex directly save me 1 character or cant use range of separators or control characters of unicode because application localized , don't want take risk of skipping data mentioning range of chars. so wanted know possible check string validating javascript @ runtime?

postgresql - Getting "Error parsing arguments for import " while trying to importing tables from postgres to HDFS? -

i using following command import database : sqoop import --connect 'jdbc:postgresql://0.0.0.0:5432/toptal?ssl=true&sslfactory=org.postgresql.ssl.nonvalidatingfactory' -p \ --username 'capacityprediction_user'\ --table 'raw_hd' \ --target-dir '/home/raw_hd' i new hadoop ,i have followed below link https://www.toptal.com/database/hdfs-tutorial-data-migration-from-postgresql error getting : 17/09/14 05:32:24 error tool.basesqooptool: error parsing arguments import: 17/09/14 05:32:24 error tool.basesqooptool: unrecognized argument: raw_hd 17/09/14 05:32:24 error tool.basesqooptool: unrecognized argument: --target-dir 17/09/14 05:32:24 error tool.basesqooptool: unrecognized argument: /home/raw_hd

Regex: how to match anything before and after uppercase sequences with a period as delimiter? -

i have series of sentences containing uppercase keywords in large text containing several other sentences. need match sentences contain uppercase words (1 or more), instance: this sentence should matched. , 1 should too. other sentence should not matched. any suggestion? thanks! not advanced user... this it: ^.*\b[a-z]+\b.*$ \b assert position @ word boundary a-z single character in range between (index 65) , z https://regex101.com/r/kun41w/1 if i not counted uppercase word in sentence matches conditions. use this: ^.*\b[a-z]{2,}\b.*$ {2,} quantifier — matches between 2 , unlimited times, many times possible, giving needed

How to find child elements in selenium python -

i want find child elements of "row item" , store them in ordered dict form pass excel. html , code given below <div class = "col-md-5 col-sm-5" <h3>....</h3> <div class = "row item"> ::before <div class = "col-md-6 subtitle"> title</div> <div class = "col-md-6 ng-binding"> 1233344</div> ::after </div> <div class = "row item"> ::before <div class = "col-md-6 subtitle"> name</div> <div class = "col-md-6 ng-binding"> abc</div> ::after </div> similarly have 23 divs of 'row item' class , want these values in form of ordered dict like items_dict = {title:1233344, name:abc} my code : rowitem in driver.find_elements_by_xpath('//div[@class="row item"]'): titles = rowitem.find_element_by

java - Delete object's variable after instantiation -

so have object needs variables instantiated. these variables passed object through array of objects. then, each element in array gets assigned internal variable. does array garbage collected after internal variables assigned , array never referenced again, or should manually done? class myobject () { public static object [] values; public void setvalues(inputarray) { values = inputarray; } } memory kind of important because need create few hundred of these objects plus rest of code. whether array eligible gc depends on condition: is there still referencing array? if, have this: public class foo { private int[] myarray = {1, 2, 3, 4}; yourobject obj; public void somemethod() { obj = new yourobject(myarray); } } then myarray not eligible garbage collection because variable myarray in foo object still referencing it. can set myarray null make eligible gc. if myarray local variable, however: public class fo

filesystems - Source code for Network File System -

i doing small project explains how operations (file open, file write etc.) done in client side , server side in network file system. can me out providing source code can track operation. it helpful if can explain how process takes place in real time.

java - Update record on unique constraint on batch store jooq -

i trying insert records using batchstore using jooq. need know how can update record on unique constraint, throwing exception record exists sql error [23505]: error: duplicate key value violates unique constraint below code dslcontext create = getdslcontext(); list<userrecord> userrecordlist = new arraylist<>(); (users user : model.getusers()) { user record = create.newrecord(user); userrecordlist.add(record); } create.batchstore(userrecordlist).execute(); currently inserting records fine, when duplicate record found on basis of unique constraint should update record i have resolved issue using common interface updatablerecord, first have used fetchone() query record on basis of unique constraint give updatablerecord , set values updated ones added userrecordlist further passed batchstore

javaScript Debugging Code Explanation -

Image
i new javascript. html: <!doctype html> <html> <head> <meta charset="utf-8"> <title>example</title> <style> body { "background-color: #fff; color: #000; font-size: 14px; position: relative;} form { font-size:16px; } </style> </head> <!-- embedded css style --> <body> <div> <header> <h1>example</h1> </header> <div class= "container"> <main> <form> <fieldset> <legend> example </legend> <!--asks name--> <label for="nameinput">name</label> <input type="text" id="nameinput" name="name" placeholder="john doe" /> <br> <!--asks purchase price --> <label for="amt">amount:</label> <input type="text" id="amt"><br> <!--asks state--> <input type="radio" name="stat