Search Results

Search found 25579 results on 1024 pages for 'complex event processing'.

Page 77/1024 | < Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >

  • Exited event of Process is not rised?

    - by Kanags.Net
    In my appliation,I am opening an excel sheet to show one of my Excel documents to the user.But before showing the excel I am saving it to a folder in my local machine which in fact will be used for showwing. While the user closes the application I wish to close the opened excel files and delete all the excel files which are present in my local folder.For this, in the logout event I have written code to close all the opened files like shown below, Process[] processes = Process.GetProcessesByName(fileType); foreach (Process p in processes) { IntPtr pFoundWindow = p.MainWindowHandle; if (p.MainWindowTitle.Contains(documentName)) { p.CloseMainWindow(); p.Exited += new EventHandler(p_Exited); } } And in the process exited event I wish to delete the excel file whose process is been exited like shown below void p_Exited(object sender, EventArgs e) { string file = strOriginalPath; if (File.Exists(file)) { //Pdf issue fix FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read); fs.Flush(); fs.Close(); fs.Dispose(); File.Delete(file); } } But the problem is this exited event is not called at all.On the other hand if I delete the file after closing the MainWindow of the process I am getting an exception "File already used by another process". Could any help me on how to achieve my objective or give me an reason why the process exited event is not being called?

    Read the article

  • server controls complex properties with sub collections.

    - by Richard Friend
    Okay i have a custom server control that has some autocomplete settings, i have this as follows and it works fine. /// <summary> /// Auto complete settings /// </summary> [System.ComponentModel.DesignerSerializationVisibility (System.ComponentModel.DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty), Category("Data"), Description("Auto complete settings"), NotifyParentProperty(true)] public AutoCompleteLookupSettings AutoComplete { private set; get; } I also have a ParameterCollection that is really related to the auto complete settings, currently this collection resides off the control itself like so : /// <summary> /// Parameters for any data lookups /// </summary> [System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty)] public ParameterCollection Parameters { get; set; } What i would like to do is move the parameter collection inside of the AutoCompleteSettings as it really relates to my autocomplete, i have tried this but to no avail.. I would like to move from <cc1:TextField ID="TextField1" runat='server'> <AutoComplete MethodName="GetTest" TextField="Item1" TypeName ="AppFrameWork.Utils" /> <Parameters> <asp:ControlParameter ControlID="txtTest" PropertyName="Text" Name="test" /> </Parameters> </cc1:TextField> To <cc1:TextField ID="TextField1" runat='server'> <AutoComplete MethodName="GetTest" TextField="Item1" TypeName ="AppFrameWork.Utils" > <Parameters> <asp:ControlParameter ControlID="txtTest" PropertyName="Text" Name="test" /> </Parameters> </AutoComplete> </cc1:TextField>

    Read the article

  • C#. Saving information about events and event handlers and removing handlers using this information

    - by Philipp
    I have an object which is creating several event handlers using lambda expressions, and I need to remove all handlers created in that object in one time. I'm trying to create some unified static object which will 'know' which handler relates to which object and event if event handler was created through this static object. I tried something like code below, but I don't understand how to save events and event handlers objects, to be able remove handlers in one time. class Program { static void Main(string[] args) { var EventSender = new EventSender(); var EventReceiver = new EventReceiver(EventSender); EventSender.Invoke(" some var "); LinkSaver.RemoveEvent(EventReceiver); // ?? Console.ReadKey(); } } public class ObjLink{ public object Event; public object Action; } public static class LinkSaver { public static void SetEvent<T>(object obj, Action<T> Event, T Action) { Event(Action); var objLink = new ObjLink{Event = Event, Action = Action}; if (!Links.ContainsKey(obj)) Links.Add(obj, new List<ObjLink>{objLink}); else Links[obj].Add(objLink); } static Dictionary<object,List<ObjLink>> Links = new Dictionary<object, List<ObjLink>>(); public static void RemoveEvent(object obj){ foreach(var objLink in Links[obj]){ // objLink.Event -= objLink.Action; ??? } } } public class EventReceiver { public EventReceiver(EventSender obj) { LinkSaver.SetEvent<EventSender.TestDelegate>(this, obj.SetEvent, str => Console.WriteLine(str + " test event!")); } } public class EventSender { public void Invoke(string var) { if (eventTest != null) eventTest(var); } public void SetEvent(TestDelegate Action) { eventTest += Action; } public delegate void TestDelegate(string var); private event TestDelegate eventTest; // by the way public void RemoveFromEvent() { foreach (var handler in eventTest.GetInvocationList()) eventTest -= (TestDelegate)handler; } }

    Read the article

  • Complex sorting on MySQL database

    - by ChrisR
    I'm facing the following situation. We've got an CMS with an entity with translations. These translations are stored in a different table with a one-to-many relationship. For example newsarticles and newsarticle_translations. The amount of available languages is dynamically determined by the same CMS. When entering a new newsarticle the editor is required to enter at least one translation, which one of the available languages he chooses is up to him. In the newsarticle overview in our CMS we would like to show a column with the (translated) article title, but since none of the languages are mandatory (one of them is mandatory but i don't know which one) i don't really know how to construct my mysql query to select a title for each newsarticle, regardless of the entered language. And to make it all a little harder, our manager asked for the possibilty to also be able to sort on title, so fetching the translations in a separate query is ruled out as far as i know. Anyone has an idea on how to solve this in the most efficient way? Here are my table schema's it it might help > desc news; +-----------------+----------------+------+-----+-------------------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------------+----------------+------+-----+-------------------+----------------+ | id | int(10) | NO | PRI | NULL | auto_increment | | category_id | int(1) | YES | | NULL | | | created | timestamp | NO | | CURRENT_TIMESTAMP | | | user_id | int(10) | YES | | NULL | | +-----------------+----------------+------+-----+-------------------+----------------+ > desc news_translations; +-----------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------------+------------------+------+-----+---------+----------------+ | id | int(10) unsigned | NO | PRI | NULL | auto_increment | | enabled | tinyint(1) | NO | | 0 | | | news_id | int(1) unsigned | NO | | NULL | | | title | varchar(255) | NO | | | | | summary | text | YES | | NULL | | | body | text | NO | | NULL | | | language | varchar(2) | NO | | NULL | | +-----------------+------------------+------+-----+---------+----------------+ PS: i've though about subqueries and coalesce() solutions but those seem rather dirty tricks, wondering if something better is know that i'm not thinking of?

    Read the article

  • PDO Prepare statement not processing parameters

    - by Danten
    I've exhausted all efforts at what appears to be a trivial problem, but gotten nowhere. There is a simple Prepare statement: $qry = $core->db->prepare("SELECT * FROM users WHERE email = '?'"); $qry->execute(array('[email protected]')); However, no rows are returned. Running the query with the parameters hardcoded into the query results in a successful selection of one row. I've tryed many different methods of doing the prepare, but even it this most simple form it isn't working. The PDO object is stored in a singleton called Core. PDO is using the mysql driver.

    Read the article

  • Get the maximum value out of an complex class

    - by iTayb
    I have the following class: class Seller { private string sellerName; private decimal price; } ~propreties for SellerName and Price goes here~ I also have a list of sellers: list<Seller> s = new list<Seller>(); How can I get the maximum value of price out of all the sellers? Thank you very much.

    Read the article

  • complex regular expression task

    - by Don Don
    Hi, What regular expressions do I need to extract section title(s) in a text file? So, in the following sample text, I'd like to extract "Communication and Leadership" "1.Self-Knowledge" "2. Humility" "(3) Clear Thinking". Many thanks. Communication and Leadership True leaders understand that, rather than forcing their followers into a preconceived mold, their job is to motivate and organize followers to collectively accomplish goals that are in everyone's interests. The ability to communicate this to co-workers and followers is critical to the effectiveness of leadership. 1.Self-Knowledge Superior leaders are able to devote their skills and energies to leadership of a group because they have worked through personal issues to the point where they know themselves thoroughly. A high level of self-knowledge is a prerequisite to effective communication skills, because the things that you communicate as a leader are coming from within. 2. Humility This subversion of personal preference requires a certain level of humility. Although popular definitions of leaders do not always see them as humble, the most effective leaders actually are. This humility may not be expressed in self-effacement, but in a total commitment to the goals of the organization. Humility requires an understanding of one's own relative unimportance in comparison to larger systems. (3) Clear Thinking Clarity of thinking translates into clarity of communication. A leader whose goals or personal analysis is muddled will tend to deliver unclear or ambiguous directions to followers, leading to confusion and dissatisfaction. A leader with a clear mind who is not ambivalent about her purposes will communicate what needs to be done in a s traightforward and unmistakable manner.

    Read the article

  • Zend Database Adapter - Complex MySQL Query

    - by Sonny
    I have defined a function in my Navigation model that executes a query, and I was wondering if there's a more "Zendy" way of generating/executing the query. The query I'm using was proposed by Bill Karwin on another thread here for setting arbitrary record order. I tried using a prepared statement, but the values in the SIGN() function got quoted. I'm using the PDO adapter for MySQL. /** * */ public function setPosition($parentId, $oldPosition, $newPosition) { $parentId = intval($parentId); $oldPosition = intval($oldPosition); $newPosition = intval($newPosition); $this->getAdapter()->query(" UPDATE `navigation` SET `position` = CASE `position` WHEN $oldPosition THEN $newPosition ELSE `position` + SIGN($oldPosition - $newPosition) END WHERE `parent_id` = $parentId AND `position` BETWEEN LEAST($oldPosition, $newPosition) AND GREATEST($oldPosition, $newPosition) "); return $this; }

    Read the article

  • Complex regular expression

    - by Jose3d
    Hello, i will like to capture a substring part of a text choosing the number of characters but if any word is cut then get until de last blank. As example if this is the text: "This is an example of text lorem ipsum, etc..." and i would like to get for instance 12 characters that are: "This is an e". In this case example is cutted, then i would like to get "This is an". Its possible do this with Regular Expressions? Thanks in advance. Jose

    Read the article

  • mysql_fetch_object on complex objects

    - by Arsenal
    Say for example I have the follwoing DB structure Table book id title ... Table Author id name ... Table BookAuthor id bookid authorid And in PHP I have the following object class Book { var $id; var $title; var $authors = array(); function Book() {} } class Author { var $id; var $name; function Author(){} } Now, would it be possible using mysql_fetch_object to retrieve the bookobject including the authors as an array of author objects? If it's possible I'm pretty sure you'll need the basic inner join query SELECT * FROM tblbook INNER JOIN tblbookauthor on ... (wel you get the point) Is it possible? thanks!

    Read the article

  • Is this multi line if statement too complex?

    - by AndHeCodedIt
    I am validating input on a form and attempting to prompt the user of improper input(s) based on the combination of controls used. For example, I have 2 combo boxes and 3 text boxes. The 2 combo boxes must always have a value other than the first (default) value, but one of three, or two of three, or all text boxes can be filled to make the form valid. In one such scenario I have a 6 line if statement to try to make the test easily readable: if ((!String.Equals(ComboBoxA.SelectedValue.ToString(), DEFAULT_COMBO_A_CHOICE.ToString()) && !String.IsNullOrEmpty(TextBoxA.Text) && !String.Equals(ComboBoxB.SelectedValue.ToString(), DEFAULT_COMBO_B_CHOICE.ToString())) || (!String.IsNullOrEmpty(TextBoxB.Text) || !String.IsNullOrEmpty(TextBoxC.Text))) { //Do Some Validation } I have 2 questions: Should this type of if statement be avoided at all cost? Would it be better to enclose this test in another method? (This would be a good choice as this validation will happen in more than one scenario) Thanks for your input(s)!

    Read the article

  • Java date processing

    - by Don
    Hi, Given an instance of java.util.Date which is a Sunday. If there are 4 Sundays in the month in question, I need to figure out whether the chosen date is 1st Sunday of month 2nd Sunday of month 2nd last Sunday of month Last Sunday of month If there are 5 Sundays in the month in question, then I need to figure out whether the chosen date is 1st Sunday of month 2nd Sunday of month 3rd Sunday of month 2nd last Sunday of month Last Sunday of month I've had a look in JodaTime, but haven't found the relevant functionality there yet. The project is actually a Groovy project, so I could use either Java or Groovy to solve this. Thanks, Donal

    Read the article

  • How to display complex object in debugger?

    - by 4thSpace
    I'd like to display the contents of the property myarray, from the following singleton: [Session sharedManager].myarray I've tried these: po [Session sharedManager]. myarray po [[Session sharedManager] myarray] but always get this error: A syntax error near end of expression. Any suggestions?

    Read the article

  • [perl] Efficient processing of large text

    - by jesper
    I have text file that contains over one million urls. I have to process this file in order to assign urls to groups, based on host address: { 'http://www.ex1.com' = ['http://www.ex1.com/...', 'http://www.ex1.com/...', ...], 'http://www.ex2.com' = ['http://www.ex2.com/...', 'http://www.ex2.com/...', ...] } My current basic solution takes about 600mb of RAM to do this (size of file is about 300mb). Could You provide some more efficient ways? My current solution simply reads line by line, extracts host address by regex and put url into hash.

    Read the article

  • Custom Control Events in C#

    - by pm_2
    I'm trying to create a custom control and need to raise an event from it. The idea is to raise an event at the end of the click event (OnAfterClick). I found one or two tutorials on doing this, but am clearly missing a step somewhere; I have the following. In the control: public class AfterClickEventArgs : EventArgs { ... } public partial class MyButton : CommandButton { public delegate void AfterClickEvnt(object sender, AfterClickEventArgs e); public event AfterClickUpdatedEvnt AfterClick; } protected override void OnClick(EventArgs e) { ... Processing here ... AfterClickEventArgs myArgs = new AfterClickEventArgs(); AfterClick(this, newArgs); } In the program using the control: In InitializeComponent(): this.MyButton.AfterClick += new System.EventHandler(this.cmdMyButton_Click); This line is giving me a compile error (cmdMyButton_Click does exist). It tells me: Cannot implicitly convert type 'System.EventHandler' to 'Namespace.MyButton.AfterClick' Can anyone tell me what I'm missing, or misunderstanding about this, please?

    Read the article

  • Google checkout - Order processing notification handler

    - by Kunal
    Hi I need to integrate google checkout on my website. I have successfully implemented the order placing and others stuff and using the sandbox I have tested that users can successfully add items to cart and and pay thereafter. I am using my own customized shopping cart written in php mysql. The last thing I need to do is pass the new order id to google checkout and receive notifications with the new order id as well as other data google sends. I know I have to setup a path to the handler script in my accounts. I did it in my sandbox account as well. But can't find a simple pice of code to get it done. Even if I use sample code from google, just cant figure out the format of the returned data in new order notification and also how to send custom data to the cart, which would come back with new order notifications? I am just lost on this. Please help!

    Read the article

  • Reduce Processing Time of accessing databse

    - by medma
    hello all, I m making an app which requires remote databse connection. I want the values in picker from database but when I click on button to invoke picker it takes some time to fetch the values and displaying. Is there any way to do it fast? and also is there any way to reduce the time of transition between 2 views? Thanx

    Read the article

  • Best suited tool to document message processing done in C written program

    - by user3494614
    I am relatively new to UML and it's seems to be very vast I have a small program which basically receives messages on socket and then depending upon message ID embedded as first byte of message it processes the buffer. There are around 5 different message ID which it processes and communicates on another socket and has around 8 major functions. So program in short is like this. I am not pasting entire .c file or main function but just giving some bits and pieces of it so that to get idea of program flow. int main(int argc, char** argv) { register_shared_mem(); listen(); while(get_next_message(buffer)) { switch((msg)(buffer)->id) { case TYPE1: process1(); answer(); ..... } } } I want to document this is pictorial way like for Message type 1 it calls this function which calls another and which calls another. Please let me know any open source tool which will allow me to quickly draw such kind of UML or sequence diagram and will also allow me to write brief description of what each function does? Thanks In Advance

    Read the article

  • Django templatetag "order of processing"

    - by Jason Persampieri
    I am trying to write a set of template tags that allow you to easily specify js and css files from within the template files themselves. Something along the lines of {% requires global.css %}, and later in the request, {% get_required_css %}. I have this mostly working, but there are a couple of issues. We'll start with the 'timing' issues. Each template tag is made up of two steps, call/init and render. Every call/init happens before any render procedure is called. In order to guarantee that all of the files are queued before the {% get_required_css %} is rendered, I need to build my list of required files in the call/init procedures themselves. So, I need to collect all of the files into one bundle per request. The context dict is obviously the place for this, but unfortunately, the call/init doesn't have access to the context variable. Is this making sense? Anyone see a way around this (without resorting to a hack-y global request object)? Another possibility to store these in a local dict but they would still need to be tied to the request somehow... possibly some sort of {% start_requires %} tag? But I have no clue how to make that work either.

    Read the article

  • cron stops running when processing multiple items

    - by James
    Cron stops running (no visible error) after a few hours when I add more than 5 jobs in my cron tab. Each job runs every minute (polls a webpage for information which takes 1 second). I tried putting all of my php jobs in a shell script and called this shell script instead but the same problem occurs. Cron stops running, no error in the log file, no error email sent out either. Anyone encountered this before? Where/how canI debug this?

    Read the article

  • Codeigniter - Active record - sql - complex join

    - by Jack
    I have a function that retrieves all tags from a table: function global_popular_tags() { $this->db->select('tags.*, COUNT(tags.id) AS count'); $this->db->from('tags'); $this->db->join('tags_to_work', 'tags.id = tags_to_work.tag_id'); $this->db->group_by('tags.id'); $this->db->order_by('count', 'desc'); $query = $this->db->get()->result_array(); return $query; } I have another table called 'work'. The 'work' table has a 'draft' column with values of either 1 or 0. I want the COUNT(tags.id) to take into account whether the work with the specific tag is in draft mode (1) or not. Say there are 10 pieces of work tagged with, for example, 'design'. The COUNT will be 10. But 2 of these pieces of work are in draft mode, so the COUNT should really be 8. How do I manage this?

    Read the article

< Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >