Posts

Showing posts from July, 2012

java - take an object and export outside of its class -

i have class , want export outside of (to class), object httpdstatistics stats created in it. best way make this? package org.w3c.jigsaw.status ; import java.util.date; import org.w3c.tools.resources.attribute; import org.w3c.tools.resources.attributeholder; import org.w3c.tools.resources.attributeregistry; import org.w3c.tools.resources.framedresource; import org.w3c.tools.resources.integerattribute; import org.w3c.tools.resources.resource; import org.w3c.tools.resources.store.resourcestoremanager; import org.w3c.www.http.http; import org.w3c.www.http.httpmessage; import org.w3c.jigsaw.frames.httpframe; import org.w3c.jigsaw.http.reply; import org.w3c.jigsaw.http.request; import org.w3c.jigsaw.http.httpd; import org.w3c.jigsaw.http.httpdstatistics; import org.w3c.jigsaw.html.htmlgenerator; /** * class exports server statistics. * makes available bunch of various parameters current * server, , uses refresh meta-tag (as threadstat) * make them redisplay. * <p>this benefit being...

Django ManyToMany Queryset AND instead of OR -

i have following query: things = thing.objects.filter(tags__in=selected_tags).distinct() if selected_tags looks this: selected_tags = [<tag: tag1>, <tag: tag2>] then things contain thing has tag1 or tag2. i want query gives me things have tag1 , tag2 (and maybe tag3, not necessarily). best way this? __in inherently or-based. literally says pull out row has 1 of these tags. create , based query, you'd need filter each tag individually: thing.objects.filter(tags=tag1, tags=tag2, ...) that's not ideal, , unfortunately, can't use expanded dictionary in scenario because of key's same. other option use q : from django.db.models import q query = none tag in tags: if query none: query = q(tags=tag) else: query &= q(tags=tag) things = thing.objects.filter(query) it's bit convuluted, if need dynamically create query (instead of hardcoding each tag you're searching for), it's best bet.

struts2 - struts 2 file upload and form data -

action class in struts 2 model driven bean. in form submit there several form data(text field) , file upload tag. when try remove filetags , submit bean value populating if include file tags form data not been populated. possible send both multiple file upload , form data server in single form submit? it working fine problem in firebug resend request. when actual formsubmit working fine while resending same request not working.

sql - Using a view with no primary key with Entity -

i started on project converting application raw ado.net , embedded sql entity. ran in problem 1 of views used application. view has no primary key , no column (or combination of columns) uniquely identifies row. here select view created with: select filingmonth, ceil(filingmonth / 3), licnum, filingyear, decode(grouping(insurername), '1', '- insured -', insurername), insurername, policylinecode, linedescription, sum(nvl(grosspremium, 0)), sum(decode(taxexempt, 1, grosspremium, 0)), trunc( case when ( b.rsn not null or a.zeroreport = 1 ) , b.datereceived null a.datereceived else b.datereceived end), sum(aip.iscompanyadmitted(b.naiccocode, b.naicalienid)), a.insuredid aip.slbtransinsured left outer join aip.slbtransinsurer b on a.insuredid = b.insuredid left outer join aip.slblinecodes c on b.policylinecode = c.linecode a.submitted = 1 , a.entryincomplete = 0 group licnum, filingmonth, filingyear, trunc( case when ( b.rsn not null or a.zeroreport = 1 ) , b.datereceived ...

android - Approach to display dashboards on mobile devices? -

my team , working on app (both ios & android) uses lot of functionality of 1 web apps implemented. web application (asp.net) renders , creates dashboards (of custom dimensions, specified end user). dashboards use different libraries widgets (fusioncharts, googlecharts, standard .net controls...) anyway, part of functionality of mobile app display dashboards specific each user. question is: best way approach requirements? we've brainstormed here , came couple: one generate screenshot of dashboard on .net application , display screenshot on mobile app. however, approach basic , not provide interactivity. another consists of recreating each dashboard on mobile apps. problem involves recreating scratch , issues related inconsistencies between 2 versions of dashboard (mobile version vs web version) arise. loading dashboard on mobile app using url of dashboard. personally, think 3rd approach suitable, since there not coding needed, load existing dashboard using respective url...

symfony - Does Symfony2 logfile rotation require SIGHUP or restart? -

i'm working logrotate configuration file rotate symfony2 logs. have restart anything? standard symfony2 application, don't see keeps logfile file descriptors open. here's came rotate logs: /user/app/logs/*.log { missingok notifempty } if there long-running process (a daemon) used symfony2 framework, i'd imagine process have restarted during log rotation. php applications use "shared-nothing" approach - each , every page load starts scratch, no open file descriptors or similar. when using fastcgi approach, keeps php engine being re-executed each request, still case. so no, shouldn't need restart - new requests output new log files no effort needed. the 1 situation might not case when using worker processes (for instance, servicing queues), that's you'd aware of if using it.

asp.net - getting container element with jquery -

i'm using asp.net repeater control output following markup: <div class="detailsitem"> <table style="width:100%;border: solid green 1px"> <tbody> <tr> <td colspan="3" style="text-align: right"> <a href="javascript:edititem($(this).closest('.detailsitem'));">edit</a> </td> </tr> </tbody> </table> </div> i thought code $(this).closest('.detailsitem') give me containing div. if alert on what's passed edititem, javascript code showing up. not sure comes from. i've tried various combinations of .parent etc no luck. i found this post similar, didn't seem me out. i'm assuming problem might function call. what missing? many thanks, always! you need use class anchors in repeater <a href="javascript:void(0);" class="edit">edit</a> in ready event, attach click event handler anchor's: $(...

indexing - How does MySQL use ORDER BY when referencing an indexed prefix on VARCHAR? -

i'm curious how handled. have varchar(255) column named title has first 10 characters indexed. if create mysql query orders title, take advantage of index solely, or ignore it, or have issue command use index? for example let's have 2 title items named: this same thing same thing different the first 10 chars same, how mysql handle that? use prefix index first 10 chars , row row index afterwards? well, it's said that: the index can used if order not match index exactly, long of unused portions of index , order columns constants in clause. but suggest checking query explain, see path optimizer choose.

javascript - Autocomplete/sql to fill input field 2 after onblur on input1 -

Image
okay, here goes. have 2 input fiels. first 1 works charm, autocomplete huge database name, onblur after selecting it, should automatically fill input field 2 via php script, searches selected string in database , populates input field many hits gets. how can that? so: if first input's autocomplete finds string, it's stored (with multiple id's on same name), should id's. if there no string found in db on first input, have autocomplete written multi selecting id's manually on second box, submitting them. not important now. again, how can populate second input given string found in database first input? far have barebone: <input type="text" size="20" onblur"" id="firstinput" name="firstinput"> <input type="text" size="40" value="" id="manualorautogroup" name="manualorautogroup"> php json_encodes results: $lolz = array(); while( $row = mysql_fetch_assoc($...