Posts

html - JavaScript Error for OnClick -

here html: <%@ page language="c#" autoeventwireup="true" codebehind="webform2.aspx.cs" inherits="davincisapp1.webform2" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <link href="~/styles/stylesheet1.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="scripts/jquery-1.4.1.min.js"></script> <%--<script type="text/javascript" src="scripts/motion.js"></script>--%> <script type="text/javascript"> $(document).ready(function(){ /* make sure contact form hidden when page loads: */ $('div#contact-form').hide(); $('a#contact-button').toggle...

Asynchronous socket callbacks do not work in Mono/Linux -

i'm exploring porting .net c# application windows linux using mono. problem i'm stuck asynchronous tcp socket calls not work. means can send data no problems i'm seem able receive first response socket (via socket.beginreceive()). next beginreceive() puts thread wait state. in possible in principle our socket code contains bug it's been working flawlessly in windows years. thank you this works fine mono-2-10 branch (soon released mono 2.10) , master. the mono 2.6.7 shipped ubuntu fails , mono 2.8. i've found problem , testing fix. . next releases in 2.6.x series have fix (also 2.8.x if there's any, since moving 2.10 in few days). btw, should report problems in mono following http://mono-project.com/bugs instead of here.

entity - Deleting entities from app engine -

i'm going deleting entries python app engine server this: try: while true: q = db.gqlquery("select __key__ sampledata") assert q.count() db.delete(q.fetch(400)) time.sleep(0.2) except exception, e: self.response.out.write(repr(e)+'\n') pass try: while true: q = db.gqlquery("select __key__ userdata") assert q.count() db.delete(q.fetch(400)) time.sleep(0.2) except exception, e: self.response.out.write(repr(e)+'\n') pass ..but seems ugly , keep suspecting it's not entirely reliable. there way better delete entries of number of types instead of making 1 of each of these while loops? update: 1 restriction have running periodically via cron job, not wish doing manually (i.e. via admin console instance). a few improvements: you don't need sleep after eac...

asp.net mvc - How do you wire lists/collections on view models using IoC, DI, and MVC? -

i'm working mvc project, trying implement ioc , di. both these new me, apologies in advance if i'm going down wrong road, or if question not worded clearly. suppose have view needs display address form, 1 of elements being drop down list of states. (i realize address outside context of else not likely, simplicity of example, assume case here.) suppose view model: public class addresslist { public string address1 { get; set; } public string address2 { get; set; } public string city { get; set; } public list<string> states { get; set; } public string zip { get; set; } } whose responsibility populate states list? should controller this, having had service injected getting states? if so, same injection , population logic go in each of controllers needing populate address? or should go somewhere else? at layer view model belong? if view model specific given view in app, shouldn't remain in app, , therefore not used pass service populat...

java - Clear folder - delete files in folder - J2ME -

i trying clear files in folder using j2me. how do that? since using j2me, java.io.file class not available you. so assuming using fileconnector optional package (fcop). take @ javadocs javax.microedition.io.file.fileconnection , , should able figure out details. i'm not j2me expert, think code this: fileconnection fconn = (fileconnection) connector.open("file:///somedirectory"); enumeration en = fconn.list(); while (en.hasmoreelements()) { string name = en.nextelement(); fileconnection tmp = (fileconnection) connector.open( "file:///somedirectory/" + name); tmp.delete(); tmp.close(); } exception handling, proper resource handling (using finally ) left exercise reader :-)

updating a table in a Mysql database -

lets have in table named threadloc id thread 4 1 3 2 2 3 1 4 for table i want change table value of thread can pick thread , put in on bottom (id 1) , push other threads one. so pick 2 be id thread 4 1 3 3 2 4 1 2 update threadloc set id = id + 1 thread <> @currentthread , id < @currentid; update threadloc set id = 1 thread = @currentthread edit: doesn't change higher ids

How to catch IOException Error in eclispe for Android? -

i want catch ioexception error , want show in form of toast android application development. when ever apply catch( ioexception e), after try block says throws (throws ioexception ) function name after catch error message.. please provide assistance.... may desire ' throws ' catched exception above call stack, , next, catch , process exception in 1 place (or ' layer ') of code?)