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
form_remote_tag(:url => add_keyword_path(keyword), :html => {:style => 'display:inline'}) do | |
"hello" | |
#text_field_tag('keyword', nil, :size => 20) | |
#submit_tag('Submit') + | |
#link_to_function('Cancel', "$('#{id}').removeClassName('UIRightButton-selected');$('#{id}').addClassName('UIRightButton');$(this.up(1)).hide();") | |
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
# current | |
Formula.counta(:r => -People.count, :r2 => -1) | |
# new | |
Formula.counta(:rows => -People.count..-1) | |
# -or- | |
Formula.counta(:row => [-People.count, -1]) | |
# -or- | |
Formula.counta(-People.count..-1, nil) | |
Formula.counta(nil, -ParentItems..-1) | |
# In the first case you might be able to drop the nil at the 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
# how should we handle when columns are 0 (which happen quite a bit)? | |
# I was thinking like this | |
Formula.counta(:rows => 20..30) | |
# => R[20]C:R[30]C | |
# Obviously there is a trade off on readability and code density | |
# So the question, I guess, is requiring :col in the case of :rows required or can it be omitted? |
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
class Tokenizer { | |
public: | |
Tokenizer(); | |
}; | |
// inside Program.h | |
class Program { | |
public: | |
Program(); |
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
1 class CreateSurveyResponseAlternatives < ActiveRecord::Migration | |
2 def self.up | |
3 create_table :survey_response_alternatives do |t| | |
4 t.string :name | |
5 t.string :value | |
6 t.integer :position | |
7 t.references :survey_item | |
8 end | |
9 | |
10 #SurveyResponseAlternative.reset_column_information |
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
scene->pList = (polygon_t *)malloc(scene->nPolygons * sizeof(polygon_t)); | |
for(int i = 0; i < scene->nPolygons; i++) | |
{ | |
polygon_t poly; | |
scene->pList[i] = poly; | |
loadPolygon(&file, &scene->pList[i], scene->vList); |
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
//TOUCH SENSING BETA - LED TURNS ON WHEN LIGHT IS PRESENT | |
//BY: RICARDO DE LEMOS 1/17/2007 | |
int led1 = 13; | |
int cath = 2; // negative | |
int ando = 3; // positive | |
void setup() | |
{ | |
pinMode(led1, OUTPUT); | |
pinMode(cath, OUTPUT); |
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 'date' | |
def print_thursday(d1, d2) | |
d1 += 1 while (d1.wday != 4) | |
d1.step(d2, 7) do |date| | |
puts "#{Date::MONTHNAMES[date.mon]} #{date.day}" | |
end | |
end | |
print_thursdays(Date.today, Date::civil(2011, 5, 23)) |
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
import malachi | |
conn = malachi.connect('127.0.0.1', 8000) | |
#connect to AIM service | |
aim = conn.service('aim', my_user_name, my_pass) | |
a_list = aim.get_buddy_list() | |
aim.send_message(a_list[0], "hello") | |
#connect to irc service |
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
from PySide.QtCore import * | |
from PySide.QtGui import * | |
from PySide.QtWebKit import * | |
class Test(QWidget): | |
def __init__(self, parent=None): | |
super(Test, self).__init__(parent) | |
vbox = QVBoxLayout() |
OlderNewer