Posts

Showing posts from June, 2015

angularjs - Give public privilege to login.html page with spring security -

Image
i integrated angularjs template ( sb admin angular ) spring boot front-end application (the output of 'grunt built' command ). trying set login.html page privileges public. code used (not working) @configuration @order(securityproperties.access_override_order) public class websecurityconfig extends websecurityconfigureradapter { @override protected void configure(httpsecurity http) throws exception { http .httpbasic().and().authorizerequests() .antmatchers("/","/index.html","/views/pages/login.html") .permitall().anyrequest().authenticated(); } } whenever go http://localhost:8080/#/login browser's window shows telling me spring boot demands username , pass. need know mistake did. this project structure again, if ever wanted explore template , see how ui-router used in template : http://startangular.com/product/sb-admin-angular-theme/ npm install grunt build cre...

java - Return an array of strings containing all sub-sequences for s (except the empty string) ordered lexicographically? -

i need code (or snippet of code following problem or hint on how solve): a sub sequence of string s obtained deleting 1 or more characters s. set of sub sequences string s = abc a, ab, ac, abc, b, bc, c, , empty string (which sub sequence of strings). find possible sub sequences s , print them in lexicographic order. this have come out it's not working: treeset<string> ls = new treeset<>(); for(int i=0;i<s.length();i++) { for(int j=i;j<s.length();j++) { stringbuffer sb = new stringbuffer(); for(int k=i;k<j+1;k++) { sb.append(s.charat(k)); } ls.add(sb.tostring()); } } return ls.toarray(new string[ls.size()]); result: testcase : abc output: ab abc b bc c expected output: ab abc ac b bc c your code looks substrings , consecutive sequences of characters original string. however, "ac" taken non -conse...

MvvmLight template for C# WPF project -

i have created new wpf application project in microsoft visual studio express 2015 windows desktop , added nuget package 'mvvmlight' solution. created 1 folder called 'viewmodel' according http://www.dotnetcurry.com/wpf/1037/mvvm-light-wpf-model-view-viewmodel should have created 4 folders ('design','model','skins','viewmodel'). 1 i've installed wrong/incomplete in way? i'm after decent mvvm model wpf application. from link, following steps stated: step 1: open visual studio , create wpf application , name ‘wpf_mvvmlight_crud’. project, add mvvm light libraries using nuget package discussed in installation section. the project add necessary libraries , ‘viewmodel’ folder... step 2: in project, add new folder name ‘model’ . in folder, add new ado.net entity data model... step 3: add new folder called ‘services’ , in folder , add class file following... and on. means folder adds viewmode...

asp.net - Use database objects created in SQL Server Management Studio in Visual Studio instead -

i building website using asp.net development. i performed database tasks (tables, user-defined functions, stored procedures) using sql server management studio. now, continue use database stuff have created website in visual studio. how do that? to give example, have created stored procedure (that works tables , scalar valued function) in ssms requires user input start , end date. in visual studio, have created webpage asks user start , end date. "transfer" above mentioned stored procedure (together tables , scalar valued functions) visual studio can use user input query stored procedure. i using following: visual studio 2010, ssms 2008 as per explanation understand want create webpage intract sql server database, below 1 example in portal connect sql server visual studio stored procedure. database created in sql server management studios cannot found visual studio 2010 http://www.aspsnippets.com/articles/select-sql-server-stored-procedures-using-a...

mysql - mysqli_insert_id is not working on php OOP method -

i testing function of getting last auto_increment_id using mysqli_insert_id . feel quite confuse when find out if use 2 different methods, results different. method 1 <?php $servername = "localhost"; $username = "username"; $password = "password"; $dbname = "mydb"; // create connection $conn = mysqli_connect($servername, $username, $password, $dbname); // check connection if (!$conn) { die("connection failed: " . mysqli_connect_error()); } $sql = "insert item(uid,item_id,item_name,item_price,item_quantity) values('1','0','hhh','23','23');"; if (mysqli_query($conn, $sql)) { $last_id = mysqli_insert_id($conn); echo "new record created successfully. last inserted id is: " . $last_id; } else { echo "error: " . $sql . "<br>" . mysqli_error($conn); } mysqli_close($conn); ?> this procedural way working can last id. ...

