Posts

Showing posts from January, 2012

javascript - Passing parameters to function before this.control() in Ext-JS 4 -

i have this: { listeners['combobox[name="counterparty_id"]'] = { afterrender: { fn: this.oncomboboxcounterpartyafterrender, scope: } }; this.control(listeners); } // function being called after rendering combobox oncomboboxcounterpartyafterrender: function(combobox, eopts){ // code }, so, how can send additional parameteres oncomboboxcounterpartyafterrender function? maybe this: listeners['combobox[name="counterparty_id"]'] = { afterrender: { fn: this.oncomboboxcounterpartyafterrender, scope: this, params: someparameters } }; there might better way, can do: listeners['combobox[name="counterparty_id"]'] = { afterrender: { fn: function(combobox, eopts) { this.oncomboboxcounterpartyafterrender(combobox, eopts, params) } ...

php - Keeping checkbox state consistent over multiple checkboxes -

i need check or uncheck automatically 2 hidden checkboxes when main visible 1 checked. 3 checkboxes inside while cycle. let me explain myself, form: <form action="updateauc.php" method="post" name="edit"> <div class="editbutton"> <ul> <li class="leditcnt"><input class="submitbutton" type="submit" name="edit" value="aggiorna trasferimenti" /></li> <li class="lremove"><a href="auctionfree_list.php"><input name="button" type="button" class="linkbutton" value="annulla" /></a></li> </ul> </div> <table width = "100%"> <tr class="title"> <td class="head">player</td> <td class="head">action

ruby - Why is a syntactic error in a subfile designed to be rescued by `require`? -

