Posts

Showing posts from February, 2015

javascript - How do I combine input type date and input type time in one -

i have angularjs ui asks user input date , time. want combine 2 in 1 date type can send rest api. how do it? my html code <div class="col-md-7"> <input type="date" id="exampleinput" ng-model="uicontroller.jobdatamodel.date" placeholder="yyyy-mm-dd" required/> <div class="col-md-7"> <input type="time" id="exampleinput1" ng-model="uicontroller.jobdatamodel.time" placeholder="hh:mm:ss:" required/> how do in controller ? should concatenate 2 ng- models? no need add input field, can use 1 input field both date , time, here code <html> <head> <title>user input</title> <link rel="stylesheet" href="styles.css"> <script src="https://code.angularjs.org/2.0.0-beta.0/angular2-polyfills.js"></script> <script src="https://code.angularjs.

How to open a new pdf file in a new browser tab with iText Java -

this question has answer here: open pdf file in new window using servlet 2 answers i'm pretty sure it's gonna easy solution can't find issue. i'm creating pdf file , @ moment users have save before opening it. have open before user decides save or not. can't find how tell itext open in new tab. sould do? here code, call method right after "document.close();" : public void openpdf(string nomdoc, string nomfichier) throws ioexception { facescontext facescontext = facescontext.getcurrentinstance(); externalcontext externalcontext = facescontext.getexternalcontext(); httpservletresponse response = (httpservletresponse) externalcontext .getresponse(); // file file = new file(getfilepath(), getfilename()); file file = new file(nomfichier); bufferedinputstream input = null; bufferedoutputstream ou

Shortcut to the command prompt in VisualStudio Code -

Image
in visualstudio code, there keyboard shortcut jump command prompt in debug mode? tiresome have click @ prompt mouse every time. edit 1 using binding workbench.debug.action.focusrepl results in following error: if debug console closed, there view: debug console ( workbench.debug.action.togglerepl ) open it. 1 bound cmd+shift+y on macos, should ctrl-shift-y on windows / linux. if debug console open, can either press aforementioned shortcut twice or use following command: debug: focus debug console it has no default shortcut, can bind whatever like, action called: workbench.debug.action.focusrepl

xamarin - There is no open() method for my DriveFile object -

i'm frustrated @ point due lack of documentation of google drive api , i'm using xamarin makes things worse. i've installed xamarin.googleplayservices.drive package , it's working properly. fast forward problem, query files , can driveid . so code is: drivefile file = driveid.asdrivefile(); //and here want use method file.open(...); the methods drivefile object has available default object methods e.g. tostring() , equals() , gettype() , gethashcode() . doing wrong, why can't access method since others have no problem accessing it. google says must use it: https://developers.google.com/drive/android/files this guy using xamarin has no problem using method: xamarin: unsure cast using drivefile.open any appreciated. have access metadata of files if helps (to download using method) i found solution problem. confusing name of classes. drivefile name of enum-like class of types of operations. idrivefile interface actual interface contains o

sql server - Please help correct this cursor SQL -

declare @abc varchar(max); declare @useipdtaskdeadline int = 1; declare tocreatetaskcursor cursor totaltask ( select abc table1 ) select abc totaltask read open tocreatetaskcursor fetch tocreatetaskcursor @abc while @@fetch_status = 0 begin -- @@fetch_status = 0 print '' begin transaction; if (@useipdtaskdeadline = 1) print 'updates completed'; end if (@useipdtaskdeadline = 0) print 'updates completed'; end; commit transaction; fetch tocreatetaskcursor @abc end -- @@fetch_status = 0 close tocreatetaskcursor deallocate tocreatetaskcursor this throws errors: msg 102, level 15, state 1, line 117 incorrect syntax near ';'. msg 156, level 15, state 1, line 126 incorrect syntax near keyword 'close'. please tell me incorrect ? have tried lot cannot make work. there issue if else syntax ? using sql server. i have tried many if else syntaxes cann

android - Zomato API: How to include multiple establishments in the search? -

