Posts

Showing posts from March, 2015

Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

Insert contacts Last Name using Intent android -

google should document contacts api, irritating find out how insert specific details. anyways, i want send following contact details contact native application of android: name last name [family name] street address city state zip code contact phone no. i have figured out family name stored in contactscontract.commondatakinds.structuredname.family_name anyhelp appreciated. , if know other columns insertion beyond these mentioned. ready buy it. condition should use contactscontract i.e. above android 2.1 api level 5 thankx :) to set name, code : conactsintent.putextra(contactscontract.intents.insert.name, firstname); try adding space in between first name , last name. conactsintent.putextra(contactscontract.intents.insert.name, firstname+" "+lastname);

.htaccess - Problem with htaccess redirect with rewrite module -

i have old url at: http://example.com/search/admin i want make go to: http://example.com/cgi-bin/admin this have far, wrong... rewriterule ^/search/admin$ https://example.com/cgi-bin/admin the mod_rewrite on , working , using apache 2.2. little correction benubird post: rewriterule ^search\/admin\/?$ cgi-bin/admin [l] rewriterules never start slash , redirect can without slash.

android development phone -

is there android development phone available? , @ cost? , specialty of phone comparing normal android phone? yes. check this link . more information here .

Pass command field from main report to crosstab formula in sub report? -

i have master detail report. crosstab included in detail section inside subreport. how pass command field main report cross tab formula field in sub report ? you can using shared formulas. in main report create new formula field - can called whatever like. create shared variable , assign value. whileprintingrecords; shared stringvar mainreportvar := {table.columnname} in sub report, create new formula field , enter following: whileprintingrecords; shared stringvar mainreportvar; mainreportvar the variables names in both of formulas must same. this display value of formula field main report on sub report. can use in cross-tab.

c# - Lucene.net IndexWriter lock obtains -

been pulling hair out several hours trying find way around limitation lucene.net (2.9.2)'s fslock problem. basically, identified whenever write action against index performed lock gets put on directory, nothing new. lock should released after every addition, indexwriter.unlock nothing, figured out can release lock via: fsdirectory.getlockfactory().clearlock("write.lock"); however, try , ensure indexwriter instance has been initialized, nativefslock exception, assuming indexwriter still believes lock persistent on directory. any ideas how can overcome this? thanks, eric my indexwriter instance not thread-safe.

regex - python regular expression replacing part of a matched string -

i got string might this "myfunc('element','node','elementversion','ext',12,0,0)" i'm checking validity using, works fine myfunc\((.+?)\,(.+?)\,(.+?)\,(.+?)\,(.+?)\,(.+?)\,(.+?)\) now i'd replace whatever string @ 3rd parameter. unfortunately cant use stringreplace on whatever sub-string on 3rd position since same 'sub-string' anywhere else in string. with , re.findall, myfunc\(.+?\,.+?\,(.+?)\,.+?\,.+?\,.+?\,.+?\) i able contents of substring on 3rd position, re.sub not replace string returns me string want replace :/ here's code myre = re.compile(r"myfunc\(.+?\,.+?\,(.+?)\,.+?\,.+?\,.+?\,.+?\)") val = "myfunc('element','node','elementversion','ext',12,0,0)" print myre.findall(val) print myre.sub("noversion",val) any idea i've missed ? thanks! seb in re.sub, need specify substitution whole matching string. means need repea

Django Foreignkey problem, -

class service(models.model) name = models.charfield("service name", max_length = 20, unique = true) class newclass(models.model): service = models.foreignkey(services) user1 = models.foreignkey(user) basically want : each service can have different user1, no duplicate user1 service. example service = 'some' user1 = 'amit' service = 'some' user1 = 'laspal' service = 'some1' user1 = 'amit' so how avoid conditions: service = 'some' user1 = 'amit' service = 'some' user1 = 'amit' should check while adding user1 newclass or there field missing out can user fk(). thanks. if mean don't want 2 newclass models can exist same service , user1, should use: class newclass(models.model): service = models.foreignkey(services) user1 = models.foreignkey(user) class meta: unique_together = (('service', 'user1'),)

ruby - How to add public API to a Rails app? -

i'd open rails 2.3 app (hosted on heroku) developers. thought of 2 ways of doing this: using respond_to |format| of app, , before_filter allowing authorized developers api keys using second heroku account dedicated api, sharing original app's database. now, better: rails, sinatra, or grape ? i know vague question. have articles or architectural patterns me? thanks, kevin we use grape. it's simple , allows cleaner separation , semantics. api not controller.

XPath to return default value if node not present -

