Posts

Showing posts from January, 2012

Aurelia Custom Element - Anything directly after that is removed from DOM -

Image
i have latest version of aurelia although believe had been fixed last year ( https://github.com/aurelia/framework/issues/35 ), still having issues. else have issue? custom element: <template> <i class="fa fa-question fa-sm"></i> </template> import {customelement, bindable, inject, bindingmode} 'aurelia-framework'; @customelement('tooltiphelper') @bindable({name: 'title', attribute: 'title', defaultvalue: 'helper text', defaultbindingmode: bindingmode.twoway}) @inject(element) export class tooltiphelper { constructor(element) { this.element = element; } bind() { $(this.element).tooltip( { title: this.title, placement: 'right' } ); } } place referenced: <template> <div class="row"> <div class="col-sm-12"> <div class="form-group"> <label class="contr

c# - The function evaluation requires all threads to run -

i have asp.net mvc 5 application, want run raw query entityframe work when run code bellow error: the function evaluation requires threads run my code: using (var context = new mydbcontext()) { //var blogs = context.mysupportcontext.sqlquery("select * dbo.supports").tolist(); string myquery = "select id, fullname, sum(mins) mins (select t.id, fullname, numberofsupports* st.minutes mins from(select st.id, st.fullname, count(s.id) numberofsupports, s.supporttypeid supportteams stinner join supports s on s.responsibleid = st.idgroup st.id, st.fullname, s.supporttypeid) t inner join supporttypes st on st.id = t.supporttypeid) t group id, fullname "; var blogs = context.database.sqlquery<string>(myquery); string qstring= string.empty; if (blogs != null) { qstring= blogs.tostring(); } } you should check out: htt

batch file - matlab - display dos command output to static text -

Image
i using gui call terminal command. using dos(my_command, '-echo') can command output in matlab's command window. there anyway replicate -echo in static text in gui? currently, my_command , write output log file, , update static text's string log file after process finishes, want live-view in command window: output displayed line line in real-time. thanks. update: @hoki: question is: when console commands being executed, if close gui matlab returns errors unstopable, how can freeze whole gui until commands finished? thanks yair altman info in article , got work involves hacking matlab java base objects (namely command window). it involves attaching listener matlab command window. careful, save work , prepared kill matlab process quite few times until right ... because every time have error in code stuck in kind of infinite loop (the error/warning sent command window, triggers listener, re-trigger error etc ...). had restart matlab dozen of t

javascript - canvas chart height AngularJS -

i want render chart in angularjs this part of html code chart: <div style="overflow: auto;"> <div id="parentdivchart" style="{{changewidth()}}; height:350px;"> <canvas id="bar" class="chart chart-bar" chart-data="datta" chart-labels="labels" chart-legend="true"> </canvas> </div> </div> and controller function changewidth(): function changewidth(trendvalues) { elem = document.getelementbyid('parentdivchart'); elem.style.width = $scope.values.length*20 +"px"; } the idea want able change width dynamically according data receive. when fix height 350px canvas not inherit value , instead stretches canvas , sets value height not suitable. me ? why canvas not inherit parent divs height, inherit width changes. how set fixed height canvas ? thanks in advance! along elem.style.width = $scope.values.length*20

python - Not able to generate a random array of categorical labels -

i have random state fixed seed using make predictive results replicable: rng = np.random.randomstate(101) len(finaltestsentences) = 500 i trying use seed generate array of random categorical variables using unique list of possibilities. here's example (i used set on training labels generate unique labels have): unique_train_labels = set([u'bla', u'blee', u'blu', u'ma']) i do: categorical_random = np.array[rng.choice(unique_train_labels, len(finaltestsentences))] but getting: categorical_random = np.array[rng.choice(unique_train_labels, len(finaltestsentences))] file "mtrand.pyx", line 1072, in mtrand.randomstate.choice (numpy/random/mtrand/mtrand.c:11545) valueerror: must 1-dimensional or integer note, workaround here what going wrong , how can achieve aim? if @ definition of np.random.choice , you'll see a , population, converted numpy array by a = np.array(a, copy=false) if set, conversion little

python - Pandas with Decimal? -

i'm calculating standard deviations giving floatingpointerrors. wanted try converting data series decimal (using https://docs.python.org/3/library/decimal.html ), see if fixes issue. i can't seem make pandas series of decimal . how can take normal pd.series of float64 , convert pd.series of decimal , such can do: series.pct_change().ewm(span=35, min_periods=35).std() would work? def column_round(decimals): return partial(series.round, decimals=decimals) df.apply(column_round(2)) alternatively lets use np.vectorize can use decimal.quantize function rounding, leave variable decimal instead of np.float64 npquantize = np.vectorize(decimal.decimal.quantize) i have been looking , seems solve issue pct_change ts.diff().div(ts.shift(1))

angularjs - Javascript critical error when running Angular 2 application -

Image
i have asp.net 5 , angular 2 setup created using steps outlined in post. this has been working great, of sudden i've been getting errors when running application, these errors related js files needed run angular 2. ideas can causing this? update i'm getting these errors when running in ie 11, when change browser chrome working expected. i realised started getting error following windows 10 update. default browser set internet explorer i changed tho chrome , application started working. next step reset internet explorer settings going tools > internet options menu , clicking on advanced tab i changed browser in visual studion internet explorer , application started working.

xml - XSLT: Group different element types -

my source xml looks follows: <a> <item> <x>10</x> <y>20</y> <data1>foo</data1> </item> </a> <b> <item> <x>10</x> <y>20</y> <data2>bar</data2> </item> </b> <a> <item> <x>11</x> <y>20</y> <data1>foo2</data1> </item> </a> <b> <item> <x>11</x> <y>20</y> <data2>bar2</data2> </item> </b> note a s , b s occur pairwise respect values of x , y . note there other elements containing nested item element should ignored. now, goal group elements having same values x , y new elements looking this: <newelement> <x>10</x> <y>20</y> <data1>foo</data1> <data2>bar</data2> </newelement> <newelement> <x>

How to compare the multiple dropdown box values using Javascript/jQuery? -

i having 3 dropdown list contains expressions filtering datatables based on selection, example, <select class="assetsearch" title="asset_type"> <option value="0">--select asset type--</option> <option value="pc">pc</option> <option value="workstation">workstation</option> </select> <select class="assetsearch" title="location_code"> <option value="0">--select location--</option> <option value="bldg 1">bldg 1</option> <option value="bldg a1">bldg a1</option> </select> <select class="assetsearch" title="floor_no"> <option value="0">--select floor no--</option> &

url - Replace schema in symfony -

is there possibility in symfony2 can create http://some.url/ url some.url (without schema , slashes)? the simplest solution str_replace(["http://", "https://", "/"], ['','', ''], ' http://some.url '); don't ( there builtin php function doc : $domain = parse_url($url, php_url_host);

python - Save a pandas dataframe as table in Image or pdf document with nice multi index display -

i'm trying include data frame multi-index in report in pdf. have nice table output. i have found these 2 solutions: pandas.df -> html -> pdf import pandas pd ipython.display import html import pdfkit # df generation df = pd.read_csv(path_to_csv, sep =',') groupeddf = df.groupby('cluster') res = groupeddf.describe([0.05, 0.5, 0.95]) res.index.rename(['cluster', 'stats'], inplace=true) res['cluster'] = res.index.get_level_values('cluster') res['stats'] = res.index.get_level_values('stats') populations = (res.iloc[(res.index.get_level_values('stats') == 'count'), \ 0].values).tolist() res['population'] = [populations[i] in res.index.labels[0].values()] total_pop = sum(populations) res['frequency'] =(res['population']/total_pop).round(3) res.set_in

angular - How to dismiss Loader after data is ready -

Image
in ionic 2 app, have component consumes service makes http fetch data. component calls service , when data available sets , presents it. it looks following : export class farmlist implements oninit { items: object; constructor(public testservice: testservice, public nav: navcontroller){ } ngoninit(){ this.getdata() } getdata(){ let loading = loading.create({ content: 'please wait..', spinner: 'crescent' }) this.nav.present(loading) this.testservice.fetchdata().then(data => this.items = data) } ... } while component fetches data asynchronously, trying have loader spinning , once data available, want loader disappear. however, current code spinner keeps spinning after data available , displayed can seen screenshot: getdata() method makes service call. how can fix this? correct way implement loader? you can find working plunker here . like can see in code of plunker, make few change

ssl - Docker private registry | TLS certificate issue -

i've tried follow following tutorial setup our own private registry (v2) on aws centos machine. i've self signed tls certificate , placed in /etc/docker/certs.d/machine_statis_ip:5000/ when trying login registry (docker login machine_ip:5000) or push tagged repository (machine_ip:5000/ubuntu:latest) following error : error response daemon: https://machine_ip:5000/v1/users/: x509: cannot validate certificate machine_ip because doesn't contain ip sans tried search answer 2 days, couldn't find any. i've set certificate cn (common name) machine_static_ip:5000 when using self signed tls certificate docker daemon require add certificate it's known certificates. use keytool command grab certificate : keytool -printcert -sslserver ${nexus_domain}:${ssl_port} -rfc > ${nexus_domain}.crt and copy client's machine ssl certificates directory (in case - ubuntu): sudo cp ${nexus_domain}.crt /usr/local/share/ca-certificates/${nexus_domain}.c

mysql - Users that haven't logged in during last n months -

i remove users haven't logged in given period, period choosen me later based on results. so need report in receive number of users haven't logged in, during last 1 month, 2 months ... n months. i don't quite know how achive moving period in single mysql query. extracting these users given period easy: select count(distinct id) tmp_last_login last_login <= date_sub(now(), interval 1 month) but how achive such report n months? expected result: **interval** **cnt** 1 xxx 2 xxx 3 xxx 4 xxx 5 xxx ... xxx n xxx the following query return count of distinct ids each month difference within interval of 10 months now . select 12 * (year(curdate()) - year(last_login)) + (month(curdate()) - month(last_login)) months, count(distinct id) cnt tmp_last_login last_login >= date_sub(curdate(), interval 10 month) group months; or yo

java - How to use MongoDB $let with Spring-Data? -

i have mongodb collection of places. typical place has of following fields: { "_id" : objectid("575014dc6b028f07bef53681"), "_class" : "domain.model.placev1", "name" : "Γιασεμί", "primary_photo_url" : "https://irs0.4sqi.net/img/general/original/34666238_sthsh6chic7hpaub4rztrvg6cfc5ylfi15arar7zuuq.jpg", "seendetails" : numberlong(0), "foursquare_checkins" : 646, "foursquare_tips" : 28, "keywords" : [ "" ], "verified" : 1, "location" : { "loc" : { "type" : "point", "coordinates" : [ 25.898318, 36.831486 ] }, "formattedaddress" : "Χώρα", "locality" : "amorgos", "first_neighbourhood" : "katapola", "greek_locality" : "Αμοργός", "gree

r - how can I plot the bar plot attached to box plot -

a small portion of data looks below dt<- structure(c(79l, 54l, 37l, 41l, 42l, 121l, 134l, 169l, 23l, 19l, 22l, 19l, 25l), .names = c("experi_1", "experi_2", "experi_3", "experi_4", "experi_5", "experi_6", "experi_7", "experi_8", "experi_9", "experi_10", "experi_11", "experi_12", "experi_13")) what try make make barplot assigned box plot under have read comment , tried use no success align barplot boxplot in r a bar plot can drawn this. however, have no control on x-axis. example if want plot distance of 5, cannot. lets 1, 5, 10 , 13 x-axis label. anyway not big issue. problem assigning box plot barplot! barplot(dt, xlab="number of s in each experiment") i used following add box plot, not seem xlim <- c(-0.5, 0.5) + range(dt) par(mar=c(3.1, 3.1, 1.1, 2.1)) boxplot(dt, horizontal=true, outline=true, ylim=xlim, frame=f, wi

c++ - Friends & Pointers -

i have following code: (*writeoutputtobuffer)(cl::enqueueargs(*queue, cl::nullrange, cl::ndrange(netspec[lastlayerindex]), cl::nullrange), writeoutputtobufferbuf[0], writeoutputtobufferbuf[1], lastlayerindex); where writeoutputtobufferbuf[0] contains cl::buffer , writeoutputtobufferbuf[1] contains cl::buffer and lastlayerindex contains int . writeoutputtobufferbuf vector of cl::buffer using above code in own class works fine. call successful this: (cl::make_kernel< cl::buffer, cl::buffer, int >) (cl::enqueueargs, cl::buffer&, cl::buffer&, int&) the kernel initialized as: std::shared_ptr<cl::make_kernel<cl::buffer, cl::buffer, int>> writeoutputtobuffer; but when use them in friend class follows: (fullyconnectedportion->writeoutputtobuffer)(cl::enqueueargs(*queue, cl::nullrange, cl::ndrange(outputsize), cl::nullrange), (fullyconnectedportion->writeoutputtobufferbuf[0]),

javascript - Onscroll video has to play once -

using scrolltop divide scroll 5 section using if condition.in 2nd section gave video scrolltop value 600 700px.the video playing many times within position if scroll again.but want video has play once if number of times within value. var scrolld=window.scrolltop(); if(scrolld >=600) { ///i gave image here } elseif((scrolld >600) & (scrolld <=700)){ //video } //rest 3 elseif contain images check link: http://projects.lollypop.biz/auluxa/lighting.html if scrolled using mouse working fine.but if scrolled using keyup , keydown(keyboard) video playing many times. please take @ code. think mean, since have on website aswel, question not clear. can atleast share ur code? $('#vid').on('ended', function(){this.playedthrough = true;}); $(window).scroll(function(){ var myvideo = document.getelementbyid("vid"); if($(window).scrolltop() > 300 && $(window).scrolltop() < 975){ // if didn't reached end

triggers - Update last modified date column -

i have table this: id name modified 11 john 2016-07-12 15:49:45 22 abraham 2016-07-12 15:52:03 i need update 'modified' column tracks last modified date row. have done using trigger, have read triggers eat performance. there way using constraints? it's possible use default constraint , default keyword in update clause. see following example: create table updatetest ( id int identity, name varchar(10), modified datetime2(2) constraint df_modified default (sysdatetime()) ) --id identity, modified default implicitly insert updatetest(name) values('test') --modified default explicitly update updatetest set name='test2', modified=default

installation - Problems installing an add in for OWA(Outlook Web App) as the add-in isn't supported by the version of Exchange Server -

i trying install custom outlook add-in owa, when attempt install xml manifest file receive error stating app isn't supported current version of exchange server. there not xml file in application folder default, in order comply request xml, changed file extension of manifest file .manifest .xml. the owa custom add-in installer not seem recognize correct file. which file should use, or doing wrong? owa can't run vsto add-ins. instead, need create mail app (so-called outlook add-in). see get started outlook add-ins office 365 more information.

java - Iterate over an enum, which saves classes, then init the classes and put them into a map -

i have made interface, classes implement, , have enum counstructor takes class<?> arguement. enum(class<?> class) , , enum has function return class. how can make class arguement must implement interface, , how later loop through values() of enum, classes, init them , put them hashmap. thanks help. use upper bound on wildcard: class<? extends yourinterface>

spring boot - How to change the endpoint of prometheus metrics -

i trying expose metrics spring-boot service prometheus. unfortunately, both spring-boot actuator , prometheus simple-client expose metrics through /metrics endpoint. how can endpoint of simple-client changed? thanks for java client specify endpoint when setting servlet, see https://github.com/robustperception/java_examples/blob/master/java_simple/src/main/java/io/robustperception/java_examples/javasimple.java#l39 example. can change endpoint whatever like.

c# - Check current user credentials in debug mode in a wpf application -

i trying run application able stop , start service remotely. application needs able used users without admin privileges impersonating user username, password , domain read encrypted database. the problem i'm facing i'm not sure if impersonate function working correctly, hence why want check in debug mode user current. this class use impersonate user: using system; using system.collections.generic; using system.text; using system.security.principal; using system.runtime.interopservices; using system.security.permissions; public class impersonateuser { [dllimport("advapi32.dll", setlasterror = true)] public static extern bool logonuser( string lpszusername, string lpszdomain, string lpszpassword, int dwlogontype, int dwlogonprovider, ref intptr phtoken); [dllimport("kernel32.dll", charset = charset.auto)] public extern static bool closehandle(intptr handle); private static intptr tokenhandle = new intptr(0

bash + Linux + how to ignore the character "!" -

i want send little script remote machine ssh the script is #!/bin/bash sleep 1 reboot but event not found - because "!" ssh 183.34.4.9 "echo -e '#!/bin/bash\nsleep 1\reboot>'/tmp/file" -bash: !/bin/bash\nsleep: event not found how ignore "!" char script send ssh? remark cant use "\" before "!" because get more /tmp/file #\!/bin/bash sleep 1 use set +h before command disable ! style history substitution : set +h ssh 183.34.4.9 "echo -e '#!/bin/bash\nsleep 1\reboot>'/tmp/file" # enable hostory expnsion again set -h

swift - Function not called with selector action -

i'm trying handle tap gesture in external uiviewcontroller's class function never called. here code: import scenekit import uikit class scenemanager { private let assetfolder: string private let maincamera: scnnode private let view: scnview private let scene: scnscene init(view: scnview, assetfolder: string, scenefile: string, maincameraname: string, backgroundcolor: uicolor) { self.assetfolder = assetfolder self.scene = scnscene(named: (self.assetfolder + "/scene/" + scenefile))! self.maincamera = self.scene.rootnode.childnodewithname(maincameraname, recursively: true)! self.view = view self.view.backgroundcolor = backgroundcolor self.view.allowscameracontrol = false self.view.pointofview = self.maincamera self.view.scene = self.scene //problem below let gesture = uitapgesturerecognizer(target: self, action: #selector(self.handletap(_:))) self.view.addgesturerecognizer(gesture) } @objc func handletap(sender: uita

spring - How to listen login fail / success with oauth2 grant_type=password -

my app uses spring cloud oauth2 rest , angular . my goal use spring server limit maximum number of login failures angular2 login code: const body = "username=" + encodeuri(username) + "&password=" + encodeuri(password) + "&grant_type=password&client_id=" + encodeuri(this.clientid); this.http.post("/oauth/token",body,{headers:authheaders}).map{ ... } spring auth-server web security code: @override protected void configure(httpsecurity http) throws exception { http.httpbasic().and().sessionmanagement() .sessioncreationpolicy(sessioncreationpolicy.stateless) .and().authorizerequests() .anyrequest().authenticated(); } i try these 2 event : public class authenticationfailurelistener implements applicationlistener<authenticationfailurebadcredentialsevent>{ @override public void onapplicationevent(authenticationfailurebadcredentialsevent e

sql server - Referencing another table in T-SQL not working -

i've been running query on large number of servers, , on 3 of them (sql2000, sql2005 , sql2008) query fails. i've boiled down referencing table in db. select * master.dbo.syslogins syslogins which works on 99% of servers, on 3 gives: invalid object name 'master.dbo.syslogins' if switch master db , run select * dbo.syslogins syslogins then works. i've checked have permissions running select is_srvrolemember('sysadmin'); which returns 1. why referencing master.dbo.syslogins table fail? maybe server set case sensitive collation. try select * master.dbo.syslogins

html - How do I margin a div as much as another? -

i want holder not overlap navbar, can set holder's margin-top as navbar without putting in numbers? here's html, #navbar { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: grey; position: fixed; top: 0; width: 100%; } #holder { min-height: 100%; background-color: #f7f4ee; position: relative; } <div> <ul id="navbar"> <li><a class="active" href="home.html">home</a> </li> <li><a href="news.html">news</a> </li> <li><a href="about.html">about</a> </li> </ul> </div> <div id="holder"> <header>""</header> <div id="body">""</div> <footer>""</footer> </div> thanks. try use this margin: 0 auto; and

oracle11g - Error while installing informatica 8.6 with oracle 11g in window 10 -

i getting below error while installing informatica 8.6: ****use error below , catalina.out , node.log in server/tomcat/logs directory on current machine more information. select retry continue installation. stdout: installing service '"informatica services 8.6.0"' on node 'node01_geettika4912'... using current_dir: c:\informatica\powercenter8.6.0\server\tomcat\bin using infa_home: c:\informatica\powercenter8.6.0 service '"informatica services 8.6.0"' has been installed. stderr: filename, directory name, or volume label syntax incorrect. service name invalid. more available typing net helpmsg 2185.** exitcode: 2** i getting error after successful creation of domain. please me in resolving error. thanks! run services.msc list of services. click properties on service want, there can see "service name" , "display name". the service name need use net command. check if informatica services 8.6.0

php - when i insert of description and img_url data behave differently? -

Image
php $rss = new simplexmlelement($xml, libxml_nocdata); foreach ($rss->channel->item $item) { foreach ($rss->channel->item $item) { $guid = $item->guid ; $title = $item->title ; $url = $item->link; $description = (string)$item->description ; $date = $item->pubdate; $img_url = $item->enclosure['url'] ; $category = $item->category[1] ; insert($guid,$title,$description,$url,$date,$img_url) ; } function insert($g,$t,$des,$u,$d,$imgu) { global $connection ; echo $g,"<br>",$t,"<br>",$des,"<br>",$u,"<br>",$d,"<br>",$imgu,"<br>" ; $insert_sql = "insert rssfeed (guid,title,description,url,date,img_url) values (?,?,?,?,?,?)" ; $stmt = $connection->stmt_init() ; $stmt->prepare($insert_sql) ; $stmt->bind_param('isssss',$g,$t,$des,$u,$d,$imgu); $stmt->execute() ; } when echo in functio

adding simple mathematical operation to python script -

i have program operates on csv file create output looks this: 724, 2 724, 1 725, 3 725, 3 726, 1 726, 0 i modify script simple math operations such render output: 724, 1.5 725, 3 726, 0.5 the script i'm using here: lines=open("1.txt",'r').read().splitlines() l in lines: data = l.split('"overall evaluation:') if len(data) == 2: print(data[0] + ", " + data[1]) how add simple averaging , slicing operation pipeline? i guess need create temporary variable, should outside loop iterates on lines? maybe this: lines=open("easychairdata.csv",'r').read().splitlines() l in lines: data = l.split('"overall evaluation:') submission_number_repo = data[0] if len(data) == 2: print(data[0] + ", " + data[1]) if submission_number_repo != data[0] submission_number_repo = data[0] edit the function simple average you can use dic

r - Fitted Arima Model with NA values -

hey have short question fitting arima model r. have large dataset multiple na values can not remove. so need figure way model data arima missing values. of aic value figured best model arima 2,0,2 if try fit model result: null does has idea how can work that? my code fit model fitted(final.arima) i tried know work missing values thats code use can not give dataset use ... daten1<-test final.aic <- inf final.order <- c(0,0,0) (p in 0:2) (q in 0:2) for(z in 0:1) { current.aic <- aic(arima(daten1, order=c(p, z, q))) if (current.aic < final.aic) { final.aic <- current.aic final.order <- c(p,z, q) final.arima <- arima(daten1, order=final.order) } } final.aic final.order final.arima acf(resid(final.arima)) box.test(resid(final.arima), lag=20, type="ljung-box") ############rmse und r² testen für arima model############### ffa<-fitted(final.arima) daten1.mean<-mean(daten1) r1<-sum((ffa-d

html - CSS and website layout -

is able me replicate layout of screen @ http://login.microsoftonline.com what after 2 columns, span size of page, there no scroll bar or anything. i want smaller of 2 columns on left, not right , want able choose image larger area in css or html. there doesn't need wording, 2 columns, , larger 1 background image. any assistance appreciated. html <div class="colmask leftmenu"> <div class="colleft"> <div class="col1"> <!-- column 1 start --> <h2>right</h2> </div> <div class="col2"> <!-- column 2 start --> <h2>left</h2> <!-- column 2 end --> </div> </div> </div> </body> </html> css body { margin:0; padding:0; border:0; /* removes border around viewport in old versions of ie */ width:100

r - Using strings saved in variables in coding -

i know how use stings stored in variable/vector/matrix etc in middle of coding in order edit names of variables/vectors or functions e.g. instead of creating below v_name1<- rep(5,10) v_name2<- rep(30,10) . . . function_name1<- { ... } function_name2<-{ ... } . . . using loop instead i know e.g. (this example illustrate) s<-c("name1","name2", ... ) (i in 1:(length(s))) { eval(parse(text=paste("v_",s[1],"<-c(rep(i,10))", sep=""))) } v_name1 [1] 1 1 1 1 1 1 1 1 1 1 i have 2 problems : 1) how make functions, below error? e.g. st<- "(x,y)<-{ 3*x + y}" eval(parse(text=paste("function_",s[1],st, sep=""))) > eval(parse(text=paste("function_",s[1],st, sep=""))) error in eval(expr, envir, enclos) : object 'x' not found 2) there faster/smarter way (substitute part of coding strings saved object) ? i

javascript - How to configure the rendering server with ReactJS -

i want create universal reactjs app. there following problem. when click on link page full refresh. server.js import path "path"; import express "express"; import react "react"; import reactdomserver "react-dom/server"; const router = require("react-router"); const routercontext = require("react-router").routercontext; const routes = require("./scripts/configs/routeconfig"); const app = express(); const port = 3000; app.use(express.static(path.join(__dirname, "../", "public"))); app.set("views", path.join("src", "views")); app.get("*", (req, res) => { router.match({ routes: routes.default, location: req.url }, (err, redirectlocation, renderprops) => { if (err) { res.status(500).send(err.message); } else if (redirectlocation) { res.status(302).redirect(redirectlocation.pathname + redirectlocation.search); } else if

angularjs - Angular.js filter search with checkbox -

Image
i doing angular filter search checkbox, working perfect wanna remove or clean results appears in right side. right possible unselecting checkboxes left. i results: test1, test2 similar this. so able remove search click in x so if click in x remove selected boxes. jsfiddle : http://jsfiddle.net/65pyj/768/ html: <div id="wrapper" class="toggled"> <div ng-app="fruit"> <div ng-controller="fruitctrl"> <!-- sidebar --> <div id="sidebar-wrapper"> <input type="checkbox" ng-click="includecolour('test1')" /> red </br/> <input type="checkbox" ng-click="includecolour('test2')" /> orange </br/> <input type="checkbox" ng-click="includecolour('test3')" /> yellow </br/> </ul> </div> &l

java - Agent to count objects inside methods using ByteBuddy -

i'm looking way of count how many different objects being called inside method using bytebuddy byte code analysis. tried string parsing, that's absolutely impossible. also, i've checked ast, should build code before doing that, lot of time. this, preferable if create agent. given following code: @test public void mymethod(){ boolean myobj = false; asserttrue(myobj).istrue(); asserttrue(myobj2).istrue(); } the output analysis method be: (myobj, myobj2). i'm new javabuddy, approach be: create element matcher find methods annotated @test . intercept .... here's problem: don't know how should count objects or iterate through method statements. can give me links or samples? in order instrument code within method, byte buddy allows use asm instrument code instruction-wise. reason asm api byte code processing , there no real reason replace end being rather similar. if want learn asm, their webpage offers great documentation. neve

rbenv - How to get newer version of Ruby into gem environment -

i've installed ruby 2.2.2 rbenv. when run gem env it says using 2.0.0. read on different question run sudo gem install -n /usr/local/bin --no-ri --no-rdoc bundler rbenv rehash bundle --path=vendor/bundle however, when running last line, receive error: could not locate gemfile or .bundle/ directory how system use ruby 2.2.2? edit: printed out contents of .bash_profile , had following 2 lines: export path export path="$home/.rbenv/bin:$path" is bad there blank export path? if so, how remove it? if have ruby 2.2.2 installed already, can use renv global rbenv global 2.2.2 check out documentation here .

html - What cause to button working like a submit button? -

i have tow buttons inside form, 1 submit , second simple button (like cancel button close dialog). code: <dialog id="addsubjectdialog" style="width:20%; height:25%;"> <div style="width:100%; hegit:20%;"><h2 style="font-size:100%;"><fmt:message key="add_subject_dialog_title" /></h2></div> <form action="addsubject" method="post" > <div style="width:100%; hegit:20%;"> <h2 style="font-size:100%;"><input id="subjectname" name="subjectname" style="font-size:100%;text-align: right;"></input> <fmt:message key="insert_subject_name" /> </h2> </div> <div style="height: 60px;margin-top:5% ;"> <fmt:message key="save" var="save"/> <input type=&quo

sql server - SSIS Package Hang randomly on execution phase -

i have master package execute 3 packages. sub-packages has data flow task in extract data excel file placed on shared location, , load sql server database table. each sub package load different file different table. no file or table used in more 1 package. in bids never face issue, runs smoothly in bids. but if execute package sql server hang on execution phase , have cancel after long long wait. the solution found if open excel files once in edit mode close them. , re-run package runs successfully. the problem have deploy on production server don't have access neither package nor file. , can't ask client open file once in edit mode , close , execute package. first of can't understand error , secondly solution. please advise. thank you everything setup on virtual machines. here log image package hang enter image description here

c# - Delete a code-first migration before update-database was run -

this frustratingly simple seeming question has been difficult find answer on google , so. have asp.net mvc project using entity framework code-first approach. went add migration when ran add-migration migrationname command, misspelled migrationname . i have not yet run update-database . renaming migration class name automatically created enough? or have delete migration first , add new 1 correct name? if so, how do that? delete automatically created migration class or there more it? while may able rename them, think may come issues regards *.resx file gets created contains zipped edmx file along naming stuff. simplest way delete root migration class (which remove migration.designer.cs , migration.resx file) , recreate it. if have ran update-database command, can still achieve rolling back: update-database -targetmigration nameofpreviousmigration (you may need add -force if rollback destroy data)

asp.net - Conversion from string to type 'Double' is not valid while updating -

i trying update table row. query seems ok don't understand why error coming error - system.invalidcastexception: conversion string "update hospitals set votescount " type 'double' not valid. ---> system.formatexception: input string not in correct format. @ microsoft.visualbasic.compilerservices.conversions.parsedouble(string value, numberformatinfo numberformat) @ microsoft.visualbasic.compilerservices.conversions.todouble(string value, numberformatinfo numberformat) --- end of inner exception stack trace --- @ microsoft.visualbasic.compilerservices.conversions.todouble(string value, numberformatinfo numberformat) @ microsoft.visualbasic.compilerservices.conversions.todouble(string value) @ hospital_details.sendreview_click(object sender, eventargs e) in e:\my web\health saviour\website\website\hospital-details.aspx.vb:line 281 ` dim hospitalid string = request.querystring("hospitalid") dim totalscorefrom int

Infer generic type argument from parameter type of function in TypeScript -

i want create toplainobject() function in typescript , have come working example: function toplainobject<s extends d, d>(source: s) { return json.parse(json.stringify(source)) d; } now can invoke function this: interface isample {} class sample implements isample {} let plain: isample = toplainobject<sample, isample>(new sample()); now question: there way declare toplainobject without need of first generic type argument s extends d using first parameter type (which s ) invoke function doing: let plain: isample = toplainobject<isample>(new sample()); the signature function toplainobject<d>(source: s extends d) { ... } not work , results in syntax error. maybe misunderstand after, don't see why can't do: interface isample {} class sample implements isample {} function toplainobject<tinterface>(source: tinterface) : tinterface { return json.parse(json.stringify(source)) tinterface; } let plain: isample = topla