objective c - How to troubleshoot iOS background app fetch not working? -

Image
i trying ios background app fetch work in app. while testing in xcode works, when running on device doesn't! my test device running ios 9.3.5 (my deployment target 7.1) i have enabled "background fetch" under "background modes" under "capabilities" on target in xcode in application:didfinishlaunchingwithoptions have tried various intervals setminimumbackgroundfetchinterval, including uiapplicationbackgroundfetchintervalminimum - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // tell system want background fetch //[application setminimumbackgroundfetchinterval:3600]; // 60 minutes [application setminimumbackgroundfetchinterval:uiapplicationbackgroundfetchintervalminimum]; //[application setminimumbackgroundfetchinterval:1800]; // 30 minutes return yes; } i have implemented application:performfetchwithcompletionhandler void (^fetchcompletionhandler)(ui...

android - KSOAP stop running at transport.call() method -

i having situation ksoap2 stopping @ transport.call() method. i not able find solution after searching hope. i know transport.call() has stopped because log shows to: log.i(tag, "start4"); thank help. here's more current code: @override protected void oncreate(bundle savedinstancestate) { log.i(tag, "begining"); super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); tele = (textview) findviewbyid(r.id.tele); request res = new request(); log.i(tag, "start"); //try{ log.i(tag, "before soapobject"); soapobject request = new soapobject(namespace, method_name); log.i(tag, "start1"); soapserializationenvelope soapenvelope = new soapserializationenvelope(soapenvelope.ver11); log.i(tag, "start2"); soapenvelope.dotnet = false; log.i(tag, "start3"); soapenvelope.setoutputsoapobject(request); httptran...

Reducing CPU Usage When Drawing Large Images With Alpha Transparency Java -

i'm in process of making game in java. in game when player damaged image drawn alpha transparency on drawing. image covers entire screen, obscuring player's view. process consumes ~50% of computer's cpu. there way of optimizing process? sscce: package com.johng.lonevessel.gui; import java.awt.alphacomposite; import java.awt.borderlayout; import java.awt.color; import java.awt.dimension; import java.awt.graphics; import java.awt.graphics2d; import java.awt.image; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.timer; import com.johng.assets.assets; import com.johng.assets.images.images; public class test { public static void main(string[] args) { new test(); } //gets image public static final image redvision = assets.getimage(images.redvision); public test() { jframe frame = new jframe(); frame.setsize(new dimension(600, 600)); gamepan...

Auto rotate fullscreen video in android -

i newbie, , trying make simple application can play video url. able play video in app, want auto rotate,hide actionbar title , fullscreen when click button fullscreen. this manifest : <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="htantruc.videotest"> <uses-permission android:name="android.permission.internet" /> <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsrtl="true" android:theme="@style/theme.appcompat.light.noactionbar.fullscreen"> <activity android:name=".video" android:configchanges="orientation|screensize"> <intent-filter> <action android:name="android.intent.ac...

c# - Check if gridview column on each row has the same values -

