This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package util { | |
import flash.utils.getQualifiedClassName; | |
import mx.logging.ILogger; | |
import mx.logging.Log; | |
import mx.logging.LogEventLevel; | |
import mx.logging.targets.TraceTarget; | |
public class LogUtil { | |
public static function getLogger(c:Object):ILogger { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Java / Maven configurations lead to directory structures of ridiculous depth - so do this to get the DOS prompt back on the LHS of the screen | |
set prompt=$N:$G |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<fx:Declarations> | |
<s:TraceTarget | |
includeCategory="true" | |
includeLevel="true" | |
includeTime="true" | |
level="{LogEventLevel.DEBUG}" | |
> | |
<s:filters> | |
<fx:String>org.spicefactory.parsley.*</fx:String> | |
</s:filters> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In Actionscript, a null result from a JSON service reponse will be converted to 0.0 default when casting to a number. | |
// What we really want is NaN: | |
var rs:Object = service.result; // Result deserialized from some JSON service | |
var value:Number = rs.value_num == null ? NaN : rs.value_num; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To get Parsley context for the current module - you just inject on the type Context (of course). | |
import org.spicefactory.parsley.core.context.Context; | |
[Inject] | |
public var context:Context; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var value:Number = rs.value_num == null ? NaN : rs.value_num; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sequel' | |
DB = Sequel.connect(:adapter=>'odbc',:driver=>'SQL Server Native Client 10.0',:server=>'localhost',:port=>1433, :uid=>'myuser',:pwd=>'mypass',:db_type=>'mssql') | |
DB.fetch("SELECT * FROM artist") do |row| | |
puts row | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<s:Group | |
xmlns:fx="http://ns.adobe.com/mxml/2009" | |
xmlns:s="library://ns.adobe.com/flex/spark" xmlns:stomp="org.codehaus.stomp.*" | |
creationComplete="init()" | |
> | |
<fx:Script> | |
<![CDATA[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<s:GridColumn dataField="valueNum" headerText="Default Value" width="100"> | |
<s:itemRenderer> | |
<fx:Component> | |
<s:GridItemRenderer> | |
<fx:Declarations> | |
<s:NumberFormatter id="numberFormatter"/> | |
</fx:Declarations> | |
<s:layout> | |
<s:HorizontalLayout horizontalAlign="right" verticalAlign="middle"/> | |
</s:layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<fx:Script><![CDATA[ | |
import spark.formatters.NumberFormatter; | |
var numberFormatter:NumberFormatter = new NumberFormatter(); | |
private function numberFormat(item:Object, column:GridColumn):String { | |
return numberFormatter.format(item [column.dataField]); | |
} | |
]]> | |
</fx:Script> | |
<s:GridColumn dataField="valueNum" headerText="Value" labelFunction="numberFormat"> |