say have pair of xml documents <foo> <bar/> <baz>mystring</baz> </foo> and <foo> <bar/> </foo> i want xpath (version 1.0 only) returns "mystring" first document , "not-found" second. tried (string('not-found') | //baz)[last()] but left hand side of union isn't node-set in xpath 1.0, use: concat(/foo/baz, substring('not-found', 1 div not(/foo/baz))) if want handle posible empty baz element, use: concat(/foo/baz, substring('not-found', 1 div not(/foo/baz[node()]))) with input: <foo> <baz/> </foo> result: not-found string data type.

Capture Flash / Flex redraw DisplayObject event? -

i'm trying capture redraw event movieclip / sprite objects in scroll area. ideally, should able capture event when flash player redraws objects can seen "show redraw regions" in fp debug. i've tried use event.render capture this, fires when object not visible / redrawn. is there native flash event can me capture accurately? tia! so far, looks there no way capture flash player's redraw event. however, solve specific problem used - on display object manually redraw, check bounds object.transform.pixelbounds use event.render fire event each objects redraws needed if within display area per bounds. not perfect, job. wish fp had feature people detail level work.

mysqli - how to avoid duplication users in my db with php -

how all, hope every 1 here ok, now have form admin can create users , can delete users let me display code first this code > > <?php error_reporting(e_all); > > session_start(); > if(!isset($_session['login']) || > $_session['login']!='1' ) { > header("location:loginpage.php"); > } ?> > > <!doctype html public "-//w3c//dtd > xhtml 1.0 transitional//en" > "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> > <html > xmlns="http://www.w3.org/1999/xhtml"> > <head> <meta http-equiv="content-type" > content="text/html; charset=utf-8" /> > <title>my control panel</title> <link > href="../css_style.css" > rel="stylesheet" type="text/css" /> > </head> > > > > <body> <div id="werpper"> <di

c++ - Network send problem -

i try send data on network, server i've programmed doesen't data. code worked befor: void mainwindow::send() { qbytearray qbarr; qdatastream qdstrm(&qbarr, qiodevice::writeonly); int icount = qlist->count(); qprogressdialog qprogrsdsend(qstring("sending..."), qstring("cancel"), 0, icount, this); qdstrm.setversion(qdatastream::qt_4_6); qprogrsdsend.setwindowmodality(qt::windowmodal); for(int = 0; < icount; i++) { if(qprogrsdsend.wascanceled()) break; qdstrm << (quint16)0; qdstrm << (*qlist)[i].data(); qdstrm.device()->seek(0); qdstrm << (quint16)(qbarr.size() - sizeof(quint16)); qprogrsdsend.setvalue(i); qtcpsoclient->write(qbarr); qtcpsoclient->flush(); qtcpsoclient->waitforbyteswritten(); qbarr.clear(); } qlblstatus2->settext("file send."); } but takes many time send each elemt qlist. tried modify methode, first elements qlist has been saved in qbarr. , sen

c++ - Infinite Loops and Early Return Statements -

i have simple console application outputs menu , waits user input. after performing appropriate action, entire process repeats. program exits when specific string entered. implemented infinite loop , return statement: int main() { while (true) { outputmenu(); string userchoice; cin >> userchoice; // ... if (userchoice == "exit") return 0; } } according teacher, it's bad practice use infinite loop , hack way out of return statement. suggests following: int main() { bool shouldexit = false; while (!shouldexit) { outputmenu(); string userchoice; cin >> userchoice; // ... if (userchoice == "exit") shouldexit = true; } return 0; } is bad idea use infinite loop , return statement? if so, there technical reason or bad practice? this might 1 of rare cases do...while appropriate. avoid adding boolean state variabl

SMS via gms modem asp.net -

i'm using gsm modem itengo 3800. i'm doing project interface website send/receive bulk sms, schedule sms , etc. the problem is, don't know should coded in. should coded asp.net web application? or should coded windows programs interface web application send/receiving sms? also receiving/sending multiple sms important, requires queue or buffer? glad if sample programme provided. because sending messages via gsm modem can slow, i'd have asp.net app post messages message queue, have windows service read queue , send messages. allows website avoid degradation issues when sending out lots of messages. here decent article discusses using msmq: http://www.15seconds.com/issue/031202.htm the asp.net app would: messagequeue queue = new messagequeue(queue_path); message msg = new message("5555551212|message"); queue.send(msg); and service listen: messagequeue queue = new messagequeue(queue_path); message msg = queue.receive();

visual studio 2010 - Fix invalid child element in WCF RIA with SOAP endpoint -

is there anyway fix warning visual studio flags when try , add soap endpoint wcf ria service ? the element 'system.servicemodel' has invalid child element 'domainservices' i found 1 blog post, silverlight forums , "answer" in says edit visual studio dotnetconfig.xsd, not

BDD naming: when does it stop being about the user experience? -

i'm drawn mspec hopes of 1 day sharing test reports non-developers * , valuable (right?) if discuss business (the user experience) in test/scenario names (instead of individual c# objects/members under test). but i'm struggling, low-level functionality, cite non-developer concerns in test/scenario names. farther concern ui, more difficulty in naming scenario such both a) relevant non-developer , b) describes low-level functionality being tested. as move farther , farther ui, there point @ test/scenario names can't shared non-developers? feel answer should "no", because i shouldn't testing behavior unless it's non-developer cares about , i'm failing regularly enough i'm not sure i'm missing. if there obvious answers somewhere, i'd appreciate citations/references. * e.g. end users or other stakeholders ("stakeholders" might include future developers -- or me in year , half -- using these specifications gain insight

Browser maximum screen size -

i planning advertisement display solution might use browser multiple monitors. 1 of questions is: there limit in maximum screen size of browser? no, there isn't. you're safe deeming 2,000 pixels or 99.999%-of-users limit, there's no hard technological limit preventing nutter having 100,000 pixel browser window displaying on times square-style billboard or something.

seo - Joomla URL canonicalisation -

could suggest best way redirect non-www www in joomla? in .htaccess file i'm unsure if it's best way dynamic websites. many shaun there extension achieve this, can find here on joomla extension directory

jquery - trigger alert on div's mouse out -

im testing out here,so please excuse css rules.i have got ul list in div,and im trying trigger alert on mouseout of div alert triggers each time mouseout li items in ul . please tell me reason behind it? guess bubbling im not sure. <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>untitled document</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <style> #box{ cursor:pointer;width:300px;height:500px;background-color:#f1e0bb; } ul#mylist{ list-style:none;padding-top:20px; } ul#mylist li{ font-family:arial;font-size:20px;font-weight:bold;height:40px;cursor:pointer;border:solid 1px #000; } </style> </head> <body> <div id="box"> <ul id="mylist"> <li>item 11<

ajax - How does opensocial-jquery overcome the browser's inability to parse the results of a cross domain POST? -

i under impression needed web proxy parse results of cross-domain ajax post. but apparently, can accomplish opensocial-jquery . could please explain how opensocial-jquery makes happen? umm... first sentence on page linked explains it from http://code.google.com/p/opensocial-jquery/wiki/ajax all requests generated jquery.ajax relayed proxy gadget server. frees cross-domain restrictions , maintains compatibility.

javascript - Creating an overlay in CSS? -

i have div display dynamically when conditions arise. when display div, how can create effect of background dimming , div appearing prominent? number of ajax lightboxes or popups. (thickbox, colorbox, prettyphoto, etc) i don;t quite how it. have else working in own custom code except piece. can me learn how? place div on content , set opacity. use in 1 of sites. <div id="error_wrapper"> <div id="site_error"> error: </div> </div> div#error_wrapper { z-index: 100; position: fixed; width: 100%; height: 100%; background-color: #000000; top: 0px; left: 0px; opacity: 0.7; filter: alpha(opacity=70); } div#site_error { position: fixed; top: 200px; width: 400px; left: 50%; margin-left: -200px; }

How does Intellij deploy to JBoss? -

i have application in intellij , deploying jboss. i'd hot deploy working looks need understand how intellij , jboss interact. when build project in intellij , start jboss, ear file not appear in deploy directory assume there magic intellij jboss reads different folder. happening during step? thanks :) please refer following articles: developing applications jboss in intellij idea debugging applications jboss in intellij idea basically, need exploded artifact configuration directory name ending .ear . build | make performs hot deployment update action (which configurable , can update resources, resources , classes, optionally redeploy or restart server). instead of copying application jboss, idea runs appropriate parameters uses artifact directory instead. configuration flexible , can change artifact directory location reside under jboss directory.

jQuery UI dialog form, not sending correct variable -

i'm loading customer info page using jquery. there's list of customers link next it: <a href="#" onclick="load_customer(<?php echo $c->id; ?>);return false;">view</a> that triggers function: function load_customer(id) { $("#dashboard").load('get_info/' + id); } that works perfectly. on page i'm loading, have jquery ui modal dialog form adding new information. <div id="addinfo"> <form><input type="hidden" name="customer_id" value="<?php echo $c->id; ?>" /></form> </div> my javascript: $("#addinfobutton").click(function(){ $("#addinfo").dialog("open"); return false; }); $("#addinfo").dialog({ autoopen:false, width:400, height:550, modal: true }); when select customer first time, populates hidden

Java: Convert byte to integer -

i need convert 2 byte array ( byte[2] ) integer value in java. how can that? you can use bytebuffer this: bytebuffer buffer = bytebuffer.wrap(myarray); buffer.order(byteorder.little_endian); // if want little-endian int result = buffer.getshort(); see convert 4 bytes int .

treemap - Android jTreeMap visual -

i need special. http://prefuse.org/gallery/treemap/ i need this, android, there way it? how? port swing android's ui framework, using android 2d drawing api ( canvas ). whole prefuse framework large , take quite time port. an better approach generate treemap on server, sending resulting png file down android app. depending on how data processing, building treemap on android phone take quite time, longer user wants sit there. also, bear in mind traditional treemap designed larger screens android devices have, , usability may problem.

android - Notifiy the user in a Thread -

code: final progressdialog pd = progressdialog.show(main.this,"","loading. please wait...", true); pd.show(); thread t = new thread() { public void run() { result = getdata("link", namevaluepairs); pd.dismiss(); if(result.contains("logged in")) { user=etuser.gettext().tostring(); } else { fail(); } } }; t.start(); fail function: public void fail () { final textview tverror = new textview(this); tverror.settext("fail"); linear_l.addview(tverror); } error: isn't possible add view during run in thread. is there workaround? do not attempt modify ui background thread. use onpostexecute() in asynctask . or, use handler . or, use post() on

mysql - Question about "FOR EACH ROW" in SQL Triggers -

if i'm using trigger update 1 row, , it's reading new row, each row needed in trigger? if never going update more 1 row update statement, each row declaration in trigger optional.

ruby - Error during Rails multi sort_by when hitting empty date value -

sorry newb question, everyone. here is: i have hash looks this: { "id" => { :task => [ { :due => mon dec 20 00:00:00 utc 2010, completed: => "2010-12-18t17:29:57z", :priority => "1", ... } ] , ... } , ... } to sort this, use: tasks = hash.with_indifferent_access tasks.sort_by { |k,v| [ v['task'][0]['completed'], v['task'][0]['due'], v['task'][0]['priority'] ] } this works fine long :due has date value. when doesn't have date value, permitted, looks this: :due => "" then rails error saying: "comparison of array array failed." i tried putting in ternary , other logic default distant date if :due empty, seems isn't possible in sort_by block. any ideas how lick one? many thanks! here example assuming "due" string , when empty want sort before other tasks same completion value. idea convert both valid dates empty strings same c

entity framework 4 - EF4 CTP5 Code First approach ignores Table attributes -

i'm using ef4 ctp5 code first approach having trouble getting work. have class called "company" , database table called "companytable". want map company class companytable table, have code this: [table(name = "companytable")] public class company { [key] [column(name = "companyidnumber", dbtype = "int")] public int companynumber { get; set; } [column(name = "companyname", dbtype = "varchar")] public string companyname { get; set; } } i call so: var db = new users(); var companies = (from c in db.companies select c).tolist(); however errors out: invalid object name 'dbo.companies'. it's not respecting table attribute on class, though says here table attribute supported. it's pluralizing name it's searching (companies instead of company.) how map class table name? on class inher

windows - Quartz.NET: Need CronTrigger on an iStatefulJob instance to *delay instead of skip* if running job while schedule matures -

greetings, friendly neighborhood quartz.net n00b back! i have windows service running istatefuljob instances on quartz.net crontrigger based schedule scheme... cron string used schedule job: "0 0/1 * * * ? *" everything works great. however, if have job set run, say, @ x:00 mark of every minute, , job happens run more minute, notice subsequent job runs after job finished executing, rather waiting until next scheduled run, "queuing" instead of merely skipping job till it's next scheduled run. i put in trigger crontrigger misfireinstruction of donothing, exact same thing happens when job overruns next scheduled execution schedule. how istatefuljob instance merely skip scheduled execution trigger if running, rather have delay until first execution completes? i explicitly set trigger.misfireinstruction = misfireinstruction.crontrigger.donothing; ...but instead of "doing nothing", job scheduled run every minute takes 90 seconds complete, exp

java - Using and controlling Spring transactions within Struts 2 actions -

hey guys, have been working while on project following components: struts2.1.8.1, spring 3.0.3 jpa 2.0, hibernate 3 i using spring's entitymanager magic... i'm having problems dealing transactions inside actions. instance, setting values on persisted object in several methods within class, , want able rollback if validate method finds validation error, or commit these changes otherwise. have spent quite long time reading half of internet comprehensive explanation. unfortunately, no complete examples exist (at least similar stack). i have stumbled thread on mailing list: @transactional spring annotation in struts2 action not work . message i'm linking @ seems have pretty simple , straightforward solution, using transactioninterceptor trick seems... problem i'm not finding useful information regarding interceptor. anyone here has experience technology , can spare tip , link or 2 on how use spring transactions inside struts2 actions? thanks! - edit

Rails - Given a block of text, auto-link links -

on mysite have ability add comments. users enter comments links (href. ...) i have links clickable/linkable (a href) when comment displayed users. how rails 3 can take comment, , links , wrap links in href tag opens in new window? thanks the simplest way use auto_link method built rails. note: in rails 3.1 auto_link has been moved a separate gem .

branch - mercurial log of changests on merged named branches, but not unmerged -

i want able "hg log" of every changeset appears in graph between changeset1 , changeset2. cannot find way without either a) omitting nodes on named branches merged between changeset1:changset2 or b) including nodes on named branches not ancestors of changeset2 here's "hg glog" of simple example 2 named branches plus default branch. 1 named branch gets merged , nodes relevant, other irrelevant: @ changeset: 5:e384fe418e9b |\ tag: tip | | parent: 2:7dc7af503071 | | parent: 3:0a9be59d576e | | summary: merge somefeature branch default | | | | o changeset: 4:4e8c9ca127c9 | | | branch: unmerged_feature | | | parent: 1:ef98ad136fa8 | | | summary: change not merged ending changeset | | | | o | changeset: 3:0a9be59d576e | |/ branch: somefeature | | parent: 1:ef98ad136fa8 | | summary: changed b.txt | | o | changeset: 2:7dc7af503071 | summary: changed a.txt | o changeset: 1

