Posts

Showing posts from May, 2011

css - html multi select option how to mark selected options? -

i using normal select , mutliselect boxes on site. should use <option selected="selected"> or <option selected> selected items ? html5 spec : https://www.w3.org/tr/html5/forms.html#attr-option-selected the selected attribute boolean attribute. http://www.w3.org/tr/html5/infrastructure.html#boolean-attributes : the presence of boolean attribute on element represents true value, , absence of attribute represents false value. if attribute present, value must either empty string or value ascii case-insensitive match attribute's canonical name, no leading or trailing whitespace. conclusion : the following valid, equivalent , true : <option selected /> <option selected="" /> <option selected="selected" /> <option selected="selected" /> the following invalid : <option selected="0" /> <option selected="1" /> <option selected="fa...

ios - change date format in iPhone -

i trying since last 2 hours , finaly left out guys :p i need convert string mon, 14 may 2012, 12:00:55 +0200 date dd/mm/yyyy hh:ss format.. any kind of towards goal appreciated. what have tried i have tried using nsdateformatter unable figure out exact format of above date. [dateformatter setdateformat:@"eeeddmm,yyyy hh:mm:ss"]; how have tried , many other formats too eg: nsstring *finaldate = @"tue, 29 may 2012, 14:24:56 +0200"; nsdateformatter *dateformatter = [[nsdateformatter alloc] init]; [dateformatter setdateformat:@"eeeddmm,yyyy hh:mm:ss"]; nsdate *date = [dateformatter datefromstring:finaldate]; here date alwasys comes nil the important part of date formatting forgotten, tell nsdateformatter input language: nsdateformatter *dateformatter = [nsdateformatter new]; [dateformatter setdateformat:@"eee, dd mmmm yyyy, hh:mm:ss z"]; dateformatter.locale = [[nslocale alloc] initwithlocaleidentifier:@"...

Return int from dialog Android -

i have next code, i'm trying return value of "players" in method, based on user selection. problem can onclick method of dialog, idea? public int dialogoinicial(){ int players = 1; final string[] playersarray = {"1","2","3","4","5","6"}; alertdialog.builder dialog = new alertdialog.builder(this); dialog.settitle("nº "+getstring(r.string.players)+":"); dialog.setsinglechoiceitems(playersarray, -1, new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int player) { players = integer.parseint(playersarray[player]); } }); dialog.show(); return players; } this problem here return players executed while dialog being shown. simple solution make players variable class level variable instead of local variable function. can make function return void since won't able return anything. a...

c# - bind the button content which textbox has the cursor -

Image
i tried create on-screen keyboard. here want bind button content, textbox has cursor. public partial class current_cursor : window { public current_cursor() { this.initializecomponent(); } private void btn_a_click(object sender, routedeventargs e) { txt_diplay_1.text += btn_a.content; } } with above code can bind button content in first textbox. but can't bind value in textbox. please me. this implementation in wpf: <textbox height="23" margin="30,28,128,0" name="textbox1" verticalalignment="top" gotfocus="textbox1_gotfocus" /> <textbox height="23" margin="58,86,100,0" name="textbox2" verticalalignment="top" gotfocus="textbox2_gotfocus"/> backend: control ctrl = null; private void button1_click(object sender, routedeventargs e) { if (ctrl != null) { text...

ruby - Rails form_for own action routes -

i want modify action (submit) form_for helper <%= form_for(@rating, :as => :post, :url => demo_create_rating_path(@rating)) |f| %> <div class="field"> <%= f.label :value %><br /> <%= f.select :value, %w(1 2 3 4 5) %> </div> <%= f.hidden_field :article_id, :value => @article.id%> <%= f.hidden_field :user_id, :value => current_user.id %> <div class="field"> <%= f.label :description %><br /> <%= f.text_area :description, size: "100x5" %> </div> <div class="actions"> <%= f.submit %> </div> <% end %> this view , not work. all want is, can redirekt action after submit button error: actioncontroller::routingerror (no route matches {:controller=>"demo_ratings", :action=>"create", :article_id=>#<rating id: nil, value: nil, description: nil, article_id: nil, use...

.net - How to integrate httpRuntime maxRequestLength="8096" into app.config [Webservices] -

i have webservice waits xml arrive. today noticed, xml seems large. wanted add <httpruntime maxrequestlength="10096" usefullyqualifiedredirecturl="true" executiontimeout="120"/> app.config. unfortunately seems have no effect... here app.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <httpruntime maxrequestlength="10096" usefullyqualifiedredirecturl="true" executiontimeout="120"/> </system.web> <system.servicemodel> <client /> <standardendpoints /> <services> <service behaviorconfiguration="metadatasupport" name="iib.wohnpreis.wohnpreisserver"> <host> <baseaddresses> <add baseaddress="urltowebservice" /> </baseaddresses> </host> </s...

php - Yii CGridView - Custom Columns -

been looking solution add feature "custom columns"... meaning, present list of columns can show user , selects ones wants see , after selection table updated , add/removes needed columns. didn't find on google (perhaps has different name looking for...) anyone has idea on how can accomplished? thanks in advance! this not complete sample, can give clues on how implement it. you've define kind of form collect data how grid has rendered. recommend create cformmodel class if there more 3 input fields. create view file form , div or renderpartial of file containing grid: $form = $this->beginwidget('cactiveformext'); echo $form->errorsummary($model); echo $form->labelex($model,'column1'); echo $form->dropdownlist($model echo $form->error($model,'column1'); echo chtml::ajaxsubmitbutton('updategrid',array('controller/grid'), array('update'=>'#grid'), ...

Android VideoView: video goes black after being removed from parent view -

i playing rtsp live streaming source using videoview. works fine. the videoview inside fragment other elements, in 'normal' state, , trying implement fullscreen toggle button. to go fullscreen mode, removing videoview parent (a linearlayout), , adding linearlayout, added on top of else using getactivity().addcontentview(), here's code: layoutinflater lf = getactivity().getlayoutinflater(); vfullscreen = lf.inflate(r.layout.full_screen, myviewgroup, false); linearlayout fullscreencont = (linearlayout) vfullscreen.findviewbyid(r.id.fullscreen_container); ((viewgroup) vsplayer.getparent()).removeview(vsplayer); fullscreencont.addview(vsplayer); layoutparams params = new layoutparams(layoutparams.fill_parent, layoutparams.fill_parent); getactivity().addcontentview(vfullscreen, params); the problem video goes black once it's removed original parent view. what i'm trying achieve it's preserve video i...

asp.net mvc - MVC3 online game with standalone C++ server -

i'm interested in making web game using mvc3 (or 4) front-end website, since web framework i'm comfortable working with. sake of example, let's it's real-estate game (fun!..) i've thought long , hard how in scalable way, , i've arrived following little questions/dilemmas: 1) code game server logic actual web server itself. advantage: web server make direct use of entity framework, fantastic data manipulation. problem: not scalable - game pretty limited single server, potentially become over-populated , slow. potentially work if used each web server single 'realm', might put lot of load on database server if 10 'realms' running. 2) code game server logic separate c++ executable, perhaps on separate machine. advantage: scalable - have multiple web front end servers connected game server , not have outages if 1 web server down. problem: difficult communicate between web server , game server. presumably, i'd need setup ...

c# - Replace values in string -

i looking find matches in string, perform action on match, , replace original match. for example finding @yahoo in string, looking on matching after ampersand first white space. of course there can multiple values match on in single string each match. i'm thinking regex not sure on matching on after ampersand first white space (the regex expression this?). or other easier way of doing this? for this: looking on matching after ampersand first white space regexp @\s+ . reference: character classes .

internet explorer - IE7/8 Javascript Errors -

i'm getting javascript error whenever click title link; in essence line: document.write('<a href="javascript:myclick(' + (i) + ')">' + '[[title]]' + '<\/a><br>'); it's frustrating me in major way since other browsers except ie7/8 don't have issues. yet, majority of our visitors using ie7/8. problem occur in ie, little else, when debug javascript error far tell. thanks.. here's info: ie8 debugging: line: 1 error: function expected myclick(3) function expected jscript - window script block, line 1 character 1 ie9 debugging (in ie8 mode): myclick(7) script5007: value of property 'myclick' null or undefined, not function object script block (4), line 1 character 1 this line 1: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"><meta http-equiv="x-ua-compatible" cont...

layout - Android: Button representing "get my position!" -

Image
i have editbox, , on right side of editbox wan't put button representing "get position". user clicks on button, , application position , fills editbox it. i found compass , added on imagebutton, don't know if represent idea. anyone knows better button represent "get position"? thanks your button looks ok, , recognized users. if want system-default (the picture of drawalbe may differ on roms htc, samsung motorola etc) can with getresources.getdrawable(android.r.drawable.ic_menu_location) always check non-null here. can download standart android location button here , (ic_menu_location), fallback, if getdrawable() call fails

jsp - Redirecting a page with a Servlet -

i have application mix of plain old servlets , struts2. there search page used throughout application, made generic page. several search pages include generic page using jsp:include . problem : have 1 page being refereed 100 other pages so: <a href="/reports/reporta/selectionpagea.jsp">report selection </a> this simple jsp page not use struts2 want page include generic search page (which uses struts2). made mapping in struts.xml because generic search page requires several things built, using genericreportselection , prior displaying page: <package name="reporta" extends="struts-default" namespace="/reporta"> <action name="selectreporta" class="genericreportselection"> <result>/reports/reporta/selectionpagea.jsp</result> </action> </package> since don't want change other 100 pages added following servlet filter: if (httpreq.getservletpath().en...

XPath composition in XQuery -

i 2 xpaths, f(x) , g(y) , , xml x . x = <example> <a> <number>1</number> </a> <b> <letter>a</letter> </b> <c> <number>2</number> </c> </example> f(x) = /example/* g(y) = /number|/letter how write h(x) in xquery such h(x) = g(f(x)) g(x) ? don't know g(x) ahead of time cannot modify it. can modify f(x) if necessary. of needs happen in xquery because it's part of oracle query. h(x) = g(f(x)) = $data/example/*... ? i may confused question, if have understood correctly answer is let $f := ffff return $f/(gggg) where ffff , gggg expressions corresponding f(x) , g(y) but i'm assuming got example wrong, , when wrote g(y) = /number|/letter you meant g(y) = number|letter i.e. relative selection rather absolute selection.

javascript - UTM and GeoJson in openlayers -

i want implement example http://api.geoext.org/1.1/examples/feature-grid.html made of geoext , openlayers, feature grid populated of geojson file in development have geojson file utm format, single feature of file (the coordinates utm) {"geometry": {"type": "point", "coordinates": [7535169.36, 402844.172]}, "type": "feature", "properties": {"nombre": "la victoria", "codigo": "1702"}, "id": "1702"} i tried show points in code, can't see anything, code // create feature store, binding vector layer store = new geoext.data.featurestore({ layer: vecciudades, fields: [ { name: 'nombre' }, { name: 'codigo' } ], proxy: new geoext.data.protocolproxy({ protocol: new openlayers.protocol.http({ ...

javascript - Call JSON.stringify on all pre elements -

i'm trying json.stringify json text in <pre> elements in document specified class, , use google-code-prettify add syntax colouring. since don't know javascript or jquery i'm struggling - far have following: <body onload="prettyprint()"> ... <pre class="prettyprint lang-js">{...}</pre> ... </body> <script> $('[class="prettyprint lang-js"]').next().text("test"); // call json.stringify()? </script> the pretty-printing works, don't know how call json.stringify or select correct elements. more specifically, want <pre> elements in document "prettyprint lang-js" class, i'd replace text content results of calling json.stringify on text, , call google-code-prettify `prettyprint()' syntax colour it. you can use class selector select element class name. try this. $('.prettyprint.lang-js').each(function(){ var $this =...

android - Registering custom broadcast for a network event -

i trying use third party sip implementation in android app. since want support version older 2.3, cant use sip framework build gingerbread. need running service listen sip call? as far know, services not meant run constantly, , listening events incoming calls or sms done system itself, broadcast system-wide. please correct me if i'm mistaken.

.net - Escape & in App.config -

i have following piece of config in app.config file: <add key="connectionstring" value="initial catalog=mydatabase;data source=myserver;user id=myuser;password=!&mypass99;"/> the above connection string rejected visual studio intellisense. says entity mypass99 not defined. problem caused & in password. how escape it? escape ampersand using &amp; in place of & as fyi, see here further characters: what characters need escape in xml documents?

Android Notification Bar icon, is there a way to lock the location of the icon? -

i have service driven notification appearing. trying figure out if there way lock location @ icon appears. want ensure icon in same location on notification bar, no matter how many notifications appear before or after it. ideally, lock on right side of clock , wifi icons. in ice cream sandwich. know if possible? all. use notification.when propperty. can locate first or last using high values (long.max) or small ones (-long.max). allways talking left group.

android - Combining Menu and Tab -

i using "tab layout , listview" http://www.androidhive.info/2012/05/android-combining-tab-layout-and-list-view/ , "android menus" http://www.androidhive.info/2011/09/how-to-create-android-menus/ . merge them together, yet doesn't work. tab works, not menu. here codes. import android.app.activity; import android.content.intent; import android.os.bundle; import android.view.menu; import android.view.menuinflater; import android.view.menuitem; import android.widget.toast; public class optionmenuactivity extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); } // initiating menu xml file (menu.xml) @override public boolean oncreateoptionsmenu(menu menu) { menuinflater menuinflater = getmenuinflater(); menuinflater.inflate(r.layout.menu, menu); return true; } /** * event handling individu...

java - Recursion - Ship Battle -

i'm trying write little ship battle game in java . it 100% academic , made practice recursion, so... want use instead of iteration, if it's simpler , more efficient in most cases. let's down business. these rules: ships 1, 2 or 3 cells wide , placed horizontally only. water represented 0, non-hit ship cells 1, hit ship cells 2 , sunken ships have it's cells in 3. with rules set, i'm using following array testing: int[][] board = new int[][] { {0, 1, 2, 0, 1, 0}, {0, 0, 1, 1, 1, 0}, {0, 3, 0, 0, 0, 0}, {0, 0, 2, 1, 2, 0}, {0, 0, 0, 1, 1, 1}, }; it works pretty far, , make more user-friendly add couple of reports. these methods need them: given matrix, return amount of ships in it. same a), separating them state (amount of non-hit ships, hit , sunken ones). i need hand reports, , ideas. remember must done using recursion, want understand this, , way go practice! thanks lot time , patience :). it's not pos...

How does Javascript handle function parameters -

i had issue javascript goes against every bone of programming background. javascript me, i'm not surprised. i have function such... function x(param1, booleanparam, arrayparam){ .... } i getting runtime error saying arrayparam.length not defined. on debugging saw true , went find out why. turns out had forgotten comma in function call such... x(param1, true [arrayjunk]); the problem i'm having figuring out why call made @ all? why isn't compile error, how javascript see , think, "yeah, seems might work!" thanks in advance enlightenment can share! that's indexing expression. it's same syntax somearray[someindex] . it end passing undefined second parameter too, unless arrayjunk happens name of property of boolean primitives.

arrays - javascript push() failing -

i'm trying add cards array in deck object reason push() failing. had working earlier after making changes, have messed up. (the "testx" writes there debugging purposes) <!doctype html> <html> <head> <style> #mycanvas { border: 1px solid #9c9898; } body { margin: 0px; padding: 0px; } </style> <script type="text/javascript"> <!-- //draws game window.onload = function() { var canvas = document.getelementbyid("mycanvas"); var context = canvas.getcontext("2d"); //draws rectangles card var cardheight = 125, cardwidth = 80; context.beginpath(); //draws top row of 5 cards for(var x=0;x<5;x++){ context.rect(10+(x*(cardwidth+10)),10,cardwidth,cardheight); } //draws bottom row of 5 cards for(x=0;x<5;x++){ context.rect(10+(x*(cardwidth+10)),150,cardwidth,cardheight); } //draws deck contex...

Where clause in LINQ Query with Entity Framework -

i trying filter linq query, it's not accepting clause , have no idea kind of lambda function use. this want, throws error. var query = s in _db.students s.payments == null orderby s.lastname select s; assuming payments not field of students , rather property representing collection of payment items related student , try query instead: var query = s in _db.students !s.payments.any() orderby s.lastname select s;

c# - Code analysis complains that object can be disposed more than once. Why? -

i warning on responsestream in following function: private static string getresponsestring(webresponse response) { using (var responsestream = response.getresponsestream()) { if (responsestream != null) { using (var responsereader = new streamreader(responsestream)) { var strresponse = responsereader.readtoend(); return strresponse; } } } return string.empty; } i call function places like one: var request = (httpwebrequest)webrequest.create(uri); request.headers.add("authorization", "googlelogin auth=" + this.securitytoken); request.contenttype = "application/x-www-form-urlencoded"; request.method = "post"; request.timeout = 5000; // build post string ...

sql server - Finding duplicate entries SQL -

i have table of called member(unique id memberid) has numerous member duplicates first , last names being different, business name, address, city, state , zip codes same. records imported duplicates. how can run script find duplicate members businessname, addr1, city, state, , zip same. i want list them on page, can choose ones eliminate. any ideas how can create script this? many in advance, paul select * member m exists(select memberid member m2 (m.businessname = m2.businessname or (m.businessname null , m2.businessname null)) , (m.addr1 = m2.addr1 or (m.addr1 null , m2.addr1 null)) , (m.city = m2.city or (m.city null , m2.city null)) , (m.state = m2.state or (m.state null , m2.state null)) , (m.zip = m2.zip or (m.zip null , m2.zip null)) , m.memberid <> m2.memberid) with above query checking see if duplicate entry exists. subquery returns result if there copy member...

c# - How to make an object seek and decelerate to a stop exactly on a specified position? -

introduction i trying create script (c# script in unity) controls point , click behaviour gameobject. in essence, player - in end - control hot air balloon clicking on screen, whereby object start accelerate , move toward position of click. when @ specific distance of click position, hot air balloon should start accelerate in opposite direction (thus decelerating) , come complete halt @ position of click. i have created functional , commented script (found @ bottom of post), moves gameobject towards position of click @ constant speed, , then, when within specific distance, starts slow down until stopping @ point. i have created separately , functional script moves toward position of click while accelerating (getting kind of asteroids thrusting behaviour). can found @ bottom of post. the problem now problem i'm facing i've been working quite while find solution can take these 2 behaviours , implement them 1 working script, is, hot air balloon have accelerating be...

java - Spring MVC, Migrate @ExceptionHandler to HandlerExceptionResolver for a RESTful service -

background i have error message class: @xmlrootelement public class errormessage { private string message; public errormessage() { } public errormessage(string message) { this.message = message; } public string geterror() { return message; } public void seterror(string message) { this.message = message; } } this class has been assigned return value @exceptionhandler in spring mvc rest controller: @exceptionhandler @responsestatus(httpstatus.not_found) @responsebody errormessage handleexception(runtimeexception e) { return new errormessage("something went wrong"); } whenever client triggers runtimeexception after issuing request application/json accept header, receives response correct status code , matching json body: {"error":"something went wrong"} alternatively, xml body received if accept header application/xml : <?xml version="1.0" encoding=...

objective c - UITableView,unrecognized selector sent to instance -

i created tableview subview of 1 uiview(call uiviewa), , uiview subview of main viewcontroller. when tried implement function " didselectrowatindexpath " of tableview, program crashed information "unrecognized selector sent instance". the delegate of tableview set "file's owner" uiviewa. tried add exception breakpoints showed exception points return uiapplicationmain(argc, argv, nil, nsstringfromclass([appdelegate class])); which in main.m if want create custom table view, should subclass of uitableview . instead creating subclass of uiviewcontroller . obviously uiviewcontroller has no method named didselectrowatindexpath (and suppose neither uiviewa has it). that's cause of crash. table view programming guide

Twig {% if myId in myArray %} not checking for unique values? -

i have id need check against array of ids. when this: {% if myid in myarray %} it works if i'm checking '10' in array of ' 10 , '11' , '12' . however, if check '1' in same array of '10','11','12', results in true since '1' present in values listed ( '0' or ' 2 ' result true in case). i'm wanting result false since exact integer ' 1 ' not present in array. is there way have twig check unique or exact integer values when using function? as maerlyn pointed out source code on in keyword of twig, visible problem caused values being strings. indeed twig considers '1' present in '12' because doesn't know '12' integer, contrain 'number1' or other string. so solution convert array contents integers first. send twig.

mysql - java.net.ConnectException: Connection timed out, Tomcat 7 and iptables -

i experiencing weird problem.. basically our java developer said in java application services access db write on error: java.net.connectexception: connection timed out java.net.connectexception: connection timed out @ java.net.plainsocketimpl.socketconnect(native method) @ java.net.plainsocketimpl.doconnect(plainsocketimpl.java:351) @ java.net.plainsocketimpl.connecttoaddress(plainsocketimpl.java:213) @ java.net.plainsocketimpl.connect(plainsocketimpl.java:200) @ java.net.sockssocketimpl.connect(sockssocketimpl.java:366) @ java.net.socket.connect(socket.java:529) @ java.net.socket.connect(socket.java:478) @ sun.net.networkclient.doconnect(networkclient.java:163) @ sun.net.www.http.httpclient.openserver(httpclient.java:394) @ sun.net.www.http.httpclient.openserver(httpclient.java:529) @ sun.net.www.http.httpclient.<init>(httpclient.java:233) @ sun.net.www.http.httpclient.new(httpclient.java:306) @ sun.net.www.http.httpclient.new(httpclient.java:323) @ sun.net.www.protoco...

CSS border jagged with different sized/color borders -

it seems when have element different sized/colored borders, can see strange jagged line happening. never noticed before, looking @ vimeo's super hot new design when noticed (don't want "glitch") weird occurrence. so if had div hanging out, styled in below, you'll notice pixel stepping (almost it's set inset, rather solid...) div { height : 25px; width : 50px; background : #eee; border-style : solid; border-color : green; border-left-color : black; border-width : 3px 3px 3px 15px; } anyone notice this/ know why happens? the reason happens because it's creating 'frame' around box. think of wooden picture frame, don't use 4 rectangular pieces of wood create frame, use 4 trapezoidal pieces , put them together. when set larger width on 1 side, diagonally rendering inward towards corner of box. the reason looks bad because antialiasing between borders h...

asp.net mvc 3 - Instantiating a class dynamically c# -

i working on developing plug , play framework in asp.net mvc whereby can define modules separate projects main project. so, developer can create many modules want. what need able update settings of of such modules. that, in main project, defined base class common settings plus each module has own custom settings. when there edit on module, have instantiate instance of module in main project. but, main project has no knowledge of modules. how achieve this? thanks! you can use dependency injection , inject modules application @ composition root. per configuration can use code or xml (configuration file). can auto wiring, late binding etc depending on need. you can have initializers @ each module whenever register module, should initialize registered modules , inject dependencies etc.

Zooming In On a Java Graphic -

i making graph of sound speed profile java graphics. have static graph drawn (the 1 pops when run program), trying implement such if user clicks on either x or y axis, zoom in can @ sound speed profile more closely. don't have sound speed profile in graph yet (i know how that, i'm saving effort of drawing until have zoom feature figured out). have ideas how make work? have seen people trying use affine transform similar tasks, not sure that's right thing or if i'm doing correctly. particular code @ paint(), zoomin(), , mouseclicked() method. ideas apprecaited! public class soundspeedprofile extends jpanel implements mouselistener, actionlistener { private string title; private string subtitle; private jframe frame; private graphics g; . . . /**draws sound speed profile , surrounding graphics * @param graphics g - graphics object */ public void paint(graphics g){ this.g = g; super....

python - libjpeg.so.62: cannot open shared object file: No such file or directory -

i trying image processing python , pil. having problem wouldn't correctly import _imaging folder did reinstall , getting problem: libjpeg.so.62: cannot open shared object file: no such file or directory i did apt-get remove python-imaging in command line , apt-get install python-imaging , won't work in eclipse. tips? try installing libjpeg62 module in ubuntu, libjpeg.so.62 file part of it.

amazon ec2 - Rails Resque workers in production - where to keep Redis server? -

i have rails app configured resque , redis. using god start/stop workers. far using redis-to-go, since moved ec2 high-memory instance, think better idea run redis server on ec2 instance , have things happening there. is idea? we run our redis instance (for resque) on same server rest of our app. it's been great, , uses little memory. process 5000 jobs day. either way, assuming using redis resque, we've done extremely low overhead in cpu or memory. redis efficient resque storage.

lucene - Get Latest N Documents from Solr -

i have standard solr 3.6 index , looking latest n documents (date ascending indexing them). this site helpful not i'm looking for. i looking this: localhost:8080/solr/select/?q=greekbailout&wt=json; date asc basically, query whatever json output , latest n submitted documents index. run before? solr query using date field n documents returned in results localhost:8080/solr/select/?q=greekbailout&wt=json&sort=date asc&rows=n default schema of solr has field called timestamp, stores time @ particular document created or modified, if date field doesn't quite store , requirement, can use timestamp.. replace date timestamp

web services - How to use Spring Autowired in a custom cxf interceptor? -

i seem run small issue when using @autowired custom cxf interceptor. use case want log soap messages , send these using amqp system. process works normal services etc. whatever do, needed properties not autowired , stay null. i checked spring di log , context scanned , pickedup, missing? is possible in cxf interceptors? @component public class logininterceptor extends abstractsoapinterceptor { private @value("#{rabbitmqproperties['rabbitmq.binding.log.soap']}") string binding; @autowired amqptemplate amqptemplate; public logininterceptor() { super(phase.receive); } @override public void handlemessage(soapmessage soapmessage) throws fault { logit(soapmessage); } private void logit(soapmessage message) throws fault { // rest of code omitted...!!! amqptemplate.convertandsend(binding, buffer.tostring()); } } you can't mix @ininterceptors (a cxf annotation) and @...

ios - UIAutomation and NSNotification -

i want able use uiautomation test app. problem i'm running is, need download allot of data network. there way pause uiautomation script until nsnotification posted, or need delay() longer think necessary download data. waiting set amount of time isn't preferable because data doesn't need re-downlaoded. any / links appreciated. uiautomation has nifty function called waitforinvalid() . if you've got progress bar or displayed , removed after data done downloading, use that. this works case in user has data , don't show ui, since function return.

haskell - reactive-banana throttling events -

i implement type of throttling of events in reactive-banana. should work such event not let through if arrives @ less delta seconds last event passed through. if not let through stored , fired after delta seconds last fired event. below program implements lists of time stamped numbers. possible translate reactive-banana ? also, in reactive-banana how fire event x seconds after other event comes in ? module main import data.list -- 1 second throtling -- logic never output value before 1 second has passed since last value outputed. main :: io() main = print $ test [ (0.0, 1.0), (1.1, 2.0), (1.5,3.0), (1.7,4.0), (2.2, 5.0) ] --should output [ (0.0, 1.0), (1.1, 2.0), (2.1,4.0), (3.1, 5.0) ] test :: [(double,double)] -> [(double,double)] test list = g v (concat xs) (v, xs) = mapaccuml f (-50,nothing) list g (t, x) ys = ys ++ [ (t+1,x) ] g _ ys = ys f (lasttime, holdvalue) (t,x) = if t > (lasttime+1) ...

mercurial - Script to adjust history in an RCS/CVS ,v file -

in preparation migration mercurial, make systematic changes many thousands of ,v files. (i'll editing copies of originals, hasten add.) examples of sorts of changes i'm after: for each revision message begins text indicates known username (e.g. [fred bloggs] ), if username in comment matches author in ,v file, delete unnecessary username text commit message if ,v contains useful description, append commit message revision 1.1 (cvs2hg ignores description - lots of our cvs files came rcs, easy put initial commit message description field mistake) for edits made shared user accounts, adjust author, depending on contents of commit message. things i've considered: running 'cvs log' on each individual ,v file - parsing output, , using rcs -m change history. problems include: there doesn't seem way pass text file rcs -m - if revision message contained singled and/or or double quotes, or spanned multiple lines, quite challenge quoting correctly in sc...

Fluent NHibernate automapping class conventions aren't being applied to entire class hierarchy -

i'm trying automap simple inheritance hierarchy fluent nhibernate, , need have different name each table class (underscores instead of pascal case). seems obvious place use conventions. want use table-per-subclass strategy, combination seems causing me issue: convention applied base class of hierarchy. here's automapping: automap .assemblyof<baserule>() .includebase<baserule>() // "baserule" abstract class .conventions.add( defaultcascade.all() ) .conventions.add<oracletablenameconvention>() how want classes mapped (class name -> table name): abstract class baserule -> base_rule class numberrule : baserule -> number_rule class patternstringrule : baserule -> pattern_string_rule what i'm getting: baserule -> base_rule numberrule -> numberrule patternstringrule -> patternstringrule as can see, base class being changed. here's existing convention, can see how i'm defining i...

php - Infinite loop on login redirect -

i have login script works me, goes infinite loop on redirecting after checking cookie stored login. browser report following: "firefox has detected server redirecting request address in way never complete." others have reported issue too. below key elements of login process. wonder if can see issue process/script. thanks, nick first @ top of each page protected: <?php session_start(); $_session['url'] = $_server['request_uri']; require('login/config.php'); require('login/functions.php'); if (allow_access(users) != "yes") { include ('login/check_login.php'); exit; } ?> then in check_login.php : <? session_start(); //check see if user has open session if (($_session[user_name] != "") && ($_session[password] != "")) { header("location:$_session[redirect]"); exit; } $lr_user = $_cookie['lr_user']; $lr_pass = $_cookie['lr_pass']; //...