Posts

Showing posts from January, 2012

c++ - How to get CEdit (or CWnd) text in debug time -

when debug project, , cedit object's text changed, want see new value. watch window doesn't display text member. text stored? edit: forgot write use visual c++ 6.0 ('98 edition) the tree of cedit in watch window seems this: m_editbox | + [cwnd] | + ccmdtarget + classcwnd + m_hwnd + wndtop + wndbottom + wndtopmost + wndnotopmost + m_hwndowner - m_nflags - m_pfnsuper - m_nmsgdraglist - m_nmodalresult + m_pdroptarget + m_pctrlcont + m_pctrlsite + _messageentries + messagemap + cwnd | + ccmdtarget + m_hwnd + m_hwndowner - m_nflags - m_pfnsuper - m_nmodalresult + m_pdroptarget - m_pctrlcont - m_pctrlsite to answer question window's text stored upfront: don't know, , neither given window. information have ask window manager instead. all information pertaining window stored in internal structure maintained window manager. window manager implemented win32k.sys , consequently internal

html5 - jQuery: Cannot empty a nested paragraph -

i'm trying empty paragraph inside div. paragraph contains others elements: div, text, images, span etc. <div id="div_id">test <p> text inside paragraph <div id="text">hello hello hello</div> <img src="http://www.mygifto.com/upload/product/26922984_l.jpg" width="200" height="200" alt="banner" /> </p> hi </div> out of div the simplest solutions should use empty() function doesn't work @ all, removes text inside paragraph. $('#div_id p').empty(); i have specify div_id because i've others p inside page , should not empty. fiddle here i've tried $('#div_id p').children('*').remove(); but without success. how can remove elements inside paragraph? the problem because html invalid. cannot have block-level div element inside inline p . change #text div span display: block on it, ,

c# - Creating Dynamic nested GridView -

i have following class structure - public class details { public string customer { get; set; } public string serial { get; set; } public string model { get; set; } } public class summary { public string header { get; set; } public list<details> details { get; set; } } i following this link structure requirement. my requirement having gridview dynamic no of columns mapped list of summary class. header mapped gridviewcolumn header. till fine. details property, want create again child gridview having dynamic no. of columns mapped list of details class , rows defined in details class properties. can 1 tell me correct solution. edit link updated what tried yet public class dynamicgridviewconverter: ivalueconverter { #region ivalueconverter members public object convert(object value, type targettype, object parameter, system.globalization.cultureinfo culture) { var dynamicconfig = value list<summary>; if

animation - Change the orientation transition of the screen from right to left in Verticle Slider in Android -

Image
i working vertical slider similar facebook in devices shown in below image. using library project facebook-like slide-out navigation slider view. my requirement show slider @ both ends of screen, left right , right left shown in image. requirement: when click on left top button, screen oriented left right, correct. problem is : whenever screen on right top button screen oriented, directed left right should come right left. i working facebook-like slide-out navigation , below custom code: public class sampleactivity extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.sample); findviewbyid(r.id.sample_button).setonclicklistener( new view.onclicklistener() { @override public void onclick(view v) { int width = (int)typedvalue.applydimension(typedvalue.complex_unit_dip, 40, ge

django - Should view logic be abstracted to other modules? -

i have handful of functions in of views abstracted away. looking through django docs , couldn't find info on best place keep them. so should go: 1: in view, abstracted away function. or 2: in new module within same django application. it depend on views do, if verify form data, use django-forms handle form data, , can make code cleaner. you can take @ them here . if lot of things models, create django modelmanager handle queries in views. however, if think there lot of boiler-plate code not fit of these, why not use django cbvs rid of having write boiler-plate code on again. it comes down want.

json - Downloading files using google-api-php-client -

i'm having issue trying download file google cloud storage using php client found @ https://code.google.com/p/google-api-php-client/ i have authenticated myself ok , using following code can return object contains link file $this->storageservice = new google_storageservice($this->client); $this->objects = $this->storageservice->objects; $options = array( 'prefix' => 'report_name_2013-07-01' ); $bucket_contents = $this->objects->listobjects($bucket, $options); the response like... { "kind": "storage#object", "id": "<bucket>/<report>.csv/1001", "selflink": "https://www.googleapis.com/storage/v1beta2/b/<bucket>/o/<report>.csv", "name": "<report>.csv", "bucket": "<bucket>", "generation": "1001", "metageneration": "1", "contenttype": "

actionscript 3 - how to play slow motion video using flvplayback component -

i need on playing video in slow motion using flvplayback component of flash. there anyway achieve functionality using flv component. how can achieve using as3? i use gettimer() flash.utils.gettimer() , enterframe event. use logic enterframe (pseudocode) : if(playstate){ pausevideo() }else if(gettimer()-previoustime > speed){ startplaying video playstate=true; previoustime -=speed; } playstate boolean variable, previoustime number this play 1 frame, wait speed milisecond , play 1 other frame. speed = 1000/ desired framerate = 32 30fps

javascript - Auto Refresh No Scroll Best way to do this -

so i'm asking question again because no 1 has been able figure out. need refresh part of page every few seconds i've tried ajax, because requires .load , script file doesn't work, because refresh not changing time till test due on sections need refreshed. data coming access database , being displayed in browser. database made , changed piece of software records chemical concentrations of plating baths mathematical equations yuou program software, can setup schedules need followed fpr these tests. web browsers displays info. far can whole page refresh no scroll top code. auto refresh no scroll below <script type="text/javascript"> function refreshpage () { var page_y = document.getelementsbytagname("body")[0].scrolltop; window.location.href = window.location.href.split('?')[0] + '?page_y=' + page_y;} window.onload = function () { settimeout(refreshpage, 1500); if (window.location.href.index

AngularJS BootstrapUI Typeahead with object & selection functionality -

i'm trying implement typeahead in angular using http://angular-ui.github.io/bootstrap/ , typeahead field displays full addresses once clicked field populated postcode address. i'm trying use ng-change or ng-click this, without success.. http://jsfiddle.net/uxtbb/2/ angular.module('myapp', ['ui.bootstrap']) .controller("mainctrl", function ($scope) { $scope.selected = ''; $scope.states = [{postcode:'b1',address:'bull ring'},{postcode:'m1',address:'manchester'}]; $scope.setpcode = function(site) { $scope.selpcode = site.postcode; }; }); <div class="container"> <div ng-controller="mainctrl" class="row-fluid"> <form class="row-fluid"> <div class="container-fluid"> postcode <input type="text" ng-model="selpcode" /> typeahead

Magento category filter by custom attributes -

i have added custom attributes categories in magento need select categories these attributes filter in custom module.can me please ?any highly appreciated. thanks, irphan $categories = mage::getmodel('catalog/category') ->getcollection() ->addattributetofilter('attribute_code_here', 'value_here'); $categories->addattributetofilter('parent_id', 2);//if want children of specific category foreach ($categories $category){ //do $category }

How to navigate back to current page from Frame in selenium webdriver -

how navigate main page iframe ? example: driver.switchto.frame(1); driver.switchto().defaultcontent(); is not working. can suggest other way retain control? you directly switch window using: driver.switchto().window(driver.windowhandles[0]);

How do you to send a message to facebook friend's inbox -

this question has answer here: send private messages friends 8 answers how send private messages friend's inbox similar how spotify sends tracks user's friends inbox. have done research have not been able find api implement this. sending messages application disabled facebook because people made spam programs. thing can use wall-posts , requests. far know, , tried. don't know how now, might changed?

r - Mysterious error by parsing French dates on OSX -

i've character vector dates in french. convert them date format in r. seems work there mysterious errors. instance, r recognize "30 juin 2012" not "30 juillet 2012" : > as.date("30 juin 2012", format = "%d %b %y") [1] "2012-06-30" > as.date("28 février 2012", format = "%d %b %y") [1] "2012-02-28" > as.date("30 juillet 2012", format = "%d %b %y") [1] na do have explanation ? ps : local setting french utf8 > sys.getlocale() [1] "fr_fr.utf-8/fr_fr.utf-8/fr_fr.utf-8/c/fr_fr.utf-8/fr_fr.utf-8" i don't have explanation, have solution. having had similar problems german numbers using "," instead of "." decimals , different ways of writing dates too. here's data not in correct format: a<-"30 juillet 2012" b<-gsub(pattern="juillet", a, replacement="july") as.date(b, format="%d %

Processing Less CSS files that have php tags -

we have less file hi_style.less : @import "css/base-ui.less"; #hi { margin: 100px; } that includes less file css/base-ui.less lines this: .ui-go { background: #74a372 url(<?php echo $l_uri; ?>/images/ui-go.png) repeat-x scroll 50% 50%; } the reason need php (unless has better idea) because there 1 codebase have many sites attached separate database singular codebase. e.g. site-a.mysite.com , site-b.mysite.com both use same code urls different. is there way ignore php tags in less or better way have explicit urls 1 codebase. we can't use relative paths base path can change , point different codebase. thanks in advance. edit: can't static file after it's processed because codebases can accessed via url like: site-a.mysite.com/testing or site-a.mysite.com/beta url of image file be: http://site-a.mysite.com/images/ui-go.png or http://site-a.mysite.com/testing/images/ui-go.png or http://site-a.mysite.com/beta/images/u

html - moz box orient not working though webkit box orient is -

html code: <div id="nav"> <div id="home_menu"> <a href="home.php">home</a> <ul> <li> <a href="feed.php">feed</a> </li> <li> <a href="">notifications</a> </li> </ul> </div> <div> <a href="profile.php">profile</a> <ul> <li> <a href="">settings</a> </li> <li> <a href="logout.php">logout</a> </li> </ul> </div> </div> styling: #nav { float:right; margin-top: 12px; width: 200px; display:box; display:-webkit-box; display:-moz-box; display:-ms-flexbox; box-orient: horizontal;

php - Why is it assigning value to $b? It should not as per operator precedence rule -

i trying answer why code infinite loop? there thought issue because of operations precedence, when checked http://php.net/manual/en/language.operators.precedence.php , . has more precedence = so tried following code : $a.$b = "test"; echo $a; echo $b; and got undefined variable a , test means assigning value $b, how assigning value $b (should not per operations precedence) i believe answer stated in docs : although = has lower precedence other operators, php still allow expressions similar following: if (!$a = foo()) , in case return value of foo() put $a . expanding on jon's answer , since can't assign expression, = takes precedence , interpreter sees following statement: $a.($b = "test"); so become 2 separate expressions, each following own precedence. , therefore test assigned $b . to prove this, add assignment: $a = 'my '; $c = $a.$b = "test"; var_dump($a); // string(3) "my " v

android - Show Edit text on spinner item selected -

i have spinner in class items. have display edittext visibility have set "invisible". need show edittext when "others" item selected in spinner. here code:- activity class:- protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); requestwindowfeature(window.feature_no_title); setcontentview(r.layout.maintenance); etservicestation = (edittext)findviewbyid(r.id.etservicestation); etservicetype = (edittext)findviewbyid(r.id.etservicetype); etservicecost= (edittext)findviewbyid(r.id.etservicecost); spinservicetype = (spinner)findviewbyid(r.id.spinservicetype); btnmaintenencesave= (imagebutton)findviewbyid(r.id.btnmaintenencesave); btnmaintenanceclear = (imagebutton

unix - Wordpress Could not copy file. /var/www/wp-content/upgrade/attitude.tmp/attitude/images/my-space@2x.png -

this problem occurs when try install themes inside wordpress admin console. have tried change owner of /var/www directories (with chown -r <username> /var/www ) have setup permission 755 directory. realize problem due file's permission in upgrade directory. file has permission -rw-r--r-- (this directory , files inside supposed created ftp user supplied when installing theme) do have selinux installed? can check going ssh window , type # sestatus it should show you selinux status: enabled/disabled selinuxfs mount: /selinux current mode: enforce/permissive mode config file: enforce policy version: xx policy config file: targeted if it's on 'enforce', can temporarily change permissive see if that's issue using # setenforce 0 # getenforce // should return permissive try upload then. if works need add directory tell selinux allow httpd write there. chcon -r -t httpd_sys_rw_content_t directory/path/that/you/want/to/write/to/ hope

c# - log4net doesn't write to the file -

i have windows forms application , trying use log4net logging file. in app.config have: <log4net debug="false"> <appender name="logfileappender" type="log4net.appender.fileappender,log4net" > <param name="file" value="c:\...\logfile.txt" /> <param name="appendtofile" value="true" /> <layout type="log4net.layout.patternlayout,log4net"> <param name="conversionpattern" value="%n%n%n%d [%t] %-5p %c - %m%n%n" /> </layout> </appender> <root> <priority value="all" /> <appender-ref ref="logfileappender" /> </root> <category name="desktoplogger.form1"> <priority value="all" /> </category> </log4net> and in code behind main form have: public log4net.ilog logger { get; set; }

sql server - Is it possible to create inherited SqlDataTable in SqlDataSet. Devart dotconnect -

the problem when redeclare standard sqldatatable customsqldatatable inside sqldataset. works until change sqldataset contain custrom datatable. after change in sqldataset recreate code of own definition , datatables again becomes standard sqldatatable. how avoid it? thanks! the mytalbedatatable class (inherits devart.data.sqlserver.sqldatatable), part of devart typed dataset, generated "partial" keyword. therefore, can create separate myclass.cs file , extend "predefined" functionality of mytalbedatatable. code within myclass.cs not wiped out because custom file.

How to Merge two or more adapters and show in one ListView in Android -

i have listview custom adapters returning both twitter , facebook feeds. have own xml. till showing them in separate activity , planning combine both data , show in 1 adapter. heard there concept "merge adapters". can me below posted code ? file : facebookadapter.java : public class facebookadapter extends arrayadapter<rssfeedstructure> { list<rssfeedstructure> imageandtexts1 = null; public facebookadapter(activity activity, list<rssfeedstructure> imageandtexts) { super(activity, 0, imageandtexts); imageandtexts1 = imageandtexts; } @override public view getview(int position, view convertview, viewgroup parent) { activity activity = (activity) getcontext(); layoutinflater inflater = activity.getlayoutinflater(); view rowview = inflater.inflate(r.layout.facebookadapter, null); textview textview = (textview) rowview.findviewbyid(r.id.feed_text); textview timefeedtext = (textview) rowview .findviewbyi

vb.net - vb 2012 how do I make independent listboxes from data records? -

Image
very new visual studio 2012. i'm trying select labour in top listbox , excavator in bottom listbox. when select bottom listbox excavator, top listbox changes excavator well. how make these independent?? listboxes looking data table each resource/selection row/record. want resource record , not modify record , user inputs quantity manually. it seems binding same object source these 2 list boxes. if datatable name dt , use dt.asenumerable() datasource each of list box.

android - How to hide activities -

i have 2 activities. first activity running in foreground. while pressing home button, first activity goes background , calls service there second activity started using intent. first activity shown on top. want hide both of activities in background. starting second activity : intent intent1 = new intent(xxx.this,yyy.class); intent1.addflags(intent.flag_activity_clear_top); intent1.addflags(intent.flag_activity_new_task); startactivity(intent1); use service send intent second activity special value extra, override onnewintent , check see if value present; if there should stop activity use finish() function end activity(as can use movetasktoback(true) hide activity). highly recommend read this question .

asp.net - Generate list of parents-childs (recursive relationship) from Dataset -

i'm trying build list (html) recursive relationship. data in dataset converted data table if it's easier. i don't know what's best option achieve this. thinking using nested repeaters. here's data: __id__ | __name__ | __parent__ | __level__ 1 | patrick | | 1 2 | mark | | 1 3 | scott | 2 | 2 4 | jason | | 1 5 | julian | | 1 6 | john | 6 | 2 7 | steve | | 1 8 | george | 1 | 2 9 | robert | 1 | 2 10 | rodney | 8 | 3 here output want produce - patrick [1] - george [8] - rodney [10] - robert [9] - mark [2] - scott [3] - julian [5] - john [6] - jason [4] - steve [7] the easiest way write recursive method. way operates depend on whether want have method return entire tree-structured list, or ou

core graphics - iOS: CAShape Layer Path Transformation -

i have used cashape layer before doing basic transformation on paths - smaller circle larger circle. enough, tried transform triangle circle; worked, transformation weird. other words, 1 shape another, "flips", "twists" before final shape formed. same shapes, there no problem - circle circle - different shapes, transformation weird. i wonder if expected way? or there other tricks or workarounds can smoothly , proportionally transform 1 shape different shape using cashape layer (or there other ways of doing this; doesn't have cashape layer )? in advance. by choosing control points, etc, can cook path draws triangle, has same number of segments , control points circle want draw. (all numeric values assume iphone screen, point general): @implementation viewcontroller { cashapelayer* shapelayer; } - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. shapelayer = [[cashapelayer alloc] in

winforms - c# Cafe Manager Application That requires login and runs at startup -

i trying create application (windows form) internet cafe managment runs @ startup of each client , asks login credentials. running server application @ counter system. have database in server , clients can access through wcf application. problem how run @ system startup , allow people use system after entering right credentials. no other activities should take place without entering credentials.and cannot closed. my guess reinventing wheel (this has been solved many times) if want roll own here things at: look @ creating replacement windows shell (look here too) running app at startup running at logon setting of winforms app system modal (use form dominate screen until auth happens) your question broad , there many ways achieve you're looking for. can clean , complex while others dirty hacks (system modal form) simpler implement.

uicolor - iOS attributedText for 5.1 -

this question has answer here: bold & non-bold text in single uilabel? 12 answers how can make in ios 5.1 - nsstring *statusstrcolored = [nsstring stringwithformat:@"%@ (%@)", statusstr, paymentstatusstr]; nslog(@"stoka = %@", statusstrcolored); //nsarray *components = [statusstrcolored componentsseparatedbystring:@" "]; nsrange greenrange = [statusstrcolored rangeofstring:statusstr]; nsrange redrange = [statusstrcolored rangeofstring:paymentstatusstr]; nsmutableattributedstring *attrstring1 = [[nsmutableattributedstring alloc] initwithstring:statusstrcolored]; [attrstring1 beginediting]; [attrstring1 addattribute: (nsstring*)kctforegroundcolorattributename value:(id)[[uicolor greencolor] cgcolor]

android - Implementing Dialog box with checkboxes -

here dialog box   public class customdialogclass extends dialog implements  android.view.view.onclicklistener {      public activity c;      public dialog d;      public button no;      checkbox yes;      boolean p;      public customdialogclass(activity a) {          super(a);          // todo auto-generated constructor stub          this.c = a;      }      @override      protected void oncreate(bundle savedinstancestate) {          super.oncreate(savedinstancestate);          requestwindowfeature(window.feature_no_title);          setcontentview(r.layout.custom_dialog);          yes = (checkbox) findviewbyid(r.id.checkbox1);          no = (button) findviewbyid(r.id.btn_no);          no.setonclicklistener(this);          yes.setchecked(false);          yes.setonclicklistener(this);      }      @override      public void onclick(view v) {          switch (v.getid()) {          case r.id.checkbox1:              yes.setchecked(true);              break;          case r.id.btn_

string - Groovy - A Tale of Two Closure Invocations -

this works: def myclosure = { println 'hello world!' } 'myclosure'() this not work: def myclosure = { println 'hello world!' } string test = 'myclosure' test() why, , there way make it? with test() the parser evaluate call test closure/method without evaluating variable first (otherwise couldn't call methods have variable of same name) instead, try: myclosure = { println 'hello world!' } string test = 'myclosure' "$test"() edit -- class example class test { def myclosure = { println "hello world" } void run( string closurename ) { "$closurename"() } static main( args ) { new test().run( 'myclosure' ) } } edit -- class run closure example class test { def myclosure = { println "hello world" } def run = { string closurename -> "$closurename"() } static main( args ) { new test().run( 'myclosure'

tsql - Check for equal amounts of negative numbers as positive numbers -

i have table 2 columns: intgroupid, decamount i want have query can return intgroupid result if every positive(+) decamount, there equal , opposite negative(-) decamount. so table of (id=1,amount=1.0),(1,2.0),(1,-1.0),(1,-2.0) return intgroupid of 1, because each positive number there exists negative number match. what know far there must equal number of decamounts (so enforce count(*) % 2 = 0) , sum of rows must = 0.0. however, cases logic are: id | amount 1 | 1.0 1 | -1.0 1 | 2.0 1 | -2.0 1 | 3.0 1 | 2.0 1 | -4.0 1 | -1.0 this has sum of 0.0 , has number of rows, there not 1-for-1 relationship of positives negatives. need query can tell me if there negative amount each positive amount, without reusing of rows. i tried counting distinct absolute values of numbers , enforcing less count of rows, it's not catching everything. the code have far: declare @tbltest table( intgroupid int ,decamount decimal(19,2) ); insert @tbltest (intgroupi

mysql - Query always return all the data -

why mysql query returns column data table?: select column table column = "+" the column type varchar. ok, after clarifying query, it's little clearer has happened. in mysql, + numeric operator only, not concatenation operator. non-numeric strings cast zero, if attempt "add" 2 empty strings (pairs of single quotes), selecting 0 + 0 . mysql> select 1 + 1, '' + '', '1abc' + 1; +-------+---------+------------+ | 1 + 1 | '' + '' | '1abc' + 1 | +-------+---------+------------+ | 2 | 0 | 2 | +-------+---------+------------+ 1 row in set, 1 warning (0.00 sec) and since non-numeric strings cast zero, non-numeric string in column match condition where column = 0 example comparing 0 numeric , non-numeric string: mysql> select 'abcd' = 0, '1234' = 0; +------------+------------+ | 'abcd' = 0 | '1234' = 0 | +------------+------------+ |

javascript - Disable tag with ng-show but not content in AngularJS -

is possible "disable" tag instead of completly hiding content? want enclose content pre-tag if boolean true. ng-show hides complete tag content if boolean false, want remove pre-tag keep content. possible? my current solution using custom filter, in opinion more hack solution. angular.module("myapp", []).filter("mytext", function () { return function (message) { message.text = message.text.trim(); if (message.flag) { message.text = "<pre>" + message.text + "</pre>"; } return message.text; }; }); using filter seems quite appropriate honest. you can hack html this: <span ng-hide="message.flag"><pre></span>{{message}}<span ng-hide="message.flg"></pre></span> the w3 validator seems down can't verify valid html if is, wouldn't use solution :)

java - InputStream Infinit Loop -

i'm trying upload file android tomcat server running jersey. i'm packaging inside post request. this in android: protected string doinbackground(string... params) { string url = params[0]; string pathtofile = params[1]; httpclient httpclient = new defaulthttpclient(); httpcontext localcontext = new basichttpcontext(); httppost httppost = new httppost(); httpresponse response = null; httppost.addheader("cookie", "sessiontoken=~session"); try { httppost.seturi(new uri(url)); httppost.setheader("accept", "application/json"); multipartentity entity = new multipartentity( httpmultipartmode.browser_compatible); file file = new file(pathtofile); if(!file.exists()) return null; filebody filebody = new filebody(file); entity.addpart("file", filebody); httppost.setentity(entity); response = httpclien

c# - having an issue using ExecuteScalar function in asp.net -

i trying use executescalar function checking backend table whether 1 of columns set “no”. if 1 of columns set no want call sendemail function, else want call delete_record function. problem is calling delete_record function , never calls sendemail function. data type post_id varchar , don’t know if has with; can’t seem figure out going on. can please help? here code: sqlcommand cmd = new sqlcommand("select count(*) mytable post_id =@post_id , (column1='no' or column2='no' or column3='no')", con); cmd.parameters.add("@post_id", sqldbtype.varchar).value = post_id; cmd.connection = con; con.open(); int32 result = (int)cmd.executescalar(); if (result == 1) { sendemail(); } else { delete_record(); } since more one, should change condition to if (result >= 1) { sendemail(); } else { delete_record(); }

python 2.7 - Apache can't read anything from mod_wsgi.so -

i'm using apache2.2 on windows 7. tried load mod_wsgi.so apache2.2 adding following line httpd.conf: loadmodule wsgi_module modules/mod_wsgi.so in httpd.conf, there's lines using directives mod_wsgi.so (maybe depend on so, i'm not sure) line: wsgisocketprefix d:\tool\apache2.2\conf this line made me stuck following error apache2.2 log: [thu jul 25 21:44:25 2013] [notice] parent: received restart signal -- restarting server. [thu jul 25 21:44:25 2013] [notice] child 6436: exit event signaled. child process ending. [thu jul 25 21:44:25 2013] [warn] module wsgi_module loaded, skipping syntax error on line 20 of d:/work/tool/apache2.2/conf/graphite.conf: invalid command 'wsgisocketprefix', perhaps misspelled or defined module not included in server configuration [thu jul 25 21:44:25 2013] [warn] (os 995)the i/o operation has been aborted because of either thread exit or application request. : winnt_accept: asynchronous acceptex failed. [thu jul 25 21:44:

angularjs - Server-side filtering with ng-grid: binding issue? -

i'm posting reference previous post server-side paging+filtering+sorting ng-grid webapi , hoping able come simple, yet working sample of using ng-grid external data sources. point, i've managed implement external paging , sorting, i'm facing issue filtering. it seems filtertext property of ng-grid filter options not bound view . when type in filter's text of ng-grid $watch-ed function not called, , have no chance request filtered data server. yet, same watch expressions work fine when used e.g. paging or sorting. by digging around bit, found post https://github.com/angular-ui/ng-grid/pull/456 bug right in area, it's not clear if still open issue. help? here relevant js code snippet: var app = angular.module('myapp', ['nggrid']); app.controller('maincontroller', ['$scope', '$http', function ($scope, $http) { $scope.items = []; $scope.filteroptions = { filtertext: "", useexternalfilt

ubuntu - Linux, store credentials with process and it's children, grandchildren? -

i'm working on little side project on linux(ubuntu) require 1 authenticated access service. idea authentication should stored process , it's children, , not linux user itself. this authentication should done calling example "myapplogin" username, password , script/application(any application) run these credentials. want possible retain these credentials in children made process, , grandchildren , on. i have looked @ few options capability. store login id or in environment variables. is, far know, passed on children. however, environment variables can written process, allowing possibly gain access should not have. when logging in, store process id of process logged in, , on every operation service, check if has stored pid, or if anywhere in it's ancestry stored pid exists. possibly become slow if ancestry grows large, , if service accessed often. option cache pid in ancestry, can have security implications pid reuse in os. using process groups , link l

ruby on rails - ActiveRecord query based on belongs_to association count -

i have user model has may scores class user < activerecord::base has_many :scores i want able query postgresql db return users have @ least 1 score. user.where(scores.count >= 1) any idea on how accomplish without adding counter_cache? a more rails-ish way user.joins(:scores).where('scores.user_id > 0') also, think select count(*) return number of users, not user rows themselves, i'm not sure that.

php - Javascript not working on changing textbox value -

i have been banging head on code , can't seem figure out why part of javascript works. here section of code <input type="hidden" name="v" id="v" value=""/> <input type="hidden" id="what" name="what" value="" /> <td><a href="#" onclick="javascript:document.getelementbyid('v').value='edit_del'; document.getelementbyid('what').value='<?php echo $recipeinventoryid ?>'; document.frmrecipe.submit();"><img src='_images/del.png'></a> the first edit works (for hidden "v") , submit works second edit ("what") doesn't.

objective c - how to read values from custom class -

i have class person. person.h #import <foundation/foundation.h> @interface person : nsobject{ nsstring *name; nsstring *screen_name; } @property (nonatomic, retain) nsstring *name; @property (nonatomic, retain) nsstring *screen_name; @end person.m #import "person.h" @implementation person @synthesize text,screen_name; @end i have nsarray object, values, such text, screen_name , etc. i do: person * person = object; ( object nsarray) i values, this: person. name , person. screen_name object : { "screen_name" = "mika_alcala"; "text" =""; "time_zone" = "eastern time (us & canada)"; "url" = "<null>"; "utc_offset" = "-14400"; "verified" = 0; }; ok, first don't need define ivars , don't need synthesize xcode 4.5+ (iirc). so should like... person.h #imp

How to package a Windows Runtime component for distribution? -

i have built winrt component (.winmd) use both javascript , xaml windows store apps. when including , referencing loose .winmd file output in javascript client, see build warning: microsoft.appxpackage.targets(808,9): warning appx1707: no implementation file provided .winmd file 'myruntimecomponent.winmd'. generate registration information in app manifest, specify 'implementation' metadata on .winmd reference item in project file. i can't find documentation on error or how include implementation metadata. when running javascript client, exception thrown when class method exported .winmd called: 0x80040154 - javascript runtime error: class not registered note referencing loose .winmd file in client application project, rather referencing visual studio project builds .winmd. use case distributing .winmd output, not full source .winmd component - source distribution not option. also note when windows runtime component referenced as project reference ,

android - How to handle errors using phonegap facebook connect plugin -

i using phonegap develop app on android , ios. far, have managed implement facebook connect plugin android , works pretty well. there 1 thing unable do, how handle plugin errors. instance, when there no network connection, fb.login(...) not work , got alert facebook-js-sdk.js: line 5105 : // cordova patch // if nativeinterface arg specified call out nativeinterface // uses native app rather using iframe / popup web if (fb._nativeinterface) { switch (params.method) { case 'auth.login': fb._nativeinterface.login(params, cb, function(e) {alert('cordova facebook connect plugin fail on login!' + e);}); break; how can intercept alert , display own error? here code using login: login: function(success, error) { fb.login(function(response) { if (response.authresponse) { //some code .. if (success && typeof(success) === "function") { success(); } } else {

Working Zoom/Pan example with D3.js? -

i'm trying example working ( http://bl.ocks.org/mbostock/2206340 ) getting error (below). code i'm trying run same @ link 1 exception, had modify json location didn't serve json file locally. i've been trying several topojson examples , getting errors too. i'm not sure if it's api version issue or what. ideas how working or enlighten me how debug issue? i'm pretty new d3. update: error added http://bl.ocks.org/mbostock/raw/4090846/us.json 200 ok 1.29s d3.v3.min.js (line 1) typeerror: undefined [break on error] .data(topojson.feature(us, us.objects.states).features) update: code added <!doctype html> <meta charset="utf-8"> <style> .background { fill: none; pointer-events: all; } #states { fill: #aaa; } #state-borders { fill: none; stroke: #fff; stroke-width: 1.5px; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; } </style> <b