Posts

Showing posts from April, 2015

How to compile mule application through command lne -

i want separate deployment portion , compilation portion of mule application. know how this? specific, if want script can compile mule application, need do? what libraries required this ? you need use maven-mule-plugin have maven build application archive. here sample configuration: <plugin> <groupid>org.mule.tools</groupid> <artifactid>maven-mule-plugin</artifactid> <version>1.9</version> <extensions>true</extensions> <configuration> <copytoappsdirectory>true</copytoappsdirectory> <excludemuledependencies>true</excludemuledependencies> <inclusions> <inclusion> <groupid>org.mule.modules</groupid> <artifactid>mule-module-cache</artifactid> </inclus

actionscript 3 - Accessing Movieclip added by a different function in the same class? -

i can't seem find answer problem. can't following work: public class callbattle extends movieclip { import flash.display.movieclip; import flash.display.stage; import flash.display.interactiveobject; import flash.events.mouseevent; import global.globalvar; public var battlegraphics:array = new array(); public function battle() { var battlewindow:movieclip = new battlewindow() movieclip; battlegraphics.push(addchild(battlewindow)); battlewindow.x = 4; battlewindow.y = 248; var attackbutton:movieclip = new battlebutton() movieclip; battlegraphics.push(addchild(attackbutton)); attackbutton.x = 192; attackbutton.y = 255; attackbutton.addeventlistener(mouseevent.click, attackclicked); } public function attackclicked(event:mouseevent):void{ battlegraphics[attackbutton].y = 248; } } i'm getting error battlegraphics[attackbutton].y = 248; before t

Paper Folding Animation in Android -

this question has answer here: page curl effect activities in android 1 answer hi friends possible create paper fold animations in android.like,i iphone have knowledge property animations that.but,i don't know whether possible in android or not. you got library on google code : https://code.google.com/p/android-page-curl/ , 1 on github : https://github.com/harism/android_page_curl http://developer.android.com/shareables/devbytes/foldinglayout.zip try fold animation supports api level 11+

c - Conversion from size_t to int -

following thread ... for piece of code: #include <stdio.h> int main(void) { int i; size_t u; (i = 0; < 10; i++) { u = (size_t)i; printf("i = %d, u = %zu\n", i, u); } return 0; } the output in assembly is: edit : compiled -o2 .file "demo.c" .section .rodata.str1.1,"ams",@progbits,1 .lc0: .string "i = %d, u = %zu\n" .section .text.startup,"ax",@progbits .p2align 4,,15 .globl main .type main, @function main: .lfb3: .cfi_startproc pushq %rbx .cfi_def_cfa_offset 16 .cfi_offset 3, -16 xorl %ebx, %ebx .p2align 4,,10 .p2align 3 .l2: movq %rbx, %rdx movl %ebx, %esi xorl %eax, %eax movl $.lc0, %edi addq $1, %rbx call printf cmpq $10, %rbx jne .l2 xorl %eax, %eax popq %rbx .cfi_def_cfa_offset 8 ret .cfi_endproc .lfe3: .size main, .-

asp.net - add Delete button at last column in gridview -

