Posts

c++ - instantiating ImageToPathFilter in ITK -

i trying use imagetopathfilter in itk not able instantiate using normal classname::pointer = classname::new(); routine. this code typedef itk::image<unsigned int, 3> labelimagetype; typedef itk::chaincodepath<2> pathtype; typedef itk::imagetopathfilter<labelimagetype, pathtype> imagetopathtype; imagetopathtype::pointer filter = imagetopathtype::new(); that last line causing following error cannot convert 'itk::smartpointer<itk::pathsource<toutputpath>>' 'itk::smartpointer<itk::imagetopathfilter<labelimagetype,pathtype>>' this class advertised filter inherits pathsource using pathsource<pathtype> instead of imagetopathfilter works cannot use setinput() itk filter. i think solution might involve casting wizardry ignorant in department. thank you it turns out itk::imagetopathfilter class base class not meant instantiated. itk classes use smart pointers have itknewmacro in definition, cla...

android - How can I display a listview from a database in a fragment in a drawer navigation activity -

can me please display listview database in fragment (drawer navigation activity)? tried doesn't work in fragment. this's file fragment3.java public class fragment3 extends fragment { private string json_string; private listview listview; public static final string url="http://10.0.3.2/scripts/select.php"; public static final string tag_json_array="result"; @nullable @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { return inflater.inflate(r.layout.fragment3, container, false); super.oncreate(savedinstancestate); setcontentview(r.layout.fragment3); listview = (listview) findviewbyid(r.id.listview); listview.setonitemclicklistener(this); getjson(); } private void display(){ jsonobject jsonobject = null; arraylist<hashmap<string,string>> list = new arraylist<hashmap<string, string>>(); try { jsonobject =...

java - Null object reference when initializing spinners in tablayout -

i have multiple tabs spinners in them, , when switch fragment sliders need initialized corresponding string-arrays. issue keep receiving "null object reference" error. here's code. fragment code: public class pageone extends fragment { public static final string arg_page = "arg_page"; private int mpage; public static pageone newinstance(int page) { bundle args = new bundle(); args.putint(arg_page, page); pageone fragment = new pageone(); fragment.setarguments(args); return fragment; } @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); mpage = getarguments().getint(arg_page); } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { mainactivity mainactivity = new mainactivity(); if(mpage>=3) { mainactivity.addshittospinners(mpage); ...

javascript - Execute a function every 3 seconds in jquery mobile -

am trying create function in jquery mobile autorefreshes every 3 seconds when on page. i have tried: $(document).on('pageshow', '#chat',function(){ function autoload(){ console.log('its after 3 sec') } autoload(); }); how can change function console.log('its after 3 sec') after 3 seconds how can add time interval.the function should execute when 1 on page(#chat) you can use setinterval method, execute specified function @ desired interval ( in milliseconds ). $(document).on('pageshow', '#chat', function() { function autoload() { console.log('its after 3 sec') } setinterval(autoload(), 3000); }); to stop execution when hiding page, store interval id , use clearinterval method. // store interval id can clear when page hidden var intervalid; $(document).on('pageshow', '#chat', function() { function autoload() { console.log('its after 3 sec...

How to make PHP loop refresh when clicking class tag -

okay have portfolio page display couple of thumbnails, , can order tags, example this: <a href="#" title="year1" class="sort" onclick="reveal('year1');">year 1</a> and works fine. however, thumbnails display @ 3 on row, first 2 should have right margin, third 1 no margin. used php works fine. if ($result=$link->query($query)) { ($i=1; $i <= $result->num_rows; $i++) { $row= $result->fetch_assoc(); $id = $row['number']; $title = $row['title']; $bgthumbnail = $row['thumbnail']; if($i%3 == 0){ echo " <div class=\"thumbnail\"> <a href=\"portfoliodetail.php?id=$id\"> <div class=\"thumbnailoverview nomargin\" style=\"background: url('images/portfolio/thumbnails/$bgthumbnail'); background-position: center center;\"> <div clas...

jquery - Submit form with AJAX to php api -

i have form posting data php api file. got api working , creates account want use ajax send data can make ux better. here php sending script expecting: <form id="modal-signup" action="/crowdhub_api_v2/api_user_create.php" method="post"> <div class="modal-half"> <input type="text" placeholder="first name" name="user_firstname"></input> </div> <div class="modal-half"> <input type="text" placeholder="last name" name="user_lastname"></input> </div> <div class="modal-half"> <input type="radio" placeholder="gender" value="male" name="user_gender">male</input> </div> <div class=...

html - Updating Div with AngularJS -

i have div defined follows: <button ng-repeat="message in user.messages"> <div ng-model="message" ng-show="{{message.received && !message.read}}" class="btn bg-green"></div> <div ng-model="message" ng-show="{{message.received && message.read}}" class="btn bg-green" ></div> <div ng-model="message" ng-show="{{!message.received}}" class="btn bg-amber"></div> basically i'm changing (show/hide) icon depending on message status (received, sent, read). however, when update status of message, icons not change, though have bound ng-model. need refresh whole page icons updated. any way can update through angular? thank you. ng-show doesn't need interpolated, can write "message.recieved..." why not use ng-class this: div ng-class="{'bg-green' : message.recieved, 'bg...