Posts

Showing posts from May, 2013

java - How can I modify generated files ,created using cxf-codegen plugin and then compile? -

i using cxf-codegen maven plugin .the first time did mvn install ,it generated set of files , placed in target/generated-sources/cxf folder , generated files compiled , packed in resulting jar maven. now find reason namespace attribute not fetched package--info.java while rest response created . server flings error saying javax.xml.bind.unmarshalexception: unexpected element (uri:"", local:"com.collabnet.teamforge.ia.types.getconfigurationparametersresponse"). expected elements \lt{http://www.collab.net/teamforge/integratedapp}createprojectconfigurationrequest\gt, \lt{http://www.collab.net/teamforge/integratedapp}getconfigurationparametersrequest\gt, \lt{http://www.collab.net/teamforge/integratedapp}getconfigurationparametersresponse\gt, \lt{http://www.collab.net/teamforge/integratedapp}getpagecomponentparametersrequest> so have planned , set namespace attribute in generated file (getconfigurationparametersresponse.java) @xmlrootelement(name = &q

Spring integration imap - multiple email accounts from the same domain -

i'm using spring's imap mechanism in order recieve emails account server. this works charm. anyhow, new requirmemnt came - instead of listening single email account have listen on multiple number of accounts. iv'e tried creating new channel each of these account. works! problem each channel added meaning new thread running. since i'm talking large number of accounts quiet issue. my question is: since email accounts (i listen to) in same domain i.e: acount1@mydomain.com acount2@mydomain.com acount3@mydomain.com .... is possible create single channel multiple accounts? is there alternative me defining n new channels? thanks. nir i assume mean channel adapter, not channel (multiple channel adapters can send messages same channel). no, can't use single connection multiple accounts. this limitation of underlying internet mail protocols. if using imap idle adapters, yes, not scale because needs thread each. however, if talking few 10

string - R: How to change the column names in a data frame based on a specification -

i have data frame, start of below: sm_h1455 sm_v1456 sm_k1457 sm_x1461 sm_k1462 ensg00000000419.8 290 270 314 364 240 ensg00000000457.8 252 230 242 220 106 ensg00000000460.11 154 158 162 136 64 ensg00000000938.7 20106 18664 19764 15640 19024 ensg00000000971.11 30 10 4 2 10 note there many more cols , rows. here's want do: want change name of columns. important information in column's name, e.g. sm_h1455, 4th character of character string. in case it's h. want change "sm" part "control" if 4th character "h" or "k", , &

Convert int datatype to string datatype c# access database -

i created windows application form project , there problem facing right now. problem is: had array of textboxes, , wanted connect database textboxes, however, cannot data because data want connect int datatype. there 2 form has been created, 1 login form, login form, database string, autocomplete working. second 1 second form, second form, database int, autocomplete not working. my question is: how convert int datatype string datatype? here code second form: string connectionstring = (@"provider=microsoft.ace.oledb.12.0;data source=\archives\projects\program\sell system\sell system\app_data\db1.accdb;persist security info=false;"); private list<list<textbox>> textboxcodecontainer = new list<list<textbox>>(); oledbdatareader dreader; oledbconnection conn = new oledbconnection(connectionstring); conn.open(); oledbcommand cmd = new oledbcommand("select distinct [code] [data] order [code] asc", conn); dreader

sql - Cast/Convert Text-Decimal -

i know bad practice way can due data migration column requirements. i looking round up(ceil) or round down (floor) value in text feild. i know fact either integers or decimals no worry bad data there. update [dbo].[t01] set [2 37] = cast( floor(convert(decimal(10,5),(cast([2 37] varchar(10))))) text ) [2 37] '%.%' my first attempt was: update [dbo].[tomcat 19032013 01] set [2 37] = floor([2 37]) [2 37] '%.%' long story short want able floor or ceil data in text field! i using sql 2005 - developer edition you should add columns conversion. declare @t01 table([2 37] text, [2 37 floor] int, [2 37 ceiling] int) insert @t01 ([2 37]) values('1.5') insert @t01 ([2 37]) values('4.1') insert @t01 ([2 37]) values('5.9') update t set [2 37 floor]=floor(convert(decimal(8,2),(cast([2 37] varchar(10)))) ) , [2 37 ceiling] =ceiling(convert(decimal(8,2),(cast([2 37] varchar(10))))) @t01 t [2 37] '%

Android service not starting, no idea why -

i'm trying run thread starting service, won't start. won't log. this inner service class. service class creates new background thread , starts it. backgroundthread , service class both innerclasses can reach variables. public class myservice extends service { private backgroundthread background; @override public ibinder onbind(intent intent) { return null; } @override public void oncreate() { super.oncreate(); toast.maketext(this, "my service created", toast.length_long).show(); log.d(tag, "oncreate"); background = new backgroundthread(); } @override public void ondestroy() { super.ondestroy(); toast.maketext(this, "my service stopped", toast.length_long).show(); log.d(tag, "ondestroy"); } public int onstartcommand(intent intent, int flags, int startid) { super.onstartcommand(intent, startid, startid)

c# - How can I call EditorFor from the controller -

i have list of locations public class location { public string locationname { get; set; } public string address { get; set; } } i created editor template class <div> <span>@html.textboxfor(a => a.locationname)</span> <span style="color: red;">@html.textboxfor(a => a.address )</span> </div> the problem locations load ajax page , going send results server. how location specific index? mean first location generate this: <input type="text" name="locations[0].locationname" /> for second location when press "add location" button should location server (from action of controller html string) index 1 not 0 because next location. is possible achieve it? or doing wrong? something this [httpget] public virtual actionresult locationeditor(int index) { viewdata.templateinfo.htmlfieldprefix = string.format("locations[{0}]", index); r

extjs4.1 - Showing loading icon on ExtJs 4.1.1 tree panels node when expanded -

Image
i using extjs 4.1.1 tree panel. xtype: 'treepanel', id: 'tpanel', flex: 0.68, title: 'tree', displayfield: 'dataname', rootvisible: false, usearrows: true, hidden: true, store: 'mystore' this tree check tree (shows checkbox). looked following example of xml tree: http://docs.sencha.com/extjs/4.1.1/#!/example/tree/xml-tree.html when expand node of tree, shows loading icon. i want similar within tree panel not able in tree. please help

php - PDO Update Statement Not Working -

i've browsed web quite bit before asking here; noticed people have same problem me, none of answers given others didn't solve problem, so.... i have basic pdo update statement inside public function: public function editrank($name, $rank){ $query = "update `chat_mod` set `chat_mod_rank` = :rank `chat_mod_ign` = :username"; $prepare = $this->_db->prepare($query); $array = array( ':rank' => $rank, ':username' => $name ); try { $prepare->execute($array); } catch (pdoexception $e){ echo 'error: ' . $e->getmessage(); return false; } return true; // if no pdo exception thrown.. } no exception thrown, function returns true; rows not being updated. yes, i've checked rows named , values not nulls. thanks, tom. p.s other queries select, add & delete work fine. you catching pdo exceptions did tell pdo throw them? to make pdo throw exceptions have configure pdo errmode . note se

ruby on rails - mongoid embedded document criteria not recognized -

here's models class scammer include mongoid::document field :email_used field :phone_used field :name_used field :first_logged, type: datetime field :last_scam_attempt, type: datetime field :checked, type: integer, default: 0 field :scams_count, type: integer field :common_commodity field :status embeds_many :reports embeds_many :reporters embeds_many :requestors end class report include mongoid::document embedded_in :scammer field :reported, type: datetime field :posed_as field :encountered_through field :commodity field :details field :logged_by end class reporter include mongoid::document embedded_in :scammer field :reporter_ip field :captured, type: datetime end class requestor include mongoid::document embedded_in :scammer field :requestor_ip field :captured, type: datetime end and here's code i'm using try these models # it's email address, if scammer.where(email_us

WCF Data Services (OData) Generated Online Help & Documentation -

with asp.net mvc 4.0 webapi nice auto-generated api, similar used generated asmx web services , can configured wcf, see link: http://msdn.microsoft.com/en-us/library/ee230442.aspx does work for, or there equivalent odata endpoints? there no official equivalent @ point, @ least afaik. need parse csdl model generated $metadata resource make ready human consumption. it's not entirely related, if remember preview specs odata v4.0 correctly, metadata accessible odata endpoint (a bit database catalogs in dbms accessible through tables themselves). able use odata explorer browse api metadata.

sql server - multiple SQL counts using multiple queries using SQL -

i need multiple counts. have 6 columns. this: select count(c.id) 'column 1', count(c.id) 'column 2', count(c.id) 'column 3', count(c.id) 'column 4', contact c i need able run different counts using different queries unsure how apply queries counts in 1 result. you have several options here. 1) use subqueries @thesoultion proposed 2) use use union select 'a' name, count(c.id) [count] contact c ... union select 'b' name, count(c.id) [count] contact c ... 3) in case same subset want sum based on conditions, use case when inside counts select sum(case ... when ... 1 else 0 end) counta, sum(case ... when ... 1 else 0 end) countb ... ...

javascript - How to detect the difference between a change made by a user and a change made programmatically? -

i have onchange event handler being triggered twice; once change made user, , second time change made programmatically result original user's change. event should triggered once, former. how discern between changed made user , 1 script? if change value el.value = x , change event not triggered. example, won't log console : var el = document.getelementbyid('el') el.onchange = function(){ console.log('changed'); }; el.value = 'asasassasa'; so, if you're seeing it's being triggered twice, it's either because: you're manually triggering el.onchange() . in case, remove call. or: the event handler bound element more once. have locate that's happening.

JQuery script in Django app - 403 error -

i'm running django app locally using heroku, , s3 media + static files. app includes mini slide show cycles through images on command, , no longer pulling in images, i'm seeing 403 error cycle through slideshow. the script embedded in html, not separate file. because know how to call images using "{{ listing.image1.url }}" when click next button, can see cycling through images (although it's showing broken image in browser) the s3 setup seems fine - other media , static files are surfacing script working fine before moved s3 i can access images individually html here script, it's first time writing jquery it's not written , left-scroll bit funky: <script type = "text/javascript" src = "http://code.jquery.com/jquery-1.8.0.min.js"></script> <script type = "text/javascript"> $(document).ready(function() { var imagename = ["{{ listing.image1.url }}", "{{ listing.image2.url }}&q

ios - AFNetworking AFNetworkReachabilityCallback Error ( Ipad IOS6.3) -

my app working in (ipad 6.1 simulator,ipad 6.0 simulator , ipad 5.1 simulator). after installed in ipad, it's not work more. i use organizer-dervices debug error, , error messages: console: jul 31 21:55:27 sandy reportcrash[937] : formulating crash report process benefitpad[781] jul 31 21:55:27 sandy reportcrash[937] : libmobilegestalt copysystemversiondictionaryvalue: not lookup releasetype system version dictionary dervice logs: incident identifier: f6306353-bef8-4626-8fa1-17f8c829aee4 crashreporter key: 1a786173c1c72ae5d44172b3d641feee8e91a4af hardware model: ipad3,3 process: benefitpad [778] path: /var/mobile/applications/d733430c-510d-4d2a-9d88-6361a6074485/benefitpad.app/benefitpad identifier: benefitpad version: ??? (???) code type: arm (native) parent process: launchd [1] date/time: 2013-07-31 19:46:51.989 +0800 os version: ios 6.1.3 (10b329) report version: 104 exception type: exc_bad_access (sigsegv

apache - Symfony config.php 403 error -

i've installed symfony2 on computer run on mountain lion. when try access localhost works pretty : when type http://localhost/~myusername/sites i've got expected result. however, when type http://localhost/~myusername/sites/symfony/web/config.php , i've got 403 error. checked permissions of file symfony nothing's wrong here. someone has idea how deal please ? check apache running user/group (/etc/apache2/httpd.conf). user myusername group staff check userconfig correct (/etc/apache2/users/myusername.conf). should like: <directory "/users/myusername/sites/"> options indexes multiviews followsymlinks allowoverride order allow,deny allow </directory> after should able acces page http://localhost/~myusername/symfony/web/config.php sidenote; maybe need proper php installation, check http://php-osx.liip.ch therefor

google app engine - How to get the attached file of a received mail using python and store it in a blob property field -

i trying attached file received mail , store blob property in gae datastore. using google app engine python. the file should added datastore if file excel file. following code shows method have used this. in class ' mail_message.attachments' give list of attachments of received mail. can file name , file content . here have format of file checking whether it's excel file. that's why have used following method. class logsenderhandler(inboundmailhandler): def receive(self, mail_message): file_format_supported=['application/vnd.openxmlformatsofficedocument.spreadsheetml.sheet','application/vnd.ms-excel'] payload_no in range(len(mail_message.original.get_payload())): one_payload = mail_message.original.get_payload(payload_no) if one_payload.get_content_type() in file_format_supported: uploadfile=files() uploadfile.temp_file=one_payload uploadfile.put() this code gives me error

asp.net - Update control panel -

i have problem update panel. have made table, , in table have 2 labels ("lblresult" , "lblcheat") need updated every time button "btncheck" or "imagebutton1" clicked. when click next button, whole table updated, , works fine code have. i don't understand why aren't labels updating since using update panel same way "btnnext" button , "btncheck" , "imagebutton1" <asp:updatepanel id="updatepanel1" runat="server"> <contenttemplate> <center> <asp:label id="lblsound" runat="server" visible="false"></asp:label> <table> <tr> <td> <asp:label id="label3" runat="server" text="sentence: "></asp:label></td> &

printf - Ideas / best practices for controlling verbosity in matlab functions -

let's have some_fun complicated work. function foo = some_complicated_fun(x,y,z,verbosity) i've written bit of debugging prints code, avg user may not interested in seeing if working. error statements (not enough args, etc) print regardless. my current method writing function is: function foo = some_complicated_fun(x,y,z,verbosity) (x,y,z,verbosity) = parse_args(x,y,z,verbosity); % parse args, check nargin, etc i=1:5, % whatever % work x,y,z % blah blah if verbosity fprintf('now on iteration %i\n',i); % basic print end % or, mutiple levels: if verbosity == 1; fprintf('now on iteration %i\n',i); % basic print end if verbosity == 2; fprintf('x = %f,y = %f,z=%f %i\n',x,y,z); % more information end % more work end i don't doing if statements because clutters code, can't think of other way. 1 liner better , worse: if verbosity; fprintf('iteration %i\

user interface - Python tkinter: Handle multiple tabs -

ok, have simple code: import tkinter.filedialog tkinter import * import tkinter.ttk ttk root = tk() root.title('test') nb = ttk.notebook(root) nb.pack(fill='both', expand='yes') f1 = text(root) f2 = text(root) f3 = text(root) nb.add(f1, text='page1') nb.add(f2, text='page2') nb.add(f3, text='page3') root.mainloop() and wondering, best way handle multiple tabs text on them in tkinter? if wanted erase text on 'page2' or insert on 'page3' how that? you have references text widgets in f1 , f2 , f3 , can call methods directly: f2.delete(1.0, 'end') # erase text on 2nd tab f3.insert('end', 'hello, world') # insert text on 3rd tab you might want add widgets list, in case want perform same action all. texts = [f1, f2, f3] text in texts: text.delete(1.0, 'end')

mysql - Django ORM query field weight? -

i'm doing following query: people.objects.filter( q(name__icontains='carolina'), q(state__icontains='carolina'), q(address__icontains='carolina'), )[:9] i want first results of query people named "carolina" (and matches other fields, name first). problem don't think way determine field "weight" or "priority". any idea? thanks! you'll need 3 queries work: names_match = people.objects.filter(name__icontains='carolina')[:9] states_match = people.objects.filter(state__icontains='carolina')[:9] addresses_match = people.objects.filter(address__icontains='carolina')[:9] all_objects = list(names_match) + list(states_match) + list(addresses_match) all_objects = all_objects[:9] there 2 problems approach, worked round: it unnecessary queries (what if names_match contained enough items already). it allows duplicates (what if in north carolina called carolina?)

Pandas merge and join not working -

i have problem merging 2 dataframes i'm processing list of 10 dataframe pairs, created same sql database , csv files. on pairs merge(df1, df2) working correctly df1.join(df2) not. example, thesea subsets 1 of pairs >>> mod:user studentid 2010453 3891583 2010453 2112086 890910 2112086 2222220 201611 2222220 2346979 7084 2346979 2414996 1817436 2414996 2420317 52821 2420317 2438767 884012 2438767 2451924 20815145 2451924 2515531 2115829 2515531 2536751 494565 2536751 2549050 315295 2549050 2549530 0 2549530 2551532 544968 2551532 2551542 213 2551542 2610206 1257038 2610206 2624429 939670 2624429 2630017 6 2630017 2633815 190564 2633815 2633857 1147211 2633857 2634405 1093092 2634405 2641370 2038012 2641370 2644284 658743 2644284 2649427 220230 2649427 2712372 9468 2712372 2714617 1231577 2714617 2718450 3907345 2718450

ios - Passing a value to a UIView returns nil -

i have uiviewcontroller gameplayviewcontroller , uiview joystickview . im trying set float value joystickview . in gameplayviewcontroller.m joystickview *joystick = [[joystickview alloc] initwithframe:cgrectmake(0, 0, 100, 100)]; joystick.velocity = 123.0f; [self.view addsubview:joystick]; in joystickview.h @property(nonatomic) float velocity; .m @synthesize velocity; -(id)initwithframe:(cgrect)frame { self = [super initwithframe:frame]; if (self) { nslog(@"%f", velocity); //output 0 } return self; } what missing? you can override initwithframe creating initwithframeandvelocity method -(id)initwithframe:(cgrect)frame andvelocity:(float)v { self = [super initwithframe:frame]; if (self) { velocity = v; nslog(@"%f", velocity); //output 0 } return self; }

php - cURL with PUT method -

is possible curl request put method using url? here url able call using curl put method: $url = https://url.net/card/activate.xml?card_id=1234567890&application_key=123123&accesskey=abcdef i able make work using rest console(chrome extension) not using curl. tried using curl_setopt curlopt_put , curlopt_infile , curlopt_infilesize receiving empty page, no response @ all. this headers , curl options have: $header[] = 'authorization: basic abc123'; $header[] = 'accept: text/xml'; curl_setopt($curl, curlopt_customrequest, 'put'); curl_setopt($curl, curlopt_url, $url); curl_setopt($curl, curlopt_httpheader, $header); curl_setopt($curl, curlopt_ssl_verifyhost, false); curl_setopt($curl, curlopt_ssl_verifypeer, false); curl_setopt($curl, curlopt_returntransfer, true); $output = curl_exec($soap_do); currently, settings, i'm getting 411 length required error. possible make work or trying configure never work? the http 411 error

recorder.stop() don't work on android 4.2 -

related @ question here problem changed.. it's possibile recorder.stop() doesn't work on android 4.2? work fine on device android 4.1 can't post logcat because tested on customer's device. have created logfile, , stop before recorder.stop() offcourse mediarecorder recorder; i call start record mcamera.unlock(); recorder = new mediarecorder(); recorder.setcamera(mcamera); recorder.setaudiosource(mediarecorder.audiosource.default); recorder.setvideosource(mediarecorder.videosource.camera); //questo metodo di default restituisce valori della camera, altrimenti null //camcorderprofile cphigh = camcorderprofile.get(camcorderprofile.quality_high); camcorderprofile cphigh = camcorderprofile.get(1, camcorderprofile.quality_high); recorder.setprofile(cphigh); recorder.setoutputfile(mediafile.getabsolutepath()); recorder.setmaxduration(400000); try { recorder.prepare(); recorder.start();

java - Creating objects from constructors -

i newbie java, been fiddling code while. public class threevector { private double x,y,z; // definign local variables public threevector(){} // constructor has no input public threevector (double va1,double va2, double va3){va1=x;va2=y;va3=z;};// creatign constructor , can used calling method later // takes 3 values public double magnitude (){ double y1= math.sqrt(x*x+y*y+z*z); return y1 ; // finds magnitude of vector } public threevector unitv(){ threevector unitv= new threevector (); unitv.threevector(x/magnitude(),y/magnitude(),z/magnitude()); } now here stuck. created object unitv call threevector constructor, compiler keeps saying create new method threevector . not sure whats going on... a constructor can called only using new keyword. you're doing here: unitv.threevector(x/magnitude(),y/magnitude(),z/magnitude()); is calling method called threevector , compiler complains there's no such method in threevector class. to fix

can somebody explain what is "This" operator in C++ -

i know "this" operator used access member functions of invoking object,but can called .so,what use of "this" operator. i don't think such bad question. not asking does, why keyword exists when implied of time. here case pointer necessary class test { int i; void set(int i) { this->i = i; } }; this used select between member variable , function parameter same name. this used when need address of object within class. void f(test *p); class test { int i; void pass() { f(this); } };

VB.Net Interop Error 0x800A0BDB -

i have vb.net program executes macros in .accdb access database. until last week, worked fine. macros execute fine when run directly in access 2 of 3 macros generating error when executed vb program: error occurred: system.runtime.interopservices.comexception (0x800a0bdb): system resource exceeded. @ microsoft.office.interop.access.docmd.runmacro(object macroname, object repeatcount, object repeatexpression) @ niceprintmsaccessmacros.module1.executemacros() here log output vb program: 7/31/2013 12:19:42 pm searching test 'run' file (\[server name removed]\apps\macros_to_run\macros_to_run_test.txt)... if found, application proceed in test mode. 7/31/2013 12:19:42 pm production 'run' file (\[server name removed]\apps\macros_to_run\macros_to_run_test.txt) found. proceeding in production mode. 7/31/2013 12:19:42 pm starting production file run. 7/31/2013 12:19:45 pm file: \[server name removed]\apps\my labels\labels\labels.accdb 7/31/20

iphone - Google Maps iOS SDK Integration not loading maps -

i using google maps ios sdk in iphone application. showing place mark on map , working fine in iphone device using apple developer account certificates . when sent build testing team using different enterprise apple developer account certificates (enterprise account), maps not loading up, shows place mark on blank screen maps loading up. i have tried on iphone devices enterprise apple developer account, , not loading map(just pin on blank screen). own apple developer account certificates, working absolutely fine. i assuming problem in enterprise apple developer account(might have change settings on apple developer account app id). not able find out solution this. can me out on this? if need more information on , please ask me in comment. thanks in advance! typically happen if don't have app bundle id added google apis console. bundle id (eg., com.myname.appname) google uses verify app allowed use api key. if you've moved app 1 developer account another, yo

MSMQ Outgoing Queue Timout Duration for failed transmissions -

most systems have default timeout durations if expected behavior not achieved. example, sql server has connection timeout , command time out. web services typically have time out period waiting response. for msmq, when attempt send message invalid host, see message in originating host's outgoing queue state of 'waiting connect' , history showing 'name resolution failed...'. how long stay in outgoing queues area? ever move dead-letter queue? there controls define duration? you want message timers . time reach queue controls when message goes dead letter queue.

java - Generate a web application using maven generate -

i have generated project struture using maven using mvn archetype:generate , project structure follows: webapps -src -main -java -com -web -app.java -test i have tried following tutorial on link create web app running mvn dependency:analyze-dep-mgt but still project structure differs. while use mvn archetype:generate -dgroupid={project-packaging} -dartifactid={project-name} -darchetypeartifactid=maven-archetype-webapp -dinteractivemode=false, pom file missing where being wrong struture differs , web.xml not being generated? c:\users\user\workspace\webappspringapp\webapp>mvn dependency:analyze-dep-mgt [info] scanning projects... [error] build not read 1 project -> [help 1] [error] [error] project com.webapp:webapp:1.0-snapshot (c:\users\user\workspace\we bappspringapp\webapp\pom.xml) has 3 errors [error] 'dependencies.dependency.version' org.springframework:spring-cor e

android - ImageView not changing image when source is changed (already using invalidate) -

i have imageview set image in xml. when try change image imageview never displays second image. instead displays blank screen. have tried code , without invalidate() , there no change. imageview image; string imgpath=environment.getexternalstoragedirectory()+"/music/evanescence - discography - 1998-2011 (320 kbps)/album's/2000 origin (limited edition) (320 kbps)/scans covers/06.jpg"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); image=(imageview)findviewbyid(r.id.imageview1); image.setimagebitmap(bitmapfactory.decodefile(imgpath)); if(!new file(imgpath).exists()) log.i("aaa","file doesnt exist"); //select image gallery //intent photopickerintent = new intent(intent.action_pick); //photopickerintent.settype("image/*"); //startactivityforresult(photopickerintent, select_photo); log.i("aaa&quo

file - php move_uploaded_file not working -

usually i'd simplify code this, or show part thats giving me trouble. in case have no idea going wrong pasted entire thing in. sorry. ok below script gets values sent ajax , uploads them sql data base. after doing moves image folder folder. the entire script works fine, supposed do, except 'move_uploaded_file' bit. sql part correctly, , session names, string edits, etc... correct. i've echoed names of files script produces , correct. folders can read+written too. , file waiting moved present in folder. what missing? why move_uploaded_file not working? in advance all. --changed move_uploaded_file() rename(), still not working-- <?php session_start(); unset($_session['reference']); $name = $_get['name']; $category = $_get['category']; $subcategory = $_get['subcategory']; $date = $_get['date']; $address = $_get['address']; $city = $_get['city']; $state = $_get['state']; $host = $_get['

Matlab gradient equivalent in opencv -

i trying migrate code matlab opencv , need exact replica of gradient function. have tried cv::sobel function reason values in resulting cv::mat not same values in matlab version. need x , y gradient in separate matrices further calculations. any workaround achieve great sobel can compute second derivative of image pixel not want. (f(i+1,j) + f(i-1,j) - 2f(i,j)) / 2 what want (f(i+i,j)-f(i-1,j)) / 2 so need apply mat kernelx = (mat_<float>(1,3)<<-0.5, 0, 0.5); mat kernely = (mat_<float>(3,1)<<-0.5, 0, 0.5); filter2d(src, fx, -1, kernelx) filter2d(src, fy, -1, kernely); matlab treats border pixels differently inner pixels. code above wrong @ border values. 1 can use border_constant extent border value out constant number, unfortunately constant number -1 opencv , can not changed 0 (which want). so border values, not have neat answer it. try compute first derivative hand...

ios - should I avoid using new to initialize my objects? -

this question has answer here: use of alloc init instead of new 8 answers recently told apple discouraging use of new, , google's ios coding standards has say: do not invoke nsobject class method new, nor override in subclass. instead, use alloc , init methods instantiate retained objects. modern objective-c code explicitly calls alloc , init method create , retain object. new class method used, makes reviewing code correct memory management more difficult. why make reviewing code correct memory management more difficult though? i expect reference ease of code reviews merely meant human readers of code may not notice word 'new' eyes scan on code looking alloc-init calls. in objective-c, word 'new' shortcut calling alloc , init. cannot pass arguments; calling no-arg constructor. if later change code in such way want call 1 of o

extjs4.2 - ExtJS displaying field name inside chart -

consider following example of stacked bar chart. can display count of each of fields (comedy, action, drama, thriller) in bars adding label config in series, how display field name?. renderer config property label doesn't seem of use function receives count argument. label:{ display:'insidestart' , field:[null, null, 'drama', 'thriller'], renderer:function(item){ //for case, item int value. thus, not sure how useful //as cannot field name it. } } actually, renderer function passed a lot more arguments value. these arguments same onplacelabel method, value added beginning, , better documented there. we've got index of field in series and, matter of fact, have series available in item argument. that, can achieve want: label: { display:'insidestart' ,field:[null, null, 'drama', 'thriller'] ,renderer: function(value, label, storeitem, item, i, display, animate, index) {

ios - SIGABRT accessing NSArray with indexPath.row -

i working on app game server company , part of app requires user see list of or game servers , whether or not online, offline, how many players on them, server name, etc. data found in php file hosted on web updated mysql database when viewed, outputs json. using code below, doesn't seem work. load view , right away "thread 1: signal sigabrt" error on line nsdictionary *myserver = [servers objectatindex:indexpath.row]; . when removing indexpath.row , replacing either 0 or 1, data displayed on uitableview in storyboard, except displayed 4 times in row , entry in json file (either 0 or 1). can't keep @ fixed number client might have 100 servers, or 5 servers why need indexpath.row . below, attached json looks when given server , accessed directly app's code i'd appreciate if please let me know problem , propose solution unique situation rid of sigabrt error , once do, make sure doesn't show 4 times in tableview now. my header file: #import <