i adding columns on grid-view dynamically datatable dt1 = new datatable(); dt1.columns.add("item title", typeof(string)); dt1.columns.add("unit pack", typeof(string)); dt1.columns.add("pack", typeof(string)); gv1.datasource = dt1; gv1.databind(); and add delete button automatically by <asp:gridview id="gv" runat="server"> <columns> <asp:commandfield showdeletebutton="true" /> </columns> </asp:gridview> it shows gridview | delete | item title | unit pack | pack | now want show delete button @ last column like | item title | unit pack | pack | delete | how can this? how create delete button @ last column? you adding column dynamically thats why need add delete column dynamic. or can add linkbutton in rowdatabound: protected void gv_rowdatabound(object sender, gridviewroweventargs e) { if (e.row.dataitem != null) { linkbutton lb = new linkbutton();

r - Create list with depth equal 2 -

i have list depth equal 2. subscript list described in following example: my.list<-list( a=list( a1=1:10, a2=11:20), b=list( b1=21:30, b2=31:40), c=list( c1=41:50, c2=51:60) ) # choose specific item my.list[[2]][[2]][[3]] # choose first items a1,a2,b1,b2,c1,c2 test<-list() for(i in 1:3) (j in 1:2)test[[i]][[j]]<-my.list[[i]][[j]][[1]] test error in `*tmp*`[[i]] : subscript out of bounds but won't work since list created has no lists within it. works this: test<-list() for(i in 1:3) (j in 1:2)test[[i]]<-my.list[[i]][[j]][[1]] and then test<-list() for(i in 1:3) (j in 1:2)test[[i]][[j]]<-my.list[[i]][[j]][[1]] test gives: [[1]] [1] 1 11 [[2]] [1] 21 31 [[3]] [1] 41 51 ... does following code solve problem? lapply(my.list, sapply, head, 1) gives first element of each vector each entry in my.list : $a a1 a2 1 11 $b b1 b2 21 31 $c c1 c2 41 51

Multiple Table Update using Stored Procedure in ASP.NET -

i'm getting following error: "procedure or function 'usp_update_customer_contact_form has many arguments specified" i have read lot of post regarding topic , implemented many of fixes i'm still seeing same error. can please me out? i have form updates 3 separate tables when update button selected. have chosen perform operation using store procedure in sql database . stored procedure , asp form code. any appreciated! thanks! kelly sql stored procedure: alter procedure [dbo].[usp_update_customer_contact_form] @customer_id int, @customer_first_name varchar(150), @customer_middle_name varchar(150), @customer_last_name varchar(150), @customer_ad_source_id int, @customer_current_control_id int, @customer_current_status_id int, @customer_current_progress_id int, @customer_initial_contact_type_id int, @customer_store_id int, @customer_bdc_rep_id int,

coldfusion - SES URL feature of Mach ii not working properly -

i have defined following properties in mach-ii.xml file: <property name="urlparseses" value="true" /> <property name="urldelimiters" value="/|/|/" /> <property name="urlbase" value="index.cfm" /> and in index.cfm page there link <a href=#buildurl("showuser", "id=#user_id#")#>view user</a> in listener getting error "element id undefined in url." whereas can see parameter id , value in url. know why getting error? other problem is, when clicking on other links in page, keep on appending link in url instead of making new url. first time when loading site loads css , js after clicking on link breaks css , js. please help. you should referencing id value in listener part of current event structure (ie; arguments.event.getarg("id") ), not url scope (ie; url.id ). your urlbase value should absolute webroot, if app @ base of webroot, urlba

jquery - Active & Inactive class add & remove -

i need add & remove class on click of anchor tag. <div class="activetab"> <a href="#." class="active">active</a> <a href="#.">inactive</a> </div> above div has 2 anchor tags & "active" & "inactive" 1 has class 'active'. requirement need remove 'active' class on click of "inactive" anchor tag & add class 'active' clicked "inactive" anchor , if clicked on "active" anchor again class remove form "inactive" anchor & add "active" anchor. jquery. if undestood well... i made refork of old lil snippet doing want (or guess want) xdd sorry english, it's hard me write on it. html <div class="container"> <div class="activetab"> <a href="#." class="button_active">active</a> <a href="#.&qu

Outlook Addin - How can I set “High Importance” on email sent using C# in VSTO -

i want know how set headers of email on click on checkboxes. have created required checkboxes in formregion. example: have checkbox named highimportance, on click of want change email header. tried this, doesn't work: private void checkbox2_checkedchanged(object sender, eventargs e) { this.outlookitem.importance = 2; } cast item mailitem, set importance. private void checkbox1_checkedchanged(object sender, eventargs e) { outlook.mailitem mymailitem = (outlook.mailitem)this.outlookitem; mymailitem.importance = outlook.olimportance.olimportancehigh }

node.js - nginx as a proxy for NodeJS+socket.io: everything is OK except for big messages -

as explained on nginx's website i've used these settings nginx proxy websockets nodejs server: location /socket.io/ { proxy_pass http://backend; proxy_http_version 1.1; proxy_set_header upgrade $http_upgrade; proxy_set_header connection "upgrade"; } everything works fine , socket.emit() / socket.on() send messages each other; until send rather big text message (26 kb of html). this big message not received nodejs (so guess issue on nginx side) there no error on nginx log once big message has been send client, nodejs stop receiving socket.io's heartbeats client. what doing wrong? there nginx setting not aware of? the "solution" found use haproxy split tcp stream between nginx , nodejs. it not optimal because adds yet-another-program in our stack, job. it seems me nginx websocket support still far being production-ready.

jsf - How do I make p:dataTable in ui:composition more reusable? -

i'm using primefaces 3.4 , have series of .xhtml datatables on page. use 1 .xhtml tables on page , use ui:param when including .xhtml each kind of datatable. if have following code fragment: <p:datatable id="invoicetable" emptymessage="pick category drop down" rows="10" var="invoice" value="#{editoruibean.invoices}" scrollable="true" scrollheight="180" editable="true" rowkey="#{invoice.seqid}" ... so imagine have .xhtml invoices, 1 cash tendered, 1 sales taxes, etc , each .xhtml identical except property in backing bean , ids , variable names. if genericify fragment above, what_do_i_replace_this_with make work? <p:datatable id="#{tableid}" emptymessage="#{emptymessage}" rows="10" var="#{rowid}" value="#{editoruibean[dataproperty]}" scrollable="true" scrollheight="180" editable="tru

c# - Dynamically evaluating a property string with Expressions -

how build expression fulfill following goal: public object eval(object rootobj, string propertystring) eg: eval(person, "address.zipcode") => return person.address.zipcode expression.propertyorfield doesn't work because don't have type of each intermediate property. i'd avoid creating dependency on scripting library. i want try use expressions because allow me store cache of these expression trees executed several times. i'm aware it's possible iteratively or recursively reflection. it sounds you're looking this: public object eval(object root, string propertystring) { var propertynames = propertystring.split('.'); foreach(var prop in propertynames) { var property = root.gettype().getproperty(prop); if (property == null) { throw new exception(...); } root = property.getvalue(root, null); } return root; } to create expression use this: public

java - Parsing HTML with Jsoup -

i'm trying parsing , i'm stuck... here's structure of html: <ul class="sub-menu"> <li id="1" class="1"><a href="http://link">some text</a> <ul class="sub-menu"> <li .... ><a ... /></li> <li .... ><a ... /></li> <li .... ><a ... /></li> </ul> </li> <li id="2" class="2"><a href="http://link2">some other text</a> <ul class="sub-menu"> <li .... ><a ... /></li> <li .... ><a ... /></li> <li .... ><a ... /></li> </ul> </li></ul> i need each li (id = 1, 2 , s) , lis inside them ( <li .... ><a ... /></li> ). here's how java looks: // ul contains source above elements lis = ul.select("li"); // kn

android - Read font size from Settings -

this question dublicate of android app: how read font size under settings? read answer of commonsware points use settings.system.font_scale . wrote few lines: float scale = -66.6f; try { scale = android.provider.settings.system.getfloat(getcontentresolver(), android.provider.settings.system.font_scale); } catch(settingnotfoundexception e) { log.e(getclass().getsimplename(), "error: ", e); } toast.maketext(this, "scale=" + scale, toast.length_long).show(); my problem settingnotfoundexception i'm using android 4.2.2 device. way code in oncreate callback of activity . i googled problem , found 3 sites uses same code. special permission required? tried permission android.permission.write_settings without success. i found in source code of settings.system function: /** @hide */ public static void getconfigurationforuser(contentresolver cr, configuration outco

objective c - Generate .ics file on iOS -

i'm building ios application must generate .ics file iphone calendar, can't found solution it. see eventkit framework doesn't give functionality, maybe other frameworks/libs can it? please find link here project perform this. haven't tested

ubuntu 12.04 - Need help in configuring LDAP acl -

i trying configure acl in such way users attribute allowedservice application name can login particular application. we have users follows: dn: ou=people,dc=prime,dc=ds,dc=geo,dc=com dn: uid=user1,ou=people,dc=prime,dc=ds,dc=geo,dc=com uid: user1 allowedservice: gitlab dn: uid=user2,ou=people,dc=prime,dc=ds,dc=geo,dc=com uid: user2 allowedservice: zabbix dn: uid=user3,ou=people,dc=prime,dc=ds,dc=geo,dc=com objectclass: top uid: user3 allowedservice: zabbix we created user follows: dn: cn=gitlab,ou=applications,ou=groups,dc=prime,dc=ds,dc=geo,dc=com cn: gitlab uid: gitlab now in application given details follows: gitlab configuration base: ou=people,dc=prime,dc=ds,dc=geo,dc=com uid: uid bind_dn: cn=gitlab,ou=applications,ou=groups,dc=prime,dc=ds,dc=geo,dc=com password: password now in acl tried various options follows: root@geopc:/# ldapsearch -q -lll -y external -h ldapi:/// -b cn=config '(olcdatabase={1}hdb)' olcaccess dn: olcdatabase={1}hdb,cn=config ol

linux - List of empty string returns non-zero length in python -

this question has answer here: remove empty strings list of strings 12 answers i have list of strings returned after command execution, split on '\n'. listname = output.decode('utf8').rstrip().split('\n') when print using print(listname) , get [''] clearly it's list containing empty string because of getting len(listname) 1. how remove empty string i think looking for: filter(none,output.decode('utf8').rstrip().split('\n')) in details: >>> filter(none, ["ford", "nissan", ""]) ['ford', 'nissan'] p.s. in python 3+ filter returns iterator, use list(filter(..)) .

asp.net - update session variable on textbox_change without postback -

is there way save textbox text session variable without having postback on text change? you need in 4 stages. 1) add onkeydown="textchanged(this.id);" textbox 2) use javascript capture text 3) fire ajax call web method 4) use web method store session variable. so this: on textbox, set autopostback=false don't post on typing. create small javascript function fired when user types. this function first clear timer attached textbox. create 1 fire function after 1 second. ensure you're not trying fire end function often. function textchanged(id) { var txtbox = document.getelementbyid(id); cleartimeout(txtbox.timer); txtbox.timer = settimeout('savevariable()', 1000); }; after 1 second, method call this: function savevariable(){ // ajax call in here , send textbox value web method var t = // getyourtextboxtexthere if (t != "") { $.ajax({ type

osx - Hosts file missing on Mac OS X - Xcode Failing to compile code -

i've tried run first objective-c code in xcode... compilation process successfully, error returns " invalid host string: 'localhost' ". after googling, found out , connected points might had hosts file deleted. now cannot recreate /etc/hosts through terminal using: sudo cat >/etc/hosts < # host database # localhost used configure loopback interface when system booting. not change entry. # 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost fe80::1%1o0 localhost eod sudo: /private/etc/sudoers mode 0666, should 0440 thanks in advance workaround. you have broken system making inappropriate changes. first, need fix permissions on /etc/sudoers. might try opening disk utility, selecting system volume, , clicking repair disk permissions. not sure change sudoers permissions. if not, reboot system , press , hold command , s keys. boots single-user mode. whe

How to implement Iterable<E> in dart? -

i still havn't understood how deal iterable/iterator in dart. i think have give , return lists that's not want since lead bad performance in case. what want understand how implement own iterable/iterator. why both of these attempts fail? library foo; import 'dart:collection'; // both attemps below raises following error: // ============================================== // // closure call mismatched arguments: function 'movenext' // // nosuchmethoderror: incorrect number of arguments passed method named 'movenext' // receiver: closure: (dynamic) => iterator<int> function 'iterator':. // tried calling: movenext() main() { iterable<int> iterable1 = new oddsiterabledartstyle([1,2,4,6,7,8,9]); (int in iterable1) print("odd: $i"); iterable<int> iterable2 = new oddsiterablejavastyle([1,2,4,6,7,8,9]); (int in iterable2) print("odd: $i"); } // -------------------------------------

opencv - pass Mat to CvMat* segmentation fault -

i want pass value pointer variable, namely type mat cvmat*? so have following , want pass variable si;; mat s=(mat_<double>(1, 3) << 1,0,1 ); cvmat* si; *si=s; but gives segmentation fault, doing wrong? use si = &s if wanted change pointer. or initialize si first copy s si si = new mat_<double>(1, 3); *si = s; basically before initialize si, invalid pointer, , assuming want copy structure whatever address pointer refers to, invalid operation. need "own" valid memory address (which new operation creates you) in order work on object. don't forget use delete si; @ point later on.

websocket - Does WSO2 ESB support web sockets? -

my project needs provide read , write access data using web services (soap/json etc), need ability serve real-time notifications of data changes external users through websockets. wso2's esb support capability? afaik, no support websockets..but, write data websockets using classmediators

c# - System.Drawing.Image.FromStream invalid parameter -

i'm trying blob database i'm getting error "invalid parameter" in line system.drawing.image objimg = system.drawing.image.fromstream(blobstream, true); here code: public partial class showblob : system.web.ui.page { private system.drawing.image.getthumbnailimageabort delegateabort; protected void page_load(object sender, eventargs e) { // handle on account, create blob service client , container proxy var account = cloudstorageaccount.parse(roleenvironment.getconfigurationsettingvalue("conn")); account.createcloudtableclient().createtableifnotexist("tablename"); var client = account.createcloudblobclient(); cloudblobcontainer container = client.getcontainerreference("tablename"); string id = request["id"].tostring(); // retrieve reference blob named "myblob" cloudblob blob = container.getblobreference(id); blo

c# - Is it possible to avoid MAX_PATH limit using WiX variables? -

i'm developing project in winforms , , i'm on process of creating installer using wix . but when installer going copy .dll comes long path, visual studio says this: 'really long route'\enterpriselibrary....\ long, qualified file name must less 260 characters, , directory name must less 248 characters. i found articles talks max_path limitations said in stackoverflow question related windows api. i'm working on big team, , discovered known error, not allowed shorten or modify path. i tried solution link above says, using \\?\ characters before, wixvariables remain this: <?define examplespath="\\?\$(sys.currentdir)\..\..\examplesfolder" ?> that results this: \\?\c:\reallylongpath\files but doesn't seem work wix variables. so question is: is there way avoid 260 characters limitation? if so, how? please, need answer on this! edit: while try @jans' suggestion, found that, if add \\?\ string wix variable , error

Importing a large .csv into Excel, -

i trying import large .csv file excel. file has close 4 million rows , 329 columns far exceeded excel's 65536 1m row limit. found vb script online import text files excel once row limit exceeded script create new worksheet till total rows in worksheets equals total rows in original text file. sub importlargefile() 'imports text file excel workbook using ado. 'if number of records exceeds 65536 splits on more 1 sheet. dim strfilepath string, strfilename string, strfullpath string dim lngcounter long dim oconn object, ors object, ofsobj object 'get text file name strfullpath = application.getopenfilename("text files (*.csv),*.csv", , "please select text file...") if strfullpath = "false" exit sub 'user pressed cancel on open file dialog 'this gives full path name e.g. c:\temp\folder\file.txt 'we need split path , file name set ofsobj = createobject("scripting.filesystemobject") strfilepath = ofsobj.getfile(s

asp.net - Ajax form reloading/returning new page instead of updating -

i'm trying hand , asp.net mvc 4 , having issue ajax form returning whole new page instead of updating div. here's razor html code: <div class="all"> <div class="search"> @using (ajax.beginform( new ajaxoptions { updatetargetid = "currentsku" } )) { @html.label("enter sku:") @html.textbox("textbox1") <input type="submit" value="find" /> } </div> <div id="currentsku"> <span>no sku selected.</span> </div> and here's controller: public actionresult index() { // pay no attention this, place holder return view( db.xinventoryext.take(1) ); } [httppost] public actionresult index(string textbox1) { if (db.xinventoryext.count(a => a.invtid == textbox1) < 1) { return content("sku not found.",

php - adding the use of multiple variables to an ob_start function -

i've got following object start code; however, right uses 1 variable ( $online ) .... need add second variable ( $var2 ) code can have "var2"=> $var2 under "online"=> $online . needs added first line of code around use (&$online) code knows use variable. ob_start(function($c) use (&$online){ $replacements = array( "online"=> $online ); return preg_replace_callback("/{(\w+)}/",function($m) use ($replacements) { return isset($replacements[$m[1]]) ? $replacements[$m[1]] : $m[0]; },$c); }); how add this? try breaks code completely. you can add many variables use like, separate them parameters: function($c) use (&$online,&$var2)

apache - Apache2 multiple name-based virtual hosts on one machine with rails/rack -

am stuck on configuring apache serve 2 different sites name based virtual hosts at: http://experimental/ and http://api.experimental/ on 1 machine setup works fine, , apache reports this: apachectl -d dump_vhosts apache2: not reliably determine server's qualified domain name, using 127.0.0.1 servername virtualhost configuration: wildcard namevirtualhosts , _default_ servers: *:* namevirtualhost default server experimental (/etc/apache2/sites-enabled/00-nowa.conf:3) port * namevhost experimental (/etc/apache2/sites-enabled/00-nowa.conf:3) port * namevhost api.experimental (/etc/apache2/sites-enabled/00-nowa.conf:15) syntax ok on 2nd machine not work, both urls end pointing first app, it's output of same command has additional : lines: apachectl -d dump_vhosts apache2: apr_sockaddr_info_get() failed experimental apache2: not reliably determine server's qualified domain name, using 127.0.0.1 servername [tue may 1

ios - Get position of cell or text field in this cell -

i have split view controller: view & tableview. in table view have custom cells text field. don't know how many cells have, generate automaticly. , i'm trying scroll textfield, when becomefirstresponder. i've tried this: -(void) textfielddidbeginediting:(uitextfield *)textfield { cgpoint focusontextfield = cgpointmake(0, 300 + textfield.frame.origin.y); [scroller setcontentoffset: focusontextfield animated: yes]; } 300px - start position of tableview. seems alright, textfield.frame.origin.y equal 0 (like , bounds.origin.y btw). i thought can solve problem if position of cell, textfield active, , replace textfield.frame.origin.y on cell.frame.origin.y or this. sorry english, hope understand did & want do. :-) =========================================================================== thank you, guys. forgot tableviews scroll disabled. follow advices , code examples , solve that: - (uitableviewcell *)cellwithsubview:(uiview *)subview {

php - Automatic email from form -

i'm creating database system user can add details within form , adds database php. want send confirmation email send of details within form. so, when add details of student instance email send me says along lines of "a student called "bob dabilda" has been added database "agentname"" - have no problem doing agent name part since can send session name through, have problems sending forward student name. appreciated. following version of add student php part. adding student form works , email works separately want email sent without agent having click button says "send email" or that. database mysql. require "dbc.php"; session_start(); if(isset($_post['submit'])) { $sname = mysql_real_escape_string($_post['shostfamilyid']); if($sname && $ssurname && $sgender && $saddress && $sdob && $sblood && $spassport && $shobby1 && $shobby2 && $schildre

java - iText - avoid last row not to cut tables on page split to next page -

i working on itext 5 using java. have pages mutiple tables dynamic rows. in instances, table last row splitted next page folowing header. using setheaderrows() , setskipfirstheader() manage continuation of next page. last row has enough space fit on earlier page. fit last row in same page instead of next page. for example, on page 1, last row splitted first row of next page. instead fit row in page 1 save 1 page blanks. i tried using setextendlastrow() , not working. know how fix problem. attaching working sample code. public class proposalitextsplitlastrow { public static void main(string[] args) { try { document document = new document(); document.setpagesize(pagesize.letter); document.setmargins(16, 14, 14, 14); pdfwriter writer = pdfwriter.getinstance(document, new fileoutputstream("c:/splitlastrow.pdf")); document.open(); document.setpagesize(pagesize.letter); document.setmargins(16, 14, 42, 38);

google apps script - Loop with timeout protection that only runs once "as it should" -

i wrote script restores calendar data backup written in spreadsheet. since amount of data highly unpredictable designed loop stops after given number of minutes , asking user continue or cancel while showing actual counter state (this prevent issue google max execution time limit). it works pretty in simplified test script used testing idea works once : when first "timeout" occurs, shows continue/cancel option expected , continues started when same condition happens second time continue button doesn't shows up. my question : why ? or better : what's difference between both situations ? the spreadsheet embedded script publicly testable here (see menu : test ) and whole script shown below (it's bit long of course interresting part near end) i used scriptproperties keep track of execution time , continue loop left. function onopen() { var ss = spreadsheetapp.getactivespreadsheet(); var menuentries = [ {name: "te

c# - Why is this exception not caught? -

i'm trying run following code: class program { static void main(string[] args) { var task = task.factory.startnew(() => { throw new applicationexception("message"); }); try { task.continuewith(t => console.writeline("end")); } catch (aggregateexception aex) { console.write(aex.innerexception.message); } } } i expected exception caught in following location: catch (aggregateexception aex) { console.write(aex.innerexception.message); } but not happening. why so? you're printing out task - won't have completed yet. printing out task doesn't wait complete, or try fetch value. if change code to: try { task.wait(); } ... then i'd expect catch exception. (i using task<t>.result , notice task no return value, non-generic task .)

xcode - iOS: Removing a reference to a deleted nib -

xcode / ios noob here... i'm working on project trying implement uinavigationcontroller in project. wound not being able work, deleted project. now, i'm getting following error , can't figure out why says i'm referencing view controller. 2013-05-14 13:04:11.336 dialysisaccesstbl[1163:907] *** terminating app due uncaught exception 'uiviewcontrollerhierarchyinconsistency', reason: 'a view can associated @ 1 view controller @ time! view <uitableview: 0x1e191600; frame = (0 20; 768 1004); clipstobounds = yes; autoresize = w+h; gesturerecognizers = <nsarray: 0x1e843f50>; layer = <calayer: 0x1e843710>; contentoffset: {0, 0}> associated <uitableviewcontroller: 0x1e845910>. clear association before associating view <viewcontroller: 0x1e841030>.' *** first throw call stack: (0x33e603e7 0x3bcea963 0x33e60307 0x35cd3d53 0x35cd3c47 0x346ce7d9 0x346ca543 0x33de68a5 0x35e0be7d 0x35e0b6ff 0x35d04079 0x35c8e451 0x35cced59 0x35cca

bash - Transforming Text File into One Line -

i have set of large text files. example, war , peace project gutenburg . need make text fits 1 (obviously long) line in text file, i.e. no line breaks. using bash on os x. so far have tried several different commands transform file (pg2600.txt) new file (output.txt) no avail. tr -d '\n' <pg2600.txt > output.txt seemed promising when open in text editor, line breaks still there. the end goal transform this: "madame, doubt ability before such audience," said he, smilingly inclining head. into "madame, doubt ability before such audience," said he, smilingly inclining head. since text files may have \r , unix operating systems may not recognize them. use instead: tr -d '\r' < input > output or in case remove newlines use: tr -d '\r\n' < input > output

display mysql query result from array parameters php -

i'll best explain create query return rows search function ex : return row id = _ _ here's code : if(!empty($champs)){ $table[0]["prog"] = array('mydb.message','message'); $table[1]["prog"] = array('mydb.newtable','username','nom','prenom'); as table , columns $nb_result =0; for($i =0 ; $i < count ($table); $i++) { $prog_tab = $table[$i]["prog"]; $sql = sprintf("select * %s 1 ", $prog_tab [0], default_access_level); for($j = 1; $j < count ($prog_tab ); $j++) { $sql .= sprintf(" or %s '%s' ",

c++ - Properly defining namespaces with anonymous functions -

i'm bit confused c++ namespaces, , how define them. have 2 files: lua.h , main.cpp . lua.h contains following helpers running lua scripts in namespace: #ifndef lua_h #define lua_h #include <lua.hpp> namespace fabric { namespace lua { void loadlibs(lua_state * l) { static const lual_reg lualibs[] = { { "io", luaopen_io }, { "base", luaopen_base }, { null, null } }; const lual_reg * lib = lualibs; (; lib->func != null; lib++) { lib->func(l); lua_settop(l, 0); } } void init(lua_state * l) { loadlibs(l); lual_dofile(l, "init.lua"); lua_close(l); } } } #endif my main.cpp files tries run lua script using these helper functions: #include "lua.h" int main (int argc, char * argv[]) { fabric::lua::init(); return 0; } but when try compile main.cpp , this: source/main.cpp:9:3: error: us