when want search have generate url https://developers.zomato.com/api/v2.1/search? lat=latitude &lon=longitude &radius=radius &establishment_type=establishment ids &category=3%2c10 you can filter putting multiple categories (in case, put "3,10") whenever same establishment types, it's api ignored , showed results get. is there way filter results using multiple establishment ids? zomato api follows methodology user can search 1 establishment type @ time. on contrary, can select/call multiple cuisines api app/web. your suggestion appreciated :)

How can I know that Android app reconnected to Socket.io? -

i have android application connects socket , emits connectiondata event on oncreate method. // connect socket private socket socket; { try { socket = io.socket(appconfig.url_socket_io); } catch (urisyntaxexception e) { log.e(log_tag, "error"); } } @override protected void oncreate(bundle savedinstancestate) { // emit connect , connection data socket socket.connect(); socket.emit("connectiondata", currplayer.getplayerid()); } on server side, there activesockets hashmap stores <connectiondata, socket> data. when internet connection lost in app, server catches disconnect event , removes socket hashmap. , when app reconnects internet, connects socket well, app doesn't emit connectiondata anymore happens once activity created. how can detect app reconnected socket on client side can emit connectiondata again? add event listener: socket.on(socket.event_connect, new emitter.listener() { @ove

Filter Firebase data Swift -

i want load every image of type modern on firebase swift. how can it? here's data model: "arts" : { "-kw5plrmdfmga9pultg3" : { "description" : "title ", "height" : 25.36023, "imageurl" : "https://firebasestorage.googleapis.com/v0/b/medici-b6f69.appspot.com/o/arts%2fj7u039fn6yckdbq7kgejkuzdo2i3%2f26ddc192-c081-4588-bd52-2841fa3ef507?alt=media&token=e828936c-5341-4429-94e9-c3aefa81769b", "postdate" : 1478657252917, "title" : "title ", "type" : "modern", "width" : 25.99424 } here's tried. it's not working. database.child("arts").queryordered(bychild: "modern").observe(.value) { (snapshot: firdatasnapshot) in self.posts = [] if let snapshot = snapshot.children.allobjects as? [firdatasnapshot] { print("snapshot: \(snapshot)") snap in snapshot {

spring-cloud-stream: Stream deployments fail on spring-cloud-dataflow-server-cf -

in our use-case need create , deploy message stream application our private cloud foundry environment. stream application meant listen on rabbitmq queue , trigger task, defined in stream. to achieve same, using cloud-dataflow-server-cloudfoundry running locally on mac. below set of commands used achieve it:- set maven remote repo export maven_remote_repositories_repo1_url=https://ftl.abc.com/nexus setup cloud foundry destination - export spring_cloud_deployer_cloudfoundry_url=https://api.paas.abc-intl.com/ export spring_cloud_deployer_cloudfoundry_org=paas-apps export spring_cloud_deployer_cloudfoundry_space=dev export spring_cloud_deployer_cloudfoundry_domain=paas.abc-intl.com export spring_cloud_deployer_cloudfoundry_username=abc@xyz.com export spring_cloud_deployer_cloudfoundry_password=password export spring_cloud_deployer_cloudfoundry_skip_ssl_validation=true export spring_cloud_deployer_cloudfoundry_stream_services=rabbitmq_server export spring_cloud_deployer_cloud

javascript - Troubles with animation svg mask (crossbrowser) -

i have trouble cross browser svg mask animation. explain behaviour in firefox, ie , webkits? , of course me please without special libs. html: <svg class="svg-defs"> <defs> <mask id="mask"> <circle r="10" cx="150" cy="150" class="c-mask-circle animation" id="cmc"/> </mask> </defs> </svg> <svg width="900" height="300">> <g mask="url(#mask)"> <image xlink:href="http://wonderfulengineering.com/wp-content/uploads/2016/01/los-angeles-wallpaper-37-1024x640.jpg" x="20" y="50" width="300" height="200" /> </g> </svg> css: .svg-defs {position: absolute;width: 0;height: 0;} .c-mask-circle { fill: white; stroke: white; stroke-width: 1; } .animation{ animation: stroke-width 10s; } @keyframe

