Search Results

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

Page 169/1024 | < Previous Page | 165 166 167 168 169 170 171 172 173 174 175 176  | Next Page >

  • Processing a stream. Must layers be violated?

    - by Lord Tydus
    Theoretical situation: One trillion foobars are stored in a text file (no fancy databases). Each foobar must have some business logic executed on it. A set of 1 trillion will not fit in memory so the data layer cannot return a big set to the business layer. Instead they are to be streamed in 1 foobar at a time, and have business logic execute on 1 foobar at a time. The stream must be closed when finished. In order for the stream to be closed the business layer must close the stream (a data operation detail), thus violating the separation of concerns. Is it possible to incrementally process data without violating layers?

    Read the article

  • processing gamestate with a window of commands across time?

    - by rook2pawn
    I have clients sending client updates at a 100ms intervals. i pool the command inputs and create a client command frame. the commands come into the server in these windows and i tag them across time as they come in. when i do a server tick i intend to process this list of commands i.e. [ {command:'duck',timestamp:350,player:'a'}, {command:'shoot',timestamp:395,player:'b'}, {command:'move', timestamp:410,player:'c'} {command:'cover',timestamp:420,player:'a'} ] how would i efficiently update the gamestate based on this list? the two solutions i see are 1) simulate time via direct equation to figure out how far everyone would move or change as if the real gameupdate was ticking on the worldtick..but then unforseen events that would normally trigger during real update would not get triggered such as powerups or collissions 2) prepare to run the worldupdate multiple times and figure out which commands get sent to which worldupdate. this seems better but a little more costly is there a canonical way to do this?

    Read the article

  • How to better explain complex software process in software specs?

    - by Lostsoul
    I'm really struggling with my software specs. I am not a professional programmer but enjoy doing it for fun and made some software that I want to sell later but I'm not happy with the code quality. So I wanted to hire a real developer to rewrite my software in a more professional way so it will be maintainable by other developers in the future. I read and found some sample specs and made my own by applying their structure to my document and wanted to get my developer friend to read it and give me advice. After an hour and a half he understood exactly what I was trying to do and how I did it(my algorithms,stack,etc.). How can I get better at explaining things to developers? I add many details and explanations for everything(including working code) but I'm unsure the best way I can learn to pass detailed domain knowledge(my software applies big data, machine learning, graph theory to finance). My end goal is to get them to understand as much as possible from the document and then ask anything they do not understand, but right now it seems they need to extract alot of information from me. How can I get better at communicating domain knowledge to developers?

    Read the article

  • How do I know if I've gone too far with processing things in a game?

    - by ThePlan
    A common programming quote I see every day is: Premature optimization is the root of all evil! I admit I'm one of those guys that like to do premature optimization in a pretty obssessive manner but that's probably because I'm not aware how powerful modern processors are. I can think of lots of sollutions for a problem, but all of them are tough on the memory side, and I keep thinking "This will hurt me more in the future when I'll have to re-do it because it's bad performance-wise." How do you know when the code you are thinking of is going too far and is not a case of premature optimization? How much can your game handle at a time before performance becomes a problem?

    Read the article

  • How can I get better at explaining complex software processes to developers?

    - by Lostsoul
    I'm really struggling with my software specs. I am not a professional programmer but enjoy doing it for fun and made some software that I want to sell later but I'm not happy with the code quality. So I wanted to hire a real developer to rewrite my software in a more professional way so it will be maintainable by other developers in the future. I read and found some sample specs and made my own by applying their structure to my document and wanted to get my developer friend to read it and give me advice. After an hour and a half he understood exactly what I was trying to do and how I did it(my algorithms,stack,etc.). How can I get better at explaining things to developers? I add many details and explanations for everything(including working code) but I'm unsure the best way I can learn to pass detailed domain knowledge(my software applies big data, machine learning, graph theory to finance). My end goal is to get them to understand as much as possible from the document and then ask anything they do not understand, but right now it seems they need to extract alot of information from me. How can I get better at communicating domain knowledge to developers?

    Read the article

  • How complex/straightforward should my programming challenge response in an interview be? [closed]

    - by atraudes
    I've had a couple of interviews for programmer positions in the past couple of weeks, and just about all of them have presented me with programming challenges. Write a program with XX language that can solve XX puzzle or problem, etc. I've had no problem answering the questions. What I'm unsure about is what the depth and breadth my response should be. What would an ideal response look like? How much oomph and time should I spend on elements of the code that aren't crucial to it running (Comments, Javadoc, error handling, etc.)? What if I have 1 hour/6 hours/a whole weekend to spend on it? What are the most important aspects of my response to the interviewer? What's worked for you in the past or what worked on you as an interviewer? I'm definitely one of those folks that can go all out on a project and make it truly shine, but I don't want to give them the impression that I'm going to waste their time and money on stuff they may not want or care about. I have a sneaking feeling there is no "wrong" way to respond to the challenge; each response has a redeeming quality about it, and the goals of the interview are subjective. Regardless, I would love your thoughts and input on this.

    Read the article

  • C# Prevent ItemChecked event on a ListView from Interering with SubItemClicked?

    - by John M
    I am using a in-place editable listview control for a project. The editable listview adds a 'SubItemClicked' event so that each 'cell' can be edited. lstSD2.SubItemClicked += new ListViewEx.SubItemEventHandler(lstSD2_SubItemClicked); I also have the listview checkboxes enabled with a 'ItemChecked' event. The problem is that once the 'ItemChecked' event is enabled double-clicking on any row fires the 'ItemChecked' event and prevents the 'SubItemClicked' event from firing. Is there a way to enforce the need to actually 'check' the listview checkbox instead of firing whenever the row is double-clicked?

    Read the article

  • Use a "x-dom-event-stream" stream in javascript ?

    - by rnaud
    Hello, HTML5 draft contains an API called EventSource to stream data (notifications) trough javascript using only one server call. Looking it up, I found an exemple on Opera Labs of the javascript part : document.getElementsByTagName("event-source")[0] .addEventListener("server-time", eventHandler, false); function eventHandler(event) { // Alert time sent by the server alert(event.data); } and the server side part : <?php header("Content-Type: application/x-dom-event-stream"); while(true) { echo "Event: server-time\n"; $time = time(); echo "data: $time\n"; echo "\n"; flush(); sleep(3); } ?> But as of today, it seems only Opera has implemented the API, neither Chrome nor Safari have a working version (Am I wrong here ?) So my question is, is there any other way in javascript, maybe more complex, to use this one stream to get data ?

    Read the article

  • Is there a way to catch a MOUSE_UP Event over a static textfield in Flash?

    - by Jovica Aleksic
    When the user presses the mouse, and releases it over a static textfield with selectable text, no MOUSE_UP event is fired - not on the stage and also nowhere else. I experienced this when using a scrollbar class on a movieclip with a nested static textfield. When the user drags the scroll handle and releases the mouse over the textfield, the dragging/scrolling is stuck. To test this, create a new AS3 fla file, place a static textfield somewhere, and put in some text. Make sure the selectable property is checked in the properties panel. Add this script to the timeline: import flash.events.* function down(event:Event):void { trace('down'); } function up(event:Event):void { trace('up'); } stage.addEventListener(MouseEvent.MOUSE_DOWN, down) stage.addEventListener(MouseEvent.MOUSE_UP, up) Now test the movie and click the mouse. You will notice that trace('up') will not occur when you release the mouse over the textfield.

    Read the article

  • what causes the .NET SerialPort class DataReceived event to fire?

    - by Klay
    I understand from the MSDN docs that the event DataReceived will not necessarily fire once per byte. But does anyone know what exactly is the mechanism that causes the event to fire? Does the receipt of each byte restart a timer that has to reach, say 10 ms between bytes, before the event fires? I ask because I'm trying to write an app that reads XML data coming in from a serial port. Because my laptop has no serial ports, I use a virtual serial port emulator. (I know, I know--I can't do anything about it ATM). When I pass data through the emulated port to my app, the event fires once for each XML record (about 1500 bytes). Perfect. But when a colleague at another office tries it with two computers connected by an actual cable, the DataReceived event fires repeatedly, after every 10 or so bytes of XML, which totally throws off the app.

    Read the article

  • Help! How to get the event handler with IE Dom interfaces?

    - by usfree74
    Hey Gurus, I am working to use IE Dom interface to automate IE page access. I am trying to get all event handlers defined in a page. I am using IHTMLElement object now for this purpose. If the html page defines "onclick=xxx", element.onclick returns the click handler. However, if an event handler is defined in javascript, element.onclick simply returns NULL. What's the right way to get the event handler then? Thanks, xin Below is an example that uses javascript to define event handler. $(document).ready(function(){ $("a").click(function(event){ $(this).hide("slow"); alert("Thanks for visiting!"); window.location="http://cnn.com"; }); }); jQuery

    Read the article

  • Doctrine: Relating a model to itself using a link table, like "This event is related to to the following other events"

    - by mattalexx
    So in English, the relationship would sound like "This event is related to to the following other events". My first instinct is to create an EventEvent model, with a first_event_id field and a second_event_id field. Then I would define the following two relationships in the Event model: $this->hasMany('Event as FirstRelatedEvents', array('local' => 'first_event_id', 'foreign' => 'second_event_id', 'refClass' => 'EventEvent')); $this->hasMany('Event as SecondRelatedEvents', array('local' => 'second_event_id', 'foreign' => 'first_event_id', 'refClass' => 'EventEvent')); But I would rather not have to use two relationships on the Event model. Is there a better way to do this?

    Read the article

  • How can I stop a default event when using a named function in addEvent?

    - by Rupert
    Normally, if I wish to stop a default event in mootools I can do this: $('form').addEvent('submit', function(e) { e.stop(); //Do stuff here } However, I don't like using an anonymous function in events because I often want to reuse the code. Lets say I have a validate function. I could do this: $('form').addEvent('submit', validate); which works fine until I want to stop the default event. validate obviously doesn't know what e is so I can't just do e.stop(). Also I've tried passing the event as a variable to validate but whenever I use a named function with parameters, the function gets called automatically on domready, rather than on the event firing. Even worse, an error is thrown when the event is fired: What am I doing wrong?

    Read the article

  • Does javascript event handling occur inside or outside the program flow?

    - by Carlo Roosen
    This question is related to Javascript event handling and flow control, but it is one step beyond. The question that remains unanswered is: when an event is fired and control is returned to the browser, could the browser decide to handle other events first (fired by other scripts or user action) (A), or will it always handle my event directly (B)? The question is important, because in case (B) you can rely on the fact that nothing has been changed between firing the event and the event handler, while (A) gives no guarantees whatsoever. My first guess is (B), how else could stopPropagation() and preventDefault() work? But giving it a second thought, it is no hard evidence.

    Read the article

  • How do I load multiple FLV files, with the same COMPLETE event handler?

    - by Josamoto
    When loading files with the Loader in ActionScript 3, I am able to inspect the event attribute on the complete event handler to determine what the URL is for the file that has completed downloading. Loader exposes a variable in the event handler attribute: event.target.url which I means that when the handler returns, I can easily determine which file is loading. However, my client has sent numerous FLV files built in After Effects that constitute the UI elements of a Flash application built for them. Loading FLV files require the use of URLLoader, and this does not appear to expose the name of the file being loaded. So I either need to convert the FLV's to SWF, so I can load them as normal. Is there a way to determine the URL inside the onComplete event handler fired by URLLoader?

    Read the article

  • Where to put data management rules for complex data validation in ASP.NET MVC?

    - by TheRHCP
    Hello, I am currently working on an ASP.NET MVC2 project. This is the first time I am working on a real MVC web application. The ASP.NET MVC website really helped me to get started really fast, but I still have some obscure knowledge concerning datamodel validation. My problem is that I do not really know where to manage my filled datamodel when it comes to complex validation rules. For example, validating a string field with a Regex is quite easy and I know that I just have to decorate my field with a specific attribute, so data management rules are implemented in the model. But if I have multiple fields that I need to validate which each other, for example multiple datetime that need to be correctly set following a specific time rule, where do I need to validate them? I know that I could create my own validation attributes, but sometimes validation ask a specific validation path which is to complex to be validated using attributes. This first question also leads me to a related question which is, is it right to validate a model in the controller? Because for the moment that is the only way I found for complex validation. But I find this a bit dirty and I feel it does not really fit a the controller role and much harder to test (multiple code path). Thanks.

    Read the article

  • initscript mysql, action "start" failed. dpkg: error processing mysql-server-5.0 (--configure)

    - by mazgalici
    2 not fully installed or removed. Need to get 0B of archives. After unpacking 0B of additional disk space will be used. Do you want to continue [Y/n]? y Setting up mysql-server-5.0 (5.0.32-7etch12) ... Stopping MySQL database server: mysqld. Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed! invoke-rc.d: initscript mysql, action "start" failed. dpkg: error processing mysql-server-5.0 (--configure): subprocess post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of mysql-server: mysql-server depends on mysql-server-5.0; however: Package mysql-server-5.0 is not configured yet. dpkg: error processing mysql-server (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: mysql-server-5.0 mysql-server E: Sub-process /usr/bin/dpkg returned an error code (1)

    Read the article

  • Scalably processing large amount of comlpicated database data in PHP, many times a day.

    - by Eph
    I'm soon to be working on a project that poses a problem for me. It's going to require, at regular intervals throughout the day, processing tens of thousands of records, potentially over a million. Processing is going to involve several (potentially complicated) formulas and the generation of several random factors, writing some new data to a separate table, and updating the original records with some results. This needs to occur for all records, ideally, every three hours. Each new user to the site will be adding between 50 and 500 records that need to be processed in such a fashion, so the number will not be steady. The code hasn't been written, yet, as I'm still in the design process, mostly because of this issue. I know I'm going to need to use cron jobs, but I'm concerned that processing records of this size may cause the site to freeze up, perform slowly, or just piss off my hosting company every three hours. I'd like to know if anyone has any experience or tips on similar subjects? I've never worked at this magnitude before, and for all I know, this will be trivial to the server and not pose much of an issue. As long as ALL records are processed before the next three hour period occurs, I don't care if they aren't processed simultaneously (though, ideally, all records belonging to a specific user should be processed in the same batch), so I've been wondering if I should process in batches every 5 minutes, 15 minutes, hour, whatever works, and how best to approach this (and make it scalable in a way that is fair to all users)?

    Read the article

  • stopping backspace on multiple browsers using jQuery

    - by jboyd
    I am attempting to stop a backspace keydown event from being handled by browsers, I'm using the jquery library, so I need to get the original event, but on some browsers (firefox at least) I get an error when trying to set the original events keyCode = 0, it gives and error saying that only a getter exists for that property. function blockBackspace(event) { var altKey = event.originalEvent.altKey; var srcElementType = event.originalEvent.srcElement; if( (altKey) || ((event.keyCode == 8) && (srcElementType != "text" && srcElementType != "textarea" && srcElementType != "password")) || ((event.ctrlKey) && ((event.keyCode == 78) || (event.keyCode == 82)) ) || (event.keyCode == 116) ) { event.keyCode = 0; event.returnValue = false; event.originalEvent.keyCode = 0; event.originalEvent.returnValue = false; //sets process backspaceFlag to keep multiple handlers from removing text processBackspace = true; } } so I'm not exactly sure what to do next, every solution I find yields more problems. There must be ways around this problem or else other text areas (that's kind of what I'm building) would not work

    Read the article

  • struct constructor + function parameter

    - by Oops
    Hi, I am a C++ beginner. I have the following code, the reult is not what I expect. The question is why, resp. what is wrong. For sure, the most of you see it at the first glance. struct Complex { float imag; float real; Complex( float i, float r) { imag = i; real = r; } Complex( float r) { Complex(0, r); } std::string str() { std::ostringstream s; s << "imag: " << imag << " | real: " << real << std::endl; return s.str(); } }; class Complexes { std::vector<Complex> * _complexes; public: Complexes(){ _complexes = new std::vector<Complex>; } void Add( Complex elem ) { _complexes->push_back( elem ); } std::string str( int index ) { std::ostringstream oss; Complex c = _complexes->at(index); oss << c.str(); return oss.str(); } }; int main(){ Complexes * cs = new Complexes(); //cs->Add(123.4f); cs->Add(Complex(123.4f)); std::cout << cs->str(0); return 0; } for now I am interested in the basics of c++ not in the complexnumber theory ;-) it would be nice if the "Add" function does also accept one real (without an extra overloading) instead of only a Complex-object is this possible? many thanks in advance Oops

    Read the article

  • Why does the roll_out event fire in this code?

    - by user339681
    I have made this simple example to demonstrate some problems I'm having. <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Canvas id="buttonCanvas" x="100" y="100" opaqueBackground="#000000" width="80%" height="300" creationComplete="init(event)"> <mx:Button x="5" y="5"/> <mx:Button x="5" y="50"/> </mx:Canvas> <mx:Script> <![CDATA[ private function init(event:Event):void{ buttonCanvas.addEventListener(MouseEvent.ROLL_OUT, function(event:Event):void{ buttonCanvas.opaqueBackground=(buttonCanvas.opaqueBackground==0)? 0x666666:0; }); } ]]> </mx:Script> </mx:Application> I don't understand the following: Why doesn't the percentage nor absolute dimensions affect the canvas? Why does the roll_out event fire when the mouse leaves a button (even when it is still inside the canvas). I'm going nuts trying to figure this out. Any help would be greatly appreciated!

    Read the article

  • How to avoid raising an event to a closed form?

    - by Steve Dignan
    I'm having trouble handling the scenario whereby an event is being raised to a closed form and was hoping to get some help. Scenario (see below code for reference): Form1 opens Form2 Form1 subscribes to an event on Form2 (let's call the event FormAction) Form1 is closed and Form2 remains open Form2 raises the FormAction event In Form1.form2_FormAction, why does this return a reference to Form1 but button1.Parent returns null? Shouldn't they both return the same reference? If we were to omit step 3, both this and button1.Parent return the same reference. Here's the code I'm using... Form1: public partial class Form1 : Form { public Form1 () { InitializeComponent(); } private void button1_Click ( object sender , EventArgs e ) { // Create instance of Form2 and subscribe to the FormAction event var form2 = new Form2(); form2.FormAction += form2_FormAction; form2.Show(); } private void form2_FormAction ( object o ) { // Always returns reference to Form1 var form = this; // If Form1 is open, button1.Parent is equal to form/this // If Form1 is closed, button1.Parent is null var parent = button1.Parent; } } Form2: public partial class Form2 : Form { public Form2 () { InitializeComponent(); } public delegate void FormActionHandler ( object o ); public event FormActionHandler FormAction = delegate { }; private void button1_Click ( object sender , EventArgs e ) { FormAction( "Button clicked." ); } } Ideally, I would like to avoid raising events to closed/disposed forms (which I'm not sure is possible) or find a clean way of handling this in the caller (in this case, Form1). Any help is appreciated.

    Read the article

  • How to defer execution of an Event on each item in a collection until iteration of collection is com

    - by Metro Smurf
    Of Note: This is more of a curiosity question than anything else. Given a List<Window> where each window has an event attached to the Close Event which removes the window from the collection, how could you use delegates / events to defer the execution of the Close Event until the collection has been iterated? For example: public class Foo { private List<Window> OpenedWindows { get; set; } public Foo() { OpenedWindows = new List<Window>(); } public void AddWindow( Window win ) { win.Closed += OnWindowClosed; OpenedWindows.Add( win ); } void OnWindowClosed( object sender, EventArgs e ) { var win = sender as Window; if( win != null ) { OpenedWindows.Remove( win ); } } void CloseAllWindows() { // obviously will not work because we can't // remove items as we iterate the collection // (the close event removes the window from the collection) OpenedWindows.ForEach( x => x.Close() ); // works fine, but would like to know how to do // this with delegates / events. while( OpenedWindows.Any() ) { OpenedWindows[0].Close(); } } } Specifically, within the CloseAllWindows() method, how could you iterate the collection to call the close event, but defer the event being raised until the collection has been completely iterated?

    Read the article

< Previous Page | 165 166 167 168 169 170 171 172 173 174 175 176  | Next Page >