Search Results

Search found 10381 results on 416 pages for 'delegate and events'.

Page 134/416 | < Previous Page | 130 131 132 133 134 135 136 137 138 139 140 141  | Next Page >

  • Run-time error 459 when using WithEvents with a class that implements another

    - by Ken Keenan
    I am developing a VBA project in Word and have encountered a problem with handling events when using a class that implements another. I define an empty class, IMyInterface: Public Sub Xyz() End Sub Public Event SomeEvent() And a class, MyClass that implements the above: Implements IMyInterface Public Event SomeEvent() Public Sub Xyz() ' ... code ... RaiseEvent SomeEvent End Sub Private Sub IMyInterface_Xyz() Xyz End Sub If I create a third class, OtherClass, that declares a member variable with the type of the interface class: Private WithEvents mMy As IMyInterface and try to initialize this variable with an instance of the implementing class: Set mMy = New MyClass I get a run-time error '459': This component doesn't support this set of events. The MSDN page for this error message states: "You tried to use a WithEvents variable with a component that can't work as an event source for the specified set of events. For example, you may be sinking events of an object, then create another object that Implements the first object. Although you might think you could sink the events from the implemented object, that isn't automatically the case. Implements only implements an interface for methods and properties." The above pretty much sums up what I'm trying to do. The wording, "that isn't automatically the case", rather than "this is flat-out impossible", seems to suggest that there is some bit of manual work I need to do to get it to work, but it doesn't tell me what! Does anybody know if this is possible in VBA?

    Read the article

  • How to design this simple database?

    - by Vafello
    I have 2 tables - one storing user information (id, username, password) and the second one storing information about events (id, name, description, date, username(represents the user who created the event)). I would like to implement 'favourite events' functionality. This would allow the user to store his favourite events and later display them in a list. I am not sure how to implement this in terms of design. I need a simple solution. Something like storing the IDs of favourite events in a field in the user table. I am using mysql and php. Can anyone point me to the right direction?

    Read the article

  • Changing middle mouse behavior in Adobe AIR HTML Control?

    - by Qz
    I'm using the Flex 4/Adobe AIR mx:HTML control in a project and I'm trying to figure out how to change the middle mouse behavior. For some reason the control treats middle mouse clicks and drags exactly the same as left mouse clicks and drags, navigating through links and selecting text -- everything. For my project I need to use the middle mouse button for a different function. I've figured out how to hook into the events (although mouseUp and mouseDown for Left/Middle don't work over HTML whitespace, perhaps because of the default behavior). However I can't figure out how to stop the default behavior for middle mouse events. Calling preventDefault() on the HTML control mouse events doesn't work, presumably because the behavior is handled by the HTMLLoader within the HTML control, which I imagine hooks mouse events to the actual HTML content displayed on screen. Unfortunately I can't view the source for HTMLLoader to figure out what's going on, and browsing the properties and events doesn't shed any light on the situation either. Any help would be greatly appreciated! Oh, if anyone can suggest a different embeddable HTML renderer that doesn't have this problem, then that might work too, I'm not too tied to WebKit (although I do need to use AIR)

    Read the article

  • How to query_posts after the current timestamp and sort reverse chronologically?

    - by Jody Heavener
    I am using the following code in Wordpress to query events (custom post type) and order them by date chronologically.. query_posts( array( 'post_type' => 'events', 'showposts' => 10, 'orderby' => 'meta_value_num','meta_key' => '_ecmb_datetime' ) ); Where the meta key _ecmb_datetime is, this is the timestamp of the event. I don't want to show events that have already happened, so my question is how do I only show events happening after my current time, and how do I sort reverse chronologically? Any help is greatly appreciated

    Read the article

  • Efficiently display file status when using background thread

    - by schmoopy
    How can i efficiently display the status of a file when using a background thread? For instance, lets say i have a 100MB file: when i do the code below via a thread (just as an example) it runs in about 1 min: foreach(byte b in file.bytes) { WriteByte(b, xxx); } But... if i want to update the user i have to use a delegate to update the UI from the main thread, the code below takes - FOREVER - literally i don't know how long im still waiting, ive created this post and its not even 30% done. int total = file.length; int current = 0; foreach(byte b in file.bytes) { current++; UpdateCurrentFileStatus(current, total); WriteByte(b, xxx); } public delegate void UpdateCurrentFileStatus(int cur, int total); public void UpdateCurrentFileStatus(int cur, int total) { // Check if invoke required, if so create instance of delegate // the update the UI if(this.InvokeRequired) { } else { UpdateUI(...) } }

    Read the article

  • Has Object in VB 2010 received the same optimalization as dynamic in C# 4.0?

    - by Abel
    Some people have argued that the C# 4.0 feature introduced with the dynamic keyword is the same as the "everything is an Object" feature of VB. However, any call on a dynamic variable will be translated into a delegate once and from then on, the delegate will be called. In VB, when using Object, no caching is applied and each call on a non-typed method involves a whole lot of under-the-hood reflection, sometimes totaling a whopping 400-fold performance penalty. Have the dynamic type delegate-optimization and caching also been added to the VB untyped method calls, or is VB's untyped Object still so slow?

    Read the article

  • When to release a class with delegates

    - by Stefan Mayr
    A quick question to delegates. Lets say, CLASSA has a delegate defined: @protocol MyDelegate -(void) didFinishUploading; @end In CLASSB I create an instance of CLASS A -(void) doPost { CLASSA *uploader = [[CLASSA alloc] init]; uploader.delegate = self; // this means CLASSB has to implement the delegate uploader.post; } and also in CLASSB: -(void)didFinishUploding { } So when do I have to release the uploader? Because when I release it in doPost, it is not valid anymore in didFinishUploading. Thanks

    Read the article

  • iPhone YouTube Channel App

    - by pki
    What would the steps be to creating an app that connected to YouTube's XML API. Here is my setup currently but it is not working. App Delegate creates object "YTXMLParser" App Delegate calls [parser prepAndPrase]; In Prep and Parse the app initiates a NSURLConnection The app downloads the XML Data using the NSURLConnection well appeneding to NSMutableData The app parses the data with NSXMLParser At the end of each "entry" the app adds the current dictionary to the class. At the beginning of each "entry" the app creates an instance of a dictionary. Here's where i'm stuck. How do I get this data back to my app delegate?

    Read the article

  • How can I Add newer Data to the start of the xml file (Example inside)

    - by Ofear
    Hi All! After alot of work i finish to make a xml reader and writer... but my problem is that i want the newer data that i insert using my form will be added to the top of the xml file. and not in the bottom.. let me show you an example: this is the XML file: <?xml version="1.0" encoding="utf-8"?> <events> <record> <event>old event</event> <eventDate>1/1/2009</eventDate> <desc>old desc</desc> </record> <record> <event>newer event</event> <eventDate>12/12/2011</eventDate> <desc>newer desc</desc> </record> </events> now.. I want the XML file to be like this: newer data and then old data <?xml version="1.0" encoding="utf-8"?> <events> <record> <event>newer event</event> <eventDate>12/12/2011</eventDate> <desc>newer desc</desc> </record> <record> <event>old event</event> <eventDate>1/1/2009</eventDate> <desc>old desc</desc> </record> </events> This is my add.php (the file that get the POST information from the Form in the main.html : <?php $record = array( 'event' => $_POST['event'], 'eventDate' => $_POST['eventDate'], 'desc' => $_POST['desc'], ); $doc = new DOMDocument(); $doc->load( 'events.xml' ); $doc->formatOutput = true; $r = $doc->getElementsByTagName("events")->item(0); $b = $doc->createElement("record"); $event = $doc->createElement("event"); $event->appendChild( $doc->createTextNode( $record["event"] ) ); $b->appendChild( $event ); $eventDate = $doc->createElement("eventDate"); $eventDate->appendChild( $doc->createTextNode( $record["eventDate"] ) ); $b->appendChild( $eventDate ); $desc = $doc->createElement("desc"); $desc->appendChild( $doc->createTextNode( $record["desc"] ) ); $b->appendChild( $desc ); $r->appendChild( $b ); $doc->save("events.xml"); header("Location: {$_SERVER['HTTP_REFERER']}"); ?> Where do i need to edit to be able to make the *xml as i want?*

    Read the article

  • Best practices for displaying large number of images as thumbnails in c#

    - by andySF
    I got to a point where it's very difficult to get answers by debugging and tracing object, so i need some help. What I'm trying to do: A history form for my screen capture pet project. The history must list all images as thumbnails (ex: picasa). What I've done: I created a HistoryItem:UserControl. This history item has a few buttons, a check box, a label and a picture box. The buttons are for delete/edit/copy image. The check box is used for selecting one or more images and the label is for some info text. The picture box is getting the image from a public property that is a path and a method creates a proportional thumbnail to display it when the control has been loaded. This user control has two public events. One for deleting the image and one for bubbling the events for mouse enter and mouse leave trough all controls. For this I use EventBroadcastProvider. The bubbling is useful because wherever I move the mouse over the control, the buttons appear. The dispose method has been extended and I manually remove the events. All images are loaded by looping a xml file that contains the path of all images. For each image in this XML I create a new HitoryItem that is added (after a little coding to sort and limit the amount of images loaded) to a flow layout panel. The problem: When I lunch the history form, and the flow layout panel is populated with my HistoryItem custom control, my memory usage increases drastically.From 14Mb to around 100MB with 100 images loaded. By closing the history form and disposing whatever I could dispose and even trying to call GC.Collect() the memory increase remain. I search for any object that could not be disposed properly like an image or event but wherever I used them they are disposed. The problem seams to be from multiple sources. One is that the events for bubbling are not disposing properly, and the other is from the picture box itself. All of this i could see by commenting all the code to a limited version when only the custom control without any image processing and even events is loaded. Without the events the memory consumption is reduced by axiomatically 20%. So my real question is if this logic, flow layout panels and custom controls with picture boxes, is the best solution for displaying large amounts of images as thumbnails. Thank you!

    Read the article

  • C++ Storing variables and inheritance

    - by Kaa
    Hello Everyone, Here is my situation: I have an event driven system, where all my handlers are derived from IHandler class, and implement an onEvent(const Event &event) method. Now, Event is a base class for all events and contains only the enumerated event type. All actual events are derived from it, including the EventKey event, which has 2 fields: (uchar) keyCode and (bool)isDown. Here's the interesting part: I generate an EventKey event using the following syntax: Event evt = EventKey(15, true); and I ship it to the handlers: EventDispatch::sendEvent(evt); // void EventDispatch::sendEvent(const Event &event); (EventDispatch contains a linked list of IHandlers and calls their onEvent(const Event &event) method with the parameter containing the sent event. Now the actual question: Say I want my handlers to poll the events in a queue of type Event, how do I do that? x Dynamic pointers with reference counting sound like too big of a solution. x Making copies is more difficult than it sounds, since I'm only receiving a reference to a base type, therefore each time I would need to check the type of event, upcast to EventKey and then make a copy to store in a queue. Sounds like the only solution - but is unpleasant since I would need to know every single type of event and would have to check that for every event received - sounds like a bad plan. x I could allocate the events dynamically and then send around pointers to those events, enqueue them in the array if wanted - but other than having reference counting - how would I be able to keep track of that memory? Do you know any way to implement a very light reference counter that wouldn't interfere with the user? What do you think would be a good solution to this design? I thank everyone in advance for your time. Sincerely, Kaa

    Read the article

  • In CQRS (event-sourced), do you need a global sequence counter in the event store?

    - by Jon M
    In trying to get my head around CQRS (and DDD in general) I have come across situations when two events occur on different aggregates but the order of them has domain meaning. If so then they could happen so close together that a timestamp (as used by the sample implementations I have seen) cannot differentiate them, meaning the event store doesn't contain a 'complete' representation of the domain as there is ambiguity over the order in which events occurred. As an example, the domain could fire a CustomerCreatedEvent which applies to the Customer aggregate, and then a CustomerAssignedToAgent event on the Agent aggregate. The CustomerAssignedToAgent event doesn't make sense if it occurs before the CustomerCreatedEvent, but typically both of these might be fired as a result of one operation which makes it likely that the timestamps would effectively be the same. So am I just modelling things badly? Should there ever be a situation where the sequence of events across different aggregates is important? Or should you keep a global sequence number on your event store, so that you can identify the exact sequence in which events occurred?

    Read the article

  • C++ and C#, "Casting" Functions to Delegates, What's the scoop?

    - by Jacob G
    In C# 2.0, I can do the following: public class MyClass { delegate void MyDelegate(int myParam); public MyClass(OtherObject obj) { //THIS IS THE IMPORTANT PART obj.SomeCollection.Add((MyDelegate)MyFunction); } private void MyFunction(int myParam); { //... } } Trying to implement the same thing in C++, it appears I have to do: MyDelegate del = gcnew MyDelegate(this, MyFunction); obj-SomeCollection-Add(del); Obviously I can create a new instance of the delegate in C# as well instead of what's going on up there. Is there some kind of magic going on in the C# world that doesn't exist in C++ that allows that cast to work? Some kind of magic anonymous delegate? Thanks.

    Read the article

  • Only assignment, call, increment, decrement, and new object expressions can be used as a statement : Messagebox

    - by Nuru Salihu
    This what i am trying to achieved if(this.BeginInvoke((Action)(() => MessageBox.Show("Test", MessageBoxButtons.YesNo) == DialogResult.No))) The above gives error. I try seperating the delegate to an outside method like delegate void test(string text); private void SetTest(string text) { if(MessageBox.Show(text,"", MessageBoxButtons.YesNo) == DialogResult.No) } But it breach the very reason why i need the delegate. I found out the first works for me but i don't know how to put it in an if/else statement. Pls any help in a better way i can achieve some thing like below would be appreciated. if(this.BeginInvoke((Action)(() => MessageBox.Show("Test", MessageBoxButtons.YesNo) == DialogResult.No)))

    Read the article

  • Syncing Data to Remote Services, Best Practices for Caching?

    - by viatropos
    I want to be able to publish events to Eventbrite, Eventful, and Google Calendar for my Google Apps. Each service has slightly different properties for events... I will be syncing many other things too, such as users with Google Contacts and MailChimp, Documents with Google Docs and some other services, etc... So I'm wondering, what is the recommended way of retrieving the data for the end user so that it's reasonably maintainable and optimized? Here are the things I'm thinking that I'm having trouble with: My App keeps a central database of all the models (Event, Document, User, Form, etc.), and whenever Admin creates an object (e.g. create through Eventbrite or through our Admin panel), we sync them and store a copy in our local database. When User goes to the site /events, App retrieves the events from the database. Read Events from a target feed, such as the Eventbrite or Eventful feed, and scrap the local database. Basically, I'm wondering, if we're storing all of the data on a remote service, do we really need to have a local database copy of the data? When would we need to have a local database, when wouldn't we?

    Read the article

  • undefined method `events' for #<ActiveRecord::Relation:0x4177518> -rails 3.0.3

    - by brg
    I am having this unexplained NoMethodError with undefined method `events' for #. I don't know why since my model association are well defined and the event table has the foreign keys for the user table. I tried using this fix but it failed: Rails 3 ActiveRecord::Relation random associations behavior event.rb class Event < ActiveRecord::Base belongs_to :user attr_accessible :event_name, :Starts_at, :finish, :tracks end user.rb class User < ActiveRecord::Base has_many :events, :dependent = :destroy attr_accessible :name, :event_attributes accepts_nested_attributes_for :events, :allow_destroy = true end schema.rb ActiveRecord::Schema.define(:version = 20101201180355) do create_table "events", :force = true do |t| t.string "event_name" t.string "tracks" t.datetime "starts_at" t.datetime "finish" t.datetime "created_at" t.datetime "updated_at" t.integer "user_id" end end error message NoMethodError in Users#index undefined method `events' for # Extracted source (around line #10): 7: <%= sortable "Tracks" % 8: 10: <% @users.events.each do |event| % 11: <% debugger % 12: 13: <%= event.starts_at % Trace of template inclusion: app/views/users/index.html.erb Rails.root: C:/rails_project1/events_manager Application Trace | Framework Trace | Full Trace app/views/users/_event_user.html.erb:10:in _app_views_users__event_user_html_erb__412443848_34308540_1390678' app/views/users/index.html.erb:7:in_app_views_users_index_html_erb___603337143_34316016_0'

    Read the article

  • .NET "Timer" would block other method calls?

    - by Ricky
    Hi guys: In ASP.NET 3.5, we suspect a delegate triggering by a "Timer" will block other method calls. From logs, some function calls will wait for the finishing of the delegate and continue to work. Is it true? If yes, what workaround can I do? PS: The delegate contains codes to use WCF to retrieve data and the following code private void Replace<T>(ref IList<T> src, IList<T> des) { lock(src) { while (src.Count > 0) { GC.SuppressFinalize(src.ElementAt(0)); src.RemoveAt(0); } GC.SuppressFinalize(src); src = des; } } Thanks a lot.

    Read the article

  • How should I map an abstract class with simple xml in Java?

    - by spderosso
    Hi, I want to achieve the following xml using simple xml framework (http://simple.sourceforge.net/): <events> <course-added date="01/01/2010"> ... </course-added> <course-removed date="01/02/2010"> .... </course-removed> <student-enrolled date="01/02/2010"> ... </student-enrolled> </events> I have the following (but it doesn't achieve the desired xml): @Root(name="events") class XMLEvents { @ElementList(inline=true) ArrayList<XMLEvent> events = Lists.newArrayList(); ... } abstract class XMLEvent { @Attribute(name="date") String dateOfEventFormatted; ... } And different type of XMLNodes that have different information (but are all different types of events) @Root(name="course-added") class XMLCourseAdded extends XMLEvent{ @Element(name="course") XMLCourseLongFormat course; .... } @Root(name="course-removed") class XMLCourseRemoved extends XMLEvent { @Element(name="course-id") String courseId; ... } How should I do the mapping or what should I change in order to be able to achieve de desired xml? Thanks!

    Read the article

  • iPhone Application crashing upon loading a new Detail View

    - by Jeb Sears
    Hi, My problem is when trying to load a detail view through a table cell, the application constantly crashes. The error that comes up when running through debug is "__TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___" objc exception thrown. If anyone can help me it would be greatly appreciated. Here is a screenshot for the debug, I am not sure if I am interpreting it right http://img43.imageshack.us/img43/2143/errorud.png Here is my code where I beleive the error is happening: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSInteger row = [indexPath row]; if(self.moreDetailView == nil){ DetailViewController *dvController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:[NSBundle mainBundle]]; self.moreDetailView = dvController; [dvController release]; } else{} moreDetailView.title = [NSString stringWithFormat:@"%@", [listOfItems objectAtIndex:row]]; goHerdv2AppDelegate *delegate = [[UIApplication sharedApplication] delegate]; [delegate.detailView pushViewController:moreDetailView animated:YES];}

    Read the article

  • C++/CLI and C#, "Casting" Functions to Delegates, What's the scoop?

    - by Jacob G
    In C# 2.0, I can do the following: public class MyClass { delegate void MyDelegate(int myParam); public MyClass(OtherObject obj) { //THIS IS THE IMPORTANT PART obj.SomeCollection.Add((MyDelegate)MyFunction); } private void MyFunction(int myParam); { //... } } Trying to implement the same thing in C++/CLI, it appears I have to do: MyDelegate del = gcnew MyDelegate(this, MyFunction); obj-SomeCollection-Add(del); Obviously I can create a new instance of the delegate in C# as well instead of what's going on up there. Is there some kind of magic going on in the C# world that doesn't exist in C++/CLI that allows that cast to work? Some kind of magic anonymous delegate? Thanks.

    Read the article

  • Which PHP calendar will suit my needs? Or build my own?

    - by John
    There are so many web based calendars out there that I'm not sure which will best suit my purposes. I want to create an events calendar, which I suppose looks and functions in much the same way as google calendar. But users shouldn't need to sign up for a gmail account or a google account. Users of my social network website should be able to create events in the calendar and share it with other friends in their "friend network". In month, year or day views, you can mouse hover events to see a bubble dialog that lists events in detail. People need to pay a monthly fee to use my website (not sure if this prevents me from using google apps). So is something like Google Calendar the way to go? Or are there other php/javascript calendars out there that already meet my needs? Or will it just save me more time to build my own?

    Read the article

  • Jquery UI dialog initiation? Is there a way to bind it?

    - by Raja
    I am trying to bind the dialog initiation (which happens in document ready) to a live or delegate for a div. Something like this for click event: $("#divSelectedContacts").delegate("span", "hover", function () { $(this).toggleClass("strikeOut"); }); for this: $("#divContacts").dialog('destroy').dialog({ bgiframe: true, resizable: false, autoOpen: false, height: 600, width: 425, modal: true, overlay: { backgroundColor: '#000', opacity: 0.5 }, buttons: { Cancel: function () { //basically do nothing $(this).dialog("close"); }, 'Done': function () { //get all the selected ppl and store it in To //alert($("#divSelectedContacts").html()); $("#divTo").empty().html($("#divSelectedContacts").html()); $(this).dialog("close"); } } }); Is this possible to use delegate for this so that it is bound forever? The main problem is I dynamically load the html in one of the tabs and when I include the dialog script in the HTML then it creates multiple dialogs and does not work. Any help is much appreciated. Thanks in advance.

    Read the article

  • Sum up values in SQL once all values are available

    - by James Brown
    I have events flowing into a MySQL database and I need to group and sum the events to transactions and store away into another table. The data looks like: +----+---------+------+-------+ | id | transid | code | value | +----+---------+------+-------+ | 1 | 1 | b | 12 | | 2 | 1 | i | 23 | | 3 | 2 | b | 34 | | 4 | 1 | e | 45 | | 5 | 3 | b | 56 | | 6 | 2 | i | 67 | | 7 | 2 | e | 78 | | 8 | 3 | i | 89 | | 9 | 3 | i | 90 | +----+---------+------+-------+ The events arrive in batches and I would like to create the transaction by summing up the values for each transid, like: select transid, sum(value) from eventtable group by transid; but only after all the events for that transid have arrived. That is determined by the event with the code e (b for the beginning, e for the end and i for varying amount of intermediates). Being a novice in SQL, how could I implement the requirement for the existance of the end code before the summing?

    Read the article

  • more button in calendar

    - by yogsma
    Does anyone know jquery plugin for more button in month view of a calendar which shows all events of a particular date in case those events are not getting accommodated in that date. edit++ I want a jquery plugin for table row resizing. Month view of calendar is shown in table format and sometimes all the events of a particular day do not get accommodated in that table cell. So does anyone know a jquery plugin for table row resizing?

    Read the article

  • Reading data from a MySQL database into a HTML Table?

    - by Michael McKay
    So i am working on a project and need some advice. I have a MySQL database that stores events, i know how to code this functionality in PHP but im just stuck of a few specifics. As the project that I am creating is a timetable, the most important attributes are the day of the event, starting time and finishing time. Once i have read this data from the MYSQL database using my PHP script, how do i go about inserting these events in to a html timetable? Lets say i have record like below in my events table: Event ID = 01 Event Day = Monday Event Start = 12:00 Event End = 14:00 How would I then put that into a html table, bearing in mind that i may have mutiple events for a day?

    Read the article

< Previous Page | 130 131 132 133 134 135 136 137 138 139 140 141  | Next Page >