as asked liron in this question , syntax error in require -d subfile rescued method require , raised error of require . why designed this? benefit of attributing error require , not syntax error in subfile read? understanding feature introduced when gem system became standard part of ruby. related that. the relevant portion of stack trace in question: /home/***/.rvm/.../rubygems/core_ext/kernel_require.rb:45:in `require': .../food_finder/lib/restaurant.rb:84: syntax error, unexpected end-of-input, expecting keyword_end (syntaxerror)** it does error is. the syntax error wrapped in error require because that's error raised: file being processed require method . if there's error in required file, it's wrapped error handling in require . it's rescued require (and potentially re-raised) original require method can tried under variety of circumstances relating not finding file , gem failures. are suggesting require , method, somehow speci

Returning values from InputFormat via the Hadoop Configuration object -

consider running hadoop job, in custom inputformat needs communicate ("return", callback) few simple values driver class (i.e., class has launched job), within overriden getsplits() method, using new mapreduce api (as opposed mapred ). these values should ideally returned in-memory (as opposed saving them hdfs or distributedcache ). if these values numbers, 1 tempted use hadoop counters. however, in numerous tests counters not seem available @ getsplits() phase , anyway restricted numbers. an alternative use configuration object of job, which, source code reveals, should same object in memory both getsplits() , driver class. in such scenario, if inputformat wants "return" (say) positive long value driver class, code like: // in custom inputformat. public list<inputsplit> getsplits(jobcontext job) throws ioexception { ... long value = ... // value >= 0 job.getconfiguration().setlong("value", value); ... } //

C++ mapping a type to its header file -

i developing simple programming language creating c++ projects. lets type in short c++-like code , generates .h , .cpp files automatically. i need way map type , e.g. standard library, to corresponding header file . makes possible use type in language , automatically infer headers include in generated code. here example of language right now: class car { std::string print() members: int i, j std::array<wheel, 4> wheels } when processing code find types std::string , std::array need mapped header files. how can achieve mapping? is there maybe data base publicly available? not want parse headers myself of course (which assume how ides it). on top of supporting standard library of course useful able support other libraries well, secondary goal. well there excellent references can use build own database. standards slow-changing can generate map them using references. here c++ reference it's hard go around searching in header f

JQUERY - Container match biggest height -

i'm having problems getting container div match height of children. basically i'm trying achieve container height increase when children inside open. inside container 2 panels slidetoggle independently when clicked. both have different heights. want container match height of biggest panel opened. if no panels open, height of container should "auto". so in nutshell, theres 2 panels, each different heights. want container match height of biggest panel available (open). if both panels open, , user closes biggest one, container should compensate meet height of other panel. if user closes both panels, height of container should return "auto" this example of code: <div class="container"> <a href="#panel1">panel 1 button</a> <a href="#panel2">panel 2 button</a> <div id="panel1" class="panel"></div> <div id="panel2" class="panel"></di

configuration - Tmux: How to configure tmux to display the current working directory of a pane on the status bar? -

i new tmux , trying edit tmux.conf file have left side of status bar reflect: [sessionname] [currentpane] [currentworkingdirectory] i able display sessionname , currentpane . can't display currentworkingdirectory . i've tried several #(shell command) options: #(tmux select-pane -t :.#p; pwd) : prints other $pwd variable not reflect current directory of bash session in current pane. #(tmux select-pane -t :.#p; tmux send-keys pwd enter) firstly, although did print currentworkingdirectory if i'm in terminal. prints in terminal , not in status bar how want it. secondly, entered "pwd enter" every 15 seconds whether or not in terminal, hassle reverse if not quick (like am). i've tried these options no avail, possible want? , how? there variable that, doesn't seem in manpage mentioned in development version. me, works in 1.8 release of tmux. set -g status-left "#{pane_curren

php - vqmod wildcard search using regex -

as example here trying replace $this->load->model(*); , * represents wildcard search/replace. correct way in regex? <operation> <search regex="true" position="replace"><![cdata[ $this->load->model(.*); ]]></search> <add><![cdata[ $this->load->model('catalog/information'); ]]></add> </operation> the escaping required should pretty minimal. need escape $ , parentheses so <search regex="true" position="replace"><![cdata[~\$this->load->model\(.*?\);~]]></search> also you've rightly done in answer this, need add delimiter (i find ~ far less in string / hence using instead)

c# - Accessing Properties of Base class from derived class using Generic List -

in c#, best way access property of base class when generic list contains derived class. public baseclass1 { public property a{get;set;} public property b{get;set;} } public baseclass2:baseclass1 { public property c{get;set;} public property d{get;set;} } public classa:baseclass2 { } public class implement { list<classa> list1 = new list<classa>() console.writeline("would add person");//if yes add person list dynamically { //is possible acesses properties of baseclass using derived class list list1.property = console.readline();//read input console list1.property b = console.readline();//read input console . . list.property d = console.readline();//read input console list1.add(property a,property b);//add properties of baseclass1 , baseclass2 derived class } } i want take values of base class properties console , add values list , increase list if user wants a

plugins - How to add character to content of post? -

in per posts, there "oo/x/". how add "0" before "x" if length(x) <10 ? example: x=12345678 ; length(x) = 8, add "00" before x ===> x=0012345678 x=1234567 ; length(x) = 7, add "000" before x ===> x=0001234567 x=123456789 ; length(x) = 9, add "0" before x ===> x=0123456789 do understand ? sorry poor english ! thank ! in ansi c: #include <stdio.h> int main() { int x = 12345678; printf("x = %010d\n", x); return 0; } note %010d, % format specifier replaced following argument, 0 being flag pads 0's, , maximum number of 0's. read more here - printf() if java, can using system.out.printf(); in same way. edit : it's clear on problem domain lies (in case wordpress), can use php. see following barebones example using sprintf() in php: <?php // ... $x = 12345678; $yourstring = sprintf(nl2br("x = %010d\n"), $x); /

2D Array seems to change values as c++ class member -

i have got strange behavior when using double pointer array in programm this: /* in a.h */ class a{ private: int _n; int _m; int _p; int _dim; int** _t1; int** _t2; public: ~a(); a(); a(const a& a); a& operator=(const a& a); a(int n, int m, std::string filename); }; int readfile(int* p, int* dim, int*** t1, std::string filename); /* in a.cpp */ a::a(int n, int m, std::string filename){ _n = n; _m = m; _t1 = null; _t2 = null; int ierr; ierr = readfile(&_p, &_dim, &_t1, filename); // print _t1[i][j] here : no problem // fill _t2 _t1 : problem!! _t2 = new int*[_p]; // check allocation for(int k = 0; k < _p; k++){ _t2[k] = new int[_dim]; } for(int k = 0; k < _p; k++){ for(int j = 0; j < _dim; j++){ _t2[k][j] = 0; } } int in, ie, nv; for(int k = 0; k < _p; k++){ nv = _t

java - Passing a class type to a method, then casting to that type? -

i'm still pretty new java, might missing obvious here. i have following code use pick class types list of entities: public array<?> pickentities(class<?> cls) { array<? super spriteentity> allentities = new array<object>(); (spriteentity entity : mygame.allentities) { if (entity.getclass() == cls) { allentities.add(entity); } } return allentities; } that works fine, means when calling method still need cast class on other side. example: asteroid = (asteroid)pickentities(asteroid.class); what use class passing pickentities class (the cls parameter) , cast returning array (allentities) that type. is there way this? whenever try tells me 'cls' not type , can't used cast. your method should generic: public <t extends spriteentity> list<t> pickentities(class<t> clazz) { list<t> result = new arraylist<t>(); (spriteentity entity : mygame.all

visual studio 2012 - EF5, code first exception ONLY on first database access: "FK_x...x' is not a constraint. Could not drop constraint" -

this has been driving me crazy days. using vs2012, ef5 code first, sql server 2012. on development machine , i below exception when, , when, hit database first time . if, before run tests, init database, throws below exception, but not thereafter . if run tests, first test fails because of exception, but other tests pass . if catch exception , ignore it, all tests pass without error . frustrating, i've defined constraints, between 2 tables, don't know 'users_id' defined. i've tried manually deleting tables , running vs2012 generated sql dbcontext recreate table fresh, nothing works. appreciated. here exception *system.data.sqlclient.sqlexception: 'fk_dbo.userprofiles_dbo.users_id' not constraint. not drop constraint. see previous errors.* here pocos user public class user : entity<user>, iuser { public guid id { get; set; } // nav property userprofile. public virtual userprofile userprofile { get; set; }

SPF block when uing webform -

i have configured domains spf follow: v=spf1 mx:mx01.glesys.se mx:mx02.glesys.se a:smtp.bredband2.com ip4:188.40.202.41 ip4:174.136.101.66 ip4:66.228.34.169 -all the 2 mx glesys hosting service mx, bredband2.com isp , ip's servers. now question. sometimes, when using webform send message, bouncback telling me due spf, email has been blocked. this: <admin@receiving-domain.se>: host mx-cluster-b2.one.com[195.47.247.195] said: 554 5.7.1 <admin@receiving-domain.se>: recipient address rejected: please see http://www.openspf.org/why.html?sender=r.hill%40gate5.se&ip=91.198.169.19&receiver=mx-c.one.com (in reply rcpt command) does mean wrong in spf? or webform badly configured (ie. using address sender instead of having reply-to?) is there way avoid this? you have make sure ip address of server sending email in spf record. in case have add 91.198.169.19 spf entry. to avoid issues it's best use smtp server (which use in email programm) send

c++ - I am losing control and unable to Debug -

class base { private: int nid; friend int fndeletebase(base* base); public: base( int baseid):nid(baseid) { cout << "base constructed value" << endl; } base () : nid(5){cout << "base constructed without value" << endl; } ~base() { cout << "base class object killed " << endl; } }; int fndeletebase(base* base) // line 1 { delete base; // line 2 - important cout << "base object deleted " << endl; return (1); } int main() { base abase; // line 3 try { int = fndeletebase(&abase); // line 4 } catch(...) { cout << "exception handled " << endl; } return (0); } the above code snippet debugging. unable step @ line 2 deleting base object. try step or run on line 2, control g

uiview - iOS presentViewController is not working right -

as part of updating apps replace deprecated presentmodalviewcontroller presentviewcontroller, did testing. found disturbing. whereas presentmodalviewcontroller works , there no question working, have found presentviewcontroller method not display vc @ all. there no animation , never shows up. loadview called without problems, actual view not appear. so here doing: user taps button in main view controller. in callback tap, create new view controller , display shown above. the vc never appears (it intermittent problem though) because vc begins playing audio, know loadview called, looks follows. my button-pressed callback follows: - (void) buttontapped: (id) sender { vc *vc = [[vc alloc] init]; [self presentviewcontroller: vc animated:yes completion: nil]; [vc release]; } here loadview in vc class: - (void) loadview { uiview *v = [uiview new]; self.view = v; [v release]; ... create , addsubview various buttons etc here ... } thanks. make sure

java - Ordering of sheets in excel in apache poi -

i want rearrange sheets being generated before writing xls document using apache poi in java. there way of doing it? ex:sheet names "rf 10","blended 10","rf 30","blended 30". i want xls generated in following order of sheets: "rf 10","rf 30","blended 10","blended 30". you can rearrange order of sheets in workbook setsheetorder method of workbook class.

web services - Oracle SOA BPEL Partnerlink strange SSL error -

i have partner link in bpel process points http://www.webservicex.net/stockquote.asmx?wsdl clearly web service not ssl secured. when deploy composite app oracle complains following stack trace: what causing this? thank you, alessandro ferrucci <may 18, 2013 12:08:40 pm edt> <warning> <oracle.fabric.common.wsdl> <bea-000000> <failed load wsdl webservicexstockquoteservicewrapper.wsdl due to: wsdlexception: faultcode=invalid_wsdl: error reading import of oramds:/deployed-composites/default/stockquotebpel_rev1.0/webservicexstockquoteservicewrapper.wsdl: oracle.j2ee.ws.wsdl.localizedwsdlexception: wsdlexception: faultcode=parser_error: failed read wsdl file at: "http://www.webservicex.net/stockquote.asmx?wsdl", caused by: javax.net.ssl.sslhandshakeexception. : javax.net.ssl.sslhandshakeexception: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid

computational geometry - Identifying the Voronoi Verticies -

Image
i have list of 2 dimensional points , have been able find voronoi diagram using fortune algorithm implementation here , have been able compute dual delaunnay triangulation same set of points.. in figure can see input points in black, , voronoi cells in red. the vornoi diagram represented list of vertices, , list of edges.. i need find list of vertices form voronoi cell of given input point ? for example, given point near end of brown arrow in figure above,, need identify voronoi vertices marked blue circles.. i know voronoi vertices forming cell enclosing point can identified checking vornoi vertices have equal distance between point , other points... bu there more efficient solution ? is there way identify vertices voronoi diagram or delaunay triangulation ? or there implementation of voronoi diagram can give me vertices given input point ?

Changing map to pmap in my Clojure program leads to weird exception (ClassCastException) -

as far know, pmap in clojure works map , calculates results in parallel, using futures under hood. should "just work" function , sequence, if map works them. (unless there evil side effects prevent it, in case of program there nothing more loading data http server , transforming it) , in case pmap doesn't work expected. why can happen? the problem arises here (if change map pmap ): https://github.com/magicgoose/dvachmaster/blob/master/src/dvach/core.clj#l82 (defn thread-list "load threads pages, trying each page @ `max-trials` times `retry-inteval`" [board] (try (let [p0 (load-body (board-addr board 0)) numpages (count (:pages p0)) other-pages (map ; problem here (comp load-body (partial board-addr board)) (range 1 numpages)) all-pages (cons p0 other-pages) ]

Compression algorithm for files smaller than 10MB with largest compression ratio -

what lossless compression algorithm can use compress files smaller 10mb delivers largest compression ratio? it doesn't matter if cost lot of cpu cycles or memory. i have taken @ lzma , paq8. lzma popular algorithm decent compression ratio on specific settings. used 7zip , java , c libraries readily accessible. paq8 on other hand, outperforms lzma on benchmarks have read (especially on http://www.maximumcompression.com ) @ expense of cpu , memory. feel paq8 suits needs more seems still under development stages , unstable (plus can't find sources can implement on c or java)

Common Lisp: Why does my tail-recursive function cause a stack overflow? -

i have problem in understanding performance of common lisp function (i still novice). have 2 versions of function, computes sum of integers given n . non-tail-recursive version: (defun addup3 (n) (if (= n 0) 0 (+ n (addup (- n 1))))) tail-recursive version: (defun addup2 (n) (labels ((f (acc k) (if (= k 0) acc (f (+ acc k) (- k 1))))) (f 0 n))) i trying run these functions in clisp input n = 1000000 . here result [2]> (addup3 1000000) 500000500000 [3]> (addup2 1000000) *** - program stack overflow. reset i can run both in sbcl, non-tail-recursive 1 faster (only little, seems strange me). i've scoured stackoverflow questions answers couldn't find similar. why stack overflow although tail-recursive function designed not put recursive function calls on stack? have tell interpreter/compiler optimise tail calls? (i read (proclaim '(optimize (debug 1)) set debug level , optimize @ co

pug - Adding navigation to a partial in Docpad -

is possible add site navigation partial file? i keep things clean in documents , prefer seperating out navigation have been having problems in docpad when add navigation partial file. i using jade instead of eco. when place navigation in default.html.md.jade file works perfectly. when put code in partials/nav.html.jade error: warning: went wrong while rendering: html5-boilerplate.docpad/src/partials/nav.html.jade and shows in compiled html: <header>typeerror: object #<object> has no method 'getcollection'</header> this navigation code: nav ul each doc in getcollection('pages').tojson() - clazz = (document.url === doc.url) ? 'active' : null li(class=clazz) a(href=doc.url, title=doc.title)= doc.title and how set collections inside docpad.coffee collections: pages: (database) -> database.findalllive({pageorder: $exists: true}, [pageorder:1,

PHP preg-split text-string telephone-numbers -

please me following problem: $my_string = 'here text , number: +43 (0) 123 456 - 78 , more text , different number + 43(0) 1234/ 567-789 , final text'; what need this: array ( [0] => here text , number: [1] => +43 (0) 123 456 - 78 [2] => , more text , different number [3] => + 43(0) 1234/ 567-789 [4] => , final text ) and final output : <span> here text , number: <a href="tel:+43 123 456 78">+43 (0) 123 456 - 78</a> , more text , different number <a href="tel:+43 1234 567 789">+ 43(0) 1234/ 567-789</a> , final text </span> thanks helping! till. the preg_replace job you. adapt regex on first parameter following this sintax more variations. <?php $my_string = 'here text , number: +43 (0) 123 456 - 78 , more text , different number + 43(0) 1234/ 567-789 , final text'; $output = preg_replace("/(\+\s*([0-9]+)\s*\(\s*([0

javascript - Switch case not working for Images stored in array -

relating previous question , had images which(if 3 of specific image) same, wanted message appear, followed several guidelines previous question still cant work. previous question: how make if statement specific image source? it prints else statement, if 3 images of x appear, prints nothing main message, same problem occurs when 3 images of y appear(at once) or z. appreciated. new code (tad bit) : function xyz() { if((document.test.test1.src == document.test.test2.src && document.test.test2.src == document.test.test3.src )) switch (document.test.test1.src == document.test.test2.src == document.test.test3.src) { case "x": document.test.banner.value =("3 x")// stuff break; case "y": document.test.banner.value =("5 y") break; case "z": document.test.banner.value =("8 z") br

sorting - PHP Scandir Not Automatically in Alphabetical Order? -

tia. remedial php skills, can't figure out why scandir isn't automatically sorting alphabetically. (it nice have folders grouped , sorted alphabetically , files grouped , sorted alphabetically, isn't critical.) missing? <?php $dir = './customers/' . $customer . "/"; $exclude = array(".","..",".htaccess"); if (is_dir($dir)) { $files = scandir($dir); foreach($files $key=>$dir){ if(!in_array($dir, $exclude)){ echo ("<a href=\"./customers/$customer/".$dir."\">".$dir."</a><br>"); } } } ?> as wgd said, must use natcasesort following way: $files = scandir($dir); natcasesort($files); foreach ($files $file) { // code }

css3 - 100% height div in background cover div -

currently have web page background image size of cover. 2 divs inside of div 100% height. these divs need responsive. need leftside div have image sit on bottom. using clearfix on main containers class pic still goes container 1. html <div class="main-container1 clearfix"> </div> <div class="main-container2 clearfix"> <div class="wrapper"> <div class="leftside"><img class="pic" src="image/blank.png" /></div> <div class="rightside"></div> </div> </div> css body { height:100%; overflow:scroll; } .main-container1 { background-image:url(../images/footballfieldblur.jpg); background-position:center center; background-repeat:no-repeat; background-size:cover; min-height:100%; } .main-container2 { background-image:url(../images/footballfieldblur.jpg); background-position:center center; background-repeat:no-repeat; background-size:cover; min

Selecting mysql data with php array not working -

for reason code isnt working , dont know why: $action = array('id', 'lurl', 'account'); $request = 3; $stm = $pdo->prepare("select ? (select * urls order id desc limit ?) sub order id asc"); $stm->bindvalue(1, implode(',', $action)); $stm->bindvalue(2, $request, pdo::param_int); $stm->execute(); $data = $stm->fetchall(); all return following array: array ( [0] => array ( [id,lurl,account] => id,lurl,account ) [1] => array ( [id,lurl,account] => id,lurl,account ) [2] => array ( [id,lurl,account] => id,lurl,account ) ) but when manually enter data in query so: select id,lurl,account (select * urls order id desc limit 3); it supposed to. know why is? with bindvalue can bind "values" , not references. bind references need use bindparam change: $stm->bindvalue(1, implode(',', $action)); $stm->bindvalue(2, $request, pdo::param_int); to: $stm->bindparam(1, imp

objective c - How to make the NSAlert's 2nd button the return button? -

Image
i'd make nsalert : as can see, 'return' button second one. how can this? here's example of code use create nsalert , first button gets focus: nsalert *alert = [[nsalert alloc] init]; [alert setmessagetext:@"are sure want disconnect?"]; [alert addbuttonwithtitle:@"disconnect"]; [alert addbuttonwithtitle:@"cancel"]; [alert runmodal]; i want focus "cancel" button. ideas? thanks! to change key equivalents nsbutton elements inside of nsalert object, you'll have access buttons directly (after creation , before -runmodal ) , change key equivalents using -setkeyequivalent: method. for example, set disconnect esc , cancel return, following: nsarray *buttons = [alert buttons]; // note: rightmost button index 0 [[buttons objectatindex:1] setkeyequivalent: @"\033"]; [[buttons objectatindex:0] setkeyequivalent:@"\r"]; before calling -runmodal

php - Yii Captcha error -

Image
i working in yii , beginner , trying best learn framework , here stuck @ : i have created user model , required forms go it, , trying implement captcha : this validation rules in user model : $public verifycode public function rules() { // note: should define rules attributes // receive user inputs. return array( array('username, password, email', 'required'), array('username','unique'), array('email','email'), array('verifycode', 'captcha', 'allowempty'=>!ccaptcha::checkrequirements()), array('username, password', 'length', 'max'=>45), array('email', 'length', 'max'=>100), array('active', 'length', 'max'=>1), array('created_on, updated_on', 'safe'), // following rule used

r - How to load arrays with 3 dimension using R2WinBUGS? -

since winbugs , r have different ways of organizing data arrays, how should organize data when using r2winbugs order correct? thanks! you shouldn't have worry r2winbugs if specify data named list of objects (see ?bugs - data argument). r2winbugs reorganize data structure in winbugs same in r. for example, if specify array in r: y <- array(1:24,dim=c(2,3,4)) which looks like > y , , 1 [,1] [,2] [,3] [1,] 1 3 5 [2,] 2 4 6 , , 2 [,1] [,2] [,3] [1,] 7 9 11 [2,] 8 10 12 , , 3 [,1] [,2] [,3] [1,] 13 15 17 [2,] 14 16 18 , , 4 [,1] [,2] [,3] [1,] 19 21 23 [2,] 20 22 24 and specify in data argument of bugs function (e.g., bugs(data=list(y=y)... ) data winbugs (data.txt) is: list(y= structure(.data= c(1.00000e+00, 7.00000e+00, 1.30000e+01, 1.90000e+01, 3.00000e+00, 9.00000e+00, 1.50000e+01, 2.10000e+01, 5.00000e+00, 1.10000e+01, 1.70000e+01, 2.30000e+01, 2.00000e+00, 8.00000e

linux kernel - mmap() slower than write() copy_form_user(), why? -

i need transfer big blocks of data (~6mb) driver user space. in driver, allocate 2 3mb chunks per block using pci_alloc_consistent(). mmap() each block (i.e. 2 chunks) single vma using vm_insert_page(). allows user space read/write each block after mmap'ing it. seems work performance not acceptable. i implemented way of writing/reading to/from memory allocated pci_alloc_consistent() in driver. use write() user space , copy_from_user() in driver move content of each chunk in block above memory. opposite reads. i found first approach @ least 2-3 times slower , used ~40% more cpu. expected introduction of additional buffer copy in second case make slower. however, not case. i ran thest tests on x86 64-bit platforms, kernels: 2.6.* , 3.*. do above results make sense? if yes, can please provide background on taking place? thanks. caching disabled. did ioremap_cache() chunks allocated , vm_inserted? iv come across kind of problem on x86/x86_64 , has pat(pag

ujs - Update a model attribute with a simple link (link_to) in Rails 3 via AJAX -

as task management app user, click "completed" link on task record task's resolution completed. i want ajax request using rails 3 way of unobtrusive javascript (ujs). have been debugging quite while now, appreciated. here link_to call making inside view: <%= link_to "completed", task_path(:id => task.id, :resolution => "completed"), :remote => true, :method => :put %> and here update method in tasks controller: class taskscontroller < applicationcontroller respond_to :js def update @task = task.find(params[:id]) @task.update_attributes(params[:task]) respond_with(@task) end end watching network traffic chrome's dev tools appears put request being made proper url, including url parameter (tasks/{:id}?resolution=completed), preview showing following error message: template missing missing template tasks/update, application/update {:locale=>[:en], :formats=>[:js, :html], :handlers=>[

android - Have long press transition animation effect on linear layout -

referring android: how achieve glow effect when long-pressing list item? by applying list_selector_holo_light.xml on linear layout's background (which not being used in listview) , thought can achieve glowing animation effect long press on it. <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_window_focused="false" android:drawable="@android:color/transparent" /> <!-- though these 2 point same resource, have 2 states drawable invalidate when coming out of pressed state. --> <item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/list_selector_disabled_holo_light" /> <item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/list_selector_disabled_holo_light" />

c# - WPF GUI starving network messages -

i developing window7, c#/wpf based gui using blend/xaml , want show h.264 video rtp stream of video call. using c based open source library making video call. have created unmanaged code dll using c based library make video call. p-invoke wpf gui dll works fine. however notice wpf gui starving network thread used make calls , send/receive network messages. there way around problem? remember using xaml (not code) wpf gui. you need create new delegate, , pass unmanaged thread. such as: public delegate int passh264stream(byte[] buffer, int len); public passh264stream testdelegate = {}; testdelegate += (buffer, len) => application.current.dispatcher.begininvoke(new action(() => receiveinuithread(buffer, len)), dispatcherpriority.render); and pass testdelegate unmanaged thread through pinvoke. idea have unmanaged thread call ui thread , post stuff message loop, without blocking ui.

Templates from C++ in C -

trying recreate classes c++ standard library in c. example, std::pair class. emulate templates, used macros of course. here example of how looks like: #define _template_pair_struct(t1, t2, tname, strname) \ typedef struct { \ t1* first; \ t2* second; \ } strname; #define _template_pair_new(t1, t2, tname, strname) \ strname* tname##_new() \ { \ strname *new = malloc(sizeof( strname )); \ new->first = malloc(sizeof(t1)); \ new->second = malloc(sizeof(t2)); \ return new; \ } if trying use structure in multiple source files, have generate code multiple times. that, obviously, leads error. is there way fix this, can use these "templates" in c? as others have said, there few things kee

php - Pass a variable from one page to another in CodeIgniter -

in codeigniter, on page /categories have table rows of category items. there <select> box filter categories components: <form accept-charset="utf-8" method="post" action="/categories/get_categories"> <select onchange="this.form.submit()" name="selectcatsbycomponent"> <option value="0" selected="selected">-- choose component --</option> <option value="1">content</option> <option value="2">e-commerce</option> </select> </form> so whenever select <option> <select> list , , click on button add new category , want pass post value next page , automatically select corresponding component id in same <select> list. i tried seems not working: if( $this->input->post('selectcatsbycomponent') ) $com_id = $this->input->post('selectcatsbycomponen

Problems loading page with jQuery in fancybox -

i'm using fancybox 1.3.4 load page inside (from same domain). everything looks ok, if use jquery on page loaded in fancybox, "overrides" functions on parent page (for example, fancybox won't work second time). if don't use it, jquery depended scripts won't work on loaded page, can close , reopen fancybox again. the loaded page address defined in href , uses stylesheet of parent page. what's causing problem , how can fixed?

intuit partner platform - IPP Create Customers Never Appears in QBD -

i trying add customer , invoice quickbooks, neither appear. quickbooks responds xml: http://pastebin.com/plsfba6n my code adding customers , invoices appears work , see no errors: public customer buildcustomeraddrq(jmaorder _order) { // construct subordinate required records //buildstandardtermsaddrq("web order"); // build main customer record customer qbcustomeradd = new customer(); var customer = _order.billingaddress; var billing = _order.billingaddress; physicaladdress phy = new physicaladdress(); // if setting orders go under same customer id, push // address lines down 1 , store customer name on address line 1. if (_qbosettings.customerid == "singlename") { qbcustomeradd.dbaname = "web store"; qbcustomeradd.email = new emailaddress[] { new emailaddress() { address = "info@webstore.com", tag = new string[] { "

ios - How to disable keyboard but enable UITextFields when using UIDatePicker? -

Image
this 1 kind of hard explain, ask questions need clarify question. have ipad app (xcode 4.2, ios 6, arc , storyboards). in app, have uipopover contains uiview 2 (2) uitextfields in , uidatepicker . (see image). when go scene, have unchecked userinteractionenabled on both textfields prevent keyboard responding, works, doesn't allow other uitextfield accessed after first one. tried [ofinishtime setinputview:otimepicker]; takes timepicker , moves outside of popover, unacceptable. i have touchupinside events "wired" each of textfields, neither 1 gets called when tapped due userinteractionenabled being unchecked. remedy whole thing if have enabled , set flag in action event. how can enable both uitextfields yet prevent keyboard showing? happy post relevant code need see. may did not understand problem correctly , seems trying open picker on tap , display value set in uipicker. not using functionality of uitextfield. label or button might serve

android - how to change all package name in Eclipse? -

Image
i'm trying change package name in eclipse, have tried everything, last try change android tools-> rename application package didn't seem change package in code files itself, have more 1 package in app, selected first 1 , pressed f2 typed in same package name , changed in files, when selected second package , pressed f2 didn't want change, says package exists ! i'm wondering how app name , package read on google play, manifest file ? you have right click on package > refacor > rename

Android DrawerLayout component -

i have problems drawerlayout component. i'm using android-support-v4 jar , when i'm launching app have exception : 05-19 01:33:57.402: e/androidruntime(3120): fatal exception: main 05-19 01:33:57.402: e/androidruntime(3120): java.lang.runtimeexception: unable start activity componentinfo{com.dimosphere.app/com.dimosphere.app.mainactivity}: android.view.inflateexception: binary xml file line #1: error inflating class android.support.v4.widget.drawerlayout 05-19 01:33:57.402: e/androidruntime(3120): @ android.app.activitythread.performlaunchactivity(activitythread.java:2307) 05-19 01:33:57.402: e/androidruntime(3120): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2357) 05-19 01:33:57.402: e/androidruntime(3120): @ android.app.activitythread.access$600(activitythread.java:153) 05-19 01:33:57.402: e/androidruntime(3120): @ android.app.activitythread$h.handlemessage(activitythread.java:1247) 05-19 01:33:57.402: e/androidruntime(3120):

Run jQuery function on resize if condition is met -

i trying run script show message when hovering on logo. want run on screen sizes larger 768.e.g not mobiles. div appear , show random message list. on resize check if content container equal or larger 692, , if add class hoverinfo body. want run script if class exists, yet script still runs regardless. currently run script on doc.ready, run script check width on window resize , doc.ready. any appreciated! $(function(){ function checkwidth() { if ($('#content-wrap').width() == 692) { $('body').addclass('hoverinfo'); } else { $('body').removeclass('hoverinfo'); } } checkwidth(); $(window).resize(function () { settimeout(checkwidth, 200); }); function showtext(){ $randomtext = $(".page #messages"); $(".hoverinfo #logo").hover( function () { $randomtext.show(); },