how can check if grid-view column on each row has same values. what condition applied on below code. code int y = 0; foreach (gridviewrow row in gridreq.rows) { string catid = row.cells[2].text; if (//condition) { y = y + 1; } } if (y == 0) { //code } else { //code } other foreach inside foreach , there no feasible way check row's value against all other row's values. workarounds: maybe check against first value? int y = 0; var checkitem = gridreq.rows[0].cells[2].text; foreach (gridviewrow row in gridreq.rows) { string catid = row.cells[2].text; if (catid == checkitem) //or use string.compare here { y = y + 1; } } another way check value against of row before it. int y = 0; string catidcheck = ""; foreach (gridviewrow row in gridreq.rows) { string catid = row.cells[2].text; if (catid == catidcheck) //or use string.compare here { y = y + 1; } catidchec...

RxJS: Setting default value for observable from another observable -

i'm trying create observable stream takes user id cookie and, if not found in cookie, fetches api. how can in rxjs? var useridrequest = rx.observable.bindcallback(generateidasync); var cookieuseridstream = rx.observable.of(getcookievalue("user_id")) .filter(x => x !== null); var useridstream = cookieuseridstream.__ifemptythen__(useridrequest()); // <<< ??? // emulating async request user id // jsonp call in real app function generateidasync(cb) { settimeout(() => { cb(`id_${new date().gettime()}`); }, 300); } function getcookievalue(name) { var regexp = new regexp(`${name}=([^;]*)`); var match = document.cookie.match(regexp); return match && match[1]; } there's defaultifempty method works simple values only, not observables. in bacon.js there's or method streams, works fine, don't see similar in rxjs. miss or need implement custom observer? you may concat 2 observables , first emitte...

javascript - How to add class active for first tab in dynamic li -

i want show first tab content after page load. don't know exact how add class active first li , first content . here code. <div class="container"> <ul class="nav nav-tabs"> <?php foreach($category->result() $cate){ ?> <li><a data-toggle="tab" href="#cat<?php echo $cate->id; ?>"><?php echo $cate->category_name; ?></a></li> <?php } ?> </ul> <div class="tab-content"> <?php foreach($category->result() $cat){ ?> <div id="cat<?php echo $cat->id; ?>" class="tab-pane fade"> <?php $catego = $cat->id; $servi = $this->db->select('*')->from('sundaland_services')->where('service_category_id',$catego )->get()->result(); ?> <p> <?php for...

google play - Does APK shared from web or xender gets update from playstore? -

many websites providing apk of playstore's apps . , many apps xender , myappsharer can transfer apk . in both updates playstore ? yes. app downloaded web can update google play store. download app google play store , web same. difference have install manually when download apps , game websites.

ruby on rails - API's not accessible from DigitalOcean -

i have api's in project. on localhost , heroku works fine. deployed on digitalcoean. works fine browser , postman , mobile browser. when access in android app gives error you've requested ip address part of cloudflare network. valid host header must supplied reach desired website.

How to get Docker Swarmkit token with Ansible to use with swarmkit nodes -

i have playbook starts docker swarmkit manager. generates tokens workers join. how can token after swarmkit manager started, , store swarmkit nodes going installed? for example, have task starting swarmkit manager: - name: run swarmkit master shell: "swarmd -d /tmp/swarmkit-master --listen-control-api /tmp/swarmkit/swarm.sock --hostname swarm-master &" edit i know that: swarmctl cluster inspect default returns tokens. how should use in ansible? or should use docker swarm mode?

android - How to create a new column if not exist in ORMLite while DB Upgrade -

i using ormlite, , going release new version. have db upgrade script(json) this. { "version": 9, "ddlqueries": [ { "querydescription": "add new column column name in tablename table", "commandtype": "alter", "table": "table name", "column": { "name": "column name", "type": "blob" } }, { "querydescription": "create new column column name in table name table", "commandtype": "alter", "table": "table name", "column": { "name": "column name", "type": "text" } } ] } and onupgrade method this. public void onupgrade(object db, connectionsource connectionsource, int oldversion, int newversion) { try { while(++oldv...

java - What is a NullPointerException, and how do I fix it? -

what null pointer exceptions ( java.lang.nullpointerexception ) , causes them? what methods/tools can used determine cause stop exception causing program terminate prematurely? when declare reference variable (i.e. object) creating pointer object. consider following code declare variable of primitive type int : int x; x = 10; in example variable x int , java initialize 0 you. when assign 10 in second line value 10 written memory location pointed x. but, when try declare reference type different happens. take following code: integer num; num = new integer(10); the first line declares variable named num , but, not contain primitive value. instead contains pointer (because type integer reference type). since did not yet point java sets null, meaning "i pointing @ nothing". in second line, new keyword used instantiate (or create) object of type integer , pointer variable num assigned object. can reference object using dereferencing operator . (a dot...

cloudera cdh - Apache NiFi Hive Processors with Hive 1.1 (CDH 5.7.1) -

i work cloudera manager cdh 5.7.1, supports hive 1.1.0. nifi 1.0.0-beta uses hive 1.2.1. when try use selecthiveql processor, following error: required field 'client_protocol' unset! , means there's version mismatch between hive client , server. any suggestions solve problem? i thought building nifi hive-jdbc dependency version 1.1.0 instead of default 1.2.1 , hope there's better solution. since nifi apache project, builds apache jars (such hive , hadoop). there vendor-specific profiles , build properties can use build nifi particular hadoop distribution. for example try following build nifi distro cdh 5.7.1: mvn clean install -dskiptests -pcloudera -dhadoop.version=2.6.0-cdh5.7.1 -dhive.version=1.1.0-cdh5.7.1 -dhbase.version=1.2.0-cdh5.7.1 the hive processors use hadoop libraries provided nifi hadoop libraries nar, , other nars (like hadoop/hdfs processors) use same libraries nar, best approach build whole thing. otherwise can try replace ha...

ios - Difference between UIImageView.hidden and UIImageView.image = nil -

in view, have multiple views ( uicollectionviewcell s) that, depending on model, can include uiimageview subview (each separate instance). for case, views don't show uiimageview outnumber ones show it. i can choose either call uiimageview.hidden = false when want views show image, or set image inside image view i.e. uiimageview.image = uiimage(named: ...) . i'm wondering, more performant approach, memory , speed concerns? have feeling difference not significant enough, uiimage(named:) 's caching, want find out. if set uiimageview.image = nil , surely if image in memory, released (then reallocated if reused), suggest it if want sure uiimageview.image (1) not visible, (2) not occupy frame in cell , (3) not imply rendering time, set uiimageview.hidden = true i suggest take both actions. performances not problem here, in opinion (considering have few cells image inside)

python - error: command 'rpmbuild' failed -

i trying generate rpm package. my macos el capitan , rpm generation performed docker red hat 6. my user root my .rpmmacros file is: %__os_install_post \ /usr/lib/rpm/redhat/brp-compress \ %{!?__debug_package:/usr/lib/rpm/redhat/brp-strip %{__strip}} \ /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \ /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \ /usr/lib/rpm/redhat/brp-python-hardlink \ %{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \ %{nil} and y next error: building rpms rpmbuild -bb --define _topdir $my_project_path/build/bdist.linux-x86_64/rpm --clean build/bdist.linux-x86_64/rpm/specs/udo.spec error: error creating temporary file /var/tmp/rpm-tmp.oyik1k: operation not permitted error: unable open temp file. rpm build errors: error creating temporary file /var/tmp/rpm-tmp.oyik1k: operation not permitted unable open temp file.

bash - Reverse order of html with awk via line swapping -

basically every week have reverse following snippet <!-- homepage slider begin --> <div class="container-fluid"> <div class="single-item-home hidden-xs"> <div class="slide slide--has-caption"> <a href="/1"> <img src="/sliders/1_example.jpg"> </a> </div> <div class="slide slide--has-caption"> <a href="/2"> <img src="/sliders/2_example.jpg"> </a> </div> <div class="slide slide--has-caption"> <a href="/3"> <img src="/sliders/3_example.jpg"> </a> </div> <div class="slide slide--has-caption"> <a href="/4"> <img src="/sliders/4_example.jpg"> </a> </div> </div> </div> <!-- homepage ...

less - How to compile bootstrap to get the same version as precompiled? -

i bought template. if try compile precompiled version of bootstrap fine. @import "bootstrap.css"; //precompiled bootstrap @import "nifty/nifty.less"; //my theme however, if compile bootstrap less variant, colors other expected: @import "bootstrap/bootstrap.less"; //same version above, not precompiled @import "nifty/nifty.less"; //my theme what difference. how should compile bootstrap, have exact same result precompiled variant in dist folder in terms of colors? i need this, because need compile template kendo ui , template provides not every theme variable need kendo ui bootstrap mapper. this gulp task: gulp.task('theme', function () { return gulp.src('./content/less/theme.less') .pipe(plumber()) .pipe(less({ paths: [path.join(__dirname, 'less', 'includes')] })) .pipe(gulp.dest('./content/theme')); }); there...

css - How to layout tabular form in HTML -

Image
how layout following panel div/spans table some grid ? bootstrap (easy use, responsive grid system) or table (simpler solution). depends on requirements. this bootstrap grid structure in case: <div class="container-fluid"> <div class="row"> <div class="col-md-2"> </div> <div class="col-md-10"> </div> </div> <div class="row"> <div class="col-md-2"> </div> <div class="col-md-4"> </div> <div class="col-md-2"> </div> <div class="col-md-4"> </div> </div> <div class="row"> <div class="col-md-2"> </div> <div class="col-md-4"> </div> <div class="col-md-2...

c# - Asp.NET Web Api 2 Routing parameters -

i have following route: config.routes.maphttproute( name: "defaultapi", routetemplate: "api/{service_name}/{controller}/{id}", defaults: new { service_name = "identity", id = routeparameter.optional } ); i want route work following pattern (service name should identity): api/identity/{anycontroller}/{id} now accomplish changing route template routetemplate: "api/identity/{controller}/{id}", but not able read "service_name" request.getroutedata(); since it's not named parameter. is there simpler way this, rather creating actionfilter filter requests who's service name not "identity" in case. you add route attribute above method affected. example, [route("api/identity/{controller}/{id}", order = 1)] [httpget] public ihttpactionresult dosomethinghere(int id) { // magic here } have @ article attribute routing in asp....

javascript - How to use a 'this' in the selector in queryselectorall -

is possible use kind of 'this' in selector in queryselectorall()? explanation: if use: var _childlist = document.queryselectorall("#treeic > li"); i got result wish first level in tree. but if use: var _ictree = document.getelementbyid("treeic"); var _childlist = _ictree.queryselectorall("li"); i got li tags nested down tree. if wrote: var _childlist = _ictree.queryselectorall("> li"); // or var _childlist = _ictree.queryselectorall("this > li"); it doesn't work. i need use recursive call in implementation , why need it. know how workaround, know if there way use 'this' in queryselectorall() , write more clean code.

sql server - How to convert rows into column in sql -

Image
i have table, and need convert i have tried pivot can't figure out please me out . pivot not work more 1 column out-of-the-box there several approaches solve this: use table variable tests , please state sample data copy'n'pasteable. best mcve (minimal complete verifyable example) set code mine here. declare @tbl table(id int, code int,employeename varchar(100),examname varchar(100),board varchar(100),result varchar(100)); insert @tbl values (11537,12984,'thename','ssc','b04','1st') ,(11537,12984,'thename','hsc','b04','2nd') ,(11537,12984,'thename','ba(h)','u33','2nd'); this code first concatenate data 1 single column. allows pivot : select p.* ( select tbl.id ,tbl.code ,tbl.employeename ,'exam_' + cast(row_number() over(partition tbl.id order tbl.code) varchar(100)) colname ,examname + ' (' + boar...

google analytics - Your project does not have access to this feature (403) -

i have receive mail google great news! we’ve received request join google analytics account setup , configuration apis beta , project has been whitelisted access. these apis allow programmatically create , edit properties, views, , goals. but when wondering access management api here https://developers.google.com/apis-explorer/?hl=en_us#p/analytics/v3/analytics.management.profiles.insert?accountid=83303713&webpropertyid=ua-83303713-1&_h=3&resource=%257b%250a%257d& i getting same error "errors": [ { "domain": "global", "reason": "insufficientpermissions", "message": "your project not have access feature." } ], "code": 403, "message": "your project not have access feature." } what else missing?

security - Authenticate public-key which is coming from a database -

i wrote small chat application, users can write each other messages: on first login, user generate public/private keypair, derived users password. the public-key sent server (database). if user (a) wants write user (b) message, user encrypts message public key of user b , sends server (and server send user b). but what, if database-access change public-key of user b in database? attacker can read messages. is somehow possible authenticate public key in database , make sure, not changed , 100% belongs user b? so you're trying protect against scenario attacker has control on server , server cannot trusted. since can't trust any information server, cannot use directly in form of verification either. server can relegated being dumb transport, , verification needs happen directly against other peer. being able exchange key out-of-band lot here, meaning can somehow facilitate direct peer-to-peer exchange of key. since difficult trust identity of random remot...

How to run "sudo su tomcat" from a .NET application -

i need run shell scripts (shutdown scripts tomcat) tomcat user out c# .net application. i tried winscp .net assembly. can login via ssh , run commands. but how run sudo su tomcat first same password used login ssh server? a secure solution great (no passwords in log files or bash history)! maybe other solution instead of winscp .net assembly? the sudo / su made not automatable. reason. so solution dirty , unreliable hack. if need able allow automatic run of command, allow run without password in sudoers . that's correct , transparent solution.

jsf - Disable selection in datatable -

Image
i'm using primefaces 5.3, , i'm filling datatable records database if length of records lower 10 complete empty records datatable diplays 10 rows. my datatable looks : <p:datatable id="datatable" editable="true" editmode="cell" value="#{beanplanningl.getlistplanningsalle(entry, 1)}" var="planning" selectionmode="single" selection="#{beanplanning.selectedplanning}" rowkey="#{planning.id}" sortby="#{planning.heuredebut}" > so want disable selection on rows has empty records. how can ? ps : planning.id equals 0 in empty records. edit : i forgot mention used rendered following : <p:column > <p:celleditor rendered="#{planning.id != 0}"> <f:facet name="output"> <h:outputtext value="#{planning.heuredebut}" /></f:facet> <f:facet name="input"> <p...

sql server - SQL Divide one count result by another OR Alternate solution -

i have table following schema. relational database schema: hotel = hotelno, hotelname, city room = roomno, hotelno(fk), type, rate guest = guestno, guestname, guestaddress booking = hotelno(fk), guestno(fk), datefrom, dateto, roomno(fk) there entries in each table data isn't relevant question. i need calculate average number of booking made each hotel, ensuring include hotels not have bookings. i have : -- call select 1 select count(*) booking b, hotel h b.hotelno=h.hotelno; -- call select 2 select count(*) hotel; select 1 returns total number of bookings. select 2 returns total number of hotels. if divide output of count in select 1 output of count in select 2 have answer. if possible can please me code, otherwise can think of alternate solution achieve same result? if "average number of bookings", want divide 2 numbers, can do: select count(b.hotelno) / count(distinct h.hotelno) hotel h left join booking b on h.hotelno...

javascript - Change iframe content with Bootstrap button click and jquery -

i change iframe src url bootstrap button click. javascript code works traditional button, goes wrong when use same code change iframe jquery: (i iframe random @ page load) bootstrap element (html page) ... <div class="col-md-6"> <a class="btn btn-primary" id="randomize">sekvanta ekzerco</a> </div> <div> <iframe id="question" src="url0" width="275" height="650" frameborder="0" allowfullscreen="allowfullscreen"> </iframe> </div> ... <script src="application.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> </body> application.js var sources = new array() sources[0] = 'url0' sources[1] = 'url1' sources[2] = 'url2' sources[3] = 'url3' var p = sources.length; $...

sql - Aggregate function exception when I run my query -

Image
this extension of previous question( getting exception datetime diff ), time i've made totalbreaktime float , below new query. merge time_tracker target using (select userid, cast(datediff(second,starttime,endtime)/60.0 numeric(36,2)) columnwithbreakscount breakstable convert(date, starttime) = convert(date, getdate()) group userid) source on target.userid = source.userid when matched update set breaks = source.columnwithbreakscount; this time when run query, i'm getting below exception. msg 8120, level 16, state 1, line 1 column 'breakstable.starttime' invalid in select list because not contained in either aggregate function or group clause. msg 8120, level 16, state 1, line 1 column 'breakstable.endtime' invalid in select list because not contained in either aggregate function or group clause. problem: as discussed in previous question, want update time_tracker.breaks sum of breakstable.totalbreaktime based on date. when run query(the pre...

angular - RxJS -- How to make a timer trigger by click a button when using RxJS? -

@component({ template: ` <div> <a *ngif="!sending" (click)="send()">send</a> <span *ngif="sending" >{{seconds}} s</span> </div>`, selector: 'password-reset-form' }) export class passwordresetformcomponent implements oninit { sending:boolean = false; seconds:number = 60; counterobservable = new subject(); constructor(public authservice:authservice, public router:router, public formbuilder:formbuilder) { } ngoninit() { this.counterobservable.subscribe(()=> { this.seconds --; }, null, ()=> { this.seconds = 60; this.sending = false; }); } send() { this.sending = true; this.counterobservable.next(observable.interval(1000).take(60)); } } hey,i try using ng2 , rxjs make timer,when click send button,it display 60s timer,but spe...

powershell - psexec remote install from remote file -

i trying install exe placed on network share via psexec on remote computer. below ./psexec \\remote-computer -h -u domain\username -p password cmd /c \\network-share\setup.exe but handle invalid error or access denied. remote-computer , network share both in same domain , have id trying have complete access still not sure what's blocking. can please advise.

android - How is the activity "adjustResize" attribute actually works -

Image
these days learning when softkeyboard pop came, out how activity layout changed. wrote sample, , found strange. here layout: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="com.margi.inputbar.mainactivity"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="hello world!" /> <linearlayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:orientation="vertical"> <textview android:layout_width="match_parent" android:layou...

python - How to change the field value as Red color when end date is less than current date on field? -

i want change field value red color when end date less current date on field ? have field name followup_date, if follow date has passed should marked red on grid. method create previous date less current date, have no idea how write method? how possible? can me out? in advance... if grid mean one2many table. here example may you. <tree colors="red:followup_date < current_date"> <field name="followup_date"/> </tree>

html - Scaling SVG produced with inkscape -

i trying resize this svg file produced using inkscape i have tried using viewbox="0 0 h w" attribute within <svg/> crops image instead of resizing. in anticipation inkscape doesn't add viewbox attribute files produces. attribute needed scaling work. the solution convert width , height values viewbox , alter width , height. so add following root <svg> tag: viewbox="0 0 205 69" then change width/height. if want double size, do: width="410" height="138" or if want fill page or it's parent container do: width="100%" height="100%" <!-- created inkscape (http://www.inkscape.org/) --> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/200...

javascript - How to calculate the page scroll length in web application? -

i'm doing below code scroll down in selenium webdriver. webdriver driver = new firefoxdriver(); javascriptexecutor jse = (javascriptexecutor)driver; jse.executescript("window.scrollby(0,250)", ""); in above code, (0,250) ? how calculate 250 web page? it's not clear want calculate. 250? lol, anything, page size, window size, webelement y location page height js.executescript("return document.body.scrollheight"); window height js.executescript("return window.innerheight");

html - angular2: Supplied parameters do not match any signature of call target, even though i have all the needed params -

push.component.ts import { component, oninit } '@angular/core'; import {pushresult} './dto/pushresult'; import {pushrequest} './dto/pushrequest'; import {pushservice} './push.service'; @component({ // selector: 'push-comp', template: // `<form (submit)="submitform()"> // <input [(ngmodel)]="element.name"/> // // <button type="submit">submit form</button> // </form> // <br> `<button (click)="getheroes()"> </button> <button (click)="saveheroes()"> push </button>`, // templateurl: 'app/html/heroes.component.html', providers: [pushservice] }) export class pushcomponent implements oninit { pushresult:pushresult; // selectedhero:hero; // addinghero = false; error:any; element:any; constructor(private pushservice:pushservice)...

PHP Error on if statment -

this question has answer here: php parse/syntax errors; , how solve them? 12 answers i keep getting error: php error message parse error: syntax error, unexpected t_encapsed_and_whitespace, expecting t_string or t_variable or t_num_string in /home/a6941725/public_html/php/usersystem/signup.php on line 4 here code: if (mysql_query("select * main username $_post['username']"); !== "$_post['username']") { $username = $_post['username']; } i @ php can't figure out why not working! you should try like, $query = sprintf("select * main username '%s'", mysql_real_escape_string($_post['username']); $result = mysql_query($query);// gives result while ($row = mysql_fetch_array($result)) { if ($row['username'] !== $_post['username']) { //...

YouTube Data API v3 - Error 500 getting playlist list -

i facing 500 internal server error message when trying get playlists pop music-topic channel ( https://www.youtube.com/channel/uce80foxpjydkkmo-byojdeg ): "error": { "code": 500, "message": null } i using youtube.playlists.list request youtube data api v3. you can test on google api explorer following link: https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.playlists.list?part=snippet&channelid=uce80foxpjydkkmo-byojdeg&_h=1& what's strange worked intented days ago. any idea ? thank you. i tried request , 500 error. according link , 500 (internal error) response code indicates youtube experienced error handling request. retry request @ later time. i tried different channel id , successful request. here request use. https://www.googleapis.com/youtube/v3/playlists?part=snippet&channelid=ucnexqeqyg6wemmk9hpqcoeq&key=your_api_key i don't know if channel has issue or youtube itsel...