background preloader

The Artima Developer Community

The Artima Developer Community

States and Components in Flex 4 States and Components in Flex 4by Chet HaaseApril 23, 2010 Summary With a demo app from his book, Flex 4 Fun, Chet Haase shows how to make components visible only in specified application states in Flex 4. Most applications enter into many different states over time. An application may have different screen states, for example, such as a shopping site that enables searching on one screen, search results on another, and shopping cart details on yet another. One of the innovative things about the Flex platform is that this concept of states is supported by the API. The underlying concept and implementation of states did not change significantly between Flex 3 and Flex 4, but the syntax for states changed dramatically. Fortunately, Flex 4 came along and completely changed the way that state code is written. Often, you may want to define states in which an object exists, or, conversely, states in which it does not. Adobe's Flash Builder

How packages work in Scala Every now and then someone discovers how packages work in Scala. This process typically passes through a number of stages. Confusion: “Hey, guys, I found this weird bug. Can you take a look?”Surprise: “What? It works like that? Not everyone reaches step 5. This behaviour is particularly unfortunate because actually Scala’s package behaviour is quite nice. And so, in the hopes of dispelling some of this confusion, I bring to you the reality of how packages work in Scala. Identifiers You have a bunch of identifiers in scope. package foo; object bar; object baz{ val kittens = "kittens"; } within this file, say within the object bar, we’ve got a bunch of identifiers in scope: We have foo, the package we are in, bar, an object, and baz, another object. Within the object baz, everything in scope at the outer level is in scope here, but we’ve introduced the additional identifier kittens. Note that a package conceptually constitutes one “level”. Top level identifiers Nesting of packages Members

JavaNCSS - A Source Measurement Suite for Java Testing Private Methods with JUnit and SuiteRunner Testing Private Methods with JUnit and SuiteRunnerby Bill VennersMay 24, 2004 Page 1 of 3 >> Summary This article compares four different approaches to testing private methods in Java classes. My very first use of JUnit was to build a conformance test kit for the ServiceUI API [1]. The purpose of a conformance test kit is to help ensure that alternate implementations of the same API are compatible with the API's specification. When I later applied JUnit to the task of writing actual unit tests, as opposed to conformance tests, I found myself wanting to write white box tests—tests that employ knowledge of the internal implementation of the packages and classes under test. Daniel Steinberg [2] showed me the common JUnit technique of using parallel source code trees, which allowed me to place test classes in the same package as the classes under test, but keep them in a different directory. Don't test private methods.

Chris' Python Page rst2s5 is a Docutils writer for S5, a Simple Standards-based Slide Show System. This means simple text files with reStructuredText (reST) markup can be converted to nice looking slideshows that can easily be viewed with the webbrowser. See presentation.txt in the archive below for an example and instructions. It's now part of the official Docutils distribution (starting from version 0.4) please use that version. There are several solutions out there, here's the next one... Based on Pyco (broken link) and py2exe. Download: py2exe-pyco.zip YaHEbwinPy - Yet An Other Hex Editor, But Written In Python Tested with file sizes up to 1267650600228229401496703205376 Bytes (2**100B). Sources: hexedit.zip (130kB, requires: Python 2.3 and wxPython 2.4) Win32 Installer, standalone version: install-YaHEbwinPy-0.7.exe (2.1MB) This is a complete rewrite of my old screensaver module. The Win32 parts are implemented using ctypes. Requires Python 2.3, ctypes, py2exe. pyvncviewer.zip (18kB) Python License. Home

Working with States in Flex 4 Working with States in Flex 4by Frank SommersSeptember 16, 2009 Summary Flex 4's new syntax simplifies working with application states. This article provides a tutorial introduction into UI state management with Flex 4, and includes a complete example. Stateless Web applications aim to store as little state on the server as possible. At the same time, only the simplest Web applications can function completely without state. Instead of storing state data on the server, rich-client applications may choose to store such information on the client. Consider, for example, a sign-in component typical of many Web applications: A user is presented with text input boxes to enter a user name and a password, as well as a button to initiate the sign-in. Click on "Need to register?" In a traditional, server-generated HTML user interface, the server may return an entirely newly rendered page when a user chooses to register instead of signing in. Listing 1: Login box with Flex 3

Higher-Order Fork/Join Operators 22 Sep 2008 I think we can all agree that concurrency is a problem. Not really a problem as in “lets get rid of it”, but more the type of problem that really smart people spend their entire lives trying to solve. Over the years, many different solutions have been proposed, some of them low-level, some more abstract. Surprisingly, the word “ordering” is not often heard in conjunction with parallelism. By the way, I really will get to fork/join a little later, but I wanted to be sure that I had laid a solid groundwork for the road ahead. Factorial One of the odd things about computer science is a depressing lack of imaginative examples. For each number, this function performs a number of discrete operations. Subtract 1 from n and store the value in some temporary $t1 Dispatch to function fac passing the value from $t1 Multiply result from dispatch with n and return All this may seem extremely pedantic but please, bear with me. The answer is quite obviously “of course not”. Fibonacci

Core J2EE Patterns: J2EE Patterns, Refactorings, Best Practices and Design Strategies Java Bien! Big Ball of Mud Brian Foote and Joseph Yoder Department of Computer Science University of Illinois at Urbana-Champaign 1304 W. Springfield Urbana, IL 61801 USA foote@cs.uiuc.edu (217) 328-3523 yoder@cs.uiuc.edu (217) 244-4695 Saturday, June 26, 1999 Fourth Conference on Patterns Languages of Programs (PLoP '97/EuroPLoP '97) Monticello, Illinois, September 1997 Technical Report #WUCS-97-34 (PLoP '97/EuroPLoP '97), September 1997 Department of Computer Science, Washington University Chapter 29 Pattern Languages of Program Design 4 edited by Neil Harrison, Brian Foote, and Hans Rohnert Addison-Wesley, 2000 This volume is part of the Addison-Wesley Software Patterns Series. This paper is also available in the following formats: [PDF] [Word] [RTF] [PostScript] Also by Brian Foote and Joseph Yoder Architecture, Evolution, and Metamorphosis The Selfish Class This paper was twice featured in Slashdot A number of additional patterns emerge out of the BIG BALL OF MUD. Still, this approach endures and thrives.

FFDmag :: Scala vs Clojure — Round 2: Concurrency! The time for ignoring concurrency has almost passed. If you read my last post you'll know that I'm looking at Scala Vs Clojure and a big part of both of these languages is their support for concurrency. Scala uses an Erlang inspired actor model, which is a distributed approach to concurrency. The goal My last post sparked heavy debate in the #scala camp, wherein many frustrations and concerns were expressed by the Scala community. The problem An old concurrency problem/exercise is 'The sleeping barber' and you can either read the full definition here or read my shorter version here: We simulate a barber-shop with 1 barber, 3 waiting chairs and 1 chair for haircutting.The barber sleeps between customers and is thus awoken when one enters the shop. This is a perfect problem for comparing these two languages for the following reasons In the O'Reilly book on Scala, they've already solved this! Actors Scala's Actor model is heavily inspired by Erlang. scala> Redford ! DeadlocksRace conditions /Lau

HtmlCleaner Project Home Page

Related: