Posts

c# - Saving a cache object when a WCF webservice is ended -

i have simple wcf webservice 2 methods : 1 save/updates obect in cache , other 1 deletes it. how can save object when close webservice server. using cacheitemremovedcallback doesn't work because object removed everytime update it. using global.asax.cs.application_end() doesn't work because cache cleared time here. using dispose() method method doesn't work because called every time call has finished. [servicecontract] public class webservice { [operationcontract] public void test(string message) { list<string> logs; logs = httpruntime.cache.get("logmessages") list<string>; if (logs == null) { logs = new list<string>(); logs.add(message); } else logs.add(message); httpruntime.cache.insert("logmessages", logs, null, cache.noabsoluteexpiration, cache.noslidingexpiration, cacheitempriority.notremovable, null); } [operationcontra...

Oracle SQL Statement Order By -

i have got following query: column index_name format a15 heading "index_name" column column_name format a15 heading "column_name" column column_position format 999999 heading "column_position" select index_name, column_name, column_position all_ind_columns table_owner = 'abc' the returned result follows: index_name column_name column_position --------------- --------------- --------------- sys_c007963 c_uname 1 order_line_pkey ol_id 1 order_line_pkey ol_o_id 2 orders_pkey o_id 1 item_pkey i_id 1 customer_pkey c_id 1 country_pkey co_id 1 cc_xacts_pkey cx_o_id 1 author_pkey a_id 1 address_pkey addr_id ...

ruby on rails - get a model from other controller in emberjs in view -

i got problem bigger project in ember, want information model when i'm in template not associated controller model. i got these templates: <script type="text/x-handlebars" data-template-name="community"> {{model.name}} {{outlet}} </script> //users subroute community <script type="text/x-handlebars" data-template-name="communityusers"> //assume want display community here like: {{community.id}} {{#each user in model}} <li>{{user.name}}</li> {{/each}} </script> in routes fetch appropriate models community got 1 community , in communityusers have array users does know best solution this? i got problem bigger project in ember, want information model when i'm in template not associated controller model. assuming communities this: app.communityroute = ember.route.extend({ model: function() { return app.community.find(); } }); further assuming want...

loops - Knowing when to insert a comma in ColdFusion -

every often, either in display code or in assembling string, i'll making list , need figure out how insert commas in list. this how it: <cfset hide_comma=true> <cfloop ... kind of loop ...> <cfif hide_comma><cfset hide_comma=false><cfelse>,</cfif> .... rest of code here ... </cfloop> i'm wondering if there's cleaner way of doing this. realize 1 option following: <cfset output_as_array = []> <cfloop ... kind of loop ...> <cfset loop_output = ""> ... rest of code here, append output loop output instead ... <cfset arrayappend(output_as_array, trim(loop_output))> </cfloop> <cfoutput>#arraytolist(output_as_array, ", ")#</cfoutput> but doesn't seem clearer. in django, in contrast, each loop has built in counter can write like: {% ... kind of loop ... %} {% if not forloop.first %},{% endif %} ... rest of code here ... {% endfor %...

javascript - removeattr scroll-sel and Add atriv -

i javascript remove <ul class="selection-list sel-scroll sel-items js-items-unchecked"> remove (sel-scroll) and add code below that this code <link rel="stylesheet" type="text/css" media="all" href="js/jscrollpane.css" /> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/jquery.mousewheel.js"></script> <script type="text/javascript" src="js/jscrollpane.js"></script> <script type="text/javascript"> $(function() { $('#pane1').jscrollpane({showarrows:false,scrollbarwidth:10, scrollbarmargin:20}); }); </script> it looks you're using jquery. therefore can do: $('#elementid').removeclass('sel-scroll'); also into: $('.sel-scroll').removeclass('sel-scroll');

c# - Upgrade from Unity3D 4.1.5 to 4.2 causes CS0433 build error -

i trying upgrade 4.1.5 4.2. when , open project created under 4.1.5 " assets/uniject/interface/iresourceloader.cs(8,17): error cs0433: imported type `system.xml.linq.xdocument' defined multiple times " build error. file contains interface 1 property being xdocument. i've google'd quite bit , don't see explanation/solution of problem. the system.xml.linq.dll referenced in each of generated projects, solution building prior upgrade without problems. i have uninstalled everything, wiped \users\*\appdata\roaming\unity , c:\program files (x86)\unity clean , rebooted before doing fresh install , still same build error. i've blown away project gotten fresh copy source control no love. , i've uninstalled 4.2 re-installed 4.1.5 , project builds fine on clean copy (since 4.2 upgraded unity files incompatible 4.1.5 files). what has changed, , how fix can use latest version of unity? thanks, mike

java - i18n on dropdown menu using s:select tag -

this question has answer here: struts select tag localization implementation 2 answers i have dropdown menu in jsp page implemented <s:select> tag <s:select name="priortoapplyinginfo.userprofile.phonenumbers[0].type" listkey="key" listvalue="value" list="phonetypes" headerkey="0" headervalue=""/> now values in dropdown menu list phonetypes implemented hashmap in .java file. phonetypes = new linkedhashmap<integer, string>(); phonetypes.put(new integer(1), gettext("home")); // phone contactbook category business phone phonetypes.put(new integer(daohelperfactory.owner_profile_phone_category), gettext("work")); phonetypes.put(new integer(3), gettext("mobile")); phonetypes.put(new integer(daohelperfactory.owner_profile_fax_category), gettext("fax...