Skip to content

Instantly share code, notes, and snippets.

for change in list(changes['in']):
match = stratParmExp.match(change)
if match:
for outChange in list(changes['out']):
outMatch = stratParmExp.match(outChange)
if outMatch:
if outMatch.group(1) == match.group(1) and \
outMatch.group(2) == match.group(2):
finalChanges.append(change)
changes['out'].remove(outChange)
@Jragon
Jragon / change.py
Last active September 23, 2016 19:47
# ideal inputs/output
changesIn = [
"<UpdateECBAttribute Compound='15CP31_STA' ECB='STATION' ParmName='CFGOPT' ParmValue='1280'/>",
"<UpdateECBAttribute Compound='15CP31_STA' ECB='STATION' ParmName='MARCY' ParmValue='0'/>",
"<UpdateBlockAttribute Strategy='15E11_CE1' Block='HMI' ParmName='IN_6' ParmValue='0'/>",
"<UpdateBlockAttribute Strategy='15E11_CE1' Block='HMI' ParmName='IN_3' ParmValue='0'/>",
"<UpdateBlockAttribute Strategy='15E11_CE1' Block='HMI' ParmName='IN_4' ParmValue='0'/>"
]
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="kinetic.js"></script>
<script type="text/javascript" src="map.js"></script>
</head>
<body>
<div id="container"></div>
<script type="text/javascript" src="kinetictest.js"></script>
</body>
var map = [
{
"x": 0,
"y": 0,
"terrain": "occupied",
"village": {
"name": "Greece",
"level": 4
}
},
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="kinetic.js"></script>
<script type="text/javascript" src="map.js"></script>
</head>
<body>
<div id="container"></div>
<script type="text/javascript" src="kinetictest.js"></script>
</body>
<table id="report">
<thead>
<th></th>
<th colspan="3" class="collheader">Change #1</th>
<th colspan="3" class="collheader">Change #2</th>
<th colspan="3" class="collheader">Change #3</th>
</thead>
<tbody>
<tr id="header">
<th></th>
class ReportsController < ApplicationController
def index
end
def village
@village = Village.find(params[:id])
@changes = @village.changes_with_score
@resource = @village
<table id="report">
<thead>
<th></th>
<th colspan="3" class="collheader">Change #1</th>
<th colspan="3" class="collheader">Change #2</th>
<th colspan="3" class="collheader">Change #3</th>
</thead>
<tbody>
<tr id="header">
<th></th>
class Change < ActiveRecord::Base
before_validation { |change| change.name.capitalize! }
has_many :conversations, dependent: :destroy
has_many :discussions, through: :conversations
has_many :groups, through: :discussions
validates :name, presence: true, uniqueness: true
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: postgresql
encoding: UTF-8
database: OTIS_development
pool: 5