How to check if background data is enabled on the android? -

i want check if user enabled background data on his/her device , display message if disabled. how can check if has been enabled? tried import android.provider.settings; //... settings.system.getstring(getcontentresolver(), settings.secure.background_data); //and settings.secure.getstring(getcontentresolver(), settings.secure.background_data); but returning null. thank you, achie. you want use connectivity manager info. connectivitymanager mgr = (connectivitymanager)context.getsystemservice(context.connectivity_service); boolean bgdata = mgr. getbackgrounddatasetting() ;

python - BFS function not returning path right -

hey guys, what's ya'll. this, have create bfs function finds shortest path between destination , source game called quoridor, i'm sure of ya'll played before. when run it, no errors found want shortest path function return path 1 did in searchbfs function. also, sorry sloppy post, it's first one. here's code.... from interface import * import engine #public routines def init(gamefile, playerid, numplayers, playerhomes, wallsremaining): """ parts engine calls method player can initialize data. gamefile - string file containing initial board state. playerid - numeric id of player (0-4). numplayers - number of players (2 or 4). playerhomes - list of coordinates each players starting cell (po-p4). wallsremaining - number of walls remaining (same players @ start).""" # log message string standard output , current log file engine.log_msg("player.init called player "

asp.net - Request.Form for DropDownList -

