Posts

Showing posts from August, 2015

C# how do I read an mdb(MS Access) file then pass in the retrieved columns selected in an array for later use? -

how read mdb file pass in retrieved columns selected in array? basically, trying retrieve items match 2 specified criteria columns save last column in array. i have printed results correct per 2 criterias them being qdc , qpl when printing them how save last row later use in array. var list = new list<mydata>(); while (true) { while (reader.read()) { var data = new mydata { columnone = reader.getstring(0), columntwo = reader.getstring(1), columnthree = reader.getstring(2), columnfour = reader.getstring(3), columnfive = reader.getstring(4), }; list.add(data); console.writeline(""); foreach (var row in list) { console.writeline("start here"); console.writeline(row.columnone); console.writeline(row.columntwo); console.writeline(row.columnt

javascript - onScroll event called multiple times -

i want load more content when user scrolls webpage. tried using onscroll event javascript getting called multiple times jquery .scroll() method called multiple times. how handle this? browser issue? note: calling onscroll = "function()" on body tag of html. load content while scrolling: http://www.webresourcesdepot.com/load-content-while-scrolling-with-jquery/

read eval print loop - How do I access scala documentation from the repl? -

first of built in docs, , own code. specifically, want information similar how in python can call help() on method or object information on object printed repl. scaladocs generated html, don't want them appearing in repl window. might want load docs in browser repl, however. can creating own method (this 1 takes instance; have take instance of class[a] instead, if prefer): def viewdoc[a](a: a) { val name = a.asinstanceof[anyref].getclass.getname val url = "http://www.scala-lang.org/api/current/index.html#"+name val pb = new processbuilder("firefox",url) val p = pb.start p.waitfor } if want extra-clever, parse name point web browser @ javadocs java classes , scaladocs scala classes , wherever have documentation classes. want use local source, file:///my/path/to/docs/index.html# instead of api web. used can try out scala> viewdoc(some(1))

MySQL Conditional Select -

i've been trying night following query work: select user.username, user.email, user.id, user.last_mail, us.24hr wine_users user, wine_subscriptions sub, wine_user_settings user.id = sub.user_id , us.id = user.id , sub.wine1 = 'yes' , user.receive_mail = 'yes' , if(24hr = 'yes') user.last_mail >= date_sub (user.last_mail interval 1 day) basically, have 3 tables, containing username ( wine_users ), subscriptions ( wine_subscriptions ) , user settings( user_settings ) what want select users have either selected no in us.24hr or have selected yes in us.24hr (stored enum 'yes' 'no' in us.24hr) , have not received e-mail in last 24 hours (this stored timestamp in user.lastmail) any stop me tearing out own brain through left nostril! :) thanks :) seb wow! guys great! :) tried of suggestions, return following error: 1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near 

objective c - Get XML from NSWebView -

i have nswebview in there loaded xml data. cannot stringbyevaluatingjavascriptfromstring because javascript doesn't want work xml. how hell supposed it? why annoying difficult simple? creating xml url won't work. how xml nswebview nsstring? do need use webview? i'd suggest grabbing data itself: nsstring *content = [nsstring stringwithcontentsofurl:[nsurl urlwithstring:@"example.com"]];

How do I track changes of an instance variable outside of the class in Ruby? -

i new ruby , building program works interactive orchard, user input type of tree want grow , give commands water, prune, pick , harvest tree. the problem having when try have program ask commands until tree dies occurs @ height. height defined in instance variable inside class, , can't seem figure out how have program track variable outside of class, keeps prompting command until value achieved. the below code start , end of code, not middle parts seem working fine. each of commands @ bottom work once, program ends. appreciated. class orangetree def initialize name @name = name @height = 0 @branches = 0 @winter = false @orangesontree = 0 @orangesinbasket = 0 @timeofyear = 0 puts @name + 'just sprouted! him?' end puts 'welcome orchard! grow today?' reply = gets.chomp while reply != 'oranges' puts 'i sorry, not have kind of tree, try again' gets.chomp end oranges = orangetree.new 'woody ' while orangetree |@height| <= 61

c# - How can I know if a non-required RenderSection exists? -

@* omitted code.. *@ @renderbody() @rendersection("sidebar", required: false) is there way know in omitted code part if rendersection sidebar exists or not? @if (issectiondefined("sidebar")) { @rendersection("sidebar") } else { <div>some default content</div> }

javascript - Hover div, show other div -

<div id="quickstart"> <asp:hyperlink id="hlhemenbasla" runat="server">deneyim paylaÅŸ</asp:hyperlink> </div> <div id="visiblepanel" class="visiblepanel"></div> i have 2 div s on website. while hovering on div#quickstart , div#visiblepanel should visible; @ other times, should not be. i found code on internet, "couldn't run none". first, make sure you're not self closing <script> tags. it should be: <script type="text/javascript" src="scripts/jquery-1.6.2.js"></script> not <script type="text/javascript" src="scripts/jquery-1.6.2.js"/> then show/hide: $('#quickstart').hover(function() { $('#visiblepanel').toggle(); }); jsfiddle

javascript - jQuery fadeIn() different intervals with multiple div's -

i have homepage 6 div's. different shaped boxes, , want them fade in @ random intervals when page loads. javascript code follows: $(document).ready(function(){ $("#topleft").fadein(2000).animate({opacity: 1.0}); }); of course, need 6 div's targeted, not one, , want them randomly fade in within 3 seconds of page load. how go this? way, using jquery , since i'm new @ it, there may use don't know about. here's example you: http://jsfiddle.net/paulpro/gtfsk/

Auto-Fill Google Form w/ Fusiontable Data -

i using google map api v3 , fusiontables create interactive map. working want to, except feature add. map shows list of businesses may have internship opportunities local school. information boxes pop have link @ bottom says "pursue site!" when link clicked take fusiontable data specific infobox opened , autofill google form. possible? need use other google forms? here map: internship map all appreciated. yes, developer posted nice solution problem on fusion tables forum: http://code.google.com/apis/fusiontables/groups/fusiontablesapigroup.html?place=topic%2ffusion-tables-users-group%2fpakuzvnaogs%2fdiscussion

iphone - Getting artifacts when trying to read video stream from YouTube -

i'm trying read video frames rtsp stream youtube. here link test video: rtsp://v8.cache5.c.youtube.com/ciileny73wiagqkjlrxmiag8bxmydsanfeggugz2awrlb3mm/0/0/0/video.3gp if i'm reading frames local file - fine, when read them stream nothing lots of artifacts. i've googled around , found out there might problem udp packets , switching tcp may can't find possible change this. here function reading frame: bool nextframe(avformatcontext *pformatctx, avcodeccontext *pcodecctx, int videostream, avframe *pframe) { avpacket packet; int framefinished = 0; while( !framefinished && av_read_frame(pformatctx, &packet) >= 0 ) { // packet video stream? if( packet.stream_index == videostream ) { // decode video frame avcodec_decode_video2(pcodecctx, pframe, &framefinished, &packet); } // free packet allocated av_read_frame av_free_packet(&packet); }

c# - ASP.NET MVC 3 - Edge case with Routing in Area -

i have page user's can "ask question" against product. the route is: context.maproute( "q&a - ask - product", "{someproducturi}/questions/ask", new { controller = "questions", action = "ask" } ); which matches: /car/questions/ask /phone/questions/ask here's action: public class questionscontroller : controller { public viewresult ask(string someproducturi) { // ... } } now, problem is, need allow user select product on page itself, e.g no product pre-chosen in uri. because controller in area , "default url" this: /myarea/questions/ask so what's happening is, when action, "someproducturi" set "myarea", causing sorts of grief. i want re-use same action/view both sets of url's, don't want route value set "myarea" when it's default url. hope makes sense -

php - Script that checks youtube for new videos -

im wondering if there way check specific youtube channel , create list of links out of videos on channel. im not worried list making part getting link information. also if there way, update when there new post channel? i'm guessing out of php , js, js better choice this. if there jquery solution more helpful. the youtube api offers channel specific rss/json feeds php script read out , digest. feeds accessed via http://gdata.youtube.com/feeds/api/users/channelname/uploads?orderby=updated check out api documentation more info http://gdata.youtube.com/

Asterisk : create a multi-level IVR example -

i want create example multi-level ivr. let's welcome menu, asked enter employeeid. there second menu after that, , have option go previous menu. idea how ? here's pseudo-code example doesn't work, because don't know yet how create multi-level ivr. [testmenu] exten => start,1,answer() same => n,log(notice, call starts) same => n,background(welcomeintro) // welcome menu same => n,background(welcomeoption) // options have same => n,waitexten(5) exten => 0,1,playback(digits/0) ; if enter 0, play welcome menu same => n,goto(testmenu,start,1) // ??? ok ? , suppose want skip background(welcomeoption) part directly ? // if 1 enterred, lets ask employeeid exten => 1,1,playback(digits/1) ; same => n,playback(askemployeeid) same => n,goto ???? exten => i,1,playback(pbx-invalid) ; invalid same => n,goto(testmenu,start,1) exten => t,1,playback(byebye) ; timeout same => n,hangup() [emplo

html5 - Use clearRect to erase part of a png image drawn to canvas with drawImage -

is possible use clearrect delete part of png image drawn canvas using drawimage? i'm trying , not working: <canvas id="canvas"></canvas> <img id="pngimg" src="" alt="" /> [...] canvas = document.getelementbyid("canvas"); pngimg = document.getelementbyid("pngimg"); [...] pngimg.src = canvas.todataurl(); context.drawimage(pngimg, 0, 0, canvas.width, canvas.height); [...] then using clearrect erase mouse. erase works on strokes added canvas using drawline not images using drawimage. must clearrect instead of drawing solid color because background isn't solid. possible this? where loading image from? you can't use canvas.todataurl() if image on canvas originated different domain. see here: why canvas.todataurl() throw security exception? in same domain situation should work: original image: <img id="pngimg" src="http://www.domain.com/image.png" /

objective c - What's the difference between a Cocoa framework and a C static library? -

can explain me fundamental differences between cocoa framework , c static library? in particular, i'm finding out in both cases have reference file (.framework or .a) in "link binary libraries" part target in xcode. however, don't seem have put .a in "copy files". have put .framework "copy files". reason difference? a static library compiled part of app, whereas framework distributed app (or system frameworks present) , linked dynamically. see this question .

nhibernate - Projections with Restrictions.Discjunction -

projections restrictions.discjunction() or restrictions.or() produce clause instead of having clause. result in error (the clause cannot refer aggregate expressions). example: .createcriteria(typeof(salesorderline), "sol") .createcriteria("deliveryorderlines", "dol", jointype.leftouterjoin) .setprojection( projections.groupproperty("sol.key").as("salesorderlineid"), projections.groupproperty("sol.item"), projections.groupproperty("sol.description"), projections.groupproperty("sol.unitprice"), projections.groupproperty("sol.quantity"), projections.groupproperty("sol.discountpercentage"), projections.groupproperty("sol.salesorder")) .add(restrictions.or( restrictions.isnull(projections.sum("dol.quantity")), restrictions.gtproperty("sol.quantity", projections.sum("dol.quantity")))), .list(); sql result:

iphone - How to display the text of one tableview cell in the detailtextlabel of previous controller through array -

i have created controller class named taddalarmcontroller has tableview consists of 6 rows .when click on second row navigates page new controller name talarmnewcontroller tableviewcontroller , in have created nsmutablearray , populated array 7 static values when second controller displayed tableview displayed 7 static values in it.i want when click on row of second controller value present inside cell of paticular row should set detailtextlabel of previouscontroller i.e taddalarmcontroller .please me in solving problem.this code: addalarmcontroller.h #import <uikit/uikit.h> @class stopsnoozeappdelegate; @class alarm; @class talarmnewcontroller; @interface taddalarmcontroller : uitableviewcontroller { stopsnoozeappdelegate *app; iboutlet uitableview *tblview; nsdateformatter *dateformatter; nsundomanager *undomanager; alarm *am; talarmnewcontroller *anew; } @property(nonatomic,retain)nsdatef

rails 3 No route matches error -

i newbe rails3 have 20 controllers in rails app..redirecting 1 controller 1 rails app gives no route matches should add resources :controllername entry each controller in routes.rb file? or other general method this? when run rake:routes route there? if not you'll 'no route matches'. better use routes.rb config continuously redirect 1 controller another

asp.net mvc - JQUERY call to Controller Action: String Parameter truncated if containing 'space' character -

i have view accepts 2 string parameters , 2 date values. user hits search button , filtered output screen. works until user inputs string space. i.e. can search 'waste' not 'waste oil'. interestingly, in latter, parameter ok javascript before call made. on entering controller code goes form being 'waste oil' on client 'waste'. when happens other parameters set null crashing system. i've tried replacing spaces if present '#' character stripping out , putting in ' ' on controller side. messy fudge , appears work 1 parameter. there must simple explanation parameter data loss, comments appreciated not sure code example needed here anyway if help: my controller header : public actionresult indexsearch(int? page, string searchtext,string searchtextsite,string startdate,string enddate) { my html javascript : function search(ssearchtext,ssite) { ssearchtext = ssearchtext.tostring().replace(" "

matlab - Interpolating along the 2-D image slices -

Image
i have set of 100 2-d image slices of same size. have used matlab stack them create volumetric data. while size of 2-d slices 480x488 pixels, direction in images stacked not wide enough visualize volume in different orientation when projected. need interpolate along slices increase size visualization. can please give me idea or tip how it? edit: anotated projected microscopy-images the figure 1 top-view of projected volume. the figure 2 side-view of projected volume. when change rotation-angle, , try visualize volume in different orientation, e.g. side-view (figure 2), see in figure 2. i want expand side view interpolating along image slices. here adapted example matlab documentation on how visualize volumetric data (similar yours) using isosurfaces : %# load mri dataset: 27 slices of 128x128 images load mri d = squeeze(d); %# 27 2d-images %# view slices countours contourslice(d,[],[],1:size(d,3)) colormap(map), view(3), axis tight %# apply isos

xml - XSOM vs Apache XmlSchema -

i wanted library can used introspect xsd. parse , give object representation can types, names, annotaions,namespace etc. came across 2 of libraries: java.net xml schema object model (xsom) , apache commons xmlschema i felt xsom better, seems having different cddl license. able use xsom in commercial project cant make open source? of aware of better such libraries have lgpl type of license? i've used apache commons xmlschema , works well. but loving or hating library merely expose view of underlying structure subjective thing. regarding license, xsom seems released under mixture of gpl , simil-gpl licenses. if want go on safe side go apache , relax. putting apache hat on, if feel apache commons xmlschema can improved, please join project mailing list, let hear ideas, submit patches, , make better library.

visual studio 2010 - TPL Task return values -

i have application face recognition system received camera frames around 30 : 50 frame/second depending on camera type , each frame have anther function persons on , each persons in person in current frame check if person exist in database or not database records it’s around 100,000 records , steps made ever frame i rewrite previous question simple c# statement more clear // frame camera can consider it's inside loop (int frame = 1; frame < 50; frame++) { // each fram person insied frame // list<persons> foreach (var perosn in allpersons_inframe) { // each person need check //against database recored foreach (var recored in database) { // perosn exist in database // give me person id } } } till application working without problems have anther dea make task more simple , take small time comparing current time taken .i need used parallel programming "tpl" how : ne

c# - how to run nunit test standalone -

i have bunch of .net nunit tests need run on specific machine. unfortunately have remote desktop access machine , unable install visual studio , stuff. question: there way run unit tests standalone application? sure. use nunit runner supplied nunit.

actionscript 3 - How to create and use popup window in flex 3? -

i have used datagrid , 1 button in control bar. clicking button application goes edit state base state. question how can use popup editing selected record of datagrid instead of changing state. please give me example code describe how pop ups can used in flex 3 application. i got answer above problem. first have create custom component popup named mypopup and in application: import components.popups.mypopup; public var pop:mypopup; public function show_pop():void { pop= popupmanager.createpopup(this,mypopup,true) mypopup; popupmanager.centerpopup(pop); } calling function: <mx:button click="show_pop()" id="btn1" label="show popup"/>

Fire only one event in JQuery -

how make jquery fire last event handler set? example, in test case , want launch last alert ("world"). here's 1 way of doing it $("#test").click(function() { alert('hello'); return false; }); // before last event handler. $("#test").unbind("click"); $("#test").click(function() { alert('world'); return false; });

jquery - How to find select option position? -

i'm trying find option's index. for example, 1 when run following fake code js: $("#test[value='usd']").index() ? html: <select id='test'> <option value='cny'>cny</option> <option value='usd'>usd</option> </select> is possible? you close, want use index on option element, not select : var = $("#test option[value='usd']").index(); gratuitous live example note break if select contains optgroup elements. if so, you'll want pass 'option' index : var = $("#test option[value='usd']").index('option'); live example (i changed position it's 4th element example)

Is there a Moles version which support .net framework 4.0 -

i've noticed moles declares support vs2010, company policy enforces our project uses .net 4.0, target framework of installed moles 2.0. and know 2.0 , 4.0 incompatible version change. so there downloadable moles version support .net 4.0 ? moles supports .net versions 2-4. please ensure have current version of moles. moles should work in visual studio 2008 , 2010, on supported .net framework.

java me - How to create a field of format dd/yyyy? -

the field datefield instead value month , year '05/2011' : how create such field ? in java-me, can use java.util.calendar package formatting date. here snippet tutorial on displaying date , time in java me : private void outputdateusingcalendar(date date) { calendar calendar = calendar.getinstance(); calendar.settime(date); stringbuffer sb = new stringbuffer(); int day = calendar.get(calendar.day_of_month); sb.append(numbertostring(day)); sb.append("-"); int month = calendar.get(calendar.month) + 1; sb.append(numbertostring(month)); sb.append("-"); sb.append(calendar.get(calendar.year)); stringitem item = new stringitem("using calendar", sb.tostring()); mainform.append(item); }

python - Django - Multiple optional ForeignKey -

class truc(models.model): name = models.charfield(max_length=50, unique=true) machin1 = models.foreignkey(machin1, blank=true, null=true) machin2 = models.foreignkey(machin2, blank=true, null=true) machin3 = models.foreignkey(machin3, blank=true, null=true) i truc linked 1 machin , either machin1 either machin2 or machin3 . only 1 link, kind of validation: machin1 xor machin2 xor machin3 if ever linked 1 use generic relation : class truc(models.model): name = models.charfield(max_length=50, unique=true) content_type = models.foreignkey(contenttype) object_id = models.positiveintegerfield() machin_object = generic.genericforeignkey('content_type', 'object_id')

Does the implementation of the java.util.Iterator use the State pattern? -

i looking reasonable answear how implementation of java.util.iterator is coming under state design pattern edit please refer below link examples of gof design patterns in java's core libraries that, not sure. far know, implementation of iterator design pattern . however, can, wrongly, said uses state pattern , calling next() affects state of iterator object. but, imo, not state pattern implementation, doesn't change base object on operation has executed. wikipedia having fine java example of state pattern .

inotifypropertychanged - WPF Are NotifyPropertyChangeds marshalled to the dispatcher? -

if update property throws notifypropertychanged on thread other bound control's dispatcher update forcibly marshalled dispatcher? backgrounworker.run() => { blah.blahness = 2; // notifies property changed on bw, marshalled dispatcher? } yes, propertychanged event automatically marshalled ui dispatcher, don't need use invoke marshall explicitly. note true change notifications on scalar properties (i.e. propertychanged event). collection change notifications ( inotifycollectionchanged.collectionchanged event) don't work way, must raised on ui thread manually. wrote class automatically, can find here .

How to send xml data in request in JSP? -

i need send request xml servlet jsp. how can that? two ways (in case 'jsp' mean 'from browser'): with form submit - <form method="post" action=".."> . have prepare xml (with javascript example) , set in field request parameter, parse request parameter on servlet with ajax - using xmlhttprequest or framework jquery. can submit anything.

Python equivalent of php's virtual() -

do know if there python equivalent of php's virtual() ? my configuration python, djanogo, mod_wsgi, apache trying include script has examples php using above include , needs included in website's pages. thanks le: i'm including .cgi script the reference see is http://www.modpython.org/pipermail/mod_python/2004-january/014834.html which states in theroy can use apache 2.x chain handlers feature, more 1 content handler can process request. in theroy because i've read it, never tried =) from php manual, virtual() apache-specific function similar <!--#include virtual...--> in mod_include. performs apache sub-request . . . function supported when php installed apache module. here link info apache filters, meant "chain handling": http://httpd.apache.org/docs/2.2/filter.html the document should able processed mod_include after it's output mod_wsgi (or before, if that's want).

Is it possible to allow Flash Socket Client in Android Webview? -

in project, need data dynamically socket server. build following app: app |----socketserver |----webview   |----html     |----flash socket client my flash socket client need data user a's app, user b's app. connection ip list server. i sure :  1.the serversocket work. can data desktop.  2.flash work on desktop. can let flash data android app.  so, here question....  is possible allow flash socket client in webview? if true, how it? i used wrong way publish flash. must set swf permission level in access network only. adobe learning actionscript 2.0 in adobe flash / understanding security / about local file security , flash player my wordpress post has more information , example files .

context menu android -

i have listactivity in android. context menu open when press item of listview. the problem occurs when close context menu , press same item (the other items have no problems) if press text, context menu doesn't open, if press in white area contextmenu appears. ¿what's problem? oncreate method: lv = getlistview(); lv.setonitemclicklistener(new onitemclicklistener() { public void onitemclick(adapterview<?> parent, view view, int position, long id) { textview text = (textview) view.findviewbyid(r.id.label); if (!text.gettag().tostring().equals("-1")) { registerforcontextmenu(text); opencontextmenu(text); } } }); if want context menu listview , call registerforcontextmenu() in oncreate() of activity, passing in listview . here sample project demonstrating this, including showing how determine particular row in listview user long-t

c# - Windows application settings -

i have windows app written in c# (.net 3.5), , have settings.settings file holds application's settings. when this: properties.settings.default.hslastsend = datetime.now; properties.settings.default.save(); it gets saved , persisted when restart application, settings.settings file still has original value. can't seem find new value stored. have expected settings.settings file have new value when went it. is problem or normal? cheers in advance, stu setting.settings provide default values application, instead changed one, saved in binary file resources. can prove loading application after save changed settings, , changed value, if settings file has still "old" one. edit just note properties.settings. default . on xp machine should at: c:\documents , settings\"yourmachineusername"\application data\ regards.

java - Android, How to use readTypedList method correctly in a Parcelable class? -

i have 2 activities, in first one, instanciate arraylist of object myobject. in second activity, need arraylist. i've found tutorial : http://prasanta-paul.blogspot.com/2010/06/android-parcelable-example.html have implemented class liked it's explain. public class chapitre implements parcelable{ private int numero; private string titre; private string description; private int nbvideo; private arraylist<video> listevideo; public chapitre(int numero, string titre, string description, arraylist<video> listevideo) { this.numero = numero; this.titre = titre; this.description = description; this.listevideo = listevideo; this.nbvideo = listevideo.size(); } //getters , setters ... private chapitre(parcel source) { numero = source.readint(); titre = source.readstring(); description = source.readstring(); nbvideo = source.readint(); source.readtypedlist(listevideo, video.creator); } @override public int describecon

intellij idea - I want to change my shortcut settings in IntellijIdea -

i have xml file defines shortcut , have copied .intellijidea>config>keymaps , opened intellijidea , in settings tab have selected xml file problem shortcuts defined in file not working .. ideas ?? may have applications catch shortcuts in 'global' scope ?

javascript - Multipart form with data output to browser in jQuery/PHP. How to show input data? -

i'm trying create form 3 steps: fill form check if data correct (show input) thank you with advice of people here (regarding previous question) i've changed way of doing php + js-validation js + php process data. i need advice how deal now. previously i've had php if/else determined step show , kept data in $_session 2nd step , possible corrections in 1st step. now i'm wondering if need 2 ajax calls (first process data in order show - 2nd form step uses $_session display data input in 1st step; second generate e-mail , pdf given data - same $_session step2). maybe solution put data javascript 2nd step aswell , use $_session in final processing , generating. what's common/your approach problem? here's normal flow: user loads page form on it. fills out. submits it. you can validate every field fill out (instant feedback nice user's perspective) or validate using onsubmit event (in jquery $('#formid').submit). don'

string - how to convert EditText control's value in to float value in android -

im receiving value edittext control. , want value calculation need convert float value how can that? i tried below getting null pointer exception: float ip1=integer.getinteger(t1.gettext().tostring()); any soln? try this: string str = t1.gettext().tostring(); float ip1 = new float(str); system.out.println("float value = "+ip1);

Question about interfaces in C# -

here question... i work in telecom industry , have piece of software provides best network available given service number or site installation address. company uses network of wholesale provider , have our own network well. assess services customer might able get, call webservice find out services available on given telephone exchange , based on services available, need run checks against either our network or network of wholesale provider. my question how can modelled using interfaces in c#? software have not make use of interfaces , whatever classes there satisfy fact code cannot live outside classes. i familiar concept of interfaces, @ least on theoretical level, not familiar concept of programming interfaces. what thinking along following lines: create interface called iservicequalification have operation defined : void qualify(). have 2 classes called qualifybynumber , qualifybyaddress , both of these implement interface , define details of operation qualify. thinkin

multithreading - Scalable multi threaded String object in Java -

i'm doing little research server application i'm planning build. main function - lots of users able perform live editing. so looking options scalable string, kind of stringbuffer able handle lots(hundreds?) of threads working on @ same time quite large amount of text. instead of reinventing wheel, hope see libraries shared have such features :) couldn't find google. you might want take @ sourcecode of etherpad - it's java-based collaborative text editing web app, has have sort of string implementation allows concurrent write access separate regions of string, presumably without losing data. of course, whether fulfills performance requirements different matter...

jQuery Mobile: Styling content loaded through AJAX -

on particular jquery mobile page loading content through ajax post. replacing content in dom returned html. returned html contains form elements, jqm style. this used work in beta 1: $.ajax({ type: 'post', url: form.attr("action"), data: form.serialize(), success: function (response) { if (response.worked) { voucher_area.fadeout(function () { $(this).html(response.html).children().page(); $(this).fadein(); }); } else { notify.showmessage("could not update call voucher information: " + response.message, "error"); } }, datatype: "json", error: function () { notify.showmessage("fatal error."); } }); the call page on content style cont

iphone - How to get tag number of UIButton -

i using various button, , have set tag of xib files. , connected button single method -(void) note:(id)sender . now want retrive tag number.so can see button clicked -(void) note:(id)sender { notesclass *note = [[notesclass alloc] initwithnibname:@"notesclass" bundle:nil]; note.notetag = sender; nslog(@"%@",note.notetag); [self.navigationcontroller pushviewcontroller:note animated:yes]; } when print nslog output: <uibutton: 0x4e70350; frame = (227 119; 20 18); opaque = no; autoresize = rm+bm; tag = 1; layer = <calayer: 0x4e70480>> any 1 can please me. try following code, surely out uibutton *button = (uibutton *)sender; nsinteger btag = button.tag;

iphone - How to allow user to multiple photo selection to upload? -

i found flicker , dropbox allow upload multiple selection of photo , upload @ time. working on 1 application need such functionality. can me on or provide reference link take @ elcimagepickercontroller project on github. it's using assetslibrary framework build custom image selection controller

nlp - Algorithm to determine if a word could be English? -

i have list of strings need check against english dictionary. don't want start checking every piece of gibberish in list. first, want check if string english word. does know of algorithm or @ least rules need apply verify word? for example: no spoken word can start more 3 consonants, , if there are 3 initial consonants in word, first 1 must "s". finding word in data structure going fast (e.g. use bloom filter (mind false positives!), or set) chances not worth doing efficiency reasons. if want provide suggestions, @ peter norvig's spell checking implementation. if want go way, i'd construct frequencies of follows b existing text see whether given sequence contained within english words.

iphone - ModalView doesnt show up with tabbarcontroller -

i building app has login screen leads tabbar. followed example on how push modal view once launch app (as "sign in" page) , dismiss it. example --> show / hide tab bar from reason, it's not working - when launch app, see tabbar view 2 view controllers. no sign in page. here code: appdelegate: - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // override point customization after application launch. self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; uiviewcontroller *viewcontroller1 = [[firsttab alloc] initwithnibname:@"firsttab" bundle:nsbundle.mainbundle]; uiviewcontroller *viewcontroller2 = [[secondtab alloc] initwithnibname:@"secondtab" bundle:nsbundle.mainbundle]; uinavigationcontroller *secondnavcontroller = [[uinavigationcontroller alloc]initwithrootviewcontroller:viewcontroller2]; self.tabbarcontroller = [[uitabbarcontroller alloc] init]; s

javascript - Is it possible to bind multiple event handlers to JqGrid events without overwriting previous ones? -

for example, call default settings on every page load , bind function loadcomplete basic formatting grids. on pages, have additional logic execute @ same time, if set loadcomplete in grid definition, overwrite function set in defaults. is there way bind multiple handlers, or other way of executing necessary code? in advance. i think ask important problem existing in current version of jqgrid. it's difficult implement more 1 event handler in jqgrid now. problem not important small projects use jqgrid, can important in case want construct classes interprets jqgrid. current workaround ok, have restriction understand yourself. main problem in way can implement only one more additional loadcompleteex handler. what suggest usage of jquery.trigger or better jquery.triggerhandler . can use jquery.bind , jquery.unbind . in way can define number of event handlers works standard jquery events. for example, var grid = $("#list"); grid.bind('jqgridload

What is the difference between php and html file extensions? -

i having .php file following code. while changing extension of file .html behaving in same way. can explain following: why file behaving in same manner both extensions? what difference between .php , .html file extensions? .php file <html> <head> <!-- html code --> </head> <body> <?php echo "hello!" ?> </body> </html> the filetype way identify file, can't trust them. depending on web server configuration, see different results. .html use html no serverside code. .php used serverside php code , html if required. they can used anything, depends on setup.

.net - "Retrieving the COM class factory for component with CLSID {DB797690-40E0-11D2-9BD5-0060082AE372} failed due to the following error: 80040154." -

i pretty new here , please me below query . have referred xceedzip.dll in project . , created stepup file .msi file . , installed in 2 3 machines , happy result . and uninstalled older version , installed new version of tool bugs fixed . , when try using tool , getting below application error when unzipping file application . "retrieving com class factory component clsid {db797690-40e0-11d2-9bd5-0060082ae372} failed due following error: 80040154." in 1 machine when uninstall xceedzip.dll , issue got resolved (using regsvr32 /u "c:\windows\system32\xceedzip.dll") , did same resolution steps in machine without success . have application sharing same dll , if uninstall tool , getting same error shared application. please help, stuck here . want know root cause , fix . that error means "class not registered". sample gave ("regsvr32 /u") unregisters dll. did mean regsvr32 without "/u"? have expected "regsvr

html - How to choose the output format of the BlueGriffon editor? -

wikipedia says bluegriffon can create , edit pages in accordance html 4, xhtml 1.0, html 5 , xhtml 5. can't find choose output format, creates xhtml file when saving. give me hint? thanks, stephan as turns out can't. can pick new documents format, afterwards can't change.

javascript - Websockets message loss -

when using websockets noticed message loss. trying communicate between mobile safari (client) , c#(server). using superwebsocket (opensource) server, might server bug... but messages dropped when connection congested (when send alot of messages). "reaks" of udp me, remember reading somewhere web-sockets tcp. is there occasion might issue "send" command in javascript, , receiving side not message? i've been using websockets extensively in high traffic applications , in situations single lost message (in either direction) fatal. i've never seen messages lost, ever. however, recall seeing post or question somewhere same issue , person using superwebsocket server. strong suspicion there bug in superwebsocket. do see same problem if use non-mobile browser? it's possible ios brower (i assume that's mean mobile safari) has websocket bug. i've not extensively tested browser websockets. have extensively tested chrome, firefox (with webs

batch file - monitor http log using logparser -

i have situation have monitor execution time of webservices using logparer cannot run perfmon. becoz of unreasonable demands of client. i have query documneted want replace u_ex110713.log dynamic file name want monitor latest file. how make happen. open using dos batch file can schedule , pipe results batch alert if threshold increases 30 seconds. select to_string(to_localtime(to_timestamp(date, time)), 'yyyy-mm-dd hh:mm') timestamps, count(timestamps),avg(div(time-taken,1000)),max(div(time-taken,1000)),min(div(time-taken,1000)) \\server.qc.cgo.ca\c$\inetpub\logs\logfiles\w3svc1\u_ex110713.log group timestamps order timestamps asc honestly, if in place i'd end querying *ex*.log in directory, knowing processes in place zip , delete logs on monthly basis. you current system time , use create statement, i'm afraid knowledge isn't great, i'm not aware of way pull system time in utc (which, assuming you're using iis defaults, need file r

multithreading - How to stop all threads on KeyboardInterupt with Python's workerpool -

this job class: class queryjob(workerpool.job): "job downloading given url." def __init__(self, query): self.query = query # query we'll need download when job runs def run(self): try: // query something... except (exception, keyboardinterrupt, systemexit): # todo: keyboardinterrupt not seem work... print '*** shutting down ***' pool.shutdown() pool.wait() this how start it: # initialize pool, 12 threads in case pool = workerpool.workerpool(size=12) # loop on input file , create job download url on each line query in open(options.file): job = queryjob(query) pool.put(job) if i'd stop before it's finished, hit ctrl-c, nothing happens. try ctrl-c repeatedly no avail. finally, i'll ctrl-z , find process id , kill -9 stop threads. is want it? there no way catch keyboardinterrupt i'm trying above? note, i've tried other thing

c++ - Are multiple sequential array access optimised? -

will c++ compilers automatically optimise following code calculate 3*i once, , increment result, or must programmer code this? void writetoarray(int i, int a, int b, int c) { array[3*i][1]=a; array[3*i][2]=b; array[3*i][3]=c; } when enable optimization, compilers not precompute common index 3*i pointer array + (3*i)*sizeof (*array) .

Routes problem with path helper in rails 3 -

my route contains following: namespace :admin resources :retailers resources :drop_ship_orders collection post :edit_individual put :update_individual end member put :fire :fire post :resend end end end my view contains: <%= form_tag edit_individual_drop_ship_orders_path %> <table class="index" id='listing_orders'> <thead> <tr data-hook="admin_orders_index_headers"> <th><%= check_box_tag('test') %></th> <% if @show_only_completed %> <th><%= sort_link @search, :completed_at, t("activerecord.attributes.order.completed_at") %></th> <% else %> <th><%= sort_link @search, :created_at, t("order_date") %></th> <% end %> <th><%= sort_link @search, :number, t("order_number") %>&

Reuse of javascript code with asp.net -

i've taken on development of website written in asp.net. before taking on, have spent little time web applications. have no experience in area, hesitant criticise, feel website badly written. look @ following search results produced visual studio: \website\js\admin_userprofile.js(715):function sendinvite() { \website\js\admin_userprofilepro.js(745):function sendinvite() { \website\js\mycontactdetails.js(466):function sendinvite() { \website\js\mycontactdetailspro.js(466):function sendinvite() { \website\js\mycontactrequestspro.js(676):function sendinvite() { \website\js\mycontacts.js(239):function sendinvite() \website\js\mycontactspro.js(240):function sendinvite() \website\js\mygroups.js(103):function sendinvite() \website\js\myprofile.js(715):function sendinvite() { \website\js\myprofilepro.js(745):function sendinvite() { \website\js\search.js(55):function sendinvite() { \website\js\searchpro.js(55):function sendinvite() {

javascript - I want to cancel page submit ,on cancel action of confirm using C# in asp.net4.0 -

i want stop page submit on cancel action of confirm . what want achive , have form server validation, if user submit form without entering fields, should validate form , no confirm window should open. if user have filled fields , go on submit form, should confirm page submission (are sure want create user.), on clicking yes should submit page . on cancel should cancel page submission. my problem cancel still submitting form. my code in javascript follows: function confirmsubmit() { page_clientvalidate(); if (page_isvalid) { if(!confirm('are sure?')) { return false; } } } <asp:button id="btnsave" runat="server" onclientclick="javascript:return confirmsubmit()" onclick="btnsave_click" text="save" /> i have server code on btnsave_click. please me , have tried many things not sucesseed many thanks.. use on button client event onclientclick="ret

jquery - Page Switcher using the url (javascript) -

is possible switch pages depending on url using javascript? i working on large scale site requires switcher added users can switch between specific market sites depending if page viewing available on other market. what want able give user option view same page on market , if page not exist e.g. 400 page redirect specific markets homepage. does know if functionality possible using javascript? kind regards, b so, want link checker basically, checks if "page" on other market valid (does not redirect homepage), , give user option go page if valid? i suppose done using ajax. attempt follow link using ajax, , if response of homepage, don't show link, otherwise show link. in jquery (roughly): $.ajax({ url:[your link], datatype:'html', success: function(html){ if($(html).find("body.homepage").length == 0) alert('link good'); else alert('link bad'); } }); you might able in way catch 301/302 status redi

Parse a raw HTTP Response in C# to get the Status Code -

is there simple way parse http response string such follows: "http/1.1 200 ok\r\ncontent-length: 1433\r\ncontent-type: text/html\r\ncontent-location: http://server/iisstart.htm\r\nlast-modified: fri, 21 feb 2003 23:48:30 gmt\r\naccept-ranges: bytes\r\netag: \"09b60bc3dac21:1ca9\"\r\nserver: microsoft-iis/6.0\r\nx-po" i status code. not need turn in httpresponse object, acceptable parsing out status code. able parse httpstatuscode enum? i using sockets based approach , cannot change way getting response. have string work with. edit taking account " i using sockets based approach , cannot change way getting response. have string work with ". how about string response = "http/1.1 200 ok\r\ncontent-length: 1433\r\ncontent-type: text/html\r\ncontent-location: http://server/iisstart.htm\r\nlast-modified: fri, 21 feb 2003 23:48:30 gmt\r\naccept-ranges: bytes\r\netag: \"09b60bc3dac21:1ca9\"\r\nserver: microsoft-iis/6.0\