Posts

silverlight - IApplicationService in WPF -

i'm new wpf , i'm migrating project silverlight wpf 4.0 , problem can't find equivalence iapplicationservice , iapplicationlifetimeaware . the library , namespace system.windows loaded, yet have error message; "the type or namespace name 'iapplicationlifetimeaware' not found'. any idea missing please. thanks finally found there's no direct migration , need recoded. if implementing iapplicationservice , iapplicationlifetimeaware access statservice() , can make method public, without argument.. public void startservice() { . . } and call method during instanciation in app.xaml.cs public app() { this.startup += this.application_startup; this.exit += this.application_exit; initializecomponent(); offlinedatabaseservice x = new offlinedatabaseservice(); x.startservice(); }

c# - Minimizing WCF service client memory usage -

i'm implementing wcf service client aimed test several service methods. that's done using standard generated proxy class created add web reference (inherited system.web.services.protocols.soaphttpclientprotocol ). need execute type of requests many times simultaneously see how affect server performance (something capacity testing server infrastructure). here's problem - each of responses these requests pretty large (~10-100 mb) , see few calls like // parameterslist.count = 5 foreach(var param in parameterslist) { var serviceresponse = servicewebreferenceproxy.executemethod(param); // serviceresponse not saved anywhere else, // expected gc'd after iteration } causes private bytes of process jump ~500 mb of memory , working set 200-300 mb. suspect running them in parallel , increasing iterations count 100-200 needed cause stackoverflow/outofmemoryexception. how can done then? i'm expecting removal of assigning service method response variable help...

ios - Implement the Flash button animation as in iPhone camera in my app? -

im developing camera app, want implement same animation happens in default iphone camera app when click on flash button, i.e once click on falsh button, can see other 2 buttons animating, , once u click 1 button again animates , hides. how can this? thanks in advance.. take @ ddexpandablebutton able , includes example code creating flash button. https://github.com/ddebin/ddexpandablebutton

python - Failed to draw a row of rectangles (pygame) -

Image
i'm trying draw simple row of rectangles, somewhow when execute code doesn't draw screen. can't figure out why. overlooking obvious, need point me it. my code: import pygame # define colors black = ( 0, 0, 0) white = ( 255, 255, 255) green = ( 0, 255, 0) red = ( 255, 0, 0) pygame.init() # set width , height of screen [width,height] size = [255,255] screen = pygame.display.set_mode(size) pygame.display.set_caption("my game") width = 20 height = 20 margin = 5 x = 0 #loop until user clicks close button. done = false # used manage how fast screen updates clock = pygame.time.clock() # -------- main program loop ----------- while done == false: # event processing should go below comment event in pygame.event.get(): # user did if event.type == pygame.quit: # if user clicked close done = true # flag done exit loop # event processing should go above comment # game logic should go below comment...

bash - sed replace in conf 2 different patterns -

i want replace 2 entrys in conf file sed # set server /bin/sed -i 's/server: 127.0.0.1/server: xxx.xxx.xxx.xxx/' /etc/cobbler/settings # set next server /bin/sed -i 's/next_server: 127.0.0.1/next_server: 192.168.122.1/' /etc/cobbler/settings for reason changes the primary entry on both, why ? use 2 different patterns check "server" & "next_server" also know how change quoted string pattern #change default password /bin/sed -i 's/default_password_crypted: "$1$mf86/uhc$wvcicx2t6crbz2onwxyac."/default_password_crypted: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/' /etc/cobbler/settings thx just add ^ beginning of regexp require line starting string. # set server /bin/sed -i 's/^server: 127.0.0.1/server: xxx.xxx.xxx.xxx/' /etc/cobbler/settings # set next server /bin/sed -i 's/^next_server: 127.0.0.1/next_server: 192.168.122.1/' /etc/cobbler/settings

c# - SqlDataAdapter as Object value? -

hello guys have got sqldataadapter finds highest value: datatable dt = new datatable(); sqldataadapter sda = new sqldataadapter("select max (id_k) klient", spojeni); sda.fill(dt); spojeni.close(); if selects need result add +1 , insert object value parameter. prikaz2.parameters.addwithvalue("@val4", ); // here should sda +1 i tried insert object value whole sqldataadapter nonsense. there way achieve that? thanks in advance you can use sqlcommand.executescalar() method getting value because; executes query, , returns first column of first row in result set returned query. since command returns maximum value of id_k column, want. sqlcommand command = new sqlcommand("select max (id_k) klient"); sqldataadapter sda = new sqldataadapter(command, spojeni); int max = (int)command.executescalar(); prikaz2.parameters.addwithvalue("@val4", max + 1);

iphone - Recognise a phrase from voice input only if the intensity hits certain decibel [iOS] -

i've had browse around topics in group trying see if question has been addressed before, couldn't find exact thing. so, apologies if old hat. please excuse newbie nature of question. how can have ios app recognise phrase voice input if intensity hits decibel? ex:when user says "hello there", should capture voice , check phrase make sure whether user said hello there or else. perhaps, openears might solve me. how can measure intensity of voice? voice input must considered if phrase "hello there" spoken @ 110db. if not, should ignore. can done openears? please guide me suggestions openears developer here. openears' pocketsphinxcontroller class (the class speech recognition) has property pocketsphinxinputlevel can read on secondary thread find out input power. there's info in docs , copy-paste-able example of usage in openears sample app should started. decibel levels use same convention audioqueue decibel readings give decibels negative...