Posts

actionscript 3 - In FLash AS3, does extending an object use more memory, even if the object's methods aren't used? -

i creating object pool cache recyclable objects in memory @ outset of application in order avoid (as possible) performance issues caused gc running; if possible i'd minimize memory object pool reserves, i'm attempting pool generic forms of objects (with no methods) , casting generic variants more specific , complex object types extend generic form when want them on stage. trouble requires generic variant class import/extend movieclip (because more complicated objects movieclips , make use of displayobject methods)-- importing and/or extending class add memory object takes when instantiated if never uses methods inherited class? makes sense would, , light profiling seems suggest does, i'm not 100% certain. how large should 'empty' movieclip instance in bytes? thanks, ccj i no, @ least not significantly. if little, it's unlikely present problem you. there 1 'copy' of bytecode in memory anyway, footprint of individual object depend on number...

asp.net - C# WEb App Listview formatting -

building web app here , able alternate listeview rows. can give me sample code achieve this? 3 standard ones in vs2010 sucks , i'd able give goes along scheme of webapp. row 1= blue, 2=gray, 3=blue, etc. effect. thanks set colors in templates: edited add imagine header built in layouttemplate, can bold them there (see code added). you'll want use css - define various styles need in separate css file classes, , assign classes needed save excess typing. <asp:listview id="listview1" runat="server"> <layouttemplate> <table> <tr> <td style="font-weight:bold;">header</td> <td style="font-weight:bold;">header</td> </tr> <asp:placeholder id="itemplaceholder" runat="server" /> </table> </layouttemplate> <itemtemplate> <tr style="background-colo...

java - How to run outstanding tasks immediately after ExecutorService.shutdown()? -

i've got scheduledexecutorservice tasks scheduled execute in hour. how list of outstanding tasks can force them run immediately? i believe shutdown() wait hour , looks if shutdownnow() returns list of runnables cannot run() because runnable implementation checks executor state , when notices has shut down runnable refuses run. see scheduledthreadpoolexecutor.scheduledfuturetask.run() actual implementation. any ideas? i've taken mark peters' answer, implementing abstract methods, added thread-safety , tried respecting underlying scheduledthreadpoolexecutor configuration whenever possible. /** * overrides shutdown() run outstanding tasks immediately. * * @author gili tzabari */ public class runonshutdownscheduledexecutorservice extends abstractexecutorservice implements scheduledexecutorservice { private final scheduledexecutorservice delegate; private final scheduledthreadpoolexecutor scheduledthreadpoolexecutor; private final exec...

gpu programming - Memory Error in CUDA Program for Fermi GPU -

i facing following problem on geforce gtx 580 (fermi-class) gpu. just give background, reading single-byte samples packed in following manner in file: real(signal 1), imaginary(signal 1), real(signal 2), imaginary(signal 2). (each byte signed char, taking values between, -128 , 127.) read these char4 array, , use kernel given below copy them 2 float2 arrays corresponding each signal. (this isolated part of larger program.) when run program using cuda-memcheck, either unqualified unspecified launch failure , or same message along user stack overflow or breakpoint hit or invalid __global__ write of size 8 @ random thread , block indices. the main kernel , launch-related code reproduced below. the strange thing code works (and cuda-memcheck throws no error) on non-fermi-class gpu have access to. thing observed fermi gives no error n less 16384. #define n 32768 int main(int argc, char *argv[]) { char4 *pc4buf_h = null; char4 *pc4buf_d = null; float2 *pf2inx_d ...

ruby - Rails URL question -

if have users model, , individual user, say, person1, there way have url: www.myapp.com/person1 show www.myapp.com/users/person1 would? called? thank you! you should define route in routes.rb file: match "/:user" => "users#show" and you'll username given in params[:user] . need know kind of route override other routes defined, because match string, should @ least define constraints on username. for example if usernames matches regexp define constraint match "/:user" => "users#show", :constraints => { :user => /some-regexp/ } and don't forget set route last 1 in routes file, otherwise clash sure other routes. read this full reference

c# - WCF From Class Library - hosting in IIS and wsdl generation -

allmost day today trying research on wcf , 1 of aim create wcf service manually (or so). based on few articles on web on how structure wcf application have created contracts project contain service interfaces , implementation project. both have runtime.serialization i have created app.config <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.servicemodel> <behaviors> <servicebehaviors> <behavior name="fulfillmentservicebehaviour"> <servicemetadata httpgetenabled="true" /> </behavior> </servicebehaviors> </behaviors> <services> <service behaviorconfiguration="fulfillmentservicebehaviour" name="project.services.fulfillment"> <endpoint address="http://localhost:8080/services" ...

javascript - How to ignore class in jQuery? -

here simple example did: http://jsfiddle.net/j3rbx/ my purpose: when mouseover input, give me alert. seems fine, when mouseover text has class 'txt', doesn't give me alert. should do? just add .txt selector: $(".omg, .txt").bind("mouseover", function() { alert("i mouseover'ed omg class"); }) setting pointer-events: none; on .txt class works.