Posts

Showing posts from January, 2014

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+"

objective c - Nested comments in Xcode -

when write method bit complicated prefer add little comment block above as /*--------------------------------------------------------------+ | when wrote this, god , understood doing | now, god knows +-------------------------------------------------------------*/ - (void) overlydifficultmethodtograsp { ... } is way comment out method code hit cmd + / ? result in ///*--------------------------------------------------------------+ // | when wrote this, god , understood doing // | now, god knows // +-------------------------------------------------------------*/ //- (void) overlydifficultmethodtograsp { ... } // what is /* /*--------------------------------------------------------------+ | when wrote this, god , understood doing | now, god knows +-------------------------------------------------------------*/ - (void) overlydifficultmethodtograsp { ... } */ which, can see, doesn't work... why? think large chunks of // ugly! this has not xcode, lang

GeoGoogle(Java) - How to import the file? -

i'm trying use geogoogle geocoding purposes http://geo-google.sourceforge.net/ when tried use line of code: import geo.google.geoaddressstandardizer; geoaddressstandardizer st = new geoaddressstandardizer("aabbcc"); it says geoaddressstandardizer , import cannot resolved, added jar build path already. has met issue before? thanks solution: geogoogle-1.5.0.jar instead inside https://www.cs.drexel.edu/~zl25/maven2/repo/geogoogle/geogoogle/1.5.0/ having quick through geo-google source, exist constructor here . public geoaddressstandardizer(string apikey) so problem has lie in way application using jar. deploying web server or (although i'd expect classnotfoundexception)? if @ build config in ide, jar exist? how did add it?

android - onKeyDown inside custom viewPager that has been added through code in an activity -

there 1 activity in loading 1 layout , on click event adding viewpager calling addview(customviewpagerinstance) customviewpagerinstance contains 3 separate type of custom views. want handle onkeydown method separately each type of view , handle separately on activity itself. i have implemented onkeydown() in activity : @overrride onkeydown(int keycode, keyevent event) { if(keycode==keyevent.keycode_back){ if(viewpageradded) return false; else //dobackbuttonprocessingofactivity return true; } else return false; } and on 3 custom views : @overrride onkeydown(int keycode, keyevent event) { if(keycode==keyevent.keycode_back){ { if(viewpageradded) //dobackbuttonprocessingofcustomview return true; else return false; } else return false; } and setting setfocusable(true) , setfocusableintouchmode() the in customview constructor still onkeydown() of customview not triggered. --any appreciated.

javascript - check image has been loaded using jquery -

problem- @ run time changing/replacing src attribute of images using jquery. these images default hidden. want display these images when these images download , ready display because possible images can not downloaded. <img id="pic_1" width="153" height="160" border="0" onmouseout="this.style.border='2px solid #ffffff';" onmouseover="this.style.border='2px solid #4585e7';" style="visibility: hidden;" src="**to replaced @ run time**""> please let me know solution how can achieve this. i believe can use load event this. something like: $('#myimage').load(function() { //called when image loaded }); here working example here example delayed loading

ios - How to continuously check collisions in Tiled tilemaps during a CCMoveTo -

hello people of stack overflow stand before today (not great) cocos2d issue. how can check collisions while in action, instead of checking target tile? working tilemap has meta layer there collidable tiles. following code works when click collidable tile, not when click beyond it, if happens walk straight through. currently, detect collisions code: -(void)setplayerposition:(cgpoint)position { cgpoint tilecoord = [self tilecoordforposition:position]; int tilegid = [_meta tilegidat:tilecoord]; if (tilegid) { nsdictionary *properties = [_tilemap propertiesforgid:tilegid]; if (properties) { nsstring *collision = properties[@"collidable"]; if (collision && [collision isequaltostring:@"true"]) { return; } } } float speed = 10; cgpoint currentplayerpos = _player.position; cgpoint newplayerpos = position; double playerposdifference = ccpdistance(currentplayerpos, newplayerpos) / 24; int timetomovetonewpostit

SQL server IF begin statement in where function -

i'm trying create following in statement. registration_date >=@startdate , registration_date < dateadd(day,1,@enddate) , if @affiliateid null begin channel in (select value dbo.split(',',@channel)) end else affiliate_id in (select value dbo.split(',', @affiliateid)) , registration_channel in (select value dbo.split(',', @channel)) so, trying if @affiliateid null, use @channel input affiliate ids, if not use specific @affiliateid, irrespective of channels. is there way make work? select * mytable date(registration_date) between @startdate , @enddate , exists ( select null dbo.split(',', coalesce(@affiliateid, @channel)) value = case when @affiliateid null channel else affiliateid end ) , exists ( select null dbo.split(',', @channel) value = registration_channel ) in sql

iphone - [UIDeviceRGBColor set]: message sent to deallocated instance -

i developing application instagram. have code cellforrowatindexpath , every time creates object unbutton , autorelease. button display username , may 1,2,3,4,5,.. total users. there create uibutton on depend on cout. not using arc . but crash (not everytime) when setcolour. i enabled nszombie , keeps saying: [uidevicergbcolor set]: message sent deallocated instance 0x21b526f0 uibutton *btnlikeusername = [[[uibutton alloc] init] autorelease]; [btnlikeusername.titlelabel setfont:[uifont boldsystemfontofsize:12]]; if (posx + size.width > 280) { posy = posy + 22; posx = 18; btnlikeusername.frame = cgrectmake(posx,posy,size.width,size.height); posx = posx + size.width + 5; } else { btnlikeusername.frame = cgrectmake(posx,posy,size.width,size.height); posx = posx + size.width + 5;

html - How to resize <img> in <div> with float:left? -

i've got problem, how automatic resize height of in . here i'am trying make pure css slideshow, , works, when scale browser window width changes , height - doesn't. why? , how fix this? more of i'll try use different hack/advices , use lot of them here , didnt work. when change width manualy(in css), height changes . how change height dynamic in examples? p.s. sorry bad english...i hope understand me... now have check if remove this * { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } than slider ok ...

customization - Quiet mode for pdfLaTeX in emacs -

i've begun use emacs pdflatex writer/compiler, brilliant. however, whenever execute tex file ( c-c c-f ), executes following: (setq latex-run-command "pdflatex") i awful lot of verbose output pdflatex. is there way change behaviour? thought of (setq latex-run-command "pdflatex -interaction=batchmode") doesn't seem trick. when doing latex in emacs should use package named auctex. fixes problem , has lot of functionality.

html - Mobile Email using PSD slices -

i looking way resize our newsletter automatically mobile. have our emails in tabled layout using slices in photoshop (around 100+ image slices). thing is, there's many variations of sizes image width etc. me code it. there easier way this? i've read this , kind of got gist of article, can't find ones discuss tables in depth. advice helpful, :) i can't imagine why need many slices. using photoshop slices not best practice in email. in fact images should limited necessary because in cases, reader start images turned off default in email client. many people read emails images off, , if can't see it, defeats purpose. i'd suggest take @ how create basic email newsletter , keep things simple. consistently rendering responsive emails hard accomplish many different email clients. trying more single column or 2 column type layout asking trouble. email on acid has solid responsive template started there plenty of templates on campaign monitor

javascript - Use jQuery to select multiple elements with .eq() -

i want select subset of tds table. i know before hand indexes are, random (not odd or indexes, etc). for instance want select 0th, 5th , 9th td. indexestoselect = [0, 5, 9]; // 1) selects 1 one $('table td').eq(0) $('table td').eq(5) $('table td').eq(9) // 2)this selects them group (with underscore / lodash) var $myindexes = $(); _.foreach(indexestoselect, function (idx) { $myindexes = $myindexes.add($('table td').eq(idx)); }); so (2) works , using that, wonder if there more natural way using jquery. something passing .eq() array of indexes? (that doesn't work) // not work $('table td').eq([0, 5, 9]) if not write small plugin .eqmulti(array). note: there no class these tds share exclusively, selecting based on class won't work. i'd .filter() , $.inarray() : var elements = $("table td").filter(function(i) { return $.inarray(i, indexestoselect) > -1; }); another [ more ugly ] wa

jquery - Scroll sprite element on a path -

i similar with: this instead of straight path, have path curves! , sprites must able animated on scroll! suggestions or appreciated! thanks! this jquery plugin creating dynamic character , background animation in pure html , javascript spritely.net this should !

group concat - PHP MySQL Hierarchy Data group_concat -

any amazing. got following mysql query: select group_concat( sp.`slug` separator '/' ) `category` sn, `category` sp sn.lft between sp.`lft` , sp.`rgt` , sn.`id` =3 order sp.`lft` asc; without group_concat function returns desired results in correct order. apply group_contact order mashed , incorrect. know how rewrite query give me concatenated result desired , in correct order? im @ loss on this. on side note know how rewrite using "inner join" statements opposed 2 table names quoted next each other dont understand how joining 2 tables. try this: select group_concat( sp.`slug` order sp.`lft` asc separator '/' ) `category` sn, inner join `category` sp on sn.lft between sp.`lft` , sp.`rgt` sn.`id` =3

python - Error: object.__new__() takes no parameters -

i'm getting following message, this use work before . have removed .delay function below generate message task looks processrequests.delay.(batch) object._ new _() takes no parameters if request.method == 'post': batches = batch.objects.for_user_pending(request.user) batch in batches: processrequests(batch) #processrequests.delay used here batch.complete_update() task: class processrequests(task): name = "request process" max_retries = 1 default_retry_delay = 3 def run(self, batch): e in contact.objects.filter(contact_owner=batch.user, group=batch.group): msg = message.objects.create( recipient_number=e.mobile, content=batch.content, sender=e.contact_owner, billee=batch.user, sender_name=batch

Magento extension, unable to load child html -

i added inchoo featured product extension week back, , working fine till yesterday. code follows. in home page xml layout: <reference name="content"> <block type="catalog/product" template="page/homepage.phtml" name="homepage" alias="home_page" after="cms_page"> <block type="bannerslider/bannerslider" template="bannerslider/bannerslider.phtml" name="banner_slider" /> <block type="featuredproducts/listing" template="inchoo/block_featured_products.phtml" name="featuredproducts" /> </block> <remove name="breadcrumbs" /> </reference> in template: homepage.phtml, loading featured products block as: <?php echo $this->getchildhtml('featuredproducts'); ?> this problem occurs, above line not printing anything. class block type, assumed (\app\code\community\inchoo\featuredproduct

ios - UIAlertView clickedButtonAtIndex method is not called -

in .h file @interface menuviewcontroller : uiviewcontroller<uialertviewdelegate> in .m file @interface tacdiymenuviewcontroller () @end @implementation tacdiymenuviewcontroller - (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil { self = [super initwithnibname:nibnameornil bundle:nibbundleornil]; if (self) { // custom initialization } return self; } - (void)viewdidload { [super viewdidload]; } - (void)viewwillappear:(bool)animated{ [super viewwillappear:animated]; } - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. } - (nsinteger)numberofsectionsincollectionview:(uicollectionview *)collectionview{ return 1; } - (nsinteger)collectionview:(uicollectionview *)collectionview numberofitemsinsection:(nsinteger)section{ return [self.imageviews count]; } - (cgsize)collectionview:(uicollectionview *)collectionview layout:(uicollectionviewl

mysql - Merge two similar aggregate functions in select statement -

here's sql statement: select distinct `class`, `student_id` , `student_name`, ( select sum( `credits` ) `stumgr_scores` b join `stumgr_courses` using ( `course_id` ) `year` =2012 , a.`student_id` = b.`student_id` ) `total_credits`, ( select sum( `credits` * `final_score` ) `stumgr_scores` c join `stumgr_courses` using ( `course_id` ) `year` =2012 , a.`student_id` = c.`student_id` ) `total_scores` `stumgr_scores` natural join `stumgr_students` `year` =2012 , `grade` =2011 you may discover these 2 select statement use aggregate functions similar. so, want merge them 1 following: select distinct `class`, `student_id` , `student_name`, ( select sum( `credits` ) `total_credits`, sum( `credits` * `final_score` ) `total_scores` `stumgr_scores` b join `stumgr_courses` using ( `course_id` ) `year` =2012 , a.`student_id` = b.`student_id` ) `something` `stumgr_scores` natural join `s

android - How to show toast in second java file? -

i have been reading forum days , have found no answer problem. i'm having problem getting java.lang.nullpointerexception when try show toast. in android application have myworkactivity.java main activity , statistika.java intended calculate statistics based on data database. inside class myworkactivity (public class myworkactivity extends activity implements onclicklistener) have menu item statistika. when press on item want show layout statistika.xml data statistika.java this: public class myworkactivity extends activity implements onclicklistener { //menu item statistika else if(item.getitemid()==r.id.statistika) { //layout statistika.xml setcontentview(r.layout.statistika); statistika nova_statistika = new statistika(); nova_statistika.rsatidanasjucemjesec(sdatumzaprikaz); } } but have been receiving java.lang.nullpointerexception on dbjucedanas = this.openorcreatedatabase(databaseinfo.ime_baze, mode_private,nu

c# - TransactionScope Complete() doesn't commit the transaction before exiting the USING statement -

i experiencing weird behavior transaction gets committed when using exits , not when calling scope.complete(); using (transactionscope scope = new transactionscope(transactionscopeoption.requiresnew)) { scope.complete(); // data still doesn't show in db } // shows in db how commit transaction before exiting using statement? from documentation : the actual work of commit between resources manager happens @ end using statement if transactionscope object created transaction. so doesn't can commit transaction before using statement end.

sqlite3 - How to get output of sqlite command in shell script -

i trying make rollback if went wrong during execution of sql crud operations or if can not make commit shell scripting. i have test2.sh , test.sh test.sh: #!/bin/sh sqlite3 db.sqlite << eof begin; select * table1; and test2.sh #!/bin/sh if echo `./test.sh`|grep -q "sql error"; rollback; else err=commit; if echo $err |grep -q "error"; rollback; fi fi there no table called table1 , expected sql error output of test.sh , rollback. but gives error : rollback: command not found. how can error , make rollback? or way follow right? your test2.sh script fails because shell trying execute program called rollback , hence "command not found". want use sqlite instruction rollback, whichs means you'd have @ least : sqlite3 db.sqlite << eof rollback; eof but don't think work . see it, rollback has occur within same sqlite session 1 started test.sh have effect. test.sh script makes sqlite plow through co

java - How to handle Asynchronous operations in REST -

i need understand approaches pros-n-cons handle asynchronous operations in rest. approaches found: 1- resource based: status of operation modeled status. user makes asyn rest call (put, post etc) gets accepted or in-progress response ( 202 ). further status uri polled repeatedly via check status/progress/messages operation execution. question: how long resource active @ server? if client polls in large intervals in between operation completes, how return status? seems persisting execution status work. how long persist, when archive/delete, kind of standard approach? 2- callback based: async request required have callbackuri, request gets processed asynchronously , upon completion makes call callbackuri operation status/result. question: seems more elegant, less overhead @ server-side. scenarios callback server intermittently down not responding etc, how handle this? implement typical retries callbackuri provides retries configuration well? there other downside approac

c# - source binding not working windows phone 7 -

am showing list of movie panorama windows phone 7 app. on click on each movie showing movie details,cast. movie details , cast showing pivot control. movie details works fine when got show cast , doesnt work. have list of cast objects. , binding source listbox in cast pivot control , doesnt show data. please me. below classes have used. thank you mainviewmodel.cs public class mainviewmodel { public observablecollection<itemviewmodel> movieitems { get; set; } } itemviewmodel.cs public class itemviewmodel : inotifypropertychanged { private string _title; public string _title { { return _title; } set { if (value != _title) { _title = value; notifypropertychanged("title"); } } } private observablecollection<cast> _cast; public observablecollection<cast> _cast { { return _cast; } set

c# - Building a login with ASP.NET in VB -

i found youtube video on building website login asp.net problem is in c# have been converting vb when ran program got error object reference not set instance of object. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.nullreferenceexception: object reference not set instance of object. source error: source code generated unhandled exception can shown when compiled in debug mode. enable this, please follow 1 of below steps, request url: 1. add "debug=true" directive @ top of file generated error. example: or: 2) add following section configuration file of application: <configuration> <system.web> <compilation debug="true"/> </system.web> </configuration> i know means in c# can't find is. here code. imports system imports system.collections.generic im

firefox - Unable to call FirefoxDriver constructor -

i continuously getting unsupportedcommandexception when running following code: system.setproperty("webdriver.firefox.bin","c:\\program files\\mozilla firefox\\firefox.exe"); firefoxprofile firefoxprofile = new firefoxprofile(); string domain = "extensions.firebug."; firefoxprofile.setpreference("app.update.enabled", false); firefoxprofile.addextension(new file("d:\\\\firebug-1.11.2-fx.xpi")); firefoxprofile.setpreference(domain + "currentversion", "1.11.2"); firefoxprofile.setpreference("extensions.firebug.cookies.enablesites", true); firefoxprofile.setpreference("extensions.firebug.allpagesactivation", "on"); firefoxprofile.setpreference(domain + "frameposition", "bottom"); firefoxprofile.setpreference(domain + "defaultpanelname", "cookies"); webdriver driver = new firefoxdriver(firefoxprofile);

java - System.loadLibrary does not work. UnsatisfiedLinkError for the second lib in chain -

i have java program client.class uses cpp shared library libclient.so via jni. libclient.so built shared , uses cpp shared library libhttp.so. libclient.so , libhttp.so placed in folder /home/client/lib64 client.class placed in /home/client/bin client can load library with system.load , environment variable ld_library_path system.loadlibrary , -djava.library.path the first way works fine. export ld_library_path = /home/client/lib64 java -classpath ./bin client the secon way fails. java -classpath ./bin -djava.library.path=./../lib64 client java.lang.unsatisfiedlinkerror: /home/client/lib64/libclient.so: libhttp.so: cannot open shared object file: no such file or directory when put libhttp.so /usr/lib64 second way works fine. why libclient.so looking libhttp.so in /usr/lib64 if use system.loadlibrary? how can fix without coping libhttp.so /usr/lib64? my loading code: //try load -djava.library.path boolean found = false; string lib

c# - is there a way ti get Date\time values Online? -

my pc resetting date time each restart\sleep want write application sets time on each boot there way current date time online in c# or java ? here nice post: http://nickstips.wordpress.com/2010/02/12/c-get-nist-internet-time/ describes in detail how achieve want :)

Wordpress - Hide a page when a user try to navigate to it writing the URL -

example: created custom post type "movie". added links of movie posts in nav menu, , it's ok if user navigates post writing in browser url (like www.site.com/movie/apocalypse-now ) don't want user navigates page www.site.com/movie (that lists movies). there way hide page? why not register has_archive false in register_post_type() function ? would solution if want disable post type archive.

javascript - Magento can't create order in admin due to JS errors -

in magento have put new site live , cannot create orders in backend after clicking 'create new order' button customer list , cannot select customer due js errors uncaught typeerror: cannot call method 'select' of null configure.js:74 productconfigure._initwindowelements configure.js:74 productconfigure.initialize configure.js:57 klass prototype.js:101 (anonymous function) configure.js:764 _createresponder.responder uncaught typeerror: cannot read property 'callback' of null sales.js:1214 orderformarea.initialize sales.js:1214 klass prototype.js:101 (anonymous function) sales.js:48 (anonymous function) prototype.js:391 _createresponder.responder the functionality works on test site, differences between 2 caching, i've tried refreshing etc , hasn't solved problem this down old php version in end old server running php 5.2.17 upgraded 5.4.15 discovered being thing different between new , old servers

c - fork() function will never return 0 -

i trying run fork function in c in child section of code, trying execute command using exacvp, before execution trying printf function never executes. ran in debug , have noticed pid never assigned 0. did try simple fork example on separate project , worked smoothly. have idea why child section never executes? int startprocesses(int background) { int = 0; while(*(linearray+i) != null) { int pid; int status; char *processname; pid = fork(); if (pid == 0) { printf("i child"); // child process processname = strtok(linearray[i], " "); execvp(processname, linearray[i]); i++; continue; } else if (!background) { // parent process waitpid(pid, &status, 0); i++; if(wexitstatus(status)) { printf(cannot_run_error); return 1; } } else { i++; continue; } } return 0; } stdio files flushed on prog

Loading external Html with Jquery and Asp.net MVC -

in index view have this: <script type="text/javascript" src="~/scripts/jquery-2.0.0.js"></script> <script type="text/javascript" src="~/scripts/javascript1.js"></script> <div id="dictionary"> </div> <div class="letter" id="letter-a"> <a href="#">a</a> </div> in javascrip11.js have this: $(document).ready(function () { $('#letter-a a').click(function () { $('#dictionary').load('htmlpage1.html'); alert('loaded!'); return false; }); }); and in htmlpage1 have this: <div>definitions letter a</div> i want javascript load htmlpage1 , insert div dictionary of page when click anchor tag.....i have htmlpage1 both in scripts folder , in viewfolder.. both doesnt work.... getting alert snipet not being inserted.... when loading static file in mvc using absolute path. pu

c# - DispID must be unique across interfaces? -

i use com old vb6 application. i changed code use dispid in interfaces seems work better using [classinterface(classinterfacetype.autodual)] . but allowed begin in each interface counting dispid(1), when class uses 2 interfaces? does work way stable? or missunderstood something? [comvisible(true)] [guid("9e1125a6-...")] public interface imyinterface1 { [dispid(1)] string name1 { get; } } [comvisible(true)] [guid("123425a6-...")] public interface imyinterface2 { [dispid(1)] string name2 { get; } } [comvisible(true)] [classinterface(classinterfacetype.none)] class myclass : imyinterface1, imyinterface2 { public string name1 { { return "name1"; } } public string name2 { { return "name2"; } } } is allowed begin in each interface counting dispid(1), when class uses 2 interfaces? dispids have unique within interface only. go 2 interfaces each 1 having own (different) dispid 1 properties, if both i

push notification - i cannot get the GCM ID in Android in one app -

[solved still want answer last question please, problem was using capital letters instead of lower let code other can correct errors] i have tried forum pages , searched through stackoverflow same thing, did not find solution. i have 2 apps use push messages, 1 app works great other 1 doesn't, registered 2 times in google 2 different api keys , 2 different senders id, if switch senders id still didn't id on app doesn't work(but work on app works great), never trigger onregistered function my manifest <permission android:name=""com.sexolia.sexyasiaticas.permission.c2d_message" android:protectionlevel="normal" /> <uses-permission android:name="com.sexolia.sexyasiaticas.permission.c2d_message" /> <uses-permission android:name="com.google.android.c2dm.permission.receive" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name=&q

excel - Sanitizing data in PHP for excell xml -

i using "excel xml" php library (marin crnković, version 0.9) write data database .xls file. problem database contains data not legal, , causes microsoft excel give me errors when opening file. (the document cannot opened because there problems contents) samples of bad data causing excel display errors instead of opening file: !(()&&!| | | '"()&%1prompt(918861) '&cat /etc/passwd&' '&dir&' "&cat /etc/passwd&" email&n921923=v950402 is there recommended function sanitize data before inserting data excel file? it might need escape/encode ampersands before using them excel spreadsheets (as new formats xml-based). php, perhaps try like: $value = str_replace('&', '&amp;', $value);

php - preg_match() fails silently while checking a very long string -

i using zend framework in 1 of projects , file zend/uri/http.php has function validatequery validates given query using preg_match. it works fine have paypal url query string long, around 1 500 characters, , preg_match function fails silently query. i using php ver. 5.4.7 hence don't have limit of pcre.backtrack_limit=100000. right have modified file in zendframework not validate queries above 1000 characters isn't right solution. following 1 of comments tried use long query preg_match in standalone page , have same error, pasting test data below reference. $query = 'search?q=very+long+query+string+example&aq=f&oq=very+long+query+string+example&aqs=chrome.0.57j62l3.5553j0&sourceid=chrome&ie=utf-8&search?q=very+long+query+string+example&aq=f&oq=very+long+query+string+example&aqs=chrome.0.57j62l3.5553j0&sourceid=chrome&ie=utf-8&search?q=very+long+query+string+example&aq=f&oq=very+long+query+string+example&