Skip to content

Instantly share code, notes, and snippets.

View michael's full-sized avatar

Michael Aufreiter michael

View GitHub Profile
git checkout --track -b next origin/next
def edit
@quote_option = QuoteOption.get(params[:id])
@quote_option.quote_option_type.quote_option_sections.length.to_s # => 6, correct
end
def edit
@quote_option = QuoteOption.get(params[:id])
@quote_option.quote.quote_options.each do |quote_option|
# do nothing
require "rubygems"
require "dm-core"
require "spec"
DataMapper::Logger.new(STDOUT, :debug)
DataMapper.setup(:default, "sqlite3::memory:")
class Project
include DataMapper::Resource
property :id, Serial
var json_data = {
"children": [{
"children": [
{
"children": [],
"name": "Factory Records",
"id": "/en/factory_records",
"data": {
"type": "resource"
}
=== Epic Snow Leopard Upgrayyyyd Guide ===
Son, you’re now living in the land of 64-bit systems.
That means that some of your 32-bit shit is now broken.
Not all is lost.
== Fixing MySQL weirdness
# versions used:
# dm-core:
# commit f33ade77050440dcdd590a1ca7ef8709f1e0898d
# Author: Dirkjan Bussink <[email protected]>
# Date: Wed Jun 10 16:36:53 2009 +0200
#
# dm-more:
# commit 81116667834674db37c7874ee3a3576c7f989c2f
# Author: Dan Kubb <[email protected]>
# Date: Wed Jun 10 10:12:04 2009 -0700
// using this.length instead of size makes the ArrayList#clone function work?
array.clone = function( ){
var a = new ArrayList( this.length );
for( var i = 0; i < this.length; i++ ){
a[ i ] = this[ i ];
}
return a;
};
/* faster for loops over arrays */
var myArray = [ 0, 1, 2, 3, 4, 5 ];
for( var i = 0, l = myArray.length; i < l; i++ ){
console.log( myArray[ i ] );
}
float totalWeight = 0;
for (int i=0; i < attributes.size(); i++) {
totalWeight += attributes[i].weight*attributes[i].getValues().size();
}
for (int i = 0 ; i < attributes.size(); i++) {
Attribute attribute = attributes[i];
ArrayList values = attribute.getValues();
// calculate dependent on weight (selected attributes have more weight)
// start expanding tween
public void expand() {
this.fan.continueTo(3.0, 2.0);
}
// start contracting tween
public void contract() {
this.fan.continueTo(1.0, 2.0);
}