i have on view: </td> <td class="span-8 last"> <div class="editor-label"> <label for="traslado_movimiento_ubicacionfuncional_id">ubicaci&#243;n funcional</label> </div> <div class="editor-field"> <select id="traslado_movimiento_ubicacionfuncional_id" name="traslado.movimiento.ubicacionfuncional_id"><option value=""> -- seleccione -- </option> </select> </div> </td> and want selected value on select. on controller wrote: string selected = request.form["traslado_movimiento_ubicacionfuncional_id"]; but selected null.... please, help! thx you need pass input's name , contains . s.

How do I get and set an object in session scope in JSF? -

i need persist 1 object in session scope of jsf application. define session variable, , how , set either view file or backing bean? several ways: use externalcontext#getsessionmap() externalcontext externalcontext = facescontext.getcurrentinstance().getexternalcontext(); map<string, object> sessionmap = externalcontext.getsessionmap(); sessionmap.put("somekey", yourvariable); and later: someobject yourvariable = (someobject) sessionmap.get("somekey"); or, make property of session scoped bean inject in request scoped bean. sessionbean.setsomevariable(yourvariable); and later: someobject yourvariable = sessionbean.getsomevariable(); injection of beans in each other can happen faces-config.xml described here or if you're on jsf 2.0, @managedproperty @managedbean @requestscoped public class requestbean { @managedproperty("#{sessionbean}") private sessionbean sessionbean; // ... } with @managedbean @s

