Posts

Showing posts from March, 2014

javascript - Angular UI router - can't get my data in component after resolve -

i have router configured this: .state('home.view-profile', { url: '/view-profile/:profileurl', template: '<view-profile input="$resolve.profiledata"></view-profile>', title: 'view profile', resolve: {profiledata: function(artistservice, $stateparams){ return artistservice.getartist($stateparams.profileurl).then((data) => { const timer = new date(); console.log(timer.getseconds() + ':' + timer.getmilliseconds()); console.log(data.data.artist); return data.data.artist; }); } } }) and component module.component('view-profile', { templateurl: 'view-profile/view-profile.component.html', bindings: { input: '=' }, controller: ['$state', '$scope', '$stateparams', function ($state, $scope, $stateparams) { const model = this; console.log('***************'); console...

clojure - Intersecting a list of lists of maps overriding equality -

i have list of lists of maps: (( {:id 1 :temp 1} {:id 2} ) ( {:id 1 :temp 2} ) ( {:id 1 :temp 3} {:id 2} )) i want ids @ intersection of these 3 sets :id key. result here 1 i came solution it's hurting eyes: (def coll '(( {:id 1 :temp 1} {:id 2} ) ( {:id 1 :temp 2} ) ( {:id 1 :temp 3} {:id 2} ))) (apply clojure.set/intersection (map set (map (fn [m] (map #(select-keys % '(:id)) m)) coll))) returns #{{:id 1}} which ok, other suggestions? if fine getting #{1} (as mention initially) instead of #{{:id 1}} , can improved: (apply set/intersection (map (fn [c] (into #{} (map :id c))) coll))

html - Divs overlapping when resizing window -

Image
i'm making website using twitter bootstrap , having issue when resizing browser windows. have tried using width , height both div s, making child div position: absolute; , parent div position: relative; , no avail. this code the element i'm trying show pulled through php (a map) , how overlaps. i realize shouldn't doing styling within html, wanted show details in 1 place. i able map scale without overlapping using 2 classes come twitter bootstrap, called embed-responsive embed-responsive-16by9 and source code .embed-responsive { position: relative; display: block; height: 0; padding: 0; overflow: hidden; } .embed-responsive-16by9 { padding-bottom: 56.25%; } even though tried manually make div s parent position: relative; , child of every positioning, didn't work, guess it's height , padding. thank responding, , hope answer helps more people.

How do I run typescript file after compile without generating javascript file -

type script using tsc -w -p . watch mode. , generate .js files. so, typescript run node example.js normal. but, run typescript without node example.js command how can it? will run typescript without node example.js command how can it you can use ts-node compile + run directly (without ever writing disk): ts-node example.ts more https://github.com/typestrong/ts-node

javascript - JS - Debounce a delegated event -

take @ this js code (here's snippet): //debounce function davidwalsh: https://davidwalsh.name/javascript-debounce-function //returns function, that, long continues invoked, not //be triggered. function called after stops being called //n milliseconds. if `immediate` passed, trigger function on //leading edge, instead of trailing. function debounce(func, wait, immediate) { var timeout; return function() { var context = this, args = arguments; var later = function() { timeout = null; if (!immediate) func.apply(context, args); }; var callnow = immediate && !timeout; cleartimeout(timeout); timeout = settimeout(later, wait); if (callnow) func.apply(context, args); }; }; $(document).on('click', '#foo-one, #bar-one', debounce(function(e) { $('#counter-one').append('<span>1</span>'); }, 350)); $('#foo-two').click(debounce(function(e) { $(...

c++ - Merging K Sorted Arrays/Vectors Complexity -

Image
while looking problem of merging k sorted contiguous arrays/vectors , how differs in implementation merging k sorted linked lists found 2 relatively easy naive solutions merging k contiguous arrays , nice optimized method based off of pairwise-merging simulates how mergesort() works. 2 naive solutions implemented seem have same complexity, in big randomized test ran seems 1 way more inefficient other. naive merging my naive merging method works follows. create output vector<int> , set first of k vectors given. merge in second vector, third, , on. since typical merge() method takes in 2 vectors , returns 1 asymptotically linear in both space , time number of elements in both vectors total complexity o(n + 2n + 3n + ... + kn) n average number of elements in each list. since we're adding 1n + 2n + 3n + ... + kn believe total complexity o(n*k^2) . consider following code: vector<int> mergeinefficient(const vector<vector<int> >& multilist) { ...

node.js - How can I use data passed into jade template in the views javascript? -

rendering data template res.render('account/pets/allpets', { petmap, title: 'all pets' }) have tried 2 thing make work a) var neighborhoods = []; (var = 0; < petmap.length; i++) { neighborhoods.push(new google.maps.latlng(petmap[i].location.loc[0],pet.location.loc[1])) } b) var neighborhoods = [ each pet in petmap new google.maps.latlng(petmap[i].location.loc[0],pet.location.loc[1]) ] assuming patmap javascript object, required few hacky things make work. pug renders serverside, while javascript on client, cannot directly access pug variable in js. can convert js object string when pug compiles, parse json when client executes. var petmap = json.parse(("#{json.stringify(petmap)}").replace(/&quot;/g, '"')); /* let me break down in terms of execution "#{json.stringify(petmap)}" -> executes server side, converts #{} accesses pug variable petmap, h...

javascript - React show routes if set up using react-router -

is there command on console can execute @ run-time tell me routes? have used react-router, routes don't work. in rails can list @ runtime. you can routes in array using below library https://github.com/alansouzati/react-router-to-array import react 'react'; import { route, indexroute } 'react-router'; import reactroutertoarray 'react-router-to-array'; // or var reactroutertoarray = require('react-router-to-array'); console.log(reactroutertoarray( <route path="/" component={fakecomponent}> {/* test comments */} <indexroute component={fakecomponent} /> <route path="about" component={fakecomponent}> <route path="home" component={fakecomponent} /> <route path="/home/:userid" component={fakecomponent} /> </route> <route path="users" component={fakecomponent} /> <route path="*" component={fakecomponent} /> </route>) ); /...

ios - UINavigationBar.appearance().translucent is creating a big white space -

Image
update 2 : i'm still hoping problem i'm going refine question little i've narrowed down better. my uiviewcontroller hierarchy looks this: the filter view appears if user touches filter icon , selects lift type. image on left looks without filter selected , right image looks filter selected. navigation area (outlined in green) i'm trying style. here's thing can't figure out. if add these 2 things: uinavigationbar.appearance().translucent = false uinavigationbar.appearance().bartintcolor = uicolor(hexstring: "232b35") then white space appears between navigation area , filter view: if set translucent property true, white space doesn't appear, bartintcolor has no effect. note didn't put uinavigationbar in uiviewcontroller . have uinavigationitem i'm adding code. at point, question - why big white space appearing out of when have uinavigationbar.appearance().translucent = false in code (and can rid of it, still cha...

python - Running Flask app on Windows raises "an operation was attempted on something that is not a socket" -

when running basic flask app getting error in shell , can't find how solve this. running on http://127.0.0.1:5000/ (press ctrl+c quit) <br/> restarting stat<br/> debugger active!<br/> debugger pin code: 295-257-376<br/> exception in thread thread-1:<br/> traceback (most recent call last):<br/> file "c:\users\admin\appdata\local\programs\python\python35-32\lib\threading.py", line 923, in _bootstrap_inner self.run()<br/> file "c:\users\admin\appdata\local\programs\python\python35-32\lib\threading.py", line 871, in run self._target(*self._args, **self._kwargs) <br/> file "c:\users\admin\appdata\local\programs\python\python35-32\lib\site-packages\werkzeug\serving.py", line 656, in inner fd=fd)<br/> file "c:\users\admin\appdata\local\programs\python\python35-32\lib\site-packages\werkzeug\serving.py", line 550, in make_server passthrough_errors, ssl_context, fd...

ruby on rails - use memoization in my code -

been told use memoization in code not call function on , over. implementation best way use it? seems redundant. please advise how rid of initialize function. class orderservice def initialize @current_orders = current_orders end def orders_acceptance @current_orders. with_statuses(:acceptance). select |order| order.acceptance? if order.shopper_notified_at? end end def orders_start @current_orders. with_statuses(:start). select |order| order.start? end end private def current_orders @current_orders ||= begin order.includes(:timestamps). with_statuses( [ :acceptance, :start ] ) end end end 2 tips: don't call current_orders directly in constructor. orders should loaded first time when you're calling either orders_start or orders_acceptance . there risk initializes service when request processing starts ...

Difference between Session and Connection in SQL Server -

in case of temporary tables,we see connection dependent,i mean tables created in 1 connection available connection , automatically dropped when connection lost or destroyed. what difference between connection , session in sql server? literally : connection physical communication channel , session state of information exchange. connection may have multiple sessions . the connection physical communication channel between sql server , application: tcp socket, named pipe, shared memory region. session in sql server corresponds wikipedia definition of session : semi-permanent container of state information exchange. in other words sessions stores settings cache of login information, current transaction isolation level, session level set values etc etc. normally there 1 session on each connection, there multiple session on single connection ( multiple active result sets , mars) , there sessions have no connection ( ssb activated procedures , system sessions ). there conn...

html - css scroll with overflow property does not work -

i trying have vertical scrollbar in body of page. should implemented css. i don't want use fixed height. i used following code in css: .summary-scroll { overflow-y: scroll; overflow-x:hidden; height: 100%; } but not work. when add attribute named: layout="column" (without need have class attribute) body has scrollbar. i don't know relation between layout , scrolling? have implement in css , solution handling in css file? you can this .body-scroll{ max-height:600px; height: 100% !important; overflow-y: scroll; overflow-x: hidden; }

c# - Why Visual Studio 2010 Form not show any text after power failure? -

Image
i building stand alone desktop application, in development process desktop computer turned off due power failure. after sometime when power come face problem in text in form not visible , in data gridview control show divide 0 exception below image: please resolve issue. check database running if using, or try rebuilt after close windows

mysql - How to avoid javax.persistence.RollbackException: Transaction marked as rollbackOnly -

these specifications using in application spring 4.0.0 spring data version 1.10.1.release aspect-j version 1.8.9 spring-retry version 1.1.2.release the problem facing exception associated concurrent transactions in spring data. there many users logged in application @ same time , access 1 row of datbase table simultaneously. inorder avoid dirty reads have used pessimistic locking in repository layer , example @lock(lockmodetype.pessimistic_write) wallet findone(long id); and annotated methods transactional , annotated method @retryable retrying method on exceptions, shown below @transactional(isolation = isolation.read_committed, norollbackfor = {lockacquisitionexception.class}) @retryable(value = {lockacquisitionexception.class}, maxattempts = 5) public wallet dooperations() { ...... } when multiple simultaneous hits occur on above method exceptions thrown follows: 2016-08-29 11:39:03 error [sqlexceptionhelper:logexcept...

ios - How to implement URL Schema in my application? -

Image
i have implement required things in application enable url schema, , working fine. want open application safari. have pass 1 url parameter : https://www.myurl.com/signup/callback?signupcode=123?id=20 . want open application whenever press on link. not working. please suggest me can achieve this. added required tags in .plist file (see below screenshot reference). [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"https://www.myurl.com/signup/callback?signupcode=123?id=20"]]; this actual code. hear link ( https://www.myurl.com/signup/callback?signupcode=123?id=20 ) not working. problem accure.

Label is not displaying in Symfony form -

Image
i facing issue display label. following code generate form element. $builder->add( 'hearaboutus', 'choice', [ 'choices' => ['online search'=>'online search', 'email'=> 'email', 'my company' => 'my company', 'colleague or friend'=>'colleague or friend', 'existing client' =>'existing client', 'direct mail' => 'direct mail', 'other'=> 'other',], 'label' => 'how did hear us?', 'required' => true, 'expanded'=> true, 'multiple' => false, ] ); i getting following output. "notes" label "how did hear us" label not displaying. you can try override form theme choice widget. you can : 1- create file named fields.html.twig in a...

Limit string to fixed length and open remaining string in modal popup (Angularjs) -

i have limit string length in label if exceeds 25 characters , display entire string in modal popup making hyperlink. this: if string "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", should displayed as: label: abcdefghijklmnopqrstuvwxy i gave hyperlink www.google.com in example want modal popup should open entire text. i used directive limit length: http://itsolutionstuff.com/post/angularjs-how-to-limit-string-length-using-filterexample.html . var app = angular.module('myapp', []); app.filter('limitchar', function () { return function (content, length, tail) { if (isnan(length)) length = 25; if (tail === undefined) tail = "..."; if (content.length <= length || content.length - tail.length <= length) { return content; } else { return string(content).substring(0, length-tail.length) + tail; } }; }); ` i trying make "tail" hyperlink open modal popup...

java - Android - Can't access onSuccess of callback after login with Facebook in fragment -

i have successfully logged in facebook . but, can't access token or user profile onsuccess method of callback . have added callbackmanager.onactivityresult in onactivityresult. can login, can't access token id , user profile main.java public class main extends appcompatactivity { private callbackmanager callbackmanager; @override protected void oncreate(bundle savedinstancestate) { facebooksdk.sdkinitialize(getapplicationcontext()); callbackmanager = callbackmanager.factory.create(); } @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); callbackmanager.onactivityresult(requestcode, resultcode, data); } } accountview.java (fragment , error location) public class accountview extends fragment { private callbackmanager callbackmanager; private facebookcallback<loginresult> callback; @override ...

How to Implement Shared Secret Key into the code using in-app purchase in iOS -

any 1 know how how implement shared secret key code using in-app purchase in ios please help, read document , generate shared secret key in-app purchase don't know how implement shared secret key in code 1 have answer question issue.

android - realmio - realm objects can only be accessed from thread they were created -

question sound similar asked questions. have referred couldn't find solution problem i'm having. private addcartitemdialog.cartitemlistener cartitemlistener = new addcartitemdialog.cartitemlistener() { @override public void onokclick(product cartitem, int quantity) { realm.executetransactionasync(new realm.transaction() { @override public void execute(realm bgrealm) { draftinvoice draftinvoice = bgrealm.where(draftinvoice.class).equalto("shop.id", shopid).findfirst(); invoiceitem invoiceitem = bgrealm.createobject(invoiceitem.class); invoiceitem.setprice(cartitem.getprice()); invoiceitem.setid(cartitem.getid()); invoiceitem.setquantity(quantity); invoiceitem.calculatetotal(); draftinvoice.getinvoiceitems().add(invoiceitem); updatecartitemco...

javascript - Generate PDF from HTML with Map (exactly a screenshot) -

hi have html content , map, using leaflet api map rendering ( jsfiddle ) this whole content part of modal panel open on button click after user input data . want export content pdf client side solution. i have tried jspdf like not works. tried combination of canvastohtml , jspdf like not able make work either. point mentione here content contains map export jspdf doesn't support anyone knows solution, please share. have included code below ps: using phamtomjs screenshot utilities not option <script src="https://npmcdn.com/leaflet@1.0.0-rc.3/dist/leaflet.js"></script> <link href="https://npmcdn.com/leaflet@1.0.0-rc.3/dist/leaflet.css" rel="stylesheet" /> <body> <script> function createmap(mapplaceholderid) { var osm_map_tile_server_url = 'http://{s}.tile.openstreetmap.se/hydda/full/{z}/{x}/{y}.png'; var default_map_center = l.latlng(25.296854389343867, 51.488113403320...

javascript - Jquery Not Synchronized with the DOM -

i found new problem when manipulate dom using jquery. dom not updated. here go. var postcard = function($root) { this.$root = $root; this.stuff_id = this.$root.data('stuff_id'); this.id = this.$root.data('id'); this.is_owner = this.$root.data('is_owner'); this.$propose_button = null; this.$favorite_button = null; this.init(); this.initevents(); }; postcard.prototype.init = function () { this.$propose_button = this.$root.find("." + postcard.prototype.css_classes.propose_button); this.$proposal_box_modal = this.$root.find("." + postcard.prototype.css_classes.proposal_modal); this.$proposal_box = this.$root.find("." + postcard.prototype.css_classes.proposal_box); this.$favorite_button = this.$root.find(".post-card-button-favorite"); this.$total_favorite = this.$root.find('.post-card-total-favorite'); this.$image_view_editor = this.$root.find("#" + this.id + ...

javascript - go to previous window automatically after printing dialog closes -

i have page html elements reside , print function called via javascript @ end. <script type="text/javascript"> $(document).ready(function(){ window.print(); window.history.back(); }) </script> now have code redirect user after print or if cancel clicked. works on local in live server goes previous page immediately. use go previous page $(document).ready(function() { window.print(); history.go(-1); }); or: $(document).ready(function() { window.print(); history.back(); });

Javafx TableView Color Cells with a value using CSS -

is there way color cells of tableview value using css? cell s contain any value (i.e. cell s non-empty) can selected using filled pseudoclass, e.g. using following stylesheet: .table-cell:filled { -fx-background-color: red; } .table-row-cell:selected>.table-cell:filled, .table-cell:selected:filled { -fx-background-color: purple; } however cannot style cell containing specific value using css alone.

automation - Alternatives for automated CLI based Bluemix logins -

i have shellscript based automation uses cf cli (cf login) uses bluemix userid , password credentials. there scenarios involves several login attempts happens during point of time. 1 alternative approach can see reusing bearer token generated once till expires. but see if there other approach automation can performed (such using cf login -sso) not aware of. when new token uaa, refresh token can used renew authentication token many times like, perhaps rather automating cli should consider using cloud controller api directly.

java - Setting background color for each tab in JTabbedPane -

Image
looking @ example , have create form like: if press tab button, change color of background according color of button. here code that: private void jtabbedpane1mouseclicked(java.awt.event.mouseevent evt) { getcontentpane().setbackground(color.yellow) }; and result: my problem is: can't set color whole background, , can't change variable name of tab, can't set different events different colors each tab. says 2 components in same form cannot have same name any appreciated.

java - How to use subquery into where clause? -

we integrate in query calculated field. calculated field obtained simple select max(x) table2 . but in our main query, if want filter on calculated field, had integrate in clause. our problem integrate subquery where...in condition. we try subqueries.in function problem cant inject list of value. here sql request have. select this_.dmde_cee_id y0_, this_.dt_dmde y1_, (select max(this0__.statut) y0_ cs_fc_dmde_cee this0__ this0__.dmde_cee_id=this_.dmde_cee_id limit 1 ) y16_ xxx this_ ( select max(controledemandecee_.statut) y0_ cs_fc_dmde_cee controledemandecee_ controledemandecee_.dmde_cee_id=this_.dmde_cee_id ) in (3,5) order this_.nom_dos asc, this_.dt_dmde asc limit 10; here best result can have : select this_.dmde_cee_id y0_, this_.dt_dmde y1_, (select max(this0__.statut) y0_ cs_fc_dmde_cee this0__ ...

permissions - Linux doesn't show added group -

when try make 'devexe' group says exist when try see via command : $ cut -d: -f1 /etc/passwd it's not in list . because groups stored in /etc/group correct command list groups: getent group

z3 - Is there a theory for uninterpretable functions (congruence analysis)? -

i have set of symbolic variables: int a, b, c, d, e; a set of unknown functions, constrained number of axioms: f1(a, b) = f2(c, b) f1(d, e) = f1(e, d) f3(b, c, e) = f1(b, e) c = f1(a, b) b = d here functions f1 , f2 , f3 unknown, fixed. not theory of uninterpreted functions . i want prove validity of following assertions: c = f2(f1(a, b), b) f3(d, f2(c, b), e) = f1(e, b) using substitutions based on axiomatic equalities above. is there theory, such theorems use provided equalities try combine answer, rather coming interpretation functions? if so, name of theory, , smt solver support it? can mixed other theories, linear arithmetic? this still uninterpreted functions, because if there exist functions satisfy axioms sat in theory of uninterpreted functions. similarly, if such functions not exist, unsat in uninterpreted functions. picturing satisfiable if , if problem in uninterpreted functions satisfiable, 2 theories isomorphic, i.e. same. given you...

scalatest - How not to require the import of scala.language.relectiveCalls -

i subclassed org.scalatest.flatspec add practical tooling flattest. anywhere use subclass, have import scala.language.reflectiveclass otherwise get reflective access of structural type member method test should enabled making implicit value scala.language.reflectivecalls visible. the method test in question equivalent should in standard flatspec: it should "do stuff" in { ...} why not necessary import reflectivecalls use flatspec should necessary test method, , how can avoid that? the reason why getting warning have structural type reference or new {...} call somewhere in test method. unfortunately there no way turn off warning other explicit scala.language.reflectiveclass import or rewriting code.

postgresql - Psycopg2 insert python dictionary in postgres database -

in python 3+, want insert values dictionary (or pandas dataframe) database. have opted psycopg2 postgres database. the problems cannot figure out proper way this. can concatenate sql string execute, psycopg2 documentation explicitly warns against this. ideally wanted this: cur.execute("insert table values (%s);", dict_data) and hoped execute figure out keys of dict matches columns in table. did not work. examples of psycopg2 documentation got approach cur.execute("insert table (" + ", ".join(dict_data.keys()) + ") values (" + ", ".join(["%s" pair in dict_data]) + ");", dict_data) from a typeerror: 'dict' object not support indexing what phytonic way of inserting dictionary table matching column names? two solutions: d = {'k1': 'v1', 'k2': 'v2'} insert = 'insert table (%s) values %s' l = [(c, v) c, v in d.items()] columns = ','.join(...

Custom Component in Android View -

Image
i have create custom component this: how write custom component? for setting icon on left side of edittext, can use this: android:drawableleft="@mipmap/icon_username" where "icon_username" image set hint this: android:hint="username" to draw border around edittext should use separate drawable file(xml file) sample code drawable file: edittext_lines.xml : <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:top="30dp"> <shape android:shape="rectangle"> <stroke android:width="1dp" android:color="#ffffff" /> <solid android:color="#ffffff" /> </shape> </item> </layer-list> final code may like: <edittext android:layout_width="wrap_content...

Java/Quickrex regex: missing character in group when using negative lookahaed -

in java (using eclipse quickrex plugin test) i'm using following expression: (^[\.\(&\)]*)(.*)(?!([\.\(&/\)]*$)) to match text: .(&&()..abc----....d25..../)(& the expected goal match 3 groups: (1) .(&&().. (2) abc----....d25 (3) ..../)(& the goal further continue 2nd group , cut preceeding group no.1 , subsequent group no.3. requirement user should define 3 regex expressions himself in 3 separate gui fields. what happening: 3 groups match fine in quickrex, in group no.2 abc----....d2 "5" @ end missing, , not appearing in group no.3: [.(&&()..][abc----....d2] 5 [..../)(&] environment: eclipse mars 4.5.2, java 1.8.0_66, quickrex 4.3.0 two questions: is proper way match these groups? is there logical reason why "5" not included or bug in regex engine? 5 not included because cannot matched due negative lookahead (?![.(&/)]*$) makes engine backtrack , find 2 not followed . ,...

how to create a full width with no label select element in ionic? -

in form use full width element. don't need label, possible? this select used store list of elements filled controller. have tried without using not change anything. thanks you need remove tag , set size max-width: 100%; width: 100% . <ion-item> <ion-select [(ngmodel)]="selectmodel" style="max-width: 100%; width: 100%"> <ion-option value="c">fist item</ion-option> <ion-option value="e">second item</ion-option> </ion-select> </ion-item> regards.

javascript - Create Repeated Fields in jQuery -

$(documnet).ready(function(){ $('#more_finance').click(function(){ var add_new ='<div class="form-group finance-contact" id="finance_3"><div class="col-sm-9"><label for="firstname" class="control-label">finance contact#</label></div><div class="col-sm-9"><input type="text" id="finance" name="finance[]"placeholder="finance contact" class="form-control" autofocus></div>\n\ <a href="#" class="delete_png"><img src="/img/deleted-box.png"></a></div>'; $(add_new).insertafter( "#finance_1"); }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="form-group finance-contact" id="finan...

groovy - Loop test steps in multiple test cases using SOAPUI -

i'm having issue in automating web services. actually have excel sheet containing input , outputs needed. i wrote groovy script retrieve inputs, save them in properties, execute query, retrieve outputs , compare them excel outputs. my problem process execute 1 test case. i want "pimp" process every line of excel sheet dealt test case. here's groovy code : import jxl.* import jxl.write.* workbook workbook1 = workbook.getworkbook(new file("c:\\users\\****\\desktop\\groovypssheet.xls")) sheet sheet1 = workbook1.getsheet(0) (int i=6; i<sheet1.getrows(); i++) { sleep 1000 if (sheet1.getcell(0,i).getcontents()=="") { i++ } cell clairance = sheet1.getcell(3,i) cell etatpatho = sheet1.getcell(2,i) cell idlreq = sheet1.getcell(1,i) cell idprod = sheet1.getcell(0,i) cell typeprod = sheet1.getcell(4,i) testrunner.testcase.setpropertyvalue( ...

How to implement "Who is talking?" feature in webrtc ios application? -

i creating ios application using webrtc video conferencing. want detect talking in peer connection. to more specific,i want detect audio activity of remote peer connected can detect person speaking. this can implemented measuring audio level in peerconnection stats. function should study - (void)peerconnection:(rtcpeerconnection*)peerconnection didgetstats:(nsarray*)stats

javascript - How to get innerHTML including data attributes -

i'm using document.body.innerhtml text version of html can store , reload later using jquery's append . works fine isn't saving data-* attributes i'm storing in html nodes. there method can me string of innerhtml including data attributes? assuming using jquery .data() : jquery's .data() method storing data in javascript , not html attributes. existing data-* attributes pulled object. more information check docs . to save data html data attributes use .attr() . following: $('.el').attr('data-foo', 'bar');

ios - Is there any way to change "DELETE" button from UITableViewCell? -

i want change delete button in uitableviewcell. actually, need : change position of button font text color of button. here can change button text in following delegate method : - (nsarray<uitableviewrowaction *> *)tableview:(uitableview *)tableview editactionsforrowatindexpath:(nsindexpath *)indexpath { uitableviewrowaction *viewaction = [uitableviewrowaction rowactionwithstyle:uitableviewrowactionstyledefault title:@"follow" handler:^(uitableviewrowaction *action, nsindexpath *indexpath) { nslog(@"view action fired"); }]; viewaction.backgroundcolor = [uicolor clearcolor]; return @[callaction]; } but how change other attributes of button. if knows, please let me know. thanks. to working, implement following 2 methods on uitableview's delegate desired effect - (bool)tableview:(uitableview *)tableview caneditrowatindexpath:(nsindexpath *)indexpath { return yes; } - (void)tableview:...

Dedicated settings for Azure web jobs -

Image
i have bunch of azure web jobs on 1 app service hosted on 1 app service plan . each web jobs have own role & function & settings . settings can defined (or overridden) @ app service level. does mean i missed concept & granularity of web jobs ? i should add kind of prefix in settings ? if 'settings' referring azure web app settings, indeed shared among webjobs within app service. if need them different, can host each webjob in different web app. both web apps can in same app service plan, won't cost more.

web applications - Query several user's Google Fit data via REST API -

what right way of asking google fit info of users own web application (obviously having consent)? i see param "userid" within url path unique way of asking several specific users, stated in reference manual, seems "me" value supported. ...so means not possible retrieve fitness information more 1 user using fit rest api inside web application? any welcome! you correct. you'd have 1 one. can see in get uri request : https://www.googleapis.com/fitness/v1/users/userid/datasources/datasourceid there's 1 room userid . there's users.datasources: list lists data sources visible developer, using oauth scopes provided. list not exhaustive; user may have private data sources visible other developers, or calls using other scopes.

c# - AngularJs Filter to Remove duplicates using Check two Key values -

i have collection has 2 keys below angularjs model. $scope.collection=[{id:1,name:"a"},{id:1,name:"b"},{id:1,name:"a"},{id:1,name:"c"},{id:2,name:"a"},{id:2,name:"c"},{id:2,name:"a"},{id:3,name:"d"}]; i want remove duplicate rows, if both keys have same values , wanted array without duplicate rows using angularjs filter. sample output should below $scope.collection=[{id:1,name:"a"},{id:1,name:"b"},{id:1,name:"c"},{id:2,name:"a"},{id:2,name:"c"},{id:3,name:"d"}] a possible solution (base angularjs): .filter('remover', function () { return function ( items ) { //filtering duplicates... var filtered = {}; ( var = 0; < items.length; i++ ) { if(filtered[items[i].id] == undefined) filtered[items[i].id] = []; if(filtered[items[i].id].indexof(items[i].name) ...

Dot net grid view functionality in Android -

how can bind gridview in android in dot net. see code below give delete button each row.is there similar functionality in android. <asp:gridview id="gvsample" runat="server" width="100%" autogeneratecolumns="false" datakeynames="id,place,maddress" onrowcommand="gvsensors_rowcommand"> <columns> <asp:boundfield datafield="devicename" headertext="s id"> <itemstyle horizontalalign="center" /> </asp:boundfield> <asp:boundfield datafield="mcountry" headertext="country"> <itemstyle horizontalalign="center" /> </asp:boundfield> <asp:boundfield datafield="mstate" headertext="state"> <itemstyle horizontalalign="center" /> </asp:boundfield> <asp:templatefield headertex...

wordpress - PHP Rendering Age -

i'm using wordpress , want age update dynamically in posts. i using below code in functions.php: function internoetics_determine_age($atts) { extract( shortcode_atts( array( 'dob' => '' /* see post date formats */ ), $atts ) ); $age = floor((time() - strtotime($dob)) / 31556926); return $age; } add_shortcode('age', 'internoetics_determine_age'); i use shortcode [age dob="1945"] result displayed -16, should 71. any ideas? strtotime function works dates strtotime(1945) incorrect. strtotime('1945-01-01') correct so: $age = floor((time() - strtotime(((int)$dob) . '-01-01')) / 31556926); but should use: $age = date('y') - ((int)$dob); *((int)$dob) in case $dob has different format

Android realm. Passing RealmObject as parameter to constructor. Null values fields -

it seems ralmobject sets fields default values when passes constructor of other realmobject (look @ comments in code below). simple workaround don't pass object constructor , assign fields after object created. don't understand how's possible. question is: can explain what's going on, please? , in situations else should aware of behavior while working realm? that's simple example of code reproduces issue: realm = realm.getdefaultinstance(); realm.executetransaction(new realm.transaction() { @override public void execute(realm realm) { stock stock1 = new stock(); stock1.id = "stock1"; managedstock = realm.copytorealm(stock1); } }); //output here: managedstock.id = stock1 log.d("mylogs", "managedstock.id = " + managedstock.id); goods goods = new goods(managedstock); and in constructor of goods object passed managedstock has id == null, how's possible? public class goo...

python - sklearn.cluster.DBSCAN gives unexpected result -

i'm using dbscan method clustering images, gives unexpected result. let's assume have 10 images. firstly, read images in loop using cv2.imread . compute structural similarity index between each images. after that, have matrix this: [ [ 1. -0.00893619 0. 0. 0. 0.50148778 0.47921832 0. 0. 0. ] [-0.00893619 1. 0. 0. 0. 0.00996088 -0.01873205 0. 0. 0. ] [ 0. 0. 1. 0.57884212 0. 0. 0. 0. 0. 0. ] [ 0. 0. 0.57884212 1. 0. 0. 0. 0. 0. 0. ] [ 0. 0. 0. 0. 1. 0. 0. 0. 0. 0.] [ 0.50148778 0.00996088 0. 0. 0. 1. 0.63224396 0. 0. 0. ] [ 0.47921832 -0.01873205 0. 0. 0. 0.63224396 1...

javascript - Any way to run a function when a gulp task is finished -

i have many gulp tasks in gulpfile, , need run function after each task done. i handled task registration this: var registertask = function (taskname, dependencies, todo) { if (isproduction) { gulp.task(taskname, dependencies, todo); } else { var prefixedtaskname = '_' + taskname; // original task registers here name gulp.task(prefixedtaskname, dependencies, todo); // register task after original task done gulp.task(taskname, [prefixedtaskname], myrepeatedfunction); } } and register tasks this: registertask('foo', [], function () { gulp .src() .pipe() ... }) but makes terminal dirty logs (underscored task names): [15:54:17] using gulpfile ~/projects/xxx/gulpfile.js [15:54:17] starting '_default'... [15:54:17] starting '_remove-source-map'... [15:54:17] starting '_fontastic'... [15:54:28] finished '_fontastic' after 11 s [15:54:28] starting 'fontastic'... [15:54:28] fini...

php - How with javascript change html code -

i need following change using javascript: from: <input id="innn" value="" /> to: <input id="innn" value="some_value" /> i tried this: document.getelementbyid("innn").setattribute("value", "189"); and this: document.getelementbyid('innn').value = '152'; it worked changed visual on page not html code , need change code shown below: <input id="innn" value="" /> --> <input id="innn" value="125" /> --><input id="innn" value="158" /> please or must use php : <input id="innn" value="<? php ... ?>" /> ???? html rendered in order browser know show on page. once sent server not change (at least not basic javascript). there more advanced ways of doing things, not simple. when call javascript function change something, changes in dom, see change o...

avfoundation - iOS - Swift - Some audio when recording reached the maximum allowable length -

i implemented video recorder in swift part of ios app, set maxrecordedduration video output 4 seconds (30 frames per second): self.videooutput?.maxrecordedduration = cmtimemakewithseconds( 4, 30 ) when user starts recording there 2 scenarios can occur: the user decides stop recording before max recording duration reached. the max recording duration reached before user stops video recording. in of 2 cases both func captureoutput( captureoutput: avcapturefileoutput!, didstartrecordingtooutputfileaturl fileurl: nsurl!, fromconnections connections: [anyobject]! ) and func captureoutput( captureoutput: avcapturefileoutput!, didfinishrecordingtooutputfileaturl outputfileurl: nsurl!, fromconnections connections: [anyobject]!, error: nserror! ) will triggered part of avcapturefileoutputrecordingdelegate , responsible responding events occur in process of recording video file (corresponding apple documentation). the video output works flawless in user scenario 1. howeve...