Posts

Showing posts from January, 2012

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=&q

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

mybatis annotation select query with parameter which is use multiple times in conditions -

i have problem mybatis annotation query following error. org.apache.ibatis.binding.bindingexception: parameter 'strdatestart' not found. available parameters [0, 1, param1, param2] the following code in mapper class. `@select("select * result where"and proc_date >= '#{strdatestart}'"+ "and proc_date >= '#{strdateend}'"+ "and update_date <= '#{strdatestart}'"+ "and update_date <= '#{strdateend}'") public arraylist<resultdao> select(string strdatestart,string strdateend);` giving same name parameters in query , args in method , can use multiple times in conditions same parameter? the problem solved 1. delete single quotes surround variables #{strdatexxxx} 2. creating class conditions below code. `public class selectconditions { string strdatestart; string strdateend; public string getstrdatestart() { return strda

c# - Validating a received file using a checksum -

i need pass file using web service (i have control on webservice). fulfill security requirements need make sure passed file not modified or corrupted. plan below. convert file byte[] calculate hash, system.security.cryptography.md5.create().computehash(stream); pass file when passing file (byte array) web service, passing hash value practice? or need follow other process check files? best way handle this? if it's security requirement, sending md5 sum along file not want do: can intercept file can rewrite checksum well. i use crcs, instead: more sensitive small changes in file (or stream's) contents, , more compact , easier compare. .net doesn't appear have crc implementation, found nice 1 online appears work well, calculating crc-32 in c# , .net . does client have capability of computing checksum independently on side well?

python - Outputting dictionary values by min/max value -