html - How to show mouse coordinates over canvas using pure javascript in tooltip form? -

Image
so html5 canvas. want see x:11, y:33 in form of tooltip near mouse when mouse on canvas ... mouse moves tooltip moves showing coordinates. how such thing javascript , html 5? $(function() { var canvas = $('#canvas').get(0); var ctx = canvas.getcontext('2d'); var w = h = canvas.width = canvas.height = 300; ctx.fillstyle = '#0099f9'; ctx.fillrect(0, 0, w, h); canvas.addeventlistener('mousemove', function(e) { var x = e.pagex - canvas.offsetleft; var y = e.pagey - canvas.offsettop; var str = 'x : ' + x + ', ' + 'y : ' + y; ctx.fillstyle = '#0099f9'; ctx.fillrect(0, 0, w, h); ctx.fillstyle = '#ddd'; ctx.fillrect(x + 10, y + 10, 80, 25); ctx.fillstyle = '#000'; ctx.font = 'bold 20px verdana'; ctx.filltext(str, x + 20, y + 30, 60); }, 0); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery

logging - android.util.Config.DEBUG always false even when developing and debugging in eclipse. Why? -

when developing in eclipse, android.util.config.debug constant false when debug project. the javadoc constant says "if debug build, field true." doing wrong? the "build" mentioned in document not application build, android system build. the value of config.debug only depends on system (rom) of device, nothing application. on device production build rom, config.debug alway false no matter how set usb debugging on device , debuggable flag in manifest. if document written like: "if android system debug build, field true.", less confusing.

iPhone: how to connect social networking sites and retrieving user info -

hi how connect social networking sites(twitter) , retrieving user credencials , posting tweet , viewing number of follower, following etc.can u suggest me. here's tutorial describing how connect twitter in iphone app using existing third party library: http://mobile.tutsplus.com/tutorials/iphone/twitter-api-iphone/ i found quick google search, may have come across it. i've used library referenced in tutorial, , it's worked fine in past. i agree robert. question doesn't offer many details. suggest googling around, trying tutorial , other ones come across, , coming more specific questions. good luck!

Very simple RogueLike in F#, making it more "functional" -

i have existing c# code very, simple roguelike engine. deliberately naive in trying minimum amount possible. move @ symbol around hardcoded map using arrow keys , system.console: //define map var map = new list<string>{ " ", " ", " ", " ", " ############################### ", " # # ", " # ###### # ", " # # # # ", " #### #### # # # ", " # # # # # # ", " # # # # # # ", " #### #### ###### # ", " # = # ", " # =

mercurial - Is there any workaround for hg timing out on a push operation? -

i'm trying push bitbucket, changeset several thousand files changed (i'm committing huge library dependency ). commit on local box worked fine, when try actual push, operation times out ( hg says "searching changes" while, whole thing collapses). obviously, have absolutely no control on server side. anything can in scenario this? what hg outgoing say? try push partially hg push -r changeset_no , changeset_no changeset middle of changesets need pushed.

iphone - How to send All objects of Mutable Array to Another Class? -

i want send mutable array objects first class second class. have no idea how can please tell me way... try this: yoursecondclass.mutablearray_asamembervariable = [[yourfirstclass mutablearray_asamembervariable] copy]; this makes copy out firstclass mutable array , sends second class.

javascript - how can i make an interface in php to add data csv file -

hey...i need create html+php+javascript interface where got 3 text area , want:::: that if i'll enter data text area , pressing submit button,,then it'll enter textarea's data csv file.. pls 1 help.... $fp = fopen('file.csv', 'w'); fputcsv($fp, $_get['textarea']); fclose($fp); ?>

asp.net mvc - Url.Action is throwing error CS1026: ) expected -

