events

Badges system using asynchronous php call

I'd like to implement a badge/reputation system on one of my site. When a user performs an action an event will be raised (ex: QUESTION_PUBLISHED) so that the system can check if a new badge can be awarded to the user. The logic for some of the badges is quite complex and would require slow sql queries. Instead of using cron jobs I was ...

c# trying to get an event to fire when a different window closes

I have one form that has an option to open another (dialogue). I want an event to fire when the second window closes. The first form is named frmMain() the other is frmAddEmployee(). Heres what I have: in frmMain() //create and open the second window public void (object sender, EventArgs e) { frmAddEmployee addEmp = new frmAddEmpl...

javascript location.href onchange event listener?

I want to show a message whenever you are leaving the page (not an annoying alert, just some html telling you to wait), in thinking about it I'm facing certain difficulties: when the user presses Stop in the browser, cancelling the navigate-away action, I'd like the message to go away. whenever any link is clicked, the message should a...

Silverlight TextBox.TextChanged event when tab item is unfocused

It's easy to test that TextChanged event won't fire when a text box is inside inactive tab item of a tab control. The same is true when text box is invisible (but unselecting tab item doesn't set text box's Visibility property to Collapsed). I guess the problem is not specific to text box or TextChanged event. What I need is to force Tex...

How to automatically scroll to the bottom of an HTML document loaded in a WebBrowser or Frame?

I'm using an HTML document to show text output in my application - this gives me the flexibility of HTML and the power of CSS, and I can publish the generated HTML as a log file openable in any browser. When new information is available, I update the HTML file and then call Refresh() on my WebBrowser control. Naturally, I want the user...

Why aren't my variables holding state after WaitForSingleObject?

I am implementing a Go Back N protocol for a networking class. I am using WaitForSingleObject to know when the socket on my receiver thread has data inside it: int result = WaitForSingleObject(dataReady, INFINITE); For Go Back N, I have to send multiple packets to the receiver at once, and manipulate the data, and then send an ACK pac...

Get Map Object in Javascript after using CodeIgniter Google Maps API

Hi, I'm using the codeigniter library for the google maps api. I load the map using the library located on the CI Wiki: http://www.phpinsider.com/php/code/GoogleMapAPI/ I want to then use javascript on the map object after loading the page. How can I get the map object in javascript? Can I use GMap2 on the same div? Won't that recreate ...

Javascript: Function for an event

So I would like to create a function from this: element.onclick = function(e){ ... code ... } To something like this: element.onclick = doSomething(e); element2.onclick = doSomething(e); function doSomething(e){ ... code ... } In this way I could call the function multiple times but in this way e is not passed as an event...

mobile safari, how to get the innerHTML of the touched div

The following works well in desktop browser evt.target.innerHTML but doesn't work so well on mobile safari on the IPad. You have to click on the exact top of the div, which can be difficult. I also tried doing something like var x = evt.pageX, y = evt.pageY, div = document.elementFromPoint(x, y); but x and y are zero....

Google Calendar - get events from a SPECIFIC calendar

Hello I'm hoping this will be relatively easy to someone who is familiar with the Google Calendar API, have done some searching but the API isn't giving me the answer! Imagine that a Google Account has 3 calendars, all created by that user. I'm trying to get events from a SPECIFIC calendar of that user, using the .NET Google API, as f...

Problem setting a property on an Asp.Net custom dropdownlist

I'm trying to set a property on a custom DropDownList: <custom:ReferenceDropDownList ... ValidityDate="<%# Application.CreateDate %>" /> Even though I can see that Application.CreateDate has been set in the Page_Load method on the containing UserControl, the code-behind in the DDL never seems to pick it up. protected override void On...

Which event to add programmatic parameter to sqldatasource in asp.net vb

I am trying to add a selectparameter to my sqldatasource (SqlDS) using this code: SqlDS.SelectParameters.Add(New Parameter("@approver", Data.DbType.String, "approved")) The error I keep getting is System.Data.SqlClient.SqlException: Must declare the variable '@approver'. Is there a specific event I need to use this code within? Than...

How to best use 'this' when its unavailable

say I create someObj like this var someObj = function(){ var self = this; //use this normally document.body.addEventListener('click',function(){ //use self because this is unavailable },false) } new someObj(); In the event this is not the someObj which id like to use but in this case the body element. Is there a best prac...

Order of message passing for object destruction / teardown

This is a language agnostic question about object oriented design, particularly the passing of messages regarding object destruction. This whole question could just as easily use the terms Parent and Child instead of Factory and Item. Which object should be responsible for an objects tear-down process; the object itself, or the factory...

Sharing event with WCF Service

Hi All, I would like to share the event 'MyEvent' in the following class: [ServiceContract] public interface MyInterface { [OperationContract] void Start(); event EventHandler<MyEventArgs> MyEvent; } public class MyEventArgs:EventArgs { public string Name{set;get;} } Which Attribut...

After adding an event to a user-created calendar in android,the event title doesn't show up.

I'm developing an android app that creates a calendar on the phone the first time the application is installed. When I create an event, either programmatically or using the device itself, the event will show up in the calendar but its title is missing. I'm testing my code on HTC nexus one. Since I'm getting the same behavior when creat...

Triggering event handler attached to it's own object, but inside a chain?

Right now I have: $("#myElement").bind("buildTimeline", function (event, newViewObj) { curDomObj = $(this).children(".timeline"); //this refers to #myElement curDomObj.draggable({ axis:"x", drag:curDomObj.trigger("drag") }); }); I'd much rather just have one chain, but is there a way to refer to the curren...

IPreInsertEventListener not firing for child objects

I've wired up IPreInsertEventListener and IPreUpdateEventListener to manage audit logging in my app, which is using NHibernate as the ORM layer. The problem I'm having is that the OnPreInsert() event is fired when the object is persisted, but is not fired for each inserted child object as well. In my case, I have a Canine, which has a ...

Get click event and swipe gesture in imageswitcher in android?

Hi, I have an imageswitcher as the only component on the screen. I want to capture the swipe gesture and click event separately for it. But it is not able to get the events separately. If I set the onclicklistener method for imageswitcher object then it always fires onclick method even if I have swiped. Can someone let me know the work...

How to unit test this library?

I have an external library which has a method which performs a long running task on a background thread. When it's done it fires off a Completed event on the thread that kicked off the method (typically the UI thread). It looks like this: public class Foo { public delegate void CompletedEventHandler(object sender, EventArgs e); ...