ios - UIImagepicker navigates to superview not to the subview containing UIimagpicker -

on viewcontrollera have added few uiviews , viewcontrollerb's view asubview. viewcontrollerb has imagepicker. after picking image navigates viewcontrollera. how can return viewcontrollerb without disturbing other views? -(void)changeimage:(id)sender {uiimagepickercontroller *picker=[[uiimagepickercontroller alloc]init]; picker.delegate=self; picker.allowsediting=yes; picker.sourcetype=uiimagepickercontrollersourcetypecamera; [self presentviewcontroller:picker animated:yes completion:null]; } add viewcontroller b viewcontroller a. in vc a: swift 3: instanceofvcb.willmove(toparentviewcontroller: self) addchildviewcontroller(instanceofvcb) view.addsubview(instanceofvcb.view) // add desired contraints instanceofvcb.view instanceofvcb.didmove(toparentviewcontroller: self) obj-c: [instanceofvcb willmovetoparentviewcontroller: self]; [self addchildviewcontroller: instanceofvcb]; [self.view addsubview: instanceofvcb.view]; // add desired cont

mysql - Getting number of rows inserted for ON DUPLICATE KEY UPDATE multiple insert? -

i have large table primary key of binary(20) . the table has around 17 million rows. every hour cron job tries insert many 50,000 new entries table on_duplicate_key_update syntax. each insert in cronjob 1,000 values (multiple insert). how can number of rows inserted table query? cannot row count before , after there around 17million rows , query expensive. in manual mysql says row inserted affected number of rows 1 , updated field 2 , meaning in 1000 insert on duplicate key update query have affected rows ranging 1000 - 2000, have no way of telling how many records inserted number? how can overcome this? thanks the number of inserts 2000 minus number of affected rows. more generally: (numberofvaluesininsert * 2) - mysql_affected_rows()

ios - SiriKit: Invalid Siri Support - No example phrase -

i have uploaded itunes connect app uses sirikit. didn't need special sentence didn't add appintentvocabulary.plist i received email saying: invalid siri support - no example phrase provided insetmessageattributeintent in "en" language invalid siri support - no example phrase provided insearchformessagesintent in "en" language invalid siri support - no example phrase provided insendmessageintent in "en" language i've read online have localize appintentvocabulary.plist didn't create it. can't find solution. shall localize english language info.plist? thanks from apple documentation, appstore give warning if appintentvocabulary.plist not defined. note it recommended provide global vocabulary file app , use specify 1 or more example phrases each of app’s supported intents. although global vocabulary file not required, app store issues warning apps declare siri support not include sample phrases

PUT and POSTS AS Cron commands PHP Laravel 5 -

