This file contains hidden or 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
# This configuration will set up a database (db) and a web server (web) VM. | |
# Assumes the use of VirtualBox 4.3.14-95030 as a provider. | |
# Uses vagrant-vbguest plugin (https://github.com/dotless-de/vagrant-vbguest) | |
# to keep VirtualBox Guest Addition wrangled. | |
# Configuration | |
# Machine-specific configuration | |
DB_INSTALL_SCRIPT = "vagrant_data/db/install.sh" |
This file contains hidden or 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
** delete all containers ** | |
docker rm `docker ps -a -q` | |
**delete all images** | |
docker rmi `docker images -q` |
This file contains hidden or 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
apt-get install python-pip | |
pip install -U pip | |
apt-get install python-dev libmysqlclient-dev | |
pip install MySQL-python |
This file contains hidden or 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
Charset utf8charset = Charset.forName("UTF-8"); Charset iso88591charset = Charset.forName("ISO-8859-1"); ByteBuffer inputBuffer = ByteBuffer.wrap(new Byte[]{(byte)0xC3, (byte)0xA2}); // decode UTF-8 CharBuffer data = utf8charset.decode(inputBuffer); // encode ISO-8559-1 ByteBuffer outputBuffer = iso88591charset.encode(data); byte[] outputData = outputBuffer.array(); |
This file contains hidden or 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
public class Tester { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
System.out.println("fout : "+fout()); | |
System.out.println("juist : "+juist()); | |
} |
This file contains hidden or 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 exampleObject:Object = {name:"example", value:3}; | |
var originalArray:Array = [1,"test", exampleObject]; | |
var shallowCopy:Array = originalArray.concat(); // there is not built-in method, concat() or slice() with no args does | |
var shallowCopy2:Array = originalArray.slice(); // the trick | |
if (originalArray != shallowCopy != shallowCopy2) | |
trace("the 3 arrays are different"); |
This file contains hidden or 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
/* found on: http://blog.somepixels.net/2010/01/how-to-get-bitmapdata-and-bytearray-from-embed-in-flex/ */ | |
[Embed(source="image.png")] | |
public var MyEmbed:Class; | |
private function getBitmapData():BitmapData | |
{ | |
var bitmapAsset:BitmapAsset = new MyEmbed(); | |
return bitmapAsset.bitmapData; | |
} |
This file contains hidden or 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 mx.controls.listClasses | |
// class ListBase | |
/** | |
* The UID of the item that is current rolled over or under the caret. | |
*/ | |
protected var highlightUID:String; | |
/** |