Skip to content

Instantly share code, notes, and snippets.

:octocat:
lifelong learner

Knight.zhou yangboz

:octocat:
lifelong learner
Block or report user

Report or block yangboz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@yangboz
yangboz / App42API_call_snippet
Created Feb 10, 2014
App42 API call with try...catch block
View App42API_call_snippet
@try{
//App42 service API call here.
}@catch (App42BadParameterException *ex) {
NSLog(@"BadParameterException found,status code:%d",ex.appErrorCode);
}@catch (App42SecurityException *ex) {
NSLog(@"SecurityException found!");
}@catch (App42Exception *ex) {
NSLog(@"App42 Exception found:%@",ex.description);
//NSAlert here.
}
@yangboz
yangboz / AIRAntJUnitTestClover
Created Jan 21, 2014
Ant xml example(AIRAntJUnitTestClover) for FLEX/AS3 code j-unit test with colver reporting.
View AIRAntJUnitTestClover
<?xml version="1.0"?>
<project name="AIRAntUnitTest" default="build">
<!-- TODO Change to your Flex SDK directory -->
<property name="flex.sdk.dir" value="C:\Software\FLEX\sdks\4.6.0" />
<property name="lib.dir" value="${basedir}/libs" />
<property name="src.dir" value="${basedir}/src" />
<!-- ATTENTION: Since we remove the reports directory during the clean target it get's
@yangboz
yangboz / flexunit-with-code-coverage
Created Jan 21, 2014
Ant xml example(flexunit-with-code-coverage) for FLEX/AS3 code unit test with code coverage reporting.
View flexunit-with-code-coverage
<?xml version="1.0" encoding="UTF-8"?>
<project name="flexunit-with-code-coverage" default="test" basedir=".">
<!-- =========================================================================================================================================
============================================================= PROPERTY DEFINITIONS =============================================================
========================================================================================================================================== -->
<property environment="env" />
<property name="FLEX_HOME" value="C:\Software\FLEX\sdks\4.6.0" />
<property name="output.loc" value="${basedir}/target" />
@yangboz
yangboz / AIRAntJUnitTest
Created Jan 21, 2014
Ant xml example(AIRAntJUnitTest) for FLEX/AS3 code j-unit test.
View AIRAntJUnitTest
<?xml version="1.0"?>
<project name="AIRAntUnitTest" default="build">
<!-- TODO Change to your Flex SDK directory -->
<property name="flex.sdk.dir" value="C:\Software\FLEX\sdks\4.6.0" />
<property name="lib.dir" value="${basedir}/libs" />
<!-- ATTENTION: Since we remove the reports directory during the clean target it get's
deleted so DO NOT specifiy any directory which you do not want to be deleted!!! -->
View hash256_hmac Objective-C
- (NSString*) HMACWithSecret:(NSString*)secret andData:(NSString *)data
{
CCHmacContext ctx;
const char *key = [secret UTF8String];
const char *str = [data UTF8String];
unsigned char mac[CC_SHA256_DIGEST_LENGTH];
char hexmac[CC_SHA256_DIGEST_LENGTH];
char *p;
CCHmacInit( &ctx, kCCHmacAlgSHA256, key, strlen( key ));
@yangboz
yangboz / TestCaseFileTemplates.xml
Created Feb 16, 2013
A template fie(*.xml) for customize the default information contained in new AS3 test case. More: http://help.adobe.com/en_US/Flex/4.0/UsingFlashBuilder/WS52085436-ABD3-4d4d-B5E2-41C668CF6847.html
View TestCaseFileTemplates.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<templates>
<template autoinsert="true" context="new_flexunit4_testcase_class"
deleted="false" description="Newly created FlexUnit4 TestCase Class file"
enabled="true"
id="com.adobe.flexbuilder.flexunit.filetemplates.new_flexunit4_testcase_class"
name="FlexUnit4 TestCase Class">/**
* GODPAPER Confidential,Copyright ${year}. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
@yangboz
yangboz / AS3InterfaceFileTemplates.xml
Created Feb 16, 2013
A template fie(*.xml) for customize the default information contained in new AS3 interface. More: http://help.adobe.com/en_US/Flex/4.0/UsingFlashBuilder/WS52085436-ABD3-4d4d-B5E2-41C668CF6847.html
View AS3InterfaceFileTemplates.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<templates>
<template autoinsert="true" context="new_actionscript_interface"
deleted="false" description="Newly created ActionScript Interface file"
enabled="true"
id="com.adobe.flexide.as.core.filetemplates.new_actionscript_interface"
name="ActionScript Interface">/**&#13;
* GODPAPER Confidential,Copyright ${year}. All rights reserved.&#13;
*&#13;
* Permission is hereby granted, free of charge, to any person
@yangboz
yangboz / AS3ClassFileTemplate.xml
Created Feb 16, 2013
A template fie(*.xml) for customize the default information contained in new AS3 class. More: http://help.adobe.com/en_US/Flex/4.0/UsingFlashBuilder/WS52085436-ABD3-4d4d-B5E2-41C668CF6847.html
View AS3ClassFileTemplate.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<templates>
<template autoinsert="true" context="new_actionscript_class"
deleted="false" description="Newly created ActionScript Class file"
enabled="true"
id="com.adobe.flexide.as.core.filetemplates.new_actionscript_class"
name="ActionScript Class">/**&#13;
* GODPAPER Confidential,Copyright ${year}. All rights reserved.&#13;
*&#13;
* Permission is hereby granted, free of charge, to any person
@yangboz
yangboz / NeuronNetWorkTest.as3
Created Feb 2, 2013
AS3 Artificial Neuron Network test code
View NeuronNetWorkTest.as3
package
{
import com.lookbackon.AI.ANN.NeuralNetWork;
import flash.display.Sprite;
public class NeuronNetWorkTest extends Sprite
{
private var inputDataArray:Array;
private var outputDataArray:Array;
View Ant_JMeter_xml
<project default="all" basedir="../">
<!--
Define an environment variable pointing to JMETER folder or change this
-->
<property environment="env"/>
<property name="jmeter-tools" location="${basedir}/tools/jmeter"/>
<property name="jmeter-home" location="xxx/Downloads/apache-jmeter-2.8"/>
<!--
ant-jmeter.jar comes with jmeter, be sure this is the release you have
-->
You can’t perform that action at this time.