i have put api calls methods in model class. basic commands create() read() search() store() etc. for start made these in controller class , i'm trying move logic controller commands can run scripts daily cronjob. reason wont work commands. because cant use put post calls cronjobs? since seams read functions works fine puts , posts won't work. and if cant use put , post in crons, there workaround this? here example code public function handle() { $mymodel = new mymodel; $thing = array( "title" => "my title", "user_id" => 12345, "org_id" => 54321, ); $returned_id = $mymodel->create($thing); } public function create($thing) { $api_token = "xxxx"; $url = "https://api.api-site.com/thing?api_token=" . $api_token; $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curl

angular ui bootstrap - how to close modal after submit in angularjs -

i know have many result in question no 1 give work answer me. html 1: <button class="basebtn logbtn" ng-click="openlog()">login</button> <button class="basebtn regbtn" ng-click="openreg()">sign up</button> html 2: <div ng-controller="main"> <center><img class="img-login" ng-src="../images/form-logo.png"/></center> <form class="login" name="log" ng-submit="login()" novalidate> <div class="form-group login-form" ng-class="{'has-error' : isinvalid(log.email) ,'has-success' : isvalid(log.email)}"> <input type="email" class="form-control" name="email" ng-model="user.email" required placeholder="email"> <div class="alert alert-danger" role="alert" ng-show="isinvalid(log.email)"&g

asp.net - Problems sending emails from forum -

i have been redesigning site has message board, has been written guy looked after site. it has few problems , written in .asp , uses .mdb files database. you can see whole thing here . feel free post if helps, test thing have set using original files , new database. the basic problem when posts message, supposed email sent them, have posted it. when replies, originator supposed message, replier has been posted. i’d have thought @ point in process there should script/file in postmessage.asp? the postmessage.asp page below. <% option explicit %> <!-- #include virtual="common/adovbs.inc" --> <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1252"> <meta name="generator" content="microsoft frontpage 4.0"> <meta name="progid" content="frontpage.editor.document"> <title>new page 2</title> <base target="_self"

Geolocation issue with Speed -

i trying display user's location , speed on map. code correctly display location displays speed if first move map centre user's location. prefer not move map , want display speed location. am missing in code below? function showposition(position) { speedlat = (position.coords.latitude).tofixed(3) speedlng = (position.coords.longitude).tofixed(3) rawspeed = position.coords.speed; //rawspeed = 2.2352; // test figure of 5 mph speedmph = (rawspeed * 2.2369362920544).tofixed(2); // conversions m/s speedkph = (rawspeed * 3.6).tofixed(2); speedknts = (rawspeed * 1.9438444924574).tofixed(2); mph = "speed in mph: " + speedmph; // set display results kph = "speed in kph: " + speedkph; knt = "speed in knots: " + speedknts; document.getelementbyid('showmph').innerhtml = speedmph; // populate popup results document.getelementbyid('showk

Why git rebase shows conflicts in the files I did not modify? -

let's on local repo , branch my_name/branch_a when git rebase <branch_b> , many conflicts in files did not modify. why happen? head of files branch_b except ones modified in my_name/branch_a . how can done without manually resolving these conflicts did not introduce myself. rebase copies commits (and abandons originals). root of problem. let's @ example. first, note i'm drawing commit graphs older commits towards left, , newer commits towards right. commits have single-letter names here, instead of git's true 40-character hash names f1c93ab7... . branch names appear on right, arrow pointing tip commit of branch, because how git stores these things. your current branch name my_name/branch_a , , have branch named branch_b well. there commits on each branch not on other branch, , commits on both branches. meanwhile branch, my_name/branch_a , forks off third point—so there commits on branch not on branch_b , not "your commits"

javascript - Internal server error- date malformed -

i working backbone js , oracle db. application date in dump 15/04/16 , i've created form using js when click on submit getting following error. top of stack : org.springframework.http.converter.json.abstractjackson2httpmessageconverter.readjavatype(abstractjackson2httpmessageconverter.java:224) **** bottom of stack : org.joda.time.format.datetimeformatter.parselocaldatetime(datetimeformatter.java:900) **** exception invalid format: "15/04/2016" malformed @ "/04/2016" **** stack trace the date format not valid. joda-time api used default locale format in jvm. have parse input date. can use part of code //input date string input = "15/04/16"; //cast input joda datime datetime dt = datetimeformat.forpattern("dd/mm/yy").parsedatetime(input); //use tostring method take format string needed string output = dt.tostring(format_date); //output date system.out

java - JasperPrint opens a dangerous tray icon on Mac that may kill Tomcat -

Image
i have problem accounting web application enhanced printing using jasper reports. being accounting application, has been decided being deployed accountant's workstation mac book pro laptop regular backups of mysql database. installing on serious server machine out of question. the user has java8 / tomcat8 stack , runs server command line. application worked fine until now. every time user prints report using jasper (code later), tray icon open displaying java control panel icon. clicking on icon nothing, annoying. see window (from finder top bar) called bootstrap . no menu action except exit available. clicking exit kills tomcat server. code follows: @override public byte[] generatereportpdf(list<?> dtos, string jasperfilename, locale locale) { bytearrayoutputstream bytearrayoutputstream = new bytearrayoutputstream(); try { jasperprint jasperprint = createjasperprint(dtos, jasperfilename, locale); jrpdfexporter exporter = new jrpd

is there any way to replace only last segment of url in codeigniter -

i having 5000 records , display 100 records on each page , 100 records using 2 links (next , previous). next anchor tag giving controller path - www.website.com/controller/ function/range_of_records. at first time when click on next link 100 records display when click second time on next link url become - www.website.com/controller/function/range / controller / function /range . so gives error . want change 3 segment of url change range segment. please me.

sql - Converting Oracle queries to MSSQL queries dynamically -

i have alot of queries written in oracle , wish convert them mssql queries. (not database migration, actual query query) is there , easy way on large sum of queries? 1 1 nice. thank you. i haven't seen such tool. should possible accomplish using stored procedure.

sonarqube - Unable to get size metrics data on sonar dashboard for a newly written custom plugin -

we using sonar 4.3.3 , have created new text plugin scans files .sh , .psr files , tell violations present in them.problem when sonar-scanner command runs , results uploaded in sonar dashboard violations shown in "wrv rules compliance" size metrics tells lines of code , files / directories etc information having no data. it observed if put dummy java or c file in folder , again run sonar-scanner command size metrics shows data.though lines of code correspond 1 present in java / c file while files & directory information considers new .sh , .psr files well. please guide these metrics (lines of code / lines /files /directories/classes etc) calculated @ plugin side or sonar framework ? moreover, going forward how should approach solve problem.

Visual Studio 2015 search only in literal strings that span multiple lines -

i working on problem got sent request contained data shouldn't have, , party have sent claims our logging system 'logged incorrectly'. our logging mechanism first thing captures request , after column request stored in database shouldn't touched anywhere. using dapper search column usage genius gave name [request] brings 10k results when searched have tried looking [request] in brackets noting comes up. our dapper sqls stored in multiline sql files in plain code (multi , single line). i tried looking regex since sqls multi-line nothing useful came up. how search multiline literals in visual studio 2015?

How to commit version update of child modules in a multi-module maven project? -

in multi-module maven project set versions in parent pom need execute: mvn versions:set -dnewversion=<version_to_set> then update version of parent in child modules need execute: mvn -n versions:update-child-modules the above 2 commands create files name pom.xml.versionsbackup besides original pom.xml. commit version update need execute: mvn versions:commit which deletes pom.xml.versionsbackup file parent pom.xml, not child modules. how can delete pom.xml.versionsbackup files pom.xml of child modules?

javascript - can't read selected in rangeselector highchart -

i have problem rangeselector, want input datepicker, datepicker show in menu highchart, after click date in datepicker. input date not select. here code: $(function () { $('#project').highcharts({ chart: { type: 'column', margin: 75, options3d: { enabled: false, alpha: 10, beta: 25, depth: 70 } }, title: { text: 'chart', style: { fontsize: '18px', fontfamily: 'verdana, sans-serif' } }, rangeselector: { enabled: true, selected: 1, inputdateformat: '%y-%m-%d' }, subtitle: { text: 'project', style: { fontsize: '15px'

bigdata - Flume takes time to upload a file to HDFS -

i need assistance regard checking why flume take time upload flatfiles hdfs. tried uploading 1 file (10mb size) however, 17 hours has past it's still uploading ".tmp". when checked log details, seems it's stuck in channel: nov 10, x:xx:xx.xxx pm info org.apache.flume.channel.file.logfile closing randomreader /data5/flumedata/log-1 nov 10, x:xx:xx.xxx pm info org.apache.flume.channel.file.logfile closing randomreader /data5/flumedata/log-2 nov 10, x:xx:xx.xxx pm info org.apache.flume.channel.file.logfile closing randomreader /data5/flumedata/log-3 nov 10, x:xx:xx.xxx pm info org.apache.flume.channel.file.logfile closing randomreader /data5/flumedata/log-4 nov 10, x:xx:xx.xxx pm info org.apache.flume.channel.file.logfile closing randomreader /data5/flumedata/log-5 nov 10, x:xx:xx.xxx pm info org.apache.flume.channel.file.logfil

c# - Adding the same entity object to SQL server database -

im trying add same object table using loop job entity may required more once. tried way first saves 1 record. (int = 0; < required; i++) { _context.jobs.addobject(n); } then tried way thinking entity framework might not see objects being different. (int = 0; < required; i++) { if (i > 0) { job additionaljob = new job(); additionaljob = n; _salescontext.jobs.addobject(additionaljob); } else { _context.jobs.addobject(n); } } the database saves on record. on appreciated. classes reference types. ever n setting additionaljob it, same thing. classes use pointers space in memory doing making 2 pointers. when add record ef adding same da

Jmeter Loop controller is not sending all the request given in loop count -

i have simple scenario: thread group - 1 user sign in - http sampler sign in - loop controller - count 10 - http sampler check page as per logic, working fine 1-time sign in, 10 times check page. but if give same 10 users sign in, 100 times check page, not sending requests server. it sent around 60 70 request check page. other requests not sent jmeter. server side cpu usage getting 100%, restricting jmeter send request further? scheduler configuration set duration of 600 seconds causing test stop before iterations completed, still running. removing scheduler configuration resolved issue , iterations ran. note: issue identified after long discussion in chat user. question may not contain details. following of configuration did in thread group: duration field: ${__p(duration,600)} delay : ${__p{delay,0}} removing them resolved issue.

javascript - extjs 3.2.1 chart is not displaying -

i creating pie chart in 3.2.1. , adding chart field set. not displaying chart field set. blank white page displaying. , in console "uncaught typeerror: error #1007" error showing. here code- createchart: function(node, fieldsetid, kwtags) { var store = new ext.data.jsonstore({ fields: ['name', 'data'], data: [{ "name": "item-0", "data": 5 }, { "name": "item-1", "data": 7 }, { "name": "item-2", "data": 3 }, { "name": "item-3", "data": 6 }, { "name": "item-4", "data": 2 }, { "name": "item-5", "data": 8 }] }); var chart = new ext.chart.chart({ width: 2

unicode - Detect if bytes object represent a PDF document in python -

i have list of bytes objects, can either : a text (on know encoding) a pdf document a zip document if can't decode bytes object, using like: <bytes object>.decode(encoding) clearly not text. fine, can handle exception. but how can detect if pdf or zip document ?

python - Pandas: wrong merge dataframes -

i have df id qsex age ranges month region rucitysize counts 00102b98bd9e71da3cf23fd1f599408d Женский 25-34 2016-02 Москва Москва 1 00102b98bd9e71da3cf23fd1f599408d Женский 25-34 2016-03 Москва Москва 1 00102b98bd9e71da3cf23fd1f599408d Женский 25-34 2016-04 Москва Москва 1 00102b98bd9e71da3cf23fd1f599408d Женский 25-34 2016-05 Москва Москва 1 0035f7bb84690f3a7454edbaf5ece268 Женский 25-34 2016-02 Москва Москва 1 00507d5d1772c03d2046144aeeca3593 Женский 25-34 2016-03 Москва Москва 1 006ffdb5c45a47f087c2dc15ef39ebb3 Женский 25-34 2016-02 Москва Москва 1 006ffdb5c45a47f087c2dc15ef39ebb3 Женский 25-34 2016-03 Москва Москва 1 006ffdb5c45a47f087c2dc15ef39ebb3 Женский 25-34 2016-04 Москва Москва 1 and df qsex age ranges rucitysize 0 Женский 18-24 500-млн 117 1 Женский 18-24 Миллионники 271 2 Женский 18-24 Москва 1046 3 Женский 25-34 500-млн 150 4 Же

internet explorer - Script only works on some computers - The object invoked has disconnected from its clients -

i have following, simple jscript , checks time , whether or not current user in in specific skype response group. if earlier 9:30 , want user added response group (this done checking checkbox). after 9:30 , don't want them in group anymore. togglesupport(); function togglesupport() { var ie = wsh.createobject('internetexplorer.application'), url = "https://lyncserver/rgsclients/tab.aspx", id = 'ctl05_ctl00_ctl04_ctl00_ctl00_ctl01'; date = new date(), hours = date.gethours(), minutes = date.getminutes(), time = (hours * 60) + minutes, ninethirty = 569; // 9:29 - because task runs @ 9:30 ie.visible = false; ie.navigate(url); while (ie.readystate != 4) wsh.sleep(25); var element = ie.document.getelementbyid(id); var insupport = element.checked; if (time >= ninethirty) { if (insupport) { element.cli

swift - Printed double value differs from originally set value -

i adding 2 array contains double values let arraya = [1.1,2.3] let arrayb = [4.2,5.5,6.8] let c = arraya + arrayb print("\(c)"); the print function printing following result : [1.1000000000000001, 2.2999999999999998, 4.2000000000000002, 5.5, 6.7999999999999998] how exact double values after adding arrays ? you don't. it's way double (and float ) work. as workaround can round values when going print them for num in c { print(string(format: "%.1f", num)) } 1.1 2.3 4.2 5.5 6.8

ios - Hot to add a View to a Scrollview programmatically using layout constraints -

i'm triying instert programatically view inside uiscrollview, doesn't appear here code: mainscrollview.translatesautoresizingmaskintoconstraints = false self.view.addsubview(mainscrollview) //add trailing let trailingconstraint = nslayoutconstraint(item: mainscrollview, attribute: .trailing, relatedby: .equal, toitem: self.view, attribute: .trailing, multiplier: 1, constant: 0) self.view.addconstraint(trailingconstraint) //add leading let leadingconstraint = nslayoutconstraint(item: mainscrollview, attribute: .leading, relatedby: .equal, toitem: self.view, attribute: .leading, multiplier: 1, constant: 0) self.view.addconstraint(leadingconstraint) //add top let topconstraint = nslayoutconstraint(item: mainscrollview, attribute: .top, relatedby: .equal, toitem: self.view, attribute: .top, multiplier: 1, constant: 0) self.view.addconstraint(topconstraint) //add bottom let bo

ruby - Rails and Capistrano missing gems -

i have problem missed gems when tried deploy rails app vps. can me? capistrano.log bundle check --path /home/root/apps/appname/shared/bundle debug [09094abf] [31mthe following gems missing[0m [31m * net-scp (1.2.1)[0m [31m * sshkit (1.11.4)[0m [31m * airbrussh (1.1.1)[0m [31m * debug_inspector (0.0.2)[0m [31m * binding_of_caller (0.7.2)[0m [31m * byebug (9.0.6)[0m [31m * capistrano-harrow (0.5.3)[0m [31m * capistrano (3.6.1)[0m [31m * capistrano-bundler (1.2.0)[0m [31m * capistrano-rails (1.2.0)[0m [31m * capistrano-rvm (0.1.2)[0m [31m * capistrano3-puma (1.2.1)[0m [31m * spring (2.0.0)[0m [31m * web-console (2.3.0)[0m [33minstall missing gems `bundle install` you must use capistrano/bundler gem bundler tasks (like bundle install ) in deploy. basically, must add capistrano/bundler in gemfile , require in capfile using command below: require 'capistrano/bundler' thereby capistrano run bundle install task during deploy , proble

javascript - D3: The data on the axis not mapping -

Image
i have tried implement bar chart in d3, have problem mapping on axes. have dataset x , y seems values not mapped correctly. this code: var data = [ {x: 2, y: 4}, {x: 5, y: 8}, {x: 8, y: 10}, {x: 2, y: 4}, {x: 5, y: 8}, {x: 8, y: 19}, {x: 2, y: 4}, {x: 5, y: 8}, {x: 8, y: 10}, {x: 2, y: 4}, {x: 5, y: 8}, {x: 8, y: 10}, {x: 2, y: 4}, {x: 5, y: 8},

vb.net - Create Connection String during installation -

i have windows forms application. want create setup file application. used visual studio 2012 , sql server 12. i want setup work in every new environment. so, how make connection string dynamic? can create connection string after installation , make available every form access, in local machine? any kind of source code, video links, explanations or examples great me.

delphi - App Crash Loading a pdf from a url with TwebBrowser on IOS and Google docs viewer -

when try open .pdf url using twebbrowser , google docs viewer on ios app crash. i'm using google docs viewer twebbrowser.navigate('https://docs.google.com/gview?url=http://dison.shared-servers.com:100/pdf/pda.pdf'); if call simple url twebbrowser.navigate('http://www.google.com'); work fine i set fix https://community.embarcadero.com/blogs/entry/how-to-use-custom-info-plist-xml-to-support-ios-9-s-new-app-transport-security-feature im using xe8

DB2 indoubt transactions can be resolved by instance restart? -

i have read kc saying how manually resolve indoubt xn using list indoubt transaction prompting command want understand if these indoubt transaction @ instance level? can instance restart solve these indoubt transaction? in-doubt transactions can happen in distributed database scenario, i.e., 2 or more databases involved in single distributed ("global") transaction. typical reason in-doubt transaction lost network communication, local transaction not know whether global/distributed transaction committed successfully. 1) in-doubt transactions per database , need resolved @ level. 2) instance restart not change transaction state. the x/open distributed transaction processing protocol db2 in knowledge center.

powershell - Can't Add Azure DSC Extension to VM in ARM mode -

i need create vm based on image (sql server 2016 on windows server 2016) , add dsc extension powershell. have template.json , it's parameters.json files saved when creating vm(sql2016 server on windows 2016 server) in portal(in parameters file define url published sdc zip , admin password). zip file withconfiguration located on github public repository. , created powershell publish commandlet. after next steps are: login-azurermaccount # create resource group new-azurermresourcegroup -name orsql1 -location 'north europe' # succeed # define deployment variables $deployment = @{ resourcegroupname = 'orsqllast'; mode = 'complete'; templatefile = 'template.json'; templateparameterfile = 'parameters.json'; force = $true; } new-azurermresourcegroupdeployment @deployment -deploymentdebugloglevel dsc1.ps1 contents: configuration iisinstall { node ("localhost") { windowsfeature iis {

javascript - Ajax autocomplete does not hide (not relevant) elements -

hello use autocomplete ajax. show me options fill out input field , highlight input. script not hide variables not match input anymore. for example: autocomplete variables (test, tast, testes) if type "tes" see still three, "tast" hidden. because have in autocomplete field countries world. can give advice why script not hide elements not match input? i use following code: js: <script type="text/javascript" src="js/jquery.autocomplete.js"></script> // insert in html $(function() { $( "#country" ).autocomplete({ type: "post", autofocus: true, datatype: "json", lookuplimit: 5, serviceurl: "profil/countries_form", onselect: function(suggestion) { $('#country').val(suggestion.value); $('#country_iso').val(suggestion.

javascript - Add class and then fire an event JQuery -

i trying add class , fire event, unfortunately not working , think trying in wrong way, can please suggest? following codes first want add class $(".hospital_listing_front").addclass('flexslider-hospital'); once class added fire following function (this related flexslider , add flexslider functionality) $(".flexslider-hospital").flexslider({ animation: "slide", animationloop: false, itemwidth: 210, itemmargin: 48, pauseplay: false }); add class working flexslider not working please suggest how handle this. thanks in advance i thought may have provide time add class. may use settimeout solve problem try , let me know if face again same issue. $(".hospital_listing_front").addclass('flexslider-hospital'); settimeout(function() { $(".flexslider-hospital").flexslider({ animation: "slide", animationloop: false, itemwidth: 210, itemmargin: 48,

javascript - Iterate over array in async promise -

i´m working node/ express, mysql , bluebird. i´m using promises make async database call, working far. want iterate on result (array) , call function calculation purpose. my code separated controller class, handles get/ post request. in middle service class business logic, talks database class queries in database. for show service class, because else working perfectly, don´t know how run on result array , call function, returns daterange. 'use strict'; var departmentdatabase = require('../database/department'); var moment = require('moment'); class departmentservice { constructor() { } getvacation(departmentid) { return departmentdatabase.getvacation(departmentid).then(function (result) { //without promises did this, worked. //for(var = 0; result.length > i; i++){ // var daterange = this.getdaterange(new date(result[i].datefrom), new date(result[i].dateto)); //console.log(dat