lets have dictionary: dict1 = {'a': 3, 'b': 1.2, 'c': 1.6, 'd': 3.88, 'e': 0.72} i need able sort min , max value , call on them using function still writing (note: 'occurences,' 'avg_scores' , 'std_dev' dictionaries , 'words' dictionary's keys.): def sort(words, occurrences, avg_scores, std_dev): '''sorts , prints output''' menu = menu_validate("you must choose 1 of valid choices of 1, 2, 3, 4 \n sort options\n 1. sort avg ascending\n 2. sort avg descending\n 3. sort std deviation ascending\n 4. sort std deviation descending", 1, 4) print ("{}{}{}{}\n{}".format("word", "occurence", "avg. score", "std. dev.", "="*51)) if menu == 1: in range (len(word_list)): print ("{}{}{}{}".format(cnt_list.sorted[i],) i'm sure making way more difficult o

java - The application automatically adds 10 pixels to width and height -

my question wierd, after searching , reading code 40 times, can't explain why jpanel , jframe gets additional 10 pixels width , height. the code is: public class game extends jpanel implements runnable { public static final string name = "alpha !"; public static final int width = 600, height = 400; public static void main(string[] args) { game game = new game(); game.setminimumsize(new dimension(width, height)); game.setmaximumsize(new dimension(width, height)); game.setpreferredsize(new dimension(width, height)); game.setfocusable(true); game.requestfocusinwindow(); jframe frame = new jframe(name); frame.setdefaultcloseoperation(jframe.exit_on_close); frame.setlayout(new borderlayout()); frame.add(game, borderlayout.center); frame.pack(); frame.setresizable(false); frame.setalways

xml - xslt for-each repeating same for all the nodes -

source xml: same node repeated in for-each used in xslt. need loop through line items. if have 3 line items, for-each repeated 3 times same first line item.. <?xml version="1.0" encoding="utf-8"?> <orders xmlns="http://www.oracle.com"> <product-lineitems> <product-lineitem> <net-price>100.00</net-price> <tax>6.35</tax> <gross-price>106.35</gross-price> <base-price>100</base-price> <lineitem-text>originals modern</lineitem-text> <tax-basis>100.00</tax-basis> <product-id>tw2p84400za</product-id> <product-name>the waterbury</product-name> <quantity unit=""

python module with module-wise global variable -

i made python file several functions in , use module. let's file called mymod.py. following code in it. from nltk.stem.porter import porterstemmer porter = porterstemmer() def tokenizer_porter(text): return [porter.stem(word) word in text.split()] then tried import in ipython , use tokenizer_porter: from mymod import * tokenizer_porter('this test') the following error generated typeerror: unbound method stem() must called porterstemmer instance first argument (got str instance instead) i don't want put porter inside tokenizer_porter function since feels redundant. right way this? also, possible avoid from mymod import * in case? many thanks! to access global variables in python need specify in fucntion global keyword def tokenizer_porter(text): global porter

java - Google Cloud Endpoints - APIs not updating -

i've been playing around google cloud endpoints (java) , i'm having trouble getting apis update after deploy app engine (using both eclipse + google plugin , android studio). i created endpoint based on class called process (annotated jpa). sits in package (let's say: com.example). first time deployed had accidentally imported wrong class (java.lang.process instead of com.example.process). got error when tested 1 of methods in api explorer: com.google.api.server.spi.systemservice invokeservicemethod: cause={0} javax.persistence.persistenceexception: no meta data java.lang.process. perhaps need run enhancer on class? i have corrected import, re-generated client libraries , re-deployed app app engine, keep getting same error. if app engine still thinks i'm using java.lang.process instead of process class. i made other changes. class member variable types , method names , re-deployed. app engine doesn't seem notice these changes. i read how api explorer

python for loop printing list character instead of element -

this question has answer here: convert string representation of list list in python 8 answers i have list of dictionaries of when want print list index element of key in dictionary, output index of character , not element. reader = csv.dictreader(mycsvfile, fieldnames) row in reader: print row example output: {'name':'tom','numbers':"['1','2','3']"} #row print row['numbers'] ['1',2','3'] #correct print row['numbers'][0] [ #wrong how convert row['numbers'] list? that's okay: >>> row = {'name':'tom','numbers':['1','2','3']} >>> row['numbers'] ['1', '2', '3'] >>> row['numbers'][0] '1' >

ubuntu - How to update arangodb if I change the OS -

i installed arangodb on ubuntu 14.04 lts, after that, upgrade ubuntu 15.10 , upgrade 16.04 lts, should arangodb? should re-install based on ubuntu version, or there workaround do? thank you, elmer since arangodb offers releases across recent ubuntu versions, (we need gcc 4.9 @ least build releases) should able update/upgrade arangodb @ different pace os. means: follow arangodb blog anounce releases including changes , bugfixes. keep latest released arangodb ubuntu release once new ubuntu released, update os, , install arangodb package new os should in term same release had before. you should able achieve configuring apt sources.list; first download , add signature key packaging system: wget https://www.arangodb.com/repositories/arangodb2/xubuntu_14.10/release.key apt-key add - < release.key use apt-get install arangodb: echo 'deb https://www.arangodb.com/repositories/arangodb2/xubuntu_14.10/ /' |\ sudo tee /etc/apt/sources.list.d/arangodb.li

android - addressList size is 0 Google Maps -

i 'm trying use google maps. have code: public void onmapready(googlemap googlemap) { mmap = googlemap; mmap.getuisettings().setzoomcontrolsenabled(true); list <address> addresslist = null; if (location != null || !location.equals("")){ geocoder geocoder = new geocoder(this); try { addresslist = geocoder.getfromlocationname(location, 1); }catch (ioexception e){ e.printstacktrace(); } address address = addresslist.get(0); latlng latlng = new latlng(address.getlatitude(), address.getlongitude()); mmap.addmarker(new markeroptions().position(latlng).title(location)); mmap.movecamera(cameraupdatefactory.newlatlngzoom(latlng, 15)); } } but receive this: addresslist size 0. error "java.lang.indexoutofboundsexception: invalid index 0, size 0" location variable works fine.

excel - How to move range values to Top after filtering using vba macro -

Image
how move range values top after filtering using vba macro per requirement, have filtered defects severity filter lob, requirement jira in column should on top. i not getting how move top of jira in column a.appreciate here. note: after move severity should not altered ie. jira defect should filtered severity. per screen shot attached sub moverange() lrow = range("a" & rows.count).end(xlup).row set mr = range("a2:a" & lrow) mr.select each cell in mr 'if cell.value = "jira" selection.entirerow.cut shift:=xlup if cell.value = "jira" selection.cut 'rows("2:2").select selection.insert shift:=xlup end if next end sub how simple helper-column 0 "jira" , 1 not "jira" (or true false or whatever) , sort helper column first criteria... or if not want change order (and "jira" @ top) use in helper column (start in row 2): =row()+1000*(a2<>"jira") and sort

Changing Location Settings - Android Tutorial -

i trying implement code request change location settings. following android studio tutoriel so. however, when followed tutorial , put code inside actual studio, saw came several errors. protected void createlocationrequest() { locationrequest mlocationrequest = new locationrequest(); mlocationrequest.setinterval(10000); mlocationrequest.setfastestinterval(5000); mlocationrequest.setpriority(locationrequest.priority_high_accuracy); locationsettingsrequest.builder lsbuilder = new locationsettingsrequest.builder(); lsbuilder.addlocationrequest(mlocationrequest); final pendingresult<locationsettingsresult> result = locationservices.settingsapi.checklocationsettings(mgoogleapiclient,lsbuilder.build()); result.setresultcallback(new resultcallback<locationsettingsresult>() { @override public void onresult(locationsettingsresult result) { final status status = result.gets

c++ - //! [0] in Qt source code -

what meaning of //! [n] ( n = 0, 1, 2 ...) markup in c++/qml sources in qt sample projects? for example: //! [0] glwidget::glwidget(helper *helper, qwidget *parent) : qglwidget(qglformat(qgl::samplebuffers), parent), helper(helper) { elapsed = 0; setfixedsize(840, 400); setautofillbackground(false); } //! [0] //! [1] void glwidget::animate() { elapsed = (elapsed + qobject_cast<qtimer*>(sender())->interval()) % 1000; repaint(); } //! [1] //! [2] void glwidget::paintevent(qpaintevent *event) { qpainter painter; painter.begin(this); painter.setrenderhint(qpainter::antialiasing); helper->paint(&painter, event, elapsed); painter.end(); } //! [2] despite common misconception, qdoc syntax, not doxygen. comment documentation purposes in qt project mark example snippets rendered so. not documented well, here can find corresponding code implements feature. as end user of qt, not need deal unless start contribut

Sending an Email with Form Data via Mailgun and Python -

i understand basics of sending message via mailgun api using python , requests site , works fine. attach data html form using request.forms.get(''), can't figure out syntax make work. link below need do, except in python instead of php. http://www.formget.com/mailgun-send-email/ how can send following form data example through via mailgun? html form (parts of point across) <form action="/send" method="post"> <input name="name" placeholder="name"> ... <button> ... route (parts of point across) @route('/send', method='post') def send_simple_message(): variable_i_need_to_send = request.forms.get('firstname') ... data={...", "to": "myname <myname@gmail.com>", "subject": "website info request", "text": "testing mailgun awesomness!", "html": **variable_i_need_to_send**})

javascript - Upload image using html -

i designing simple chat application using google app engine. using code available link. http://code.google.com/p/google-app-engine-samples/source/browse/trunk/simple-ajax-chat/ i new concepts of html, css , javascript. wish add feature chat application user can upload image in chat window itself. (similar feature have in facebook). i explored code , found out following html code takes care of chat window. <div id="chats"></div> <form id="send-chat-form" action="javascript:sendchat();"> <div class="form-item"> <input type="text" name="content" class="form-textfield" id="chattext" size="100" /> <input type="submit" class="form-submit" value="send" /> <input type="button" class="form-refresh" value="refresh" onclick="updatechat()" /> </div> </form> </div> t

Can I force python array elements to have a specific size? -

i using arrays modules store sizable numbers (many gigabytes) of unsigned 32 bit ints. rather using 4 bytes each element, python using 8 bytes, indicated array.itemsize, , verified pympler. eg: >>> array("l", range(10)).itemsize 8 i have large number of elements, benefit storing them within 4 bytes. numpy let me store values unsigned 32 bit ints: >>> np.array(range(10), dtype = np.uint32).itemsize 4 but problem operation using numpy's index operator twice slow, operations aren't vector operations supported numpy slow. eg: python3 -m timeit -s "from array import array; = array('l', range(1000))" "for in range(len(a)): a[i]" 10000 loops, best of 3: 51.4 usec per loop vs python3 -m timeit -s "import numpy np; = np.array(range(1000), dtype = np.uint32)" "for in range(len(a)): a[i]" 10000 loops, best of 3: 90.4 usec per loop so forced either use twice memory like, or program run twice

PHP GD generating image with an extra 20(hex) in the file -

using php gd library generate png image, seems working fine, no errors. browser cannot render image. i downloaded generated png , compare normal pngs in ultraedit, found there 20 (in hex mode) in beginning of file. after remove 20 ultraedit, png works fine. i've check through code, , cannot find line gives 0x20. relative part of code follow: public function imggen($string = "enter own lyric.", $size = 35, $lineheight = 50, $font = "./fonts/w6.ttf", $meta = "project gy picture generation", $metasize = 10, $metalineh = 25, $bg_src = "./img/bg/bg1.png", $textcolor = "w", $width=640, $height=596, $x_offset = 30, $y_offset =

facebook - Application request limit reached for different user access_tokens -

my application generates rest url facebook's graph api in following way: fb.login(function (response) { if (response.authresponse) { accesstoken = response.authresponse.accesstoken; var resturl = "https://graph.facebook.com/me/friends?fields=picture,name,id&access_token=" + accesstoken } }); i have been debugging application lot today , rest call returning following message: { "error": { "message": "(#4) application request limit reached", "type": "oauthexception", "code": 4 } } my understanding each user get's allotted number of rest calls tried running app different persons facebook account. didn't help. can explain what's going on? according this answer on quora , there rate limit applied ip address token. logging in different facebook account wouldn't if still using same ip address.

Magento log file permission issues -

i have standard magento application actions performed either through web (www-data) or cron scripts (executed cron user). default, magento creates log files chmod 0640 gives problem. whoever logs exception/system first (www-data or cron), other won't able append. if exception occurs on web, var/log/exception.log created www-data owner cron scripts won't able log exceptions in same file (cron , www-data not in same group if be, wouldn't help). possible solutions: 1. run cron same www-data user (sysadmin won't budge, doesn't agree solution) 2. change mage.php generate log files more suitable chmod (even 777 maybe). doable means modifying magento core files (mage.php) , it's not allowed license. mage class final , noticed there no pre- or post- events after logging in order possible change chmod in pre/post hook. has encountered same problem or has advice on how handle this? your proposed first solution sounds valid 1 me. cronjob should run www-d

linux - Understanding ASM. Why does this work in Windows? -

me , couple of friends fiddling strange issue. encountered crash in our application inside of small assembler portion (used speed process). error caused fiddling stackpointer , not resetting @ end, looked this: push ebp mov ebp, esp ; stuff here including sub , add on esp pop ebp when correctly should written as: push ebp mov ebp, esp ; stuff here including sub , add on esp mov esp,ebp pop ebp now our mindbreak is: why work in windows? found error ported application linux, encountered crash. neither in windows or android (using ndk) encountered issues , never have found error. there stackpointer recovery? there protection against misusing stackpointer? the ebp esp usage, called stack frame, , purpose allocate variables on stack, , afterward have quick way restore stack before ret instruction. new versions of x86 cpu can compress these instructions using enter / leave instructions instead. esp actual stack

c# - Weird .Net 4, System.IO.FileNotFoundException when call UserPrincipal.FindByIdentity, -

i start encounter new runtime system.io.filenotfoundexception exception after upgrade system win7 x64 win 10 x64. i have following code works perfect until now: { principalcontext pc = new principalcontext(contexttype.machine, environment.machinename); userprincipal usrprin = userprincipal.findbyidentity(pc, identitytype.samaccountname, username); if (usrprin == null) // no user exist { return -1; } // user exist return 1; } i built project using platform target: x86, when run application, exception when call userprincipal.findbyidentity . a first chance exception of type 'system.io.filenotfoundexception' occurred in system.directoryservices.dll first chance exception of type 'system.io.filenotfoundexception' occurred in system.directoryservices.accountmanagement.dll all projects compile .net4 , not .net4.5 during debug now, find if change build platform target anycpu, code passed no i

PHP MYSQLI Call to a member function bind_param() -

this question has answer here: reference - error mean in php? 30 answers my code $query1 = "select `user_id` `it_user` (user_email_address = ? , user_mobile_number_verified = null)"; $stmt1 = $mysqli->prepare($query1); $stmt1->bind_param("s",$email); $stmt1->execute(); if ($stmt1->affected_rows == 1) { //set registration flag 1 stating users mobile number verified echo '<meta http-equiv="refresh" content="0; url=\'../signin/\'"/>'; } else { $registration_flag = 2; //redirect user error page //echo '<meta http-equiv="refresh" content="0; url=\'../error/\'"/>'; } i getting error :: call member function

cordova - Not able to create text file inside the folder in phonegap -

i working on code create text file inside directory. i googled , found code on device ready. but not working. i used filesystem.getdirectory instead of filesystem.root.getfile . code: function gotfs(filesystem) { // create dir alert("jjßß") filesystem.root.getfile("newdir", { create: true, exclusive: false }, gotdirentry, fail); } function gotdirentry(direntry) { // create file direntry.getfile("newfile.txt", { create: true, exclusive: false }, gotfileentry, fail); } function gotfileentry(fileentry) { fileentry.createwriter(gotfilewriter, fail); } function gotfilewriter(writer) { writer.onwrite = function (evt) { console.log("write completed"); }; writer.write("some sample text"); writer.abort(); } function fail(error) { console.log(error.code); } you can try following code: window.requestfilesystem(localfilesystem.p

c# - How to check in all visible rows CELLs for string.IsNullOrEmpty and IsDateEmpty -

Image
i have table rows show/hide button click event. want check visible rows cell index string.isnullorempty , isdateempty. how this? the following code(for check visible cell[0] textbox) not working: var allvisiblerows = mytbl.rows.cast<tablerow>().where(row => row.visible); bool anytextboxempty = allvisiblerows.any(row => string.isnullorempty(((textbox)row.cells[0].controls[0]).text)); //destinavionvalidation if (anytextboxempty) { return "please, insert text"; } the following code(for check second cell 1 datetimecontrol) not working: bool anydatetimeonevalid = allvisiblerows.any(row => !(((datetimecontrol)row.cells[1].controls[0])).isvalid); bool anydatetimeoneempty = allvisiblerows.any(row => (((datetimecontrol)row.cells[1].controls[0])).isdateempty); //date validation if (anydatetimeonevalid || anydatetimeoneempty) { return "please, insert date!"; } this following error system.argumentoutofrangeexception: specified arg

ggplot2 - Linear regression different using R plot() and qplot() -

if create scatterplot using plot() lm(x~y) on data intercept @ 500 , when observe qplot on same data stat_smooth(method=lm) , intercept @ 1000 on y axis. although slope looks visually similar on simple plot() . hope makes sense. cannot understand why difference. full functions given below. appreciated. plot() : plot (my[[12]],my[[8]]) abline(lm(my[[12]]~my[[8]]),col="red") qplot() : mygg<-qplot(x=my[[12]],y=my[[8]]) # pretty scatterplot mygg<-mygg + stat_smooth(fullrange=true,method="lm") it seems me variables in regressions not correspond. in lm variable my[[12]] dependent , in qplot variant independent one. using lm(my[[8]]~my[[12]] should make equivalent. it common mistake mix variables when using plot , lm . note axis right, order of variables changes in lm compared plot . x <- rnorm(100) y <- rnorm(100) plot(x,y) abline(lm(y ~x)) to make less confusing might use formula interface in plot w

php - Get categorised result taking arguments present inside loop codeigniter -

i have got 2 tables 'category' , 'organization' . under view want list organizations work under respective categories of category table . did shown below : *here's controller : * function organization() { $data['category'] = $this->category_model->get_all_category(); $data['organization'] = $this->organization_model->get_categorised_organization(); $data['title'] = "welcome organization page"; $this->load->view('organization_index',$data); } here's model : function get_categorised_organization() function get_categorised_organization() { $category = $this->category_model->get_all_category(); $i = 0; foreach ($category $c): $sql = "select * ss_organization org_working_area='$c->category_name'"; $query = $this->db->query($sql); $result[] = $query->result();

How to create video using QTRLE codec in ffmpeg? -

i want generate video using qtrle codec , argb pixel format using ffmpeg lib. i able create video using h264 yuv420p pixel format, unable same qtrle.so how can this? i suppose first video, 1 create using h264 yuv240p pixel format mp4, , suppose want generate mp4 video qtrle codec , argb pixel format. the problem qtrle codec not compatible mp4 container, cannot have mp4 file encoded in qtrle. container know compatible mov. tried , there no problem.

sql - Query based on recorded criteria -

there 2 tables, categories(id, name) products(id, text, categoryid) there table filtering products: filter(categoryids, containtext) categoryids in filter table comma-separated: 100,101 we want query products based on criteria extracted filters table. example: filters have 2 records: categoryids | containtext ----------------------------- 100,101 | 200,201 | b here products want query: containting text 'a' in categories 100 or 101 or containting text 'b' in categories 200 or 201 we not use dynamic query. thanks help. as per giorgos comment, need normalize filter table. if you're stuck design, here solution: first, need have string splitter. here 1 taken aaron bertrand's article : create function dbo.splitstrings_xml ( @list nvarchar(max), @delimiter nvarchar(255) ) returns table schemabinding return ( select item = y.i.value('(./text())[1]', 'nvarchar(4000)

How to remove DATABASECHANGELOG from liquibase sql diff output? -

i use liquidbase compare 2 databases: call liquibase --driver=com.mysql.jdbc.driver ^ --classpath=../lib/mysql-connector-java-5.1.20-bin.jar ^ --url="jdbc:mysql://localhost:3306/skryb" ^ --username=skryb ^ --password=skryb ^ --changelogfile=%build%.xml ^ updatesql > %build%.sql 2>e2 how can avoid lines this: insert into databasechangelog ..... in output sql? thanx. you can't... these essential operations used track changesets applied database. you pass sql thru sort of filter, you'd end sql not represent operations liquibase perform. more importantly if applied filtered sql database, you'd cause later problems liquibase should attempt automatic migration (it think changeset unapplied). i'm guessing you're trying show sql 3rd party dba? in case show them liquibase doing, demonstrate how each change database being recorded. sell audit feature of application.

java - Android Studio doesnt build after update -

i have updated android studio build 130.729444, , project (which built correctly before update) has stopped work, , android studio shows me following error: internal error: (java.lang.assertionerror) unexpected node android packaging; nodes=[module 'myapplication' production, module 'myapplicationproject' production, module 'myapplication' tests, module 'myapplicationproject' tests, resources 'myapplication' production, resources 'myapplicationproject' production, resources 'myapplication' tests, resources 'myapplicationproject' tests, artifact 'myapplication', android gradle build target] java.lang.assertionerror: unexpected node android packaging; nodes=[module 'myapplication' production, module 'myapplicationproject' production, module 'myapplication' tests, module 'myapplicationproject' tests, resources 'myapplication' production, resources 'myapplicationproject

VBA - Set dictionary with convert to string e.g. EVAL -

hello friendly , nice people. idea following - have 1 dictionary of dictionaries , set loop , not each 1 separately. idea how it? so far have this: public sub mains() dim my_dict object dim d1 object dim d2 object dim d3 object dim d4 object dim d5 object dim d6 object dim d7 object dim d8 object dim long set my_dict = createobject("scripting.dictionary") = 1 8 set cstr(d & i) = createobject("scripting.dictionary") next end sub is doable in vba? set cstr("d"& i) gives error of course, want similar , not set dictionaries 1 one. you can't construct variable names programmatically. use array instead. dim dicts(8) variant = 0 7 set dicts(i) = new dictionary next alternatively, since goal build dictionary of dictionaries, can directly: dim dict new dictionary, tmp dictionar

visual studio 2013 - Microsoft (R) C//C++ Optimizing Compiler has stopped working -

i wanna compile trinitycore visual studio 2013(x86 & x64 both tested) on windows 10 i error , test every solutions such as: 1.change /zm on additional options /zm500 /zm2000(maximum) 2.disable precompiled headers 3.disable optimization 4.re-install visual studio 5.re-install windows 10 visual studio error description: error 1 error c1001: internal error has occurred in compiler. \trinitycore-3.3.5\src\server\game\server\worldsocket.cpp 256 1 game error 2 error c1060: compiler out of heap space c\src\server\game\c1xx game error 3 error d8040: error creating or communicating child process c\src\server\game\cl game event log: faulting application name: cl.exe, version: 18.0.21005.1, time stamp: 0x524faabf faulting module name: c1xx.dll, version: 18.0.21005.1, time stamp: 0x524faa90 exception code: 0xc0000005 fault offset: 0x0025236e faulting process id: 0x1948 faulting application start time: 0x01d19f24d391755f faulting application pa