this syntax error i'm new mvc , trying edit exists without having experience. having spent ages trying different syntax i'm missing something. my issue have this: var url = '<%= url.action("list") %>?page=' + pageno; which fine, not passing in required parameters part of pager functionality. what want use like: var url = '<%= html.renderaction("list", "placementagreementagencyplacementagreementsplacement", new { domain = "placement", id = model.item.placementagreement.placementagreementid, agencyplacementagreementid = model.item.agencyplacementagreementid, page = model.pageno }); %>'; but complains error cs1026: ) expected same trying <%= url.action("list", "placementagreementagencyplacementagreementsplacement", new { domain = "pl

c# - CodeSmith Nhibernate -

im developing multithreading application using code smith nhibernate template, read must use session or every thread, problem dont know how new session codesmith generated classes ... can body provide me very simple example of how use codesmith nhibernate in 2 different threads? or @ least privide me of code create new session ? thanks in advance. the codesmith generated manager objects thread safe, , ensure each thread it's own nhibernate session object. ensure threads opened , closed properly, important dispose of managers. here example: imanagerfactory managerfactory = new managerfactory(); using (icategorymanager categorymanager = managerfactory.getcategorymanager()) { category categorya = new category(); categorya.id = "test1"; categorya.name = "test 1"; categorya.descn = "hello world!"; categorymanager.save(categorya); categorymanager.session.commitchanges(); }

HTTP Connection in Iphone -

since i'm new in iphone need in learning http connections in iphone. please guide me tutorials learn http connections tricks in iphone , communicate websites. also please guide me through sample code following problem: want send "hello world" text site , got reply web same word adiition of s i.e. "hello world s ".. please brothers guide me through sample code.. it's part of application i'm developing in iphone. i new ,but have sent msg(soap xml) via http request .my sample code is... // host address nsurl *url = [nsurl urlwithstring:@"http://xyz.com"]; nsmutableurlrequest *therequest =[nsmutableurlrequest requestwithurl:url]; // find msg length, here x msg nsstring *msglength = [nsstring stringwithformat:@"%d", [x length]]; // specify type of msg u have send host(mine xml) [therequest addvalue: @"text/xml; charset=utf-8" forhttpheaderfield:@"content-type"]; // name space optional 1 [th

java - making a jar file -

i have written code client/server application. , go properties>packaging for making jar file it. when run server side , client side ! doesn't make jar file application! should do? please me thanks use make executable jar jar cf jar-file input-file(s) or alternatively can write ant script same document

jquery - jqgrid - refresh a grid after an ajax file upload -

how refresh jqgrid based grid outside of grid itself? within code grid exists option call reloadgrid . however, want reload grid after doing ajax file upload, outside of jqgrid code. how call reloadgrid in context? i realize can reload entire page like: location.reload(); reloads whole lot , puts me first page of results grid , kind of defeats purpose of using ajax upload file in first place. some code: reloadgrid called within jqgrid follows: $("#thegrid").trigger("reloadgrid"); but nothing when called within ajaxupload: oncomplete: function(file, response) { if (response == 'success') { //location.reload(); $("#thegrid").trigger("reloadgrid"); }else if (response == 'error') { alert("doh!"); } if uncomment location.reload() , page reloads trigger uncommented (as in above

iphone - Very strange problem about NSString -

a strange behavior function, void* getnsstring(const nsstring* str){ str = @"this new test"; //nsstring* str1 = @"so strange test"; return; } then nslog(@"%@",getnsstring(@"test")); the result this new test if uncomment nsstring* str1 = @"so strange test"; my understanding nothing returned, should null , why print out string ? then result so strange test i don't believe nothing returned. believe it's undefined. in other words, returned. in case, looks it's returning whatever happened on stack @ given location. happens 1 of strings modified or created can assure fortunate accident (or unfortunate since crash better). if want nothing returned, need change: void* getnsstring(const nsstring* str){ to: void getnsstring(const nsstring* str){

reflection - I want to be able to print stack traces java style in c -

simple question, want able print stack traces java style in c. have signal handlers set , stack trace addresses want translate addresses function names. therefore, decided implement reflection. right have tables follows: {"foo", &foo, "bar", &bar}. while solution works platforms, annoying keep date. there way (one wouldnt require manual upkeep?) i'm think http://www.gnu.org/s/libc/manual/html_node/backtraces.html can found answer question. #include <execinfo.h> #include <stdio.h> #include <stdlib.h> /* obtain backtrace , print stdout. */ void print_trace (void) { void *array[10]; size_t size; char **strings; size_t i; size = backtrace (array, 10); strings = backtrace_symbols (array, size); printf ("obtained %zd stack frames.\n", size); (i = 0; < size; i++) printf ("%s\n", strings[i]); free (strings); } /* dummy function make backtrace more interesting

DotNetOpenAuth occasionally throws a NotImplementedException -

i have dotnetopenauth running on background thread making calls google authorized oauth on regular basis. about once day, 1 in 10,000 calls, following exception: an unhandled exception occurred , process terminated. application id: defaultdomain process id: 3316 exception: system.notimplementedexception message: method or operation not implemented. stacktrace: @ dotnetopenauth.messaging.protocolexception.getobjectdata(serializationinfo info, streamingcontext context) in c:\users\andarno\git\dotnetopenid\src\dotnetopenauth\messaging\protocolexception.cs:line 90 @ system.runtime.serialization.formatters.binary.writeobjectinfo.initserialize(object obj, isurrogateselector surrogateselector, streamingcontext context, serobjectinfoinit serobjectinfoinit, iformatterconverter converter, objectwriter objectwriter, serializationbinder binder) @ system.runtime.serialization.formatters.binary.writeobjectinfo.serialize(object obj, isurrogateselector surrogateselector, streamingcontext conte

regex - Is it a solvable problem to generate a regular expression that matches some input set? -

i provide input set contains known separated number of text blocks. i want make program automatically generate 1 or more regular expressions each of matches every text block in input set. i see relatively easy ways implement brute-force search. i'm not expert in compilers theory. that's why i'm curious: 1) problem solvable? or there principle impossibility make such algorithm? 2) possible achieve polynomial complexity algorithm , avoid brute forcing? ".*" one-or-more regexp match every text block in input set. ;-)

django - Install Xapian for Python 2.6 on CentOS 5.5 -

i'm using django 1.2 python 2.6 on centos 5.5 , i'm trying install django haystack xapian search backend. i've followed installation instructions on http://docs.haystacksearch.org/dev/installing_search_engines.html#xapian , instructions redhat enterprise linux rpm package on http://xapian.org/download . xapian has installed, has attached python 2.4, needs present in centos other reasons. so, if go 'python' shell , 'import xapian' works correctly, if go 'python26' shell , 'import xapian' error 'no module named xapian'. i tried creating symlink in python 2.6 site packages xapian in python 2.4 site packages , gave me following error when trying import xapian in python 2.6 shell: runtimewarning: python c api version mismatch module _xapian: python has api version 1013, module _xapian has version 1012. i've tried specify python library use when configuring xapian-core seen on http://invisibleroads.com/tutorials/xapian-searc

sql - Problems with case-when-value-between something -formula -

i have case in have product codes, 4 symbol long. in cases products same no mather of first symbol, example 1 product code 7456 , 8456 , these products still have same function. difference first symbol , 3 symbols rigth remains same. my problem compare 2 data table each other , in first table used code 7456 , in second 1 code 8456. mach these 2 data dunno know how tell sql if code start 7 or 8 use 3 last symbols. i think possible solution kind of case when value between 7000-8999 use 3 right, can't code work? has solution me??? thanks! are looking this case when value between '7000' , '8999' right(value, 3) else value end

javascript - Chrome 10.0.612 dev Websocket Issue? -

out of reason, latest development version of google chrome has broken version of websocket it's using different version of handshake stable version, if has info on appreciate much. maybe has vulnerability? could stupid bug?

c++ - Char-array to int -

i have array char input[11] = {'0','2','7', '-','1','1','2', ,'0','0','9','5'}; how convert input[0,1,2] int 1 = 27 , input[3,4,5,6] int 2 = -112 , input[7,8,9,10] int 3 = 95 ? thx, jnk you can use combination of strncpy() extract character range , atoi() convert integer (or read this question more ways convert string int). int extract(char *input, int from, int length) { char temp[length+1] = { 0 }; strncpy(temp, input+from, length); return atoi(temp); } int main() { char input[11] = {'0','2','7','-','1','1','2','0','0','9','5'}; cout << "heading: " << extract(input, 0, 3) << endl; cout << "pitch: " << extract(input, 3, 4) << endl; cout << "roll: " << extract(input, 7, 4) << endl; } ou

php - Is there a risk of injection using mail function -

hi i'm developing contact form. i'm using mail function email on webmaster. is there risk inject malicious javascript , other injection attack? $to = (this config xml file) $message = $_post['message']; mail($to ,'feedback',$message); only if set content type text/html

javascript - Asynchronous google analytics -

hi there: when need register javascript activity web site google analytics may use (for example): _gaq.push(['_trackevent', 'param1', 'params2']); or _gaq.push(['_trackpageview', 'url']); does knows function call works? make ajax request google in order send data? store info , pushes server on unload event? thanks. _gaq acts queue can push commands before analytics has loaded; once has start executing you've queued. see docs .

Multiple inheritance in Objective-C -

possible duplicate: objective-c multiple inheritance i want implement multiple inheritance in objective-c i.e. have class "sub" needs sublass of class "super" uitableviewcontroller how can acheive same in obj-c? objective-c doesn't support multiple inheritance. use protocol, composition , message forwarding achieve same result. a protocol defines set of methods object must implement (it's possible have optional methods too). composition technique of include reference object , calling object when it's functionality required. message forwarding mechanism allows objects pass messages onto other objects, example, object included via composition. apple reference: protocols composition message forwarding (and forwarding , multiple inheritance )

iphone - UIImagePickerController Problem -

i've come across rather weird bug in uiimagepickercontroller . (or i'm doing wrong) i load controller such: uiimagepickercontroller*controller = [[uiimagepickercontroller alloc] init]; controller.sourcetype = uiimagepickercontrollersourcetypephotolibrary; [controller setdelegate:self]; [firstview presentmodalviewcontroller:controller animated:yes]; now problem following: code works great, once. it's tied uibutton action - if click second time instead of uiimagepickercontroller translucent (alpha 0.8ish?) black view appearing, can't dismiss. i create no such view anywhere, it's uiimagepickercontroller in action. i dismiss in delegate: - (void)imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingimage:(uiimage *)image editinginfo:(nsdictionary *)editinginfo { [firstview dismissmodalviewcontrolleranimated:yes]; [picker release]; } and works should well. what doing wrong / bug?

php - .htaccess redirect unless in iframe -

when creating websites, let clients view work in progress. @ moment uploading website directory, , use .htaccess password protect directory. keeping track of passwords , ensuring directory still protected after update becoming issue. i have created user login system clients can login , redirected preview of site (in iframe on page preview.php?c=clientname). i have looked various ways of redirecting client site preview page , easiest has been using .htaccess, redirect still affects site when in iframe. is there way stop .htaccess redirect when site in iframe? you test against "referer" header, can't rely on it's best possible. e.g. http://jsfiddle.net/qmnkr/ one of headers referer: http:// fiddle.jshell.net/qmnkr/show/light/

jquery/ajax/php big problem -

i've big problem creating intranet. made main page label menu, clicking on voices load form structure page in div , populate ajax, works problem starts when try add new data or update data, posted information sent several times php process page. sent 1 time other time 3-4 or more times, seems data cached in strange way... experience may problem? ajax code written in main page , load page may problem? better save in separated page? thanks in advance , excuse me generic question.. ciao h. that's piece of inserting code: $("#new_def").live("click", function() { var stringa = $("#new_def > div").attr("id"); var nodi=stringa.split("_"); $("#scheda_ris").html(""); $.post("./php/"+nodi[0]+".php", {azione: "new_def", dati: $("form").serialize()}, function(xml) { if ($("status", xml).text()=="1&q

iphone - How to add title or tag to UIActivityIndicatorView -

i supposed render pdf book in ipad , navigate through pages. in between navigation displaying uiactivityindicatorview indicate page still loading.... able without trouble. but, there way in can have tag or label or name along with(or beside) uiactivityindicator.... please answer this.. eagerly waiting ur inputs... , regards..... try mbprogresshud, looks apple's official indicator

javascript - How to get text around an element? -

if have <div id='wrapper'> <fieldset id='fldset'> <legend>title</legend> body text. </fieldset> </div> how retrieve "body text" without retrieving text inside of legend tag? for instance, if wanted see if text inside fieldset contains word "body" , change word, while ignoring whatever might in legend? innerhtml retrieves text children nodes. use of jquery wouldn't problem. $("#fldset").contents().eq(2).text();

C# Process Exited Event Help -

process cexe = new process(); cexe .startinfo.filename = "cexe.exe"; cexe .enableraisingevents = true; cexe .exited += this.cexited; and exited method private void cexited(object o, eventargs e) { messagebox.show(/* show file name here */); } how information process exited method? of variables (o, e) give me data , type meant be? while working .net base class library , find each event passes 2 parameters. first of type system.object , other of type (or descendant of) system.eventargs . the first argument object sender can safely cast type of class raised event. in case of type system.diagnostics.process . example: private void cexited(object o, eventargs e) { process p = (process)o; // use p here }