Search Results

Search found 2114 results on 85 pages for 'fire crow'.

Page 23/85 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • UINavigationController inside tabbar loading a child root view

    - by Doug
    Hi guys, Firstly i'll preface by saying that i am a complete Cocoa touch/objective c noob (.Net dev having a dabble) I have searched on Google as well as here but cannot seem to find an easy solution. I have a UItabbarcontroller view with a UINavigationController inside its first tab I have the root view for this UINavigationController stored in a seperate class and NIB as i am trying to seperate the data viewing from the data loading (i'm going to reuse the table list in multiple places in my database) and simply pass the root view its data using a loading method and have it take it from there. What i want to happen: App loads and loads the first view of the tab bar (A UINavigationController) The UINavigationController inside the first view loads a root view (a UIViewController with a table view) and sets its title The UINavigationController loads the data from a web service and parses it The UINavigationController sends the data to a loading method inside the UIViewController Am i thinking about this completely wrongly? What currently happens: the first tab bar loads with an empty uinavigationcontroller (no table view) the data methods fire and get the webservice data this child view gets sent its data using the loading method the tableview delegate events fail to fire inside the child view telling it to load the data into the table I just can't seem how to load my second view inside the root view of the navigation controller and then send it my data?

    Read the article

  • Asynchronous HTTP Client for Java

    - by helifreak
    As a relative newbie in the Java world, I am finding many things frustratingly obtuse to accomplish that are relatively trivial in many other frameworks. A primary example is a simple solution for asynchronous http requests. Seeing as one doesn't seem to already exist, what is the best approach? Creating my own threads using a blocking type lib like httpclient or the built-in java http stuff, or should I use the newer non-blocking io java stuff - it seems particularly complex for something which should be simple. What I am looking for is something easy to use from a developer point of view - something similar to URLLoader in AS3 - where you simply create a URLRequest - attach a bunch of event handlers to handle the completion, errors, progress, etc, and call a method to fire it off. If you are not familiar with URLLoader in AS3, its so super easy and looks something like this: private void getURL(String url) { URLLoader loader = new URLLoader(); loader.addEventListener(Event.Complete, completeHandler); loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler); loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); URLRequest request = new URLRequest(url); // fire it off - this is asynchronous so we handle // completion with event handlers loader.load(request); } private void completeHandler(Event event) { URLLoader loader = (URLLoader)event.target; Object results = loader.data; // process results } private void httpStatusHandler(Event event) { // check status code } private void ioErrorHandler(Event event) { // handle errors }

    Read the article

  • BizTalk Business Rules Engine - Repeating Elements Question

    - by Andrew Cripps
    Hello I'm trying to create what I think should be a relatively simple business rule to operate over repeating elements in an XML schema. Consider the following XML snippet (this is simplified with namespaces removed, for readability): <Root> <AllAccounts> <Account id="1" currentPayment="10.00" arrearsAmount="25.00"> <AllCustomers> <Customer id="20" primary="true" canSelfServe="false" /> <Customer id="21" primary="false" canSelfServe="false" /> </AllCustomers> </Account> <Account id="2" currentPayment="10.00" arrearsAmount="15.00"> <AllCustomers> <Customer id="30" primary="true" canSelfServe="false" /> <Customer id="31" primary="false" canSelfServe="false" /> </AllCustomers> </AllAccounts> </Root> What I want to do is to have two rules: Set /Root/AllAccounts/Account[x]/AllCustomers/Customer[primary='true']/canSelfServe = true IF arrearsAmount < currentPayment Set /Root/AllAccounts/Account[x]/AllCustoemrs/Customer[primary='true']/canSelfServer = false IF arrearsAmount = currentPayment Where [x] is 0...number of /Root/AllAccounts/Account records present in the XML. I've tried two simple rules for this, and each rule seems to fire x * x times, where x is the number of Account records in the XML. I only want each rule to fire once for each Account record. Any help greatly appreciated! Thanks Andrew

    Read the article

  • Running and managing NSTimer in different NSThread/NSRunLoop

    - by mips
    I'm writing a Cocoa application, with a GUI designed in Interface Builder. I need to schedule background activity (at regular intervals) without blocking the UI, so I run it in a separate thread, like this: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { [self performSelectorInBackground:@selector(schedule) withObject:nil]; } - (void) schedule { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; NSRunLoop* runLoop = [NSRunLoop currentRunLoop]; timer = [[NSTimer scheduledTimerWithTimeInterval:FEED_UPDATE_INTERVAL target:activityObj selector:@selector(run:) userInfo:nil repeats:YES] retain]; [runLoop run]; [pool release]; } I retain the timer, so I can easily invalidate and reschedule. Problem: I must also fire the run: method in response to GUI events, so it is synchronous (i.e. a "perform activity" button). Like this: [timer fire]; I could do this with performSelectorInBackground too, and of course it doesn't block the UI. But this synchronous firings run in another runloop! So I have no guarantee that they won't overlap. How can I queue all of my firings on the same runloop?

    Read the article

  • Dynamically loaded control - how can I access a value in Page_Init

    - by Sam
    I am loading a LinkButton dynamically when a user clicks on another LinkButton. I am attaching an event handler to it. When the user clicks on the dynamically loaded LinkButton, the event does not fire. From what I've been reading, I understand this is because when the page posts back the dynamically loaded control no longer exists. It looks like I'm supposed to make sure this control is recreated in Page_Init. The dynamically created LinkButton is dependedent on a value (Product ID). I need someway to access this value so I can properly create the control. ViewState is not accessible and I'm concerned if I use Session it could time out and then that wouldn't help. Any ideas? Also, I hardcoded a Product ID value just for testing, and that still did not cause the event to fire. Is there something else I need to do? protected void Page_Init(object sender, EventArgs e) { SetTabText(1, 1); } SetTabText calls SetActionLinks which creates the LinkButton: protected Panel SetActionLinks(int prodID, int tabID) { ... LinkButton lnkBtn = new LinkButton(); lnkBtn.ID = "lnkBtn" + rand.Next().ToString(); lnkBtn.CommandName = "action"; lnkBtn.Command += new CommandEventHandler(this.lnkAction_Command); panel.Controls.Add(lnkBtn); ... } void lnkAction_Command(object sender, CommandEventArgs e) { LinkButton btn = (LinkButton)sender; switch (btn.CommandArgument) { AddCart(); } }

    Read the article

  • WPF Control validation

    - by Jon
    Hi all, I'm developing a WPF GUI framework and have had bad experiences with two way binding and lots of un-needed events being fire(mainly in Flex) so I have gone down the route of having bindings (string that represent object paths) in my controls. When a view is requested to be displayed the controller loads the view, and gets the needed entities (using the bindings) from the DB and populates the controls with the correct values. This has a number of advantages i.e. lazy loading, default undo behaviour etc. When the data in the view needs to be saved the view is passed back to the controller again which basically does the reserve i.e. re-populates the entities from the view if values have changed. However, I have run into problems when I try and validate the components. Each entity has attributes on its properties that define validation rules which the controller can access easily and validate the data from the view against it. The actual validation of data is fine. The problem comes when I want the GUI control to display error validation information. It I try changing the style I get errors saying styles cannot be changed once in use. Is the a way in c# to fire off the normal WPF validation mechanism and just proved it with the validaiton errors the controller has found? Thanks in advance Jon

    Read the article

  • signalR groups - connecting/disconnecting and sending - am I missing something?

    - by Terry_Brown
    very new to signalR, and have rolled up a very simple app that will take questions for moderation at conferences (felt like a straight forward use case) I have 2 hubs at the moment: - Question (for asking questions) - Speaker (these should receive questions and allow moderation, but that will come later) Solution lives at https://github.com/terrybrown/InterASK After watching a video (by David Fowler/Damian Edwards) (http://channel9.msdn.com/Shows/Web+Camps+TV/Damian-Edwards-and-David-Fowler-Demonstrate-SignalR) and another that I can't find the URL for atm, I thought I'd go with 'groups' as the concept to keep messages flowing to the right people. I implemented IConnected, IDisconnect as I'd seen in one of the videos, and upon debugging I can see Connect fire (and on reload I can see disconnect fire), but it seems nothing I do adds a person to a group. The signalR documentation suggests "Groups are not persisted on the server so applications are responsible for keeping track of what connections are in what groups so things like group count can be achieved" which I guess is telling me that I need to keep some method (static or otherwise?) of tracking who is in a group? Certainly I don't seem able to send to groups currently, though I have no problem distributing to anyone currently connected to the app and implementing the same JS method (2 machines on the same page). I suspect I'm just missing something - I read a few of the other questions on here, but none of them seem to mention IConnected/IDisconnect, which tells me these are either new (and nobody is using them) or that they're old (and nobody is using them). I know this could be considered a subjective question, though what I'm looking for is just a simple means of managing the groups so that I can do what I want to - send a question from one hub, and have people connected to a different hub receive it - groups felt the cleanest solution for this? Many thanks folks. Terry

    Read the article

  • UITableView scrolling to specific position

    - by Dave
    I am using iPhone SDK 3.1.3. I have a UITableViewController which gets data from another controller. The tableview is added as a subview to the mainview but the frame is set so that it is not visible. The tableview frame is updated and made to slide over the main view by tapping on a button. The table view appears and i scroll to the last row. if i select the last row, i reload the table with more data. The table gets updated with more data. everything works fine except the scroll position is always the top. I need the scroll position to be the last row that I clicked on to load more data. I save the scroll position and call the following code after it loads more data. It executes without issues but the scroll position is always the top. [theTableView scrollTRowAtIndexPath:[NSIndexPath indexPathForRow:savedScrollPosition inSection:0] atScrollPosition:savedScrollPosition animated:NO]; The above seems to have no effect. ViewWillAppear: ViewDidAppear: does not fire and I am told that if the view controller is instantiated in code, which is the case, these don't fire.

    Read the article

  • Schedule multiple events with NSTimer?

    - by AWright4911
    I have a schedule cache stored in a pList. For the example below, I have a schedule time of April 13, 2010 2:00PM and Aril 13, 2010 2:05PM. How can I add both of these to a queue to fire on their own? item 0 -Hour --14 -Minute --00 -Month --04 -Day --13 -Year --2010 item 1 -Hour --14 -Minute --05 -Month --04 -Day --13 -Year --2010 this is how I am attempting to schedule multiple events to fire at specific date / time. -(void) buildScheduleCache { MPNotifyViewController *notifier = [MPNotifyViewController alloc] ; [notifier setStatusText:@"Rebuilding schedule cache, this will only take a moment."]; [notifier show]; NSCalendarDate *now = [NSCalendarDate calendarDate]; NSFileManager *manager = [[NSFileManager defaultManager] autorelease]; path = @"/var/mobile/Library/MobileProfiles/Custom Profiles"; theProfiles = [manager directoryContentsAtPath:path]; myPrimaryinfo = [[NSMutableArray arrayWithCapacity:6] retain]; keys = [NSArray arrayWithObjects:@"Profile",@"MPSYear",@"MPSMonth",@"MPSDay",@"MPSHour",@"MPSMinute",nil]; for (NSString *profile in theProfiles) { plistDict = [[[NSMutableDictionary alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@",path,profile]] autorelease]; [myPrimaryinfo addObject:[NSDictionary dictionaryWithObjects: [NSArray arrayWithObjects: [NSString stringWithFormat:@"%@",profile], [NSString stringWithFormat:@"%@",[plistDict objectForKey:@"MPSYear"]], [NSString stringWithFormat:@"%@",[plistDict objectForKey:@"MPSMonth"]], [NSString stringWithFormat:@"%@",[plistDict objectForKey:@"MPSDay"]], [NSString stringWithFormat:@"%@",[plistDict objectForKey:@"MPSHour"]], [NSString stringWithFormat:@"%@",[plistDict objectForKey:@"MPSMinute"]], nil]forKeys:keys]]; profileSched = [NSCalendarDate dateWithYear:[plistDict objectForKey:@"MPSYear"] month:[plistDict objectForKey:@"MPSMonth"] day:[plistDict objectForKey:@"MPSDay"] hour:[plistDict objectForKey:@"MPSHour"] minute:[plistDict objectForKey:@"MPSMinute"] second:01 timeZone:[now timeZone]]; [self rescheduleTimer]; } NSString *testPath = @"/var/mobile/Library/MobileProfiles/Schedules.plist"; [myPrimaryinfo writeToFile:testPath atomically:YES]; } -(void) rescheduleTimer { timer = [[NSTimer alloc] initWithFireDate:profileSched interval:0.0f target:self selector:@selector(theFireEvent) userInfo:nil repeats:YES]; NSRunLoop *runLoop = [NSRunLoop currentRunLoop]; [runLoop addTimer:timer forMode:NSDefaultRunLoopMode]; }

    Read the article

  • Bypass all cacheing on jQuery.autocomplete(1.02)

    - by technicalbloke
    I am using jQuery.autocomplete(1.02) on my search box and I want exact string and substring matching. I don't care (yet!) about the database load, I'm happy for it to fire off a query every keystroke and bypass the caching entirely - I just don't want anything missed. To this end I have tried setting cacheLength=1, the minimum permitted, but the autocomplete function refuses to fire off a GET request for each key up. searchbox GET_request 'a' -> http://localhost/service_search_request?q=a 'ar' -> http://localhost/service_search_request?q=ar 'ars' -> http://localhost/service_search_request?q=ars Instead, it sends the first and the third and misses the second, giving me the wrong results for 'ar' :-/ I've cleared my cache and sessions but it looks like some sort of caching is still going on. AFAIK I have no proxying going on and I'm shift-refreshing each time. It looks likely then that this behavior is from jQuery.autocomplete itself. So my questions are... A) Does this seem likely? i.e. is it a feature, or maybe a bug? B) If so is there a clean way around it?... C) If not, what autocomplete would you use instead? Naturally D) No you're just using it incorrectly you douche! is always a possibility, and indeed the one I'd prefer having spent time going down this road - assuming it comes with a link to the docs I've failed to find / read! Cheers, Roger :)

    Read the article

  • Using cellUpdateEvent with YUI DataTable and JSON DataSource

    - by Rob Hruska
    I'm working with a UI that has a (YUI2) JSON DataSource that's being used to populate a DataTable. What I would like to do is, when a value in the table gets updated, perform a simple animation on the cell whose value changed. Here are some relevant snippets of code: var columns = [ {key: 'foo'}, {key: 'bar'}, {key: 'baz'} ]; var dataSource = new YAHOO.util.DataSource('/someUrl'); dataSource.responseType = YAHOO.util.DataSource.TYPE_JSON; dataSource.connXhrMode = 'queueRequests'; dataSource.responseSchema = { resultsList: 'results', fields: [ {key: 'foo'}, {key: 'bar'}, {key: 'baz'} ] }; var dataTable = new YAHOO.widget.DataTable('container', columns, dataSource); var callback = function() { success: dataTable.onDataReturnReplaceRows, failure: function() { // error handling code }, scope: dataTable }; dataSource.setInterval(1000, null, callback); And here's what I'd like to do with it: dataTable.subscribe('cellUpdateEvent', function(record, column, oldData) { var td = dataTable.getTdEl({record: record, column: column}); YAHOO.util.Dom.setStyle(td, 'backgroundColor', '#ffff00'); var animation = new YAHOO.util.ColorAnim(td, { backgroundColor: { to: '#ffffff'; } }); animation.animate(); }; However, it doesn't seem like using cellUpdateEvent works. Does a cell that's updated as a result of the setInterval callback even fire a cellUpdateEvent? It may be that I don't fully understand what's going on under the hood with DataTable. Perhaps the whole table is being redrawn every time the data is queried, so it doesn't know or care about changes to individual cells?. Is the solution to write my own specific function to replace onDataReturnReplaceRows? Could someone enlighten me on how I might go about accomplishing this? Edit: After digging through datatable-debug.js, it looks like onDataReturnReplaceRows won't fire the cellUpdateEvent. It calls reset() on the RecordSet that's backing the DataTable, which deletes all of the rows; it then re-populates the table with fresh data. I tried changing it to use onDataReturnUpdateRows, but that doesn't seem to work either.

    Read the article

  • Using jQuery, setting Draggable on an element prevents blur from firing when you click the draggable

    - by Danno
    Using jQuery, when you set a blur event on a text box and set another element as draggable, when you click the draggable element, the blur event does not fire in FireFox. IE is a little better, you get the blur event but you don't get the click event on the draggable element. If you don't specify the cancel: "" in the draggable constructor, you will get the blur event to fire, but then the element you want to drag is not draggable. jQuery v1.3.2 jQuery UI v1.7.2 The console.log lines are for FireFox's FireBug plugin. <HTML> <HEAD> <TITLE>Blur/Click Workbench</TITLE> <script src="js/jquery.js" type="text/javascript" ></script> <script src="js/ui/ui.core.js" type="text/javascript"></script> <script src="js/ui/ui.draggable.js" type="text/javascript"></script> <script type="text/javascript"> function blurring() { console.log('1 - blurring - ' + $( this ).attr('id')); } function clicking() { console.log('2 - clicking - ' + $( this ).attr('id')); } $(document).ready(function() { $( ".draggableTool" ).draggable( { cancel: "" } ); $( '.property' ).blur( blurring ); $( '#labelContainer' ).click( clicking ); }); </script> </HEAD> <BODY> <input type='text' class='property' id='tb1' /> <br /> <input type='text' class='property' id='tb2' /> <br /> <label class='draggableTool' id='labelContainer' style='height:20px;position:absolute;'> <textarea id='taLabel' style='height:100%;background-color:white;border:1px solid grey;'>Label</textarea> </label> </BODY> </HTML>

    Read the article

  • touchesBegin & touchesMove Xcode Obj C Question

    - by AndrewDK
    So I have my app working good when you press and drag along. I also have UIButtons set to Touch Down in Interface Builder. As well when you drag you need to drag from the outside of the UIButton. You cannot click on the UIButton and drag to the other. TOUCHES MOVED: Code: -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event touchesForView:self.view] anyObject]; CGPoint location = [touch locationInView:touch.view]; if(CGRectContainsPoint(oneButton.frame, location)) { if (!oneButton.isHighlighted){ [self oneFunction]; [oneButton setHighlighted:YES]; } }else { [oneButton setHighlighted:NO]; } // if(CGRectContainsPoint(twoButton.frame, location)) { if (!twoButton.isHighlighted){ [self twoFunction]; [twoButton setHighlighted:YES]; } }else { [twoButton setHighlighted:NO]; } } TOUCHES BEGAN: Code: - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event touchesForView:self.view] anyObject]; CGPoint location = [touch locationInView:touch.view]; if(CGRectContainsPoint(oneButton.frame, location)) { [self oneFunction]; [oneButton setHighlighted:YES]; } if(CGRectContainsPoint(twoButton.frame, location)) { [self twoFunction]; [twoButton setHighlighted:YES]; } } I want to be able to click on any of the button fire the function & also be able to drag from one button on to the other and fire that function. So basically just being able to click on a button and slide your finger over and activate the other button without having to press and slide from outside of the button. I think I'm close, need a bit of help. Hope thats clear enough. Thanks.

    Read the article

  • Detecting browser capabilities and selective events for mouse and touch

    - by skidding
    I started using touch events for a while now, but I just stumbled upon quite a problem. Until now, I checked if touch capabilities are supported, and applied selective events based on that. Like this: if(document.ontouchmove === undefined){ //apply mouse events }else{ //apply touch events } However, my scripts stopped working in Chrome5 (which is currently beta) on my computer. I researched it a bit, and as I expected, in Chrome5 (as opposed to older Chrome, Firefox, IE, etc.) document.ontouchmove is no longer undefined but null. At first I wanted to submit a bug report, but then I realized: There are devices that have both mouse and touch capabilities, so that might be natural, maybe Chrome now defines it because my OS might support both types of events. So the solutions seems easy: Apply BOTH event types. Right? Well the problem now take place on mobile. In order to be backward compatible and support scripts that only use mouse events, mobile browsers might try to fire them as well (on touch). So then with both mouse and touch events set, a certain handler might be called twice every time. What is the way to approach this? Is there a better way to check and apply selective events, or must I ignore the problems that might occur if browsers fire both touch and mouse events at times?

    Read the article

  • Enable/disable RequiredValidator on client-side / CustomValidator not firing

    - by Simeon
    I've got a drop-down where the user selects a Country. It is a required "field". Next to it, there is a textfield named State. If the user selects US, then the field State is required. If the user selects e.g. Sweden, the State is not required, since Sweden has no states. Example code: <asp:DropDownList runat="server" ID="Country"></asp:DropDownList> <asp:RequiredFieldValidator ControlToValidate="Country" runat="server" Display="Static" ErrorMessage="Required field" /> <asp:TextBox runat="server" ID="State"></asp:TextBox> <asp:CustomValidator ClientValidationFunction="DoesntGetFiredIfStateIsEmpty" runat="server" Display="Static" ErrorMessage="Required field" /> <!-- SO, RATHER THIS TOGETHER WITH CONDITIONAL FIRING --> <asp:RequiredFieldValidator ControlToValidate="State" runat="server" Display="Static" ErrorMessage="Required field" /> My question to you is: How can I make this CustomValidator fire validation when it is empty? Or put simplier: How can I make a RequiredValidator fire conditionally? Or simplest: How can I enable/disable a RequiredValidator on client-side?

    Read the article

  • WPF/SL EventAggregator implementation with durable subscribers behavior?

    - by sha1dy
    Hi. Currently I'm building an application using latest Prism for Silverlight 4. I've a module and in that module I've two views with view models. Also I've a module view with two regions for each view. In module initialization I'm registering my views and view models in Unity container and also register views with corresponding regions. The problem is that views should display something similar to table-detail information - first view shows available entities ans the second view shows detail of selected entity. I need a way how to pass them initial selected entity. Newly created first view doesn't have any selected entity and newly created second view doesn't show any details. Currently I'm doing that this way: In module I create two view models and register them as instances in Unity container and then I register views as types for corresponding regions. Each view subscribes to EntitySelectedEvent from EventAggregator. Module initializer publish this event after initialization and this way two views are selecting the same entity. I know this looks ugly - I tried publishing this event from one of view models but the problems is that EventAggregator in Prism doesn't support durable subscribers - this means that if the second view model didn't subscribe to event before the first view model fired it, it won't receive and event. I know this is a normal behavior of EventAggregator, but I'm looking for a solution when view models can fire events without depending on initialization order of them - that is the first model can fire event before the second model was created and the second model will receive this 'queued' event after subscribing to it. Are there any other messaging implementations for WPF/SL which do support such behavior or using a mediator (in my example it's a module itself) isn't such a bad idea after all? One big problem with mediator is that models must be created right away in initialize and they can't be registered as types in container because this leads again to missing subscribers.

    Read the article

  • In C#, what thread will Events be handled in?

    - by Ben
    Hi, I have attempted to implement a producer/consumer pattern in c#. I have a consumer thread that monitors a shared queue, and a producer thread that places items onto the shared queue. The producer thread is subscribed to receive data...that is, it has an event handler, and just sits around and waits for an OnData event to fire (the data is being sent from a 3rd party api). When it gets the data, it sticks it on the queue so the consumer can handle it. When the OnData event does fire in the producer, I had expected it to be handled by my producer thread. But that doesn't seem to be what is happening. The OnData event seems as if it's being handled on a new thread instead! Is this how .net always works...events are handled on their own thread? Can I control what thread will handle events when they're raised? What if hundreds of events are raised near-simultaneously...would each have its own thread? Thank in advance! Ben

    Read the article

  • WCF events in server-side

    - by Eisenrich
    Hi all, I'm working on an application in WCF and want to receive events in the server side. I have a web that upon request needs to register a fingerprint. The web page request the connection of the device and then every second for 15 seconds requests the answer. The server-side code is apparently "simple" but doesn't work. Here is it: [ServiceContract] interface IEEtest { [OperationContract] void EEDirectConnect(); } class EETest : IEEtest { public void EEDirectConnect() { CZ ee = new CZ(); // initiates the device dll ee.Connect_Net("192.168.1.200", 4011); ee.OnFinger += new _IEEEvents_OnFingerEventHandler(ee_OnFinger); } public void ee_OnFinger() { //here i have a breakpoint; } } every time I put my finger, it should fire the event. in fact if I static void Main() { EETest pp = new EETest(); pp.EEDirectConnect(); } It works fine. but from my proxy it doesn't fire the event. do you have any tips, recommendations, or can you see the error? Thanks everyone.

    Read the article

  • HttpModule to Write Out JavaScript Script References to the Response

    - by Chris
    On my page in the Page_Load event I add a collection of strings to the Context object. I have an HttpModule that will fire EndRequest and retrieve the collection of strings. What I then do is write out a script reference tag (based on the collection of strings) to the response. The problem is that the page reads the script reference but doesn't retrieve the contents of the file (I imagine because this is occurring in the EndRequest event). I can't fire the BeginRequest event because I won't have access to the Context Items collection. I tried to also registering an HttpHandler which Processes the request of the script reference but I can't access the collection of strings in the Context.Items from there. Any suggestions? Page_Load: protected void Page_Load(object sender, EventArgs e) { Context.Items.Add("ScriptFile", "/UserControls.js"); } HttpModule: public void OnEndRequest(Object s, EventArgs e) { HttpApplication app = s as HttpApplication; object script = app.Context.Items["ScriptFile"]; app.Response.Write("<script type='text/javascript' src='" + script + "'></script>"); }

    Read the article

  • Need Advice on designing ATL inproc Server (dll) that serves as both a soure and a sink of events.

    - by Andrew
    Hi, I need to design an ATL inproc server that besides exposing methods and properties, also can fire events (source) and serve as a sink for a third party COM control that fires events. I would assume that this is a fairly common requirement. I can also foresee several "gotchas" that I would like to read up on before commencing the design. My questions/concerns are: Can someone point me to an example? Which threading model to use? Should I have a seperate COM object for the sink? Should I, and how do I, protect certain memory. For example, my server will receive data from the third party control. It will save this, and in some cases, fire an event to interested clients. The interested clients will request the data through a standard method or property. I did try to research this myself. I can find many examples of COM servers that are soures, and some that are sinks, but never both. The only post I did find was this: http://www.generation-nt.com/us/atl-control-an-event-source-sink-help-9098542.html Which strongly advocates putting the sink on a seperate COM object. Any leads, tutorials or ideas would be much appreciated. Thanks, Andrew

    Read the article

  • Multiple dynamic timers

    - by Rickard
    I am working on a project where I need to let the user create one (or more) timers to fire off an event. The user is supposed to define variables such as if the timer should be active and how often the timer will fire along with some other variables of what will happen when the timer is fiering. All these variables are stored in a dictionary (Disctionary) where the object holds all the variables the user has set and the string is the name that the user has chosen for this timer. I then want my program to loop through this dictionary and search for all objects which has the variable t_Active set to true (this I have already achieved). What I need help with figuring out is the follwoing: When it detects the variable, and if it's set to true, I need the program to see if there is already a timer created for this. If it isn't, it should create one and set the relevant parameters for the timer. The two variables t_num and t_period should decide the interval of the timer. t_num is an int and t_period is a string which will be set to either minutes, hours or days. Combining t_num with 60000 (minutes), 3600000 (hours) or 86400000 should give the corrct interval. But how would I go on about programatically create a timer for each user-defined active object? And how do I get the program to detect wether or not a timer has already been created? I have been searching both here and on google, but so far I haven't come across something that makes sense to me. I am still learning C#, so what make sense to you guys may not neccessarilly make sense to me yet. :) I hope I have explaned what I need good enough, please do ask me to clarify if you don't get me. Edit: Maybe I should also mention that the mentioned dictionary will also be saved to an XML file to that the user can pick up all the settings they made at any time.

    Read the article

  • Emulate domready event with a custom event (mootools)

    - by Rob
    I need to fire a one time only custom event that functions like the domready event, in that if new events are added after the event has occurred they are fired immediately. This is for some code that cannot execute until certain data and resources are initialized, so I want to do something like this: // I am including a script (loadResources.js) to load data and other resources, // when loadResources.js is done doing it's thing it will fire resourcesAreLoaded with: window.fireEvent('resourcesAreLoaded'); window.addEvent('resourcesAreLoaded', function() { // this is fine }); $('mybutton').addEvent('click', function() { window.addEvent('resourcesAreLoaded', function() { // this is not fine, because resourcesAreLoaded has already fired // by the time the button is clicked }); }); If possible I would like resourcesAreLoaded to function like domready, and execute the code immediately if the event has already fired: window.addEvent('testIsReady', function() { alert('firing test'); }); window.fireEvent('testIsReady'); window.addEvent('test', function() { // this will never execute unless I call fireEvent('testIsReady') again alert('test 2'); }); window.addEvent('domready', function() { alert('domready is firing'); }); window.addEvent('domready', function() { setTimeout(function() { alert('domready has already fired, so this is executed immediately'); }, 500); });

    Read the article

  • iphone download several files

    - by Floo
    hi all !  In my app i need to download several plist.  to download a plist i use the NSURLconnection  in my code i use an UIAlertView with a UIActivityIndicator then when the download is finished i add a button to the alert to dismiss it.  To download the plist i use somewhere in my code an NSURL set to the adresse where the plist is, next i set a NSURLRequest with the url cache policy and a timeout interval.  Then i set my NSMutableData to the NSURL connection with a NSURLRequest.  In the delegate didReceiveData: i append data to my mutable data object, in the didFailWithError: i handle error. And finaly in the connectionDidFinishLoading  i serialize my data to a plist so i can write to file my plist, and release my alertview.  My problem is : how can i do if i have sevetal file to download because the connectionDidFinishLoading is called each time my NSURLConnection is finished but i want to release my UiAlert when everything is finished. But when the first plist is downloaded my code in the connectionDidFinishLoading will fire.  here is my code :  in the view did load :  // set the UiAlert in the view did load  NSURL *theUrl = [NSURL URLWithString:@"http://adress.com/plist/myPlist.plist"]; NSURLRequest *theRequest = [NSURLRequest requestWithURL:theUrl cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; self.plistConnection = [[ NSURLConnection alloc] initwithRequest:theRequest delegate:self startImmediatly:YES]; //plistConnection is a NSURLConnection - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {  [incomingPListData appendData:data]; } -(void)connection:(NSURLConnection *)connectionDidFailWithError:(NSError *)error { // handle error here  } -(void)connectionDidFinisloading:(NSURLConnection *) connection {  NSPropertyListFormat format; NSString *serialErrorString;  NSData *plist = [NSPropertyListSerialisation propertyListFromData:incomingPlistData mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&serialErrorString]; if (serialErrorString) {//error} else { // create path and write plist to path} // change message and title of the alert so if i want todownload an another file  where do i put the request the connection and how can i tell the didFinishLoading to fire code when all my file are downloaded.  thanks to all

    Read the article

  • Tomcat Application Generating too many logs

    - by rohitgu
    Hi, I have an application which runs on tomcat 6.0.20 server on linux ubuntu server. It generates a huge amount of logs in the catalina.out folder, most of these are generated while using the application, but are not generated by the application. Some of the logs it generates are given below, Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester startElement FINE: startElement(,,mime-type) Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester startElement FINE: Pushing body text ' ' Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester startElement FINE: New match='web-app/mime-mapping/mime-type' Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester startElement FINE: Fire begin() for CallParamRule[paramIndex=1, attributeName=null, from stack=false] Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester characters FINE: characters(audio/x-mpeg) Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester endElement FINE: endElement(,,mime-type) Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester endElement FINE: match='web-app/mime-mapping/mime-type' Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester endElement FINE: bodyText='audio/x-mpeg' Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester endElement FINE: Fire body() for CallParamRule[paramIndex=1, attributeName=null, from stack=false] Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester endElement FINE: Popping body text ' How can I turn them off? This is very important, since this a production application. Regards, Rohit

    Read the article

  • Mostly PJAX site with some AngularJS

    - by jrhicks
    I have a site using PJAX all over the place and I have a few pages that are using AngularJS. For the AngularJS pages I would like to continue to use PJAX to get all the benefits associated with not reloading the entire HTML page, assets etc. Unfortunately, PJAX just loads some HTML into the page and doesn't fire any javascript. This is okay, because I can fire the javascript manually on pjax success, but I can't quite figure out what makes AngularJS initialize. For a simple scenario, lets say I AJAX the following HTML into a page. Also assume, the page already had Angular.js included. What could I call to have the following behave like an Angular App? <div> <label>Name:</label> <input type="text" ng-model="yourName" placeholder="Enter a name here"> <hr> <h1>Hello {{yourName}}!</h1> </div> Thanks

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >