Posts

Showing posts from March, 2011

time series - R-Weekly Forecast -

when use ts <- ts(df, frequency=52, start=c(2007,1)) , print it, got results shown below, instead of 2007.01, 2007.02, 2007.52 ...., got 2007.000, 2007.019, ....which gets 1/52=0.019 mathematically correct not easy interpret, there way label date data frame or @ least 2007 wk1, 2007 wk2 ... time series: start = c(2007, 1) end = c(2014, 11) frequency = 52 week, amount 2007.000, 645575.4 2007.019, 2185193.2 2007.038, 1016711.8 2007.058, 1894056.4 2007.077, 2317517.6 2007.096, 2522955.8 2007.115, 2266107.3 fit <- auto.arima(dmsales[[2]]) fcast<-forecast(fit,h=input$ahead) dfcast<-data.frame(fcast) b<-data.frame(seq(as.date(dmsales[[3]]+7), = "week", length.out = input$ahead)) ffcast<-as.data.frame(cbind(b,dfcast$point.forecast,dfcast$lo.95,dfcast$hi.95)) names(ffcast)<-c("week","forecast","lo-95","hi-95")

angularjs - How to update the $scope variable values with the new Values I'm getting from the Database? -

i have been setting response values every time hit web-service $scope variable on click of button $scope variable not getting updated new values have click button twice $scope variables updated. have checked, each time hit button web-service getting called. controller.js $scope.getdetails = function() { services.getsomedetails($scope.id).then(function(response) { $scope.details= response.data; } } view.html <a ng-click="getdetails();">click me!</a> use $scope.$apply() after scope variable. services.getsomedetails($scope.id).then(function(response) { $scope.details= response.data; $scope.$apply(); }

reactjs - Hiding and showing text in React -

hey guys stupid, i'm having troubles wrapping ly head around. i'm trying show/hide text inside 1 of components, i'm not able it. i clicked! message know function being passed down. missing? need declare visibility css declaration, maybe that's i'm missing. i'm getting cornfused. :/ thanks in advance: snippetlist.jsx import react, { component, proptypes } 'react' import { createcontainer } 'meteor/react-meteor-data'; import snippet './snippet' import { snippets } '../../../api/collections/snippets.js' class snippetlist extends react.component { constructor(props) { super(props); this.state = { visible: false } this.togglevisible = this.togglevisible.bind(this); } togglevisible() { this.setstate( { visible: !this.state.visible } ) console.log('i clicked'); } rendersnippets() { return this.props.snippets.map( (snippet) => ( <

javascript - Get Alt="" value from the selected radio button with jQuery -

i have following radio buttons within php loop: <form> <table class="table table-bordered optionschk"> <tr> <td colspan="2"> select bench case </td> </tr> <?php foreach($db->getrecordset($sql) $bench){ ;?> <tr> <td class="w5"> <input type="radio" alt="<?php echo($bench['lbl']); ?>" value="<?php echo($bench['sno']); ?>" name="b_sno" id="b_<?php echo($bench['sno']); ?>"> </td> <td class="w95"> <label for="b_<?php echo($bench['sno']); ?>"><?php echo($bench['lbl']); ?></label> </td> </tr> <?php } ?> i displaying values of above following function: function donebenchselection() { try { var benchsno = $("input[type=radio][name=b_sno]:

jquery - How to populate textbox from bootstrap modal after ajax response appended to bootstrap modal -

whenever click on go button data fetch data database loads table inside bootstrap modal using ajax after loading data how populate textbox selecting data in bootstrap modal <div class="modal fade" id="mymodal1" role="dialog"> <div class="modal-dialog"> modal content <div class="modal-content"> <div class="modal-header"></div> <div class="modal-body"> <table id="records_table"> <tbody id="values"> <tr>

javascript - Redux redux-think Load Async data before React component is mounted -

i new redux , reactjs, , having issues load data before react component mounted. i have userpage container linked redux store container/user-page.js class userpage extends page { componentwillmount() { this.props.userlist(); } title() { return 'user management'; } breadcrumb() { return [ { title: 'home', icon: 'fa-users' }, { title: this.title(), active: true } ]; } /** * content loaded page */ content() { console.log(this.props); if(this.props.fetched) { console.log('fetching now...'); console.log(this.props.payload); } return ( <div classname="row"> {/* left column */} <div classname="col-md-6"> {/* general

c# - Get real timestamp of frame captured using OpenCV -

i'm using emgucv wrapper opencv capture live video ip camera. i'm trying frame timestamp using function capture _capture = new capture(url); _capture.imagegrabbed += capture_imagegrabbed; private void _capture_imagegrabbed(object sender, eventargs e) { mat frame; _capture.retrieve(frame); double ts = getcaptureproperty(capprop.posmsec); } the function work, return position of frame beggining of capturing , not device clock timestamp. in manual of emgucv , opencv says: getcaptureproperty(cv_cap_prop_pos_msec) returning film current position in milliseconds or video capture timestamp is there way choose if return film position or timestamp? thanks

Why Selenium always create temporary Firefox Profiles using Web Driver? -

why selenium create temporary firefox profiles using web driver though told use existing 1 ? according this answer not possible stop selenium creating temporary firefox profiles using web driver. chromedriver can achieve this. why different firefox. checked firefoxprofile.cs of selenium repo , found following code snipet used copy profile--- public void writetodisk() { this.profiledir = generateprofiledirectoryname(); if (!string.isnullorempty(this.sourceprofiledir)) { fileutilities.copydirectory(this.sourceprofiledir, this.profiledir); } else { directory.createdirectory(this.profiledir); } this.installextensions(); this.deletelockfiles(); this.deleteextensionscache(); this.updateuserpreferences(); } but chorme there no such things. is because webdriver install extension (webdriver.xpi) communicate firefox whereas chromedriver.exe used interact chrome

hive - IIS Logs Straming to Hadoop real time -

i trying poc in hadoop log aggregation. have multiple iis servers hosting atleast 100 sites. want to stream logs continously hdfs , parse data , store in hive further analytics. 1) apache kafka correct choice or apache flume 2) after streaming better use apache storm , ingest data hive please suggestions , information of kind of problem statement. thanks you can use either kafka or flume can combine both data hdfs but need write code there opensource data flow management tools available, don't need write code. eg. nifi , streamsets you don't need use separate ingestion tools, can directly use data flow tools put data hive table. once table created in hive can analytics providing queries. let me know need else on this.

xcode - Cocoapods - Module Compiled with Swift 3.0 cannot be imported in Swift 3.0.1 -

just updated xcode v8.1 , trying install pod. however, once import it, xcode gives me error saying module compiled swift 3.0 cannot imported in swift 3.0.1 , path module. i have tried saying use legacy swift language version not solve issue. any other ideas of can change make compile? have hard time believing minor version change should cause trouble. thanks in advance help. this happens every update. try pod update in terminal pods located pods latest versions.

javascript - After click on print button.Modal window is not closing/not only the modal it will stuck my webpage -

below code.after printing invoice modal window not close.i have used below commented commands also.but not working.is there solution this.i'm using meteor var printcontents = document.getelementbyid('myinvoicetableprint').innerhtml; var originalcontents = document.body.innerhtml; document.body.innerhtml = printcontents; window.print(); document.body.innerhtml = originalcontents; location.reload(); // window.close(); console.log("print state"); // $('#mymodal').modal('toggle'); // $('#mymodal').modal('hide'); // $('.modal-backdrop').remove();

vb.net - How to delete a record from related child table using BindingNavigator -

i’ve created dataset master , child table (with relation key). when try delete record, it’s being deleted master table , not child. why that? private sub bindingnavigatordeleteitem_click(sender system.object, e system.eventargs) handles bindingnavigatordeleteitem.click me.match_masterbindingsource.removecurrent() ' me.player_detailsbindingsource.removecurrent() me.match_masterbindingsource.endedit() me.player_detailsbindingsource.endedit() me.match_mastertableadapter.update(me.footballdataset) me.player_detailstableadapter.update(me.footballdataset) end sub

dictionary - Java - get value from equivalent key in ConcurrentHashMap -

for code: //... system.out.println(main.getcurrentpage().getdots()); //type: concurrenthashmap<point,string> system.out.println(mdp.getactivepoint()); //type: point system.out.println(main.getrealcurrentpage().getdots().get(mdp.getactivepoint())); //type: string //... i output: {java.awt.point[x=278,y=354]=a1, java.awt.point[x=542,y=370]=a1} java.awt.point[x=278,y=354] null i don't understand why third line of output isn't a1 because point printed in second line of output contained in keyset of map. i thought because they're not being treated same object/reference reason, made class extends concurrenthashmap: public class goodchashmap<k,v> extends concurrenthashmap<k,v>{ public goodchashmap(){ super(); } public goodchashmap(goodchashmap<k,v> m){ super(m); } @override public v get(object key){ if(key instanceof point){ //system.out.println("!!!!

php - Class 'League\Glide\ServerFactory' is not found -

im trying use league glide showing image, here code: require(apppath.'vendor/autoload.php'); use league\flysystem\adapter\local; use league\flysystem\filesystem; function league_image(){ $array = array( 'source' => new filesystem(new local(realpath(apppath.'../../images'))), 'cache' => new filesystem(new local(realpath(apppath.'../../images/cache/'))), ); $server = league\glide\serverfactory::create( $array; ); $server->setsourcepathprefix('source'); $server->setcachepathprefix('cache'); return $server; } i got glide folder, using zip move vendor and got folowing error : fatal error: class 'league\glide\serverfactory' not found in c:\xampp\htdocs\deal\application\helpers\image_helper.php on line 106 a php error encountered severity: error message: class 'league\glide\serverfactory' not found filename: helpers/image_he

android - USB Touch Screen Input device not recognised -

added support lg 17mb15t usb touch screen hid-ids.h , hid-multitouch.c , recompiled kernel. device recognised in dmesg , claimed hid-multitouch : <6>[ 307.451668] usb 3-1.6: new full-speed usb device number 7 using sw-ehci <6>[ 307.563695] usb 3-1.6: new usb device found, idvendor=16fd, idproduct=d091 <6>[ 307.563753] usb 3-1.6: new usb device strings: mfr=1, product=2, serialnumber=0 <6>[ 307.563803] usb 3-1.6: product: lg ts2009f-usb <6>[ 307.563842] usb 3-1.6: manufacturer: edamak <6>[ 307.582868] input: edamak lg ts2009f-usb /devices/platform/sw-ehci.2/usb3/3-1/3-1.6/3-1.6:1.0/input/input8 <6>[ 307.588181] hid-multitouch 0003:16fd:d091.0006: input: usb hid v1.11 mouse [edamak lg ts2009f-usb] on usb-sw-ehci-1.6/input0 getevent -l lists device input device: add device 1: /dev/input/event2 name: "edamak lg ts2009f-usb" add device 2: /dev/input/event5 name: "sun7i-ir" not driver version /dev/inp

Updating/overwriting a file in c without creating a new or temp file -

i writing c code file handling have file format such below: domain1:ip:port:id1,id2,id3 domain2:ip:port:id1,id2, it should possible add new line new domains , should possible modify existing domains id's. , modify id's mean, number of id's can increased or decreased such in 1 operation should able add id4 domain1 in above example , in operation should able delete id1 of domain2 example. so questions (thanks help): i don't want create temp/new file , change name , delete old file. can read , write existing file? how can make secure? (i tried examples updating lines (using fwrite) see remove characters next line when add more characters such id4 , other strange characters in trials) ). sample code? also later need use locking file, 1 should able read , write @ 1 time. suggestions/links appreciated. thanks alot. for appending file don't need temporary file or anything. if want replace characters equal amount of characters, don't need

javascript - What is gulp.src for? -

im trying use gulp prompt : gulp.src('test.js') .pipe(prompt.prompt({ type: 'input', name: 'task', message: 'which task run?' }, function(res){ //value in res.task (the name option gives key) })); im confused gulp.src for? don't have src want prompt user input. gulp.src creates stream of source files perform 'piped' operations on. in example you're asking task perform, means you're asking task perform on file test.js . if want ask task perform, , run 1 or more gulp tasks think you'll need write plain old nodejs application asks input , start gulp [name of task] there.

matrix - Implicit Matrices in Python -

i have matrices in multiplication , 2x2, 2x1 , 2x1. [ b [ e(a1) [ a1 c d ] x f(a2) ] = a2 ] how can calculate a1 , a2 in python ? think use implicit methods how ? i think need use numpy . installing numpy in linux such easy as: $ pip install numpy collecting numpy downloading numpy-1.11.2-cp27-cp27mu-manylinux1_x86_64.whl (15.3mb) 100% |████████████████████████████████| 15.3mb 92kb/s installing collected packages: numpy installed numpy-1.11.2 do root if not in virtualenv . there example of matrices multiplication in interactive python session below: >>> import numpy np >>> = [[1, 0], [0, 1]] >>> b = [[4, 1], [2, 2]] >>> np.matmul(a, b) array([[4, 1], [2, 2]]) numpy best choice if have play mathematics.

c# - Nested Json array in MVC Controller -

pretty silly question ask. not figure out . in c# mvc controller action , need model json array testing purposes. but shows me compilation errors instead of being valid json : var result = { "controllerid": "controller1", "controllername": "controllerone" }; but valid : var scheduleresult = new[] { new { scheduleid = "schedule1",schedulename = "scheduleone"}, new { scheduleid = "schedule2",schedulename = "scheduletwo"} }; why ? also how write nested json array : i tried : var scheduleresult = new[] { new { scheduleid = "schedule1",schedulename = "scheduleone",new[]{ new {doorid="door1",doorname="doorone"}, new { doorid = "door2", doorname = "doortwo" } } }, new { scheduleid = "schedule2",schedulename = "scheduletwo"} }; but shows errors in syntax. ? i need have nested array with

encoding - Regarding Python IDLE Unicode with kivy -

i dealing application needs sort of korean language. had set font root still encoding error when run idle. how fix it? ex39.py code from kivy.uix.widget import widget kivy.uix.behaviors import dragbehavior kivy.app import app kivy.properties import stringproperty class horse(dragbehavior,widget): horse_state=stringproperty('not dragging') def on_touch_move(self,touch): tx,ty = touch.pos sx,sy = self.pos if sx+52>=tx>sx+36 , sy+53>=ty>sy+28: self.horse_state = 'dragging' return super(horse, self).on_touch_move(touch) class ex39(widget): pass class ex39app(app): def build(self): return ex39() if __name__=='__main__': ex39app().run() ex39.kv file code <horse>: size: 100,74 drag_rectangle: self.x+36, self.y+28, 16, 25 drag_timeout: 10000000 drag_distance: 0 on_touch_up: self.horse_state = 'not dragging' canvas: rectangle:

dataframe - R change strings into numeric in a data frame -

i have data frame below , generate data frame replacing characters in dataframe numeric according condition. condition: gd 5 o 4.5 av 3 b 2.5 dataframe: name peter paul mary chan jose nokia b o o gd gd iphone av o o o o moto av av o o av htc b o av av av dput: structure(list(name = c("nokia", "iphone", "moto", "htc"), peter = c("b", "av", "av", "b"), paul = c("o", "o", "av", "o"), mary = c("o", "o", "o", "av"), chan = c("gd", "o", "o", "av"), jose = c("gd", "o", "av", "av")), .names = c("name", "peter", "paul", "mary", "chan", "jose"), class = "data.frame&q

javascript - How to position a popover in Ionic 2 -

how manually position popover in ionic 2? i can't set position in css class, since popover controller sets position inline style. looking through code, there doesn't seem option popover's position. however, when opening popover result of user tapping something, can positioned click event. can use knowledge manual positioning well: let pop = this.popoverctrl.create(mypopover); let ev = { target : { getboundingclientrect : () => { return { top: '100' }; } } }; pop.present({ev}); a few things note: you can set value top , left , or both. the values must given in pixels, numbers. if top or left not given, usual positioning algorithm used value. i'd happy know if there's better way, far best come with.

android - How to show recently added items first in recyclerview -

i'm creating app similar instagram app admin can add contents. used python django backend when add new item django database, comes last on recyclerview. want in way that, when add new item, comes first when open app way instagram shows recent items first. custom adapter class public class dealadapter extends recyclerview.adapter<dealadapter.dealholder> { context context; arraylist<deal> arraylist; public dealadapter(context context, arraylist<deal> arraylist) { this.context = context; this.arraylist = arraylist; } @override public dealholder oncreateviewholder(viewgroup parent, int viewtype) { layoutinflater inflater = layoutinflater.from(context); view v = inflater.inflate(r.layout.deal_cardview, parent, false); dealholder dealholder = new dealholder(v); return dealholder; } @override public void onbindviewholder(dealholder holder, int position) { deal deal = arraylist.get(position); holder.title.settext(deal.gettitle(

c# - Not Getting Updated data when using threading -

in program there 2 method 1 start processing , second end processing. public void startprocessing() { thread.sleep(30000) bool isactive = _repository.findby(s=>s.uid == 1).isactive //linq query } public void endprocessing() { //update data } so when call startprocessing() method wait 30 second , after 30 sec returns data sql. problem when updating data before 30 second, it's not returning me updated data. please give me solution of this. 1)don't reuse context (i assume use ef) in many threads.create new context/repository in each thread 2)don't use threads,use tasks (task parallel library ) i guess findby checks loaded items first,that's why "old" data. if follow "1" problem solved. if not,you don't update user....

javascript - Count length of items in nested js object -

given array this, how count of charts in particular category. each category can have multiple or no groups. { "categories":[ { "title":"category 1", "id":"cat1", "groups":[ { "title":"group 1", "id":"grp1", "charts":[ { "title":"chart 1", "id":"chart1", "type":"line" } ] } ] }, { "title":"category 2", "id":"cat2", "charts":[ { "title":"chart 2", "id":"chart2", "type":"line" }

Get filename without path in Spark DataFrame SQL -

i have spark dataframe, has data parsed xml folder through spark-xml. want add column containing source file, done through input_file_name() function. the problem returns whole path, , want filename. tried registering udf in spark sql, extracts filename, empty columns in end. function works, apparently gets empty values input, , don't understand why. does know issue , how solve it? edit: example if select filename column through df.selectexpr('input_file_name()') path , filename. if define function returning input: def f(path): return path and register through session.udf.register('f',f) , , select column again through df.selectexpr('f(input_file_name())') , empty column. we can register udf return part of string after last "/" , , apply function output of input_file_name() : from pyspark.sql.functions import input_file_name spark.udf.register("filename", lambda x: x.rsplit('/', 1)[-1]) df.selecte

c# - I need a responsive grid (cell can be clicked) on the form, what control should be used? -

i need show grid on form, displays 32 32 cells, each cell can clicked operation(like windows calendar app). i'v considered buttons , panels, that'll 1024 controls. better way? here's way create responsive grid buttons in wpf: the responsiveness created gridlength(1, gridunittype.star) mainwindow.xaml.cs public partial class mainwindow : window { public mainwindow() { initializecomponent(); (int x = 0; x < 32; x++) { buttongrid.columndefinitions.add(new columndefinition { width = new gridlength(1, gridunittype.star) }); buttongrid.rowdefinitions.add(new rowdefinition { height = new gridlength(1, gridunittype.star) }); (int y = 0; y < 32; y++) { var bt = new button(); bt.content = x + "" + y; grid.setrow(bt, x); grid.

node.js - Can't see data in my local mongodb but there is no errors and login works fine -

i using nodejs , created login system using passport. here user shema: var userschema = mongoose.schema({ local: { username: string, password: string } }); use url connect local mongodb: module.exports = { 'url' : 'mongodb://localhost:27017/loginuser' } thing when register user , try login , logout works when try find loginuser database using mongo shell can't see @ all. can guide me why?

How to get nth jQuery element -

in jquery, $("...").get(3) returns 3rd dom element. function return 3rd jquery element? why not browse (short) selectors page first? here is: :eq() operator. used get() , returns jquery object. or can use .eq() function too.

MSVS c++ 2010 Allocated and free memory spend a lot of time -

i can´t figure out why when try allocated , free memory through msvs 2010 c++ these actions spend lot of time, between 200-300 ms, whereas when if try run same application out of msvs 2010 spend 0-1 ms. i checked project configuration seems ok. anyone can me ? advanced thanks

git - How to resize the remote repository without deleting all the commit history? -

there several related question on stackoverflow (a few linked below) not solve particular problem. i share repository co-workers have pushed huge datafiles/images increased size of remote repository 14 gb. later on, these files got deleted using rm filename resized local repositories reasonable size. however, when check online, repository's size still 14 gb. what tried reduce repositories size suggested here : git reflog expire --expire=now --all git gc --aggressive --prune=now but affected local repository's size. the answers here did not either since files not deleted on own computer on co-workers' ones. what have not tried yet, might work delete commit history described here . however, keep commit history , rid of garbage created rm filename on machines not own. is there solution (getting rid of garbage created on other local machines decrease size of remote repository) without removing commit history? edit: in @torek's link in comments, fo

html - CSS for input[type="submit"] -

before start crying, please explain why none of attempted css soltions styling submit button have effect @ all? i've gone font-size: 50px make obvious if hit right element, haven't yet: input[type="submit"].wysija-submit { border-radius: 10px; border: none; box-shadow: none; font-family: inherit; font-size: 50px!important; } .wysija-submit input[type="submit"] { border-radius: 10px; border: none; box-shadow: none; font-family: inherit; font-size: 50px!important; } .wysija-submit.wysija-submit-field input[type="submit"] { border-radius: 10px; border: none; box-shadow: none; font-family: inherit; font-size: 50px!important; } <input class="wysija-submit wysija-submit-field" type="submit" value="sign-up">

r - Substring in Corpus in tm package -

i have created corpus using following command: corpus_map <-vcorpus(vectorsource(classified_narr_sel$narration)) corpus_map <- tm_map(corpus_map, removenumbers) the above command removes numbers corpus. there command such can sub-string words of corpus? eg: "travelling" should converted #to substring of 3 letters "tra". normally, use substr("travelling",1,3) but want same thing corpus in tm you can write function conversions want , run on corpus, example: convertstrings <- function(textinput){ textoutput <- gsub("travelling", "tra", textinput) textoutput <- gsub("furtherwords", "further", textoutput) #... return(textoutput) } corpus_transformed <- convertstrings(corpus_map)

c++ - How do I access USB with Electron? -

my systemenvironment: windows 10 visual studio 2015 (including c++ compiler tools) , node.js installed i tried include node library electon-quick-start-project , failed. first of tried electron-usb include electron-usb. you can found problem here . unfortunately couldn't solve it. therefore tried include usb. found how here did every step according description: npm install --save usb changing variables property in node_modules/usb/binding.gyp include module_name , module_path electron-gyp node-gyp rebuild --target=0.26.0 --arch=ia32 --dist-url= https://atom.io/download/atom-shell when executed rebuild command, got build error: error c2011: 'timespec': 'struct' type redefinition (compiling source file ..\libusb\libusb\core.c) . same error in different files. i included have_struct_timespec in project-files. didn't work either afterwards. now ask myself, easiest , best way access usb electron? library can recommend? know complete tutorial i

c# - Regex for integers delimited by commas -

i need regex allows integers (positive , negative) delimited comma 2,-3,4 , comma should in middle of 2 integers, not @ start or end or 2 consecutive commas 23,34,,4 . currently have this: regex regex = new regex(@"^\d{1,10}([,]\d{10})*$"); if (!regex.ismatch("123,34,2,34,234")) but doesn't seems match thing rejects valid inputs 123,34,2,34,234 can please point out wrong above regex. the \d{10} subpattern matches 10-digit chunks. you need allow 1 10 {1,10} (or 1 , more + ) with @"^\d{1,10}(?:,\d{1,10})*$" or @"^\d+(?:,\d+)*$" note use of non-capturing group (?:...) not store submatches, , meant group sequence of subpatterns. see regex demo edit: allow matching negative values, add optional - : @"^-?\d+(?:,-?\d+)*$" ^^ ^^ see another regex demo .

html - css for different screen resolutions? -

if check html on 2 different systems different resolutions view distorted. is there way of calculating screen width , height @ run time ? i lack experience css did research , found : https://css-tricks.com/css-media-queries/ but there suggesting different classes .(if not wrong) my question possible height , width @ run time , use 1 css ? something : .view { min-width :"some how gets computed:which device using ?" min-height :"some how gets computed:which device using ?" } media queries choice problem. you don't have use different classes these, have define different behaviour based on resolution. you can know screen height , width javascript, css, dont think possible. best can css define range of devices in mobiles, tablets, laptops, large screen devices , based on media queries can define class on type of device. have below example: /* mobile */ @media screen , (max-width: 540px) { .view { width: 400px; } }

javascript - How to make a component load other components and its related files -

Image
i trying create app using angularjs 1.5, trying architect app, far been fun , interesting. i have 2 components, 1 of them "chart" , other component "dashboard". chart suppose part of dashboard not sure how embed chart in such way dashboard becomes resposible loading chart , related files template, controller, style sheets etc. index.html <html> <head> <style> td{ border: 1px solid black; } </style> </head> <body ng-app="hellosolarsystem"> <a ui-sref="dashboardpage" ui-sref-active="active">dashboard</a> <a ui-sref="about" ui-sref-active="active">about</a> <ui-view></ui-view> <script src="//npmcdn.com/angular@latest/angular.js"></script> <script src="//npmcdn.com/angular-ui-router@1.0.0-alpha.4/release/angular-ui-router.js"></script>

c++ - C++11 Create compile time boolean expression with variadic template arguments -

let have following base struct struct functor { virtual bool execute()=0; }; on base created structs a, b , c. want evaluate boolean expression on variadic list of these objects @ runtime this: bool evaluate(list<functor> objs) { for(list<functor>::iterator = objs.begin(); it!=objs.end();++it) { if(!it->execute()) return false; } return true; } my question can having function declared this template<typename ...f> static bool doevaluation(f... args) { return... args->execute(); } and executing this doevaluation(new a(), new b(), new c()); in end @ compile time? return new a()->execute() && new b()->execute() && new c()->execute(); you can implement after, follows: #include <functional> // overload single argument template <typename t> constexpr bool check(t&& f) { return f(); } // extract first parameter recursively call self others templ

Read 3 variables on the same line C# -

this question has answer here: is there equivalent 'sscanf()' in .net? 8 answers i have question. work on console application , read 3 variable on same line. with language c can write this int a; string b; int c; scanf("%d %s %d", &a, &b, &c); when start program write : 1+1 on same line , = 1 b = "+" c = 1 how can make same in c# console.readline() ? thank in advance, nico this answer modified reading 2 integers in 1 line using c# . can several ways described in answer, suggest like: //read line, , split whitespace array of strings string[] scanf= console.readline().split(); //parse element 0 int = int.parse(scanf[0]); //parse element 1 string b = scanf[1]; //parse element 2 int c = int.parse(scanf[2]); i suggest following link there more ways described.

Jquery print() not showing color in google chrome print prview -

i using code print option on web page $(document).on('click','.print_report',function(){ $(this).closest('.blockone').print(); }); but display black , white content. try inline color style show black , white. how make page print in color?

sql - Deleting the row in php -

i have create database (student) , table(details) in sql, fields name,class,section,address,mobile. need delete selva row in table,i can't delete please explain!! php code- <?php $connection = mysql_connect('localhost', 'root',''); if (!$connection) { die("database connection failed" . mysql_error()); } $select_db = mysql_select_db( "student",$connection); if (!$select_db) { die("database selection failed" . mysql_error()); } ?> <?php if(isset($_get['did'])) { $delete_id = mysql_real_escape_string($_get['did']); $sql = mysql_query("delete details name = 'selva' "); if($sql) { header("location: table1.php"); } else { echo "error"; } } ?> please explain ! how delete row in table database. your mysql query proper need check below condition satisfied or not. if(isset($_get['did'])) { echo 'debug test';exit; }

laravel - SSL connection error - Connection reset by peer - On Homestead machine -

we have application using recaptcha, application works without problems on production environment, on mine new development homestead machine, following error: file_get_contents(): ssl: connection reset peer i have troubles using composer, there following error: [errorexception] zlib_decode(): data error i think both errors related ssl. do miss something, have configure cacerts hand? the problem related virtualbox mentioned here . after downgrade of osx (sierra 10.12.1) virtualbox 5.1.8 5.1.6, problem solved.

Clearing internal Octopus events during migration -

we're migrating octopus data 1 server another, , during import on destination server exception thrown. complains old project references in of events found in events folder. is considered safe erase content of folder prior import? additional info: exporting octopus 2.x 3.5.1. copied output: the resource 'deploymentprocess-projects-141' not found. octopus.core.persistence.resourcenotfoundexception: resource 'deploymentprocess-projects-141' not found. @ octopus.core.relationalstorage.relationaltransaction.loadrequired[t](string id) in z:\buildagent\work\cd33152532ae115f\source\octopus.core\relationalstorage\relationaltransaction.cs:line 93 @ octopus.migrator.importprocess.importcontroller.importscript(importcontext context, string scriptfile) in z:\buildagent\work\cd33152532ae115f\source\octopus.migrator\importprocess\importcontroller.cs:line 557 @ octopus.migrator.importprocess.importcontroller.importscripts(importcontext context) in z:\buildagent

java - Cannot add to layout constraints must be a gridbagconstraint -

i need use gridbaglayout below error. can please help? java.lang.illegalargumentexception: cannot add layout: constraints must gridbagconstraint @ java.awt.gridbaglayout.addlayoutcomponent(unknown source) @ java.awt.container.addimpl(unknown source) @ java.awt.container.add(unknown source) @ havuzaracıformu.(havuzaracıformu.java:221) @ havuzaracıformu$1.run(havuzaracıformu.java:47) @ java.awt.event.invocationevent.dispatch(unknown source) @ java.awt.eventqueue.dispatcheventimpl(unknown source) @ java.awt.eventqueue.access$500(unknown source) @ java.awt.eventqueue$3.run(unknown source) @ java.awt.eventqueue$3.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.security.protectiondomain$javasecurityaccessimpl.dointersectionprivilege(unknown source) @ java.awt.eventqueue.dispatchevent(unknown source) @ java.awt.eventdispatchthread.pumponeeventforfilters(unknown source) @

installing numpy on a python 2.7 with system windows 8.1 -

i'm working on code run in abaqus. need in code use numpy module. have python 2.7.11 on computer. have installed on windows 8.1. have downloaded numpy-1.11.zip already. easy detailed guide installing on python thank you! if have pip installed on system, execute pip install numpy

javascript - Typescript: Property does not exist -

i'm trying develop decorator rest api interfaces in typescript. here decorator implementation export function remoteresource(params: any): function { console.log("remoteresource.params: ", params); return function (target: function) { //--post target.prototype.post = function () { console.log("----post"); }; //--get target.prototype.retrieve = function () { console.log("----get"); }; //--delete target.prototype.remove = function () { console.log("----delete"); }; //--pull target.prototype.update = function () { console.log("----pull"); }; console.log("remoteresource.target: ", target); return target; } } now, can use decorator @remoteresource , methods post|retrieve|remove|update added original object prototype correctly. @remoteresourc

r - Rstudio (version 1.0.44) printing plots takes a lot longer than previous versions -

i installed new rstudio 1.0.44 on windows 7 64 bits. upgraded r 3.3.2 @ same time. now, rendering of complex ggplot figures taking lot longer in previous version. problem quite noticeable when using transparency (alpha) parameters. i've getting plots have rendered , getting following warning: warning message: in names(gp) : reached elapsed time limit any insights on great. thanks it seems there have been several reports of general performance decreases recent rstudio releases, of may have been resolved in daily builds, can find here before reach stable release: https://dailies.rstudio.com/

html - JQuery UI Sortable Element not moving according to mouse -

i using jquery ui sortable. working fine except when drag element element element not moving according mouse pointer. pointer goes first , when pointer stops element comes pointer position. doing wrong or there setting this. code following: jquery( "#test1" ).sortable({ start:function(event, ui) { $("#test2").css('background-color','#ebf2f9'); $("#test2").css('border','2px dashed #3b73af'); $("#test3").css('background-color','#ebf2f9'); $("#test3").css('border','2px dashed #3b73af'); }, over: function(event, ui) { var parent_id = ui.item.parent().attr('id'); if(parent_id != "test1") { $("#test1").css('background-color','#f3f9f4'); $("#test1").css('border','2px dashed #14892c'); }

c# - How to map ImmutableArray without getting it cast to IEnumerable which is not thread safe? -

so i'm working in multithreaded environment , wan't use immutablearray time because it's thread safe. unfortunately, immutablearray implements thread unsafe interfaces , select method linq returns ienumerable. this way, thread safe variable becomes thread unsafe. how map immutablearray immutablearray? it seems there lot of misunderstandings behind question. need go @ source code select method , learn yield keyword. second, linq methods made short-lived. have various threads doing various processing tasks. using pipeline situation, want transform data in 1 thread , pass result thread? have careful yield keyword in situation; essentially, need flush (er, realize, lack of better word) collections before passing them next thread actual work done in present thread. in scenario, object ownership kicks in , don't need thread-safe collections. in short, enumerable returned calling select on immutablearray thread-safe. can realize @ point , won't gi

adoconnection - How to set Application Name property of a TADOConnection in Delphi? -

i have delphi app connects ms sql server using tadoconnection. need set "application name" property of tadoconnection (so seen on db select distinct program_name sys.sysprocesses query). tadoconnection not have applicationname property. instead internally assigns application executable name (which can seen query above). how set "application name" property of tadoconnection connection ms sql database? "application name" property (and others) can set so: adoconnection1.properties['application name'].value := 'myappname';

Thin Plate Spline for 3D surface prediction in R -

Image
i tried answer get surface plot in r but hasn't helped. perform tps (using tps fields{}) on xyz dataframe xy co-orinates , z thickness. visualise plot firstly before tps , after tps..? possible. extract predicted thicknesses given set of new xy co-ordinates..? please let me know if possible my dataframe looks this, dataframe called lsp: time part meas partsub xloc yloc xxxx 1 1.956 -3465 -94350 xxxx 1 1.962 -3465 -53850 xxxx 1 1.951 50435 -40350 xxxx 1 1.958 -57365 -40350 so tried this: lsp.spline <- tps(lsp[,5:6], lsp$meas) out.p <- predict.surface(lsp.spline, xy = c(1,2)) plot.surface(out.p, type="p") but out.p null..? so attempting plot gives me: error in nrow(z) : argument "z" missing, no default any appreciated. paul. predict.surface obsolete / deprecated function. use predictsurface instead. fit<- tps( bd[,1:4], bd$lnya) # fit

javascript - Rotating the highchart -

im having following code <!doctype html> <head> <title>shipment tracker</title> <script type="text/javascript" src="file:///android_asset/jquery.min.js"></script> <script type="text/javascript" src="file:///android_asset/highcharts.js"></script> <script type="text/javascript" src="file:///android_asset/highcharts-3d.js"></script> <script> function loadshipment(){ $(function () { $('#container').highcharts({ colors:['#f58835','#f32d2b',], chart: { type: 'column' },options3d: { enabled: true, alpha: 15, beta: 15, depth: 50, viewdistance: 25 },title: { text: 'shipment