Popular recipes tagged "framework" but not "dotnet"http://code.activestate.com/recipes/tags/framework-dotnet/2015-06-30T03:24:07-07:00ActiveState Code RecipesConsumer Application Skeleton (Python) 2015-06-30T03:24:07-07:00Vovanhttp://code.activestate.com/recipes/users/4192447/http://code.activestate.com/recipes/579074-consumer-application-skeleton/ <p style="color: grey"> Python recipe 579074 by <a href="/recipes/users/4192447/">Vovan</a> (<a href="/recipes/tags/application/">application</a>, <a href="/recipes/tags/consumer/">consumer</a>, <a href="/recipes/tags/daemon/">daemon</a>, <a href="/recipes/tags/framework/">framework</a>). Revision 2. </p> <h4 id="consumer-application-skeleton">Consumer Application Skeleton</h4> <p>This is very basic skeleton for data processing application implementing consumer pattern:</p> <pre class="prettyprint"><code>while is_running(): task = get_next_task_from_queue() if task: submit_task_for_processing(task) else: sleep_for_a_moment() </code></pre> <p>Here's an example:</p> <pre class="prettyprint"><code>class ExampleApp(ConsumerAppBase): def _get_next_task(self): # Get next task from the queue. return self._queue.next() def _run_task(self, task): # This code's being executed in separate worker thread of # ThreadPoolExecutor return task / 2 def _on_task_done(self, task, future): # Once worker thread finished - task results are available # in _on_task_done() callback as a concurrent.futures.Future object. self._log.info('Task done. Result: %s', future.result()) </code></pre> processing (Python) 2012-01-09T02:23:35-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578004-processing/ <p style="color: grey"> Python recipe 578004 by <a href="/recipes/users/2608421/">Stephen Chappell</a> (<a href="/recipes/tags/experiment/">experiment</a>, <a href="/recipes/tags/framework/">framework</a>, <a href="/recipes/tags/gui/">gui</a>). </p> <p>This module was inspired by <a href="http://processing.org/" rel="nofollow">http://processing.org/</a> . The code is meant to mimic an extremely small subset of this high-performance library. After seeing how easy it was to accomplish certain task in the Java framework, a desire was created to have a simple starting point to create little graphical experiments that would be easy to program without haveing to know a lot of details regarding setup, timing, et cetera. This is the result of that desire.</p> Attribute-based Framework 1: Basics (Python) 2010-07-21T21:40:54-07:00Jack Trainorhttp://code.activestate.com/recipes/users/4076953/http://code.activestate.com/recipes/577327-attribute-based-framework-1-basics/ <p style="color: grey"> Python recipe 577327 by <a href="/recipes/users/4076953/">Jack Trainor</a> (<a href="/recipes/tags/educational/">educational</a>, <a href="/recipes/tags/framework/">framework</a>, <a href="/recipes/tags/oop/">oop</a>, <a href="/recipes/tags/simulation/">simulation</a>). Revision 2. </p> <p>I am adapting Prof. David Cheriton's OO software methodology to Python. It's an approach for building industrial-strength code with a disciplined architecture, consistent naming conventions, and a rigorous division of interface from implementation. I'll be adding more of his techniques in further recipes. These recipes are based on Cheriton's CS249a course at Stanford.</p> Attribute-based Framework 2: Notifications (Python) 2010-07-23T20:12:10-07:00Jack Trainorhttp://code.activestate.com/recipes/users/4076953/http://code.activestate.com/recipes/577330-attribute-based-framework-2-notifications/ <p style="color: grey"> Python recipe 577330 by <a href="/recipes/users/4076953/">Jack Trainor</a> (<a href="/recipes/tags/educational/">educational</a>, <a href="/recipes/tags/framework/">framework</a>, <a href="/recipes/tags/oop/">oop</a>, <a href="/recipes/tags/simulation/">simulation</a>). Revision 2. </p> <p>I am adapting Prof. David Cheriton's OO software methodology to Python. It's an approach for building industrial-strength code with a disciplined architecture, consistent naming conventions, and a rigorous division of interface from implementation. I'll be adding more of his techniques in further recipes. These recipes are based on Cheriton's CS249a course at Stanford.</p>