Posts

Appcelerator Titanium using common options for labels -

for ( = 0; < 10; i++) { var ypos = 30; var label1 = ti.ui.createlabel({ left : 0, top : ypos , width: "50%", backgroundcolor: "blue", height: 20, text: i.tostring(), textalign: ti.ui.text_alignment_center }); var label2 = ti.ui.createlabel({ left : "50%", top : ypos , width: "50%", backgroundcolor: "blue", height: 20, text: i.tostring(), textalign: ti.ui.text_alignment_center }); ypos += 30; }; i not use again , again following block of code in loop. width: "50%", backgroundcolor: "blue", height: 20, text: i.tostring(), textalign: ti.ui.text_alignment_center i using alloy. assigned class below var label2 = ti.ui.createlabel({ left : "50%", top : ypos , ...

javascript - Event handler / trigger for when web browser's autofill is used -

i have form inputs labels hovering above them placeholders. user types text, these labels hidden. problem when browser autofill fired, , chrome example populates inputs values, labels left visible, creating overlapping of label text, , input text. need trigger fired when autofill used can hide these labels. i have found a hack solution , requires timer checks each input value , listens changes. isn't ideal me because of resource consumption, , lot of code simple function. is there event listener or effect, if input autocompleted, trigger function of own?

Text Document Editor in Java Swing Application -

Image
i in process of developing java application using swing. want open document file inside application user can select content. on right click, should give list of fields above, when user clicks on field selected part document goes particular field. please refer image: you can select text in jtextcomponent , bring jpopupmenu . menu should have action each field copies selected text corresponding field. related example illustrates of concepts.

matlab - Finding R peak from a heart signal input from a stethoscope -

given heart beat signal measured using stethoscope audio card of computer through hardware(mainly amplifier , low pass filter having cutoff frequency 100hz). signal filtered cutoff 100hz..the code find peak , beats per minute given below..the code works cases. please me find mistake clear %input signal matlab [x,fs]=wavread('heartbeat.wav'); figure(1) subplot(2,1,1) x1=x(:,2); plot(x1(500:10000),'r-'); title('unfiltered input x(n),cut off frequency 0.0270,passband 60hz,stopband 70hz'); ylabel('amplitude in volts'); xlabel('number of samples') grid on %to filter signal above 50-60 hz order=4; h=fir1(4,0.0270,hamming(order+1)); y=filter(h,1,x1); subplot(2,1,2) plot(y(500:10000),'b-') title('filtered output y(n),cut off frequency 0.0270,passband 50hz,stopband 60hz'); ylabel('amplitude in volts'); xlabel('number of samples') grid on %sound(y,5000) th = max(y) * 0.9; %so here i'm considering less 90% of ...

Audio Player: Constant playing -

i building radio website friend of mine. possible make player keep playing , not interrupt when navigating/reloading website (the audio player's source link of stream server, using html5 player)? interrupting annoying. last solution adding on popup window guy wants visitors have website opened (i dont know why). have tried far: added player in new web page, , inserted in radio website via iframe no results. in advance! the radio website on wordpress (i don't think matters, saying) you can create own audio player , freez or use below audio player plugin reference. http://wordpress.org/plugins/audiobar/

c++ - How to implement two structs that can access each other? -

the code have written: struct a; struct b; struct { int v; int f(b b) { return b.v; } }; struct b { int v; int f(a a) { return a.v; } }; the compile message: |in member function 'int a::f(b)':| 11|error: 'b' has incomplete type| 7|error: forward declaration of 'struct b'| ||=== build finished: 2 errors, 0 warnings (0 minutes, 0 seconds) ===| i know, why code not correct, don't know how implement 2 structs can access each other. there elegant way? in advance. if want keep exact same signature of member functions, have postpone definition of member functions until both class definitions have been seen // forward declarations struct a; struct b; struct { int v; int f(b b); // works forward declaration }; struct b { int v; int f(a a); }; int a::f(...

javascript - Cannot set attributeBindings to property on View's ObjectController in Ember -

i managed set attributebinding controller context through handlebars template: <li {{bindattr class="view.controller.isselected:active:"}}> <a href="#" {{action "toggleselected"}}>{{view.controller.title}}</a> </li> which called within each group this: <ul class="nav nav-tabs nav-stacked"> {{#each skill in controller}} {{view app.skillview}} {{/each}} </ul> but found emberjs adding divs around each view causing problems css removed li tags template , set tagname in skillview , attempted attributebinding through js object adds li dom element want attributebindings using doesn't seem work: app.skillview = ember.view.extend({ templatename: 'skill', tagname: 'li', attributebindings: ['controller.isselected:active:'] }); nor this: app.skillview = ember.view.extend({ templatename: 'skill', tagname: 'li', attrib...

regex - Regular expression for a dynamic URL in Jmeter -

i pretty new jmeter , regular expressions. below bold 1 characters changes every time new link generated user. want add regular expression below. can 1 me in this? /summithealthivv/common/electronicsignatureacceptance.aspx?strquerystring= +ettntn2yqkmqzjblj3uma1umqv8j4sevzco7uv8tir0gadccb3xbqfdrx7fxswwhsqybtq7kk4feqxfvgtnpiwkj7rlsm1ukzgatnkqgfpbijh2ljln7jkny7hfx7ngg try this: /strquerystring\=([a-z0-9\+]{1,})/i or /strquerystring\=(\s{1,})/i

java - Invocation target exception -

here code of program import javax.swing.*; import java.awt.*; import java.awt.event.*; class jadapterokno extends windowadapter { public void windowclosing(windowevent e) { system.exit(0); } } class calcbutton extends jbutton implements actionlistener { kontroler k; calcbutton(kontroler k, string nazwa, int s) { super(nazwa); this.k = k; setfocusable(false); this.setfont(new font("tahoma", font.bold, s)); addactionlistener(this); } public void actionperformed(actionevent er) { k.dopisz(this); } } class infobutton extends jbutton implements actionlistener { kontroler k; infobutton(kontroler k, int s) { super("info"); this.k = k; setfocusable(false); addactionlistener(this); this.setfont(new font("tahoma", font.bold, s)); } public void actionperformed(actionevent err) { k.info(); } } class cl...

knockout.js - Knockout computed bool value not updating -

here's simple viewmodel: var vm = { isvalid1: ko.observable(false), isvalid2: ko.observable(false), isvalid3: ko.observable(false), isvalid4: ko.observable(false), isallvalid: ko.computed(function() { return isvalid1() && isvalid2() && isvalid3() && isvalid4(); }); } when updating isvalid , setting them true this: vm.isvalid1(true); vm.isvalid2(true); vm.isvalid3(true); vm.isvalid4(true); isallvalid never seems updated. doing wrong here? thanks nicolas you cant use literal that, have create constructor , initiate like var vm = function() { this.isvalid1 = ko.observable(false); this.isvalid2 = ko.observable(false); this.isvalid3 = ko.observable(false); this.isvalid4 = ko.observable(false); this.isallvalid = ko.computed(function() { return this.isvalid1() && this.isvalid2() && this.isvalid3() && th...

Re-assigning a Cursors SELECT Statement. SQL Server 2008 -

for while have been searching resources way re-assign cursors select statement no success. first let me show code far: @keystring - stores list of id's seperated comma. @individual - stores individual id once @keystring broken up. declare @keystring varchar(100) = '4, 6' declare @individual varchar(10) while len(@keystring) > 1 begin if patindex('%, %', @keystring) > 1 begin set @individual = substring(@keystring, 0, (patindex('%, %', @keystring))) end else begin set @individual = @keystring end if not cursor_status('global', 'id_cursor')>= -1 begin declare id_cursor cursor select blah tbl_blah id = @individual open id_cursor end else begin /*reset id_cursor = select blah tbl_blah keyword = @individual (the next @individual after first loop)*/ end fetch next id_cursor @blah while @@fetch_status = 0 begin ...... fetch next id_cursor @blah end...

osx - Flash AS 3.0 Relative path to file in Mac OS X -

i have swf loads images , displays it. path images relative. looks this: ../../../images/thumbnail1.png on windows works fine. on mac os x swf file cannot load images. there differences between relative path on windows , mac os? previewimagepath ../../../images/thumbnail1.png previewloader = new loader(); previewloader.contentloaderinfo.addeventlistener(event.complete, previewloaded); previewloader.load(new urlrequest(previewimagepath)); public function previewloaded(e:event):void { previewimagebtm = bitmap(previewloader.content); previewimagebtm.smoothing=true; addchild(previewimagebtm); }//previewloaded there no limitation on osx load image on previous folders. code correct. ensure have sufficient privileges in previous folders , test file in local server. here have example , works on mac. https://docs.google.com/file/d/0bw9pblm_bascdws2d2lczfvrdwm/edit?usp=sharing

javascript - A nice algorithm for font-size relative to number of chars and screen width -

ok, have input field big font (100px). thought when user starts writing letters, font size lower instead of phrase moving off screen. its gotta responsive well, algorighm includes screen width nice. what have now: var chars = $('#big-search').val(); var w = $(window).innerwidth(); var fz = parseint($('#big-search').css("font-size"), 10); console.log(fz); var nfz = 100-((chars.length/w)*(w*2.2)); if(nfz < 100){ $('#big-search').css("font-size", nfz+"px") } the problem speeds lowering of font size. should rather slow down. any thoughts on this? this did trick: var basefz = 100; var chars = $('#big-search').val(); var w = $(window).innerwidth(); var nfz = (w/100)*(basefz/chars.length); if(nfz <= 100 && nfz >= 20){ $('#big-search').css("font-size", nfz+"px"); } else if(nfz >= 100){ $('#big-search').css("font-size", 100+"...