__author__ = 'David Randolph' # Copyright (c) 2014-2018 David A. Randolph. # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal in the Software without # restriction, including without limitation the rights to use, # copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following # conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. from abc import ABC, abstractmethod import pickle import re import networkx as nx from itertools import islice from datetime import datetime from didactyl.dactyler import Constant from didactyl.dcorpus.DCorpus import DCorpus from didactyl.dcorpus.DNote import AnnotatedDNote from didactyl.dcorpus.DAnnotation import DAnnotation import os
"""Base class for all fingering algorithms."""
# FIXME: The log should be timestamped and for the specific algorithm being used. SQUAWK_OUT_LOUD = False DELETE_LOG = True
self._log.close() if Dactyler.DELETE_LOG:
os.remove(self._log_file_path)
@staticmethod def combine_abcdf_segments(segments):
""" Combine the array of abcDF strings into a single, simplified abcDF string. """ abcdf = '' current_hand = None for seg in segments:
- for ch in seg:
- if ch == "<" or ch == ">":
- if ch != current_hand:
- abcdf += ch current_hand = ch
- else:
- abcdf += ch
return abcdf
@staticmethod def hand_digit(digit, staff):
""" Determine the handed digit for the input digit string. If the string already has an assigned digit, just return it. Otherwise assign the default hand for the specified staff. :return: The abcDF hand digit (">2" or "<3"). """ if digit is None:
return Nonehanded_re = re.compile('^[<>]d$') if handed_re.match(str(digit)):
return digitstaff_prefix = ">" if staff == "lower":
staff_prefix = "<"handed_digit = staff_prefix + str(digit) return handed_digit
@staticmethod def digit_hand(handed_digit):
""" Determine the hand specified in the handed digit. :return: The abcDF hand specifier (">" or "<"). """ handed_re = re.compile('^([<>]{1})d$') mat = handed_re.match(str(handed_digit)) hand = mat.group(1) if hand != "<" and hand != ">":
raise Exception("Ill-formed handed digit: {0}".format(handed_digit))return hand
self._log.write(str(msg) + "n") if Dactyler.SQUAWK_OUT_LOUD:
print(str(msg))
self._log.write(str(msg)) if Dactyler.SQUAWK_OUT_LOUD:
print(str(msg), end="")
@staticmethod def one_note_advise(d_note, staff="upper", first_digit=None, last_digit=None):
""" Dispense advice for the degenerate case where we have only one note to consider in isolation. Unless otherwise constrained, we prefer the thumb for a white key and an index finger for a black key. :param d_note: The note to consider. :param staff: The staff containing the note. :param first_digit: The digit to use is constrained to be this. :param last_digit: The digit is constrained to be this. :return: Advice in the form of a handed digit (e.g., ">2"). """ if staff != "upper" and staff != "lower":
raise Exception("One note advice not available for {0} staff.".format(staff))
- if first_digit and last_digit and first_digit != last_digit:
- raise Exception("Ambiguous digit constraint: {0} and {1}".format(first_digit, last_digit))
- if staff == "upper":
- advice = ">"
- else:
- advice = "<"
digit = "1" if first_digit:
digit = str(first_digit)
- elif last_digit:
- digit = last_digit
- elif d_note.is_black():
- digit = "2"
advice += digit
return advice
@abstractmethod def segment_advise(self, segment, staff, offset, handed_first_digit, handed_last_digit, k=1):
""" Abstract method must be implemented by derived classes to return a k-element array of two-element tuples in order of preference. :param segment: The segment to work with, as a music21 score object. :param staff: The staff (one of "upper" or "lower") from which the segment was derived. :param offset: The zero-based index to begin the returned advice. :param handed_first_digit: Constrain the solution to begin with this finger. :param handed_last_digit: Constrain the solution to end with this finger. :param k: The number of advice segments to return. The actual number returned may be less, but will be no more, than this number. :return: suggestions, costs: Two lists are returned. The first contains suggested fingering solutions as abcDF strings. The second list contains the respective costs of each suggestion. """ return list(), list()
@staticmethod def standard_graph_advise(g, target_id, k):
""" Apply standard shortest path algorithms to determine set of optimal fingerings based on a standardized networkx graph. :param g: The weighted graph. Weights must be specified via a "weight" edge parameter. Fingerings must be set on each "handed_digit" node parameter. :param target_id: The node id (key) for the last node or end point in the graph. :param k: The number of :return: An array of the k-best abcdf advice strings for the weighted graph provided. Return scalar abcdf string if k is set to 1 or is not specified. """ if k is None or k == 1:
path = nx.shortest_path(g, source=0, target=target_id, weight="weight") segment_abcdf = '' for node_id in path:
node = g.nodes[node_id] if node["handed_digit"]:
segment_abcdf += node["handed_digit"]return segment_abcdf
- else:
k_best_abcdf = list() k_best_paths = list(islice(nx.shortest_simple_paths(g, source=0, target=target_id, weight="weight"), k)) for path in k_best_paths:
segment_abcdf = '' for node_id in path:
node = g.nodes[node_id] if node["handed_digit"]:
segment_abcdf += node["handed_digit"]k_best_abcdf.append(segment_abcdf)
return k_best_abcdf
pass
d_scores = self._d_corpus.d_score_list() if score_index >= len(d_scores):
raise Exception("Score index out of range")
d_score = d_scores[score_index] if staff == "both":
- if offset or first_digit or last_digit:
- raise Exception("Ambiguous use to offset and/or first/last digit for both staves.")
upper_advice = self.advise(score_index=score_index, staff="upper") abcdf = upper_advice + "@" if d_score.part_count() > 1:
lower_advice = self.advise(score_index=score_index, staff="lower") abcdf += lower_advicereturn abcdf
handed_first_digit = Dactyler.hand_digit(digit=first_digit, staff=staff) handed_last_digit = Dactyler.hand_digit(digit=last_digit, staff=staff)
# We support (segregated) left hand fingerings. By segregated, we # mean the right hand is dedicated to the upper staff, and the # left hand is dedicated to the lower staff.
d_part = d_score.d_part(staff=staff)
segments = d_part.orderly_note_stream_segments(offset=offset) segment_index = 0 last_segment_index = len(segments) - 1 segment_lengths = list() suggestions_for_segment = list() costs_for_segment = list() for segment in segments:
segment_offset = 0 segment_handed_first = None segment_handed_last = None if segment_index == 0:
segment_offset = offset segment_handed_first = handed_first_digitsegment_length = len(segment) - segment_offset if segment_index == last_segment_index:
segment_handed_last = handed_last_digit
- suggestions, costs = self.segment_advise(segment=segment, staff=staff,
- offset=segment_offset, handed_first_digit=segment_handed_first, handed_last_digit=segment_handed_last, k=k)
suggestions_for_segment.append(suggestions) costs_for_segment.append(costs) segment_lengths.append(segment_length) segment_index += 1
return suggestions, costs
@staticmethod def strike_distance_cost(gold_hand, gold_digit, test_hand, test_digit, method="hamming"):
- if method == "hamming":
- if test_digit != gold_digit or test_hand != gold_hand:
- return 1
- else:
- return 0
one = str(gold_hand) + str(gold_digit) other = str(test_hand) + str(test_digit) if method == "natural":
cost = Constant.NATURAL_EDIT_DISTANCES[(one, other)] return cost
- elif method == "pivot":
- cost = Constant.PIVOT_EDIT_DISTANCES[(one, other)] return cost
- else:
- raise Exception("Unsupported method: {0}".format(method))
@staticmethod def _distance_and_loc(method, staff, test_annot, gold_annot, gold_offset=0, zero_cost=False):
current_gold_hand = ">" if staff == "upper" else "<" current_test_hand = ">" if staff == "upper" else "<"
test_sf_count = test_annot.score_fingering_count(staff=staff) gold_sf_count = gold_annot.score_fingering_count(staff=staff)
adjusted_gold_sf_count = gold_sf_count - gold_offset if test_sf_count != adjusted_gold_sf_count:
raise Exception("Length mismatch: test: {0} gold: {1}".format(test_sf_count, adjusted_gold_sf_count))score = 0 i = None gold_digit = None for i in range(test_sf_count):
gold_i = i + gold_offset gold_sf = gold_annot.score_fingering_at_index(index=gold_i, staff=staff) gold_strike = gold_sf.pf.fingering.strike gold_hand = gold_strike.hand if gold_strike.hand else current_gold_hand gold_digit = int(gold_strike.digit)
test_sf = test_annot.score_fingering_at_index(index=i, staff=staff) test_strike = test_sf.pf.fingering.strike test_hand = test_strike.hand if test_strike.hand else current_test_hand test_digit = int(test_strike.digit)
current_gold_hand = gold_hand current_test_hand = test_hand
- cost = Dactyler.strike_distance_cost(method=method,
- gold_hand=gold_hand, gold_digit=gold_digit, test_hand=test_hand, test_digit=test_digit)
- if zero_cost and cost:
- return cost, gold_i, gold_digit
score += cost
return score, i, gold_digit
@staticmethod def _eval_strike_distance(method, staff, test_annot, gold_annot):
- (cost, location, gold_digit) = Dactyler._distance_and_loc(method=method, staff=staff,
- test_annot=test_annot, gold_annot=gold_annot)
return cost
""" Evaluate the best solution for a given score reported by the model against each of the specified gold-standard annotations embedded in the DScore object using the specified method. :param method: The edit distance metric to apply in the evaluation. One of "hamming," "natural," or "pivot." :param score_index: The zero-based index of the DScore within the DCorpus currently loaded in this Dactyler. :param staff: The staff to include in the evaluation (one of "upper," "lower," or "both." :param gold_indices: The zero-based indices of the DAnnotation objects from the DScore's ABCDHeader to use as the gold standard advice. :return: An array of distance measures against each specified gold index, in sorted order. """ d_score = self._d_corpus.d_score_by_index(score_index) if not d_score.is_fully_annotated():
raise Exception("Only fully annotated scores can be evaluated.")
test_abcdf = self.advise(score_index=score_index, staff=staff) test_annot = DAnnotation(abcdf=test_abcdf) hdr = d_score.abcd_header() scores = [] gold_index = 0 for gold_annot in hdr.annotations():
- if gold_indices and gold_index not in gold_indices:
- gold_index += 1 continue
score = 0 for staff in staves:
- score += Dactyler._eval_strike_distance(method=method, staff=staff,
- test_annot=test_annot, gold_annot=gold_annot)
scores.append(score) gold_index += 1
return scores
""" Evaluate the k best solutions for a given score reported by the model against each of the specified gold-standard annotations embedded in the DScore object. :param method: The edit distance metric to apply in the evaluation. One of "hamming," "natural," or "pivot." :param score_index: The zero-based index of the DScore within the DCorpus currently loaded in this Dactyler. :param staff: The staff to include in the evaluation (one of "upper," "lower," or "both." :param gold_indices: The zero-based indices of the DAnnotation objects from the DScore's ABCDHeader to use as the gold standard advice. :param k: The number of "k-best" abcDF advice strings produced by the Dactyler model to evaluate. :return: A DEvaluationSet object detailing the results of the evaluation. """ d_score = self._d_corpus.d_score_by_index(score_index) if not d_score.is_fully_annotated():
raise Exception("Only fully annotated scores can be evaluated.")
test_abcdf = self.advise(score_index=score_index, staff=staff) test_annot = DAnnotation(abcdf=test_abcdf) hdr = d_score.abcd_header() scores = [] gold_index = 0 for gold_annot in hdr.annotations():
- if gold_indices and gold_index not in gold_indices:
- gold_index += 1 continue
score = 0 for staff in staves:
- score += Dactyler._eval_strike_distance(method=method, staff=staff,
- test_annot=test_annot, gold_annot=gold_annot)
scores.append(score) gold_index += 1
return scores
d_score = self._d_corpus.d_score_by_index(score_index) if not d_score.is_fully_annotated():
raise Exception("Only fully annotated scores can be evaluated.")
hdr = d_score.abcd_header() scores = {"upper": [], "lower": []} for staff in staves:
current_gold_index = 0 for gold_annot in hdr.annotations():
score = 0 if len(gold_indices) > 0 and current_gold_index not in gold_indices:
current_gold_index += 1 continuecurrent_gold_index += 1
test_abcdf = self.advise(score_index=score_index, staff=staff) self.squawk("COMPLETE ADVICE: {0}".format(test_abcdf)) if staff == 'upper':
test_abcdf += '@'
- else:
- test_abcdf = '@' + str(test_abcdf)
test_annot = DAnnotation(abcdf=test_abcdf) (cost, loc, gold_digit) = self._distance_and_loc(zero_cost=True, method=method, staff=staff,
test_annot=test_annot, gold_annot=gold_annot)score += cost self.squawk("GOLD: {0} staff for {1}".format(staff, gold_annot.abcdf(staff=staff, flat=True))) self.squawk("TEST: {0} staff for {1}".format(staff, test_abcdf)) self.squawk("SCORE: {0} COST: {1} LOC: {2}".format(score, cost, loc))
- while cost > 0:
- test_abcdf = self.advise(score_index=score_index, staff=staff,
- offset=loc, first_digit=gold_digit)
self.squawk("GOLD: {0} staff for {1}".format(staff, gold_annot.abcdf(staff=staff, flat=True))) self.squawk("TRUNCATED ADVICE: {0}".format(test_abcdf)) if staff == 'upper':
test_abcdf += '@'
- else:
- test_abcdf = '@' + str(test_abcdf)
test_annot = DAnnotation(abcdf=test_abcdf) (cost, loc, gold_digit) = self._distance_and_loc(zero_cost=True, gold_offset=loc,
method=method, staff=staff, test_annot=test_annot, gold_annot=gold_annot)score += cost self.squawk(" score: {0} cost: {1} loc: {2}".format(score, cost, loc))
scores[staff].append(score)
total_scores = [] if len(scores['upper']) > 0:
- for i in range(len(scores['upper'])):
total_scores.append(scores['upper'][i]) if len(scores['lower']) > 0:
total_scores[i] += scores['lower'][i]
return total_scores
@staticmethod def _pivot_flags(staff, d_notes, annot):
current_hand = ">" if staff == "upper" else "<"
sf_count = annot.score_fingering_count(staff=staff)
pivot_flags = list() prior_ad_note = None for i in range(sf_count):
d_note = d_notes[i] sf = annot.score_fingering_at_index(index=i, staff=staff) strike = sf.pf.fingering.strike hand = strike.hand if strike.hand else current_hand digit = int(strike.digit) ad_note = AnnotatedDNote(m21_note=d_note.m21_note(),
prior_note=prior_ad_note, strike_hand=hand, strike_digit=digit)
- if ad_note.is_pivot():
- pivot_flags.append(True)
- else:
- pivot_flags.append(False)
prior_ad_note = ad_note current_hand = hand
return pivot_flags
@staticmethod def _pivot_alignment_score(gold_pivot_flags, test_pivot_flags, cost=1):
- if len(gold_pivot_flags) != len(test_pivot_flags):
- raise Exception("Mismatched pivot flag lists.")
score = 0 for i in range(len(gold_pivot_flags)):
- if gold_pivot_flags[i] != test_pivot_flags[i]:
- score += cost
return score
d_score = self._d_corpus.d_score_by_index(score_index) if not d_score.is_fully_annotated():
raise Exception("Only fully annotated scores can be evaluated.")
test_abcdf = self.advise(score_index=score_index, staff=staff) test_annot = DAnnotation(abcdf=test_abcdf) hdr = d_score.abcd_header() scores = [] gold_index = 0 for gold_annot in hdr.annotations():
- if gold_indices and gold_index not in gold_indices:
- gold_index += 1 continue
score = 0 for staff in staves:
d_part = d_score.d_part(staff=staff) d_notes = d_part.orderly_d_notes() test_pivot_flags = Dactyler._pivot_flags(staff=staff, d_notes=d_notes, annot=test_annot) gold_pivot_flags = Dactyler._pivot_flags(staff=staff, d_notes=d_notes, annot=gold_annot) staff_score = self._pivot_alignment_score(gold_pivot_flags=gold_pivot_flags, test_pivot_flags=test_pivot_flags) score += staff_scorescores.append(score) gold_index += 1
return scores
@abstractmethod def segment_advise(self, segment, staff, offset, handed_first_digit, handed_last_digit, k=None):
pass
@abstractmethod def train(self, d_corpus, staff="both", segregate=True, segmenter=None, annotation_indices=[]):
return
@abstractmethod def smooth(self):
return


Las Vegas shoppers hitting stores early on Black Friday
by Subrina HudsonBlack Friday was less busy than usual at Fashion Show mall in the early hours.
Lines formed for specialty stores such as Lululemon Athletica and Apple, but it wasn’t the rowdy scene that could have been expected a few years ago.
Shoppers said the internet was largely to blame—or thank—for the relative calm. Many had already did the time-consuming portions of shopping online, price comparisons and browsing for deals.
Best Buy’s North Decatur Boulevard store had long lines, but store workers say Thanksgiving Day was the real mad rush.
The Retail Association of Nevada estimates roughly 1.65 million adults in the state will be shopping over the five-day Thanksgiving weekend and Cyber Monday.
The trade organization projects total spending to reach $593 million over the holiday weekend, a nearly 6 percent increase from a year earlier. The average Nevadan is predicted to spend $360, compared with last year’s average of $350.
This is a developing story. Check back for updates.


|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--marf.Classification.NeuralNetwork.Neuron
Class Neuron
A basic element of a neural network
$Header: /cvsroot/marf/marf/src/marf/Classification/NeuralNetwork/Neuron.java,v <IP_ADDRESS> 2003/02/16 18:08:54 mokhov Exp $
| Field Summary | |
double |
delta
Used in error calculation |
static int |
HIDDEN
Indicates middle (hidden) neuron |
static int |
INPUT
Indicates input neuron |
java.lang.String |
name
Neuron's name |
static int |
OUTPUT
Indicates output neuron |
double |
result
Current Neuron's result |
double |
threshold
Activation threshhold |
int |
type
Current neuron type |
static int |
UNDEF
Indicates undefined neuron type |
| Constructor Summary | |
Neuron(java.lang.String n,
int t)
Neuron Constructor |
| Method Summary | |
boolean |
addInput(Neuron in,
double weight)
Adds an input neuron and its associated weight |
boolean |
addOutput(Neuron out)
Adds an output neuron |
void |
commit()
Applies weight changes |
void |
eval()
Evaluates current neuron's value |
void |
printXML(java.io.BufferedWriter bw,
int tab)
Dumps XML of the current Neuron |
void |
train(double expected,
double alpha,
double beta)
Neuron training |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final int UNDEF
public static final int INPUT
public static final int HIDDEN
public static final int OUTPUT
public java.lang.String name
public int type
public double delta
public double threshold
public double result
| Constructor Detail |
public Neuron(java.lang.String n, int t)
n
- Neuron's namet
- Neuron's type| Method Detail |
public final boolean addInput(Neuron in, double weight)
in
- Neuron to be addedweight
- associated weighttrue
if add was successfulpublic final boolean addOutput(Neuron out)
out
- the Neuron to addpublic final void eval()
public final void train(double expected, double alpha, double beta)
expected
- expected valuealpha
- used in error calculationbeta
- used in error calculationpublic final void commit()
public final void printXML(java.io.BufferedWriter bw, int tab) throws java.io.IOException
bw
- Writer object to write outputtab
- tabulation needed
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


1 We leave the Ionians' opinion aside, and our own judgment about the matter is this: Egypt is all that country which is inhabited by Egyptians, just as Cilicia and Assyria are the countries inhabited by Cilicians and Assyrians, and we know of no boundary line (rightly so called) below Asia and Libya except the borders of the Egyptians.
2 But if we follow the belief of the Greeks, we shall consider all Egypt commencing from the Cataracts and the city of Elephantine to be divided into two parts, and to claim both the names, the one a part of Libya and the other of Asia.
3 For the Nile, beginning from the Cataracts, divides Egypt into two parts as it flows to the sea. Now, as far as the city Cercasorus the Nile flows in one channel, but after that it parts into three.
4 One of these, which is called the Pelusian mouth, flows east; the second flows west, and is called the Canobic mouth. But the direct channel of the Nile, when the river in its downward course reaches the apex of the Delta, flows thereafter clean through the middle of the Delta into the sea; in this is seen the greatest and most famous part of its waters, and it is called the Sebennytic mouth.
5 There are also two channels which separate themselves from the Sebennytic and so flow into the sea: by name, the Saïtic and the Mendesian.
6 The Bolbitine and Bucolic mouths are not natural but excavated channels.


Random Jokes API
Chose your joke
Random General Jokes
Random Knock-Knock Jokes
Random Programming Jokes


Ireland ease to win over Namibia to claim third place in T20 qualifier
by By Press AssociationIreland eased to a 27-run victory over Namibia to finish third at the ICC T20 World Cup qualifiers in Dubai.
Defeat to the Netherlands on Friday meant that Ireland – who had already sealed qualification for next year’s World Cup in Australia – would be forced to contest the third place play-off.
Ireland failed to bat out their 20 overs, having elected to bat first, as they were bowled out for 135 with five balls remaining of their innings.

Spinner Simi Singh claimed three for 25, while Mark Adair, Gareth Delany and Boyd Rankin took two wickets apiece to bowl Namibia out for 108 in 18.2 overs.
Holland – who have also already secured qualification for the tournament – face Papua New Guinea in the final this evening.


The main interface for calling all AVRG functions on the client and on the server. By default,
it consists of two tabs at the very top, the client tab and the server tab. Each of these, in
turn, contains a series of tabs that are the categories of API functions that may be called,
each one corresponding roughly to a sub control type. Within each of these tabs are
FunctionPanel
instances containing all the functions in that group. The panel logs
all events received from the server.
TODO: control which events are logged.
protected var _ctrl:AVRGameControl
protected var _defs:Definitions
protected var _tabPanel:TabPanel
public function ClientPanel(ctrl:AVRGameControl)
Creates a new client panel. If the given ctrl has no mob sprite exporter, a test one is
assigned.
Parameters
protected function createMob(id:String):DisplayObject
Parameters
Returns
public function handleAdded(evt:Event):void
Parameters
protected function handleGameMessage(evt:MessageReceivedEvent):void
Parameters
public function handleRemoved(evt:Event):void
Parameters
protected function logEvent(event:Event):void
Parameters
public static function toString(obj:*):String
Converts a reference to a string, interpreting fields directly if it is a simple object.
Also has a special case for AVRGameAvatar
because it has no toString method.
Parameters
Returns


Software engineer offering a strong foundation in enterprise computing resource requirements analysis and design, single sign-on management, application and server deployment, virtualization, task automation, security configurations, full-stack web development, and performance analysis.
download resumeBachelor's of Science in Information Technology
Coursework
CSI 1200 - Computing and Programming
CSI 1310 - Computer Programming
CSI 2300 - Object-Oriented Computing
CSI 2470 - Computer Networks
CSI 2520 - Interactive Web Systems
CSI 2440 - Computer Systems
CSI 2500 - Operating Systems
CSI 3370 - Software Engineering
CSI 3450 - Database Design and Implementation
CSI 3500 - Human Computer Interaction
CSI 3520 - Systems Analysis
CSI 4480 - Information Security Practice
• Develop NodeJS APIs that provide app deployment automation tools to internal teams
• Utilize Git for source control to deliver stable, tested, and versioned software
• Provide support for automation tools to ensure the successful delivery of network automation services that meets Ford's business objectives
• Perform lifecycle management on legacy infrastructure
• Responsible for representing network engineering during vehicle launch events
• Conduct FMEA testing on next-gen datacenter leaf layer switches
• Developed internal web portal for inventory tracking and project management
• Migrated TFTP virtual servers to physical infrastructure while automating the backup and compression of network configs
• Implement change controls to F5 load balancers, primarily the copy of SSH keys
• Completed failover conversion of primary Syslog-ng host to secondary node
• Provide client support and technical resolution via email, phone and other electronic mediums for pre-live locations
• Manage client cases within Salesforce CRM and communicate any perceived delays to management upon identification
• Configure Cisco Meraki cloud-managed routers
• Configure self-service kiosks in accordance to customer’s order
• Install hardware, software and device drivers on standalone computers
• Test computer peripherals, hardware and software to ensure that they are working appropriately
• Acted as a technical resource for user’s computer problems by phone, email and in person
• Analyze and troubleshoot network authentication issues
• Document technical procedures
• Responsible for creating 53 procedures documenting routine duties in inventory/demand forecasting
• Configured web-hosted forecasting tool to utilize single-sign on through Active Directory
• Participated in early proof of concept negotiations in robotic process automation
• Briefed executive leadership on summer internship deliverables
• Configured Automation Anywhere test environment with credential vault and developed proof of concept demo
• Administer the daily/monthly/annual operation schedules for the core mainframe and related interfaces including imaging technology
• Provide system and interface support to all departments ensuring problems are solved without significant interruption to member services
• Lead Symitar patch code review, testing, and documentation of results
• Ensure the off-site storage of credit union data
• Oversee the Episys patch and release information process to business partners
Coming soon!
Royal Oak, Michigan, USA
aleksdushaj@outlook.com


Created by:
Aleksander Kwiatkowski / @bobik314
"Rust competes for mindshare with C++ and D for programmers who are prepared to accept more complex syntax and semantics (and presumably higher readability costs) in return for the maximum possible performance. For example, micro controllers, AAA game engines, and web rendering engines."
http://dave.cheney.net/2015/07/02/why-go-and-rust-are-not-competitors
"Go competes for mindshare in the post 2006 Internet 2.0 generation of companies who have outgrown languages like Ruby, Python, and Node.js (v8) and have lost patience with the high deployment costs of JVM based languages."
http://dave.cheney.net/2015/07/02/why-go-and-rust-are-not-competitors
Mix of Python and Go?
Hacker news: who is still using C/C++ in 2014, and why?
A Quick Comparison of Nim vs. Rust
Hacker news: We just switched from Rust to Nim...
Let's build a REST api! Using crystal_api
10 object in seeds, 5s
| technology | GET requests (20) | GET requests (100) | POST requests (20) | POST requests (100) |
|---|---|---|---|---|
| crystal_api | 24829 | 25712 | 1137 | 1129 |
| postgrest | 7865 | 9297 | 998 | 1014 |
| rails | 1055 | 1168 | 535 | 538 |
Other stuff


Warns about the invalid assignment of the animation trigger. To attach an animation to an element, use
[@triggerName]="expression"
or an attribute without a value
@triggerName
.


Bold text row means it is first request on concurrent request.
If have interval 300ms between a request and before request,
ngrinder-recorder decision it is not concurrent request.
Choose the request row, If you want use in script.
Change the scope to you want (init/call/BefreTest/Test/AfterTest/etc...)
Default don't use Cookie in Request Header.
If you want use to cookie, Check "Use cookie" checkbox.
If you check to "use cookie", cookie(from before response) able overwite(delete).
If you complete to select request, Click to "Create Scritp" Button!


FlaneurImagePickerConfig
public class FlaneurImagePickerConfig
An object used to set all the configurations relative to the FlaneurImagePicker
-
Changes the order of the imageSources shown in the .imageSources section
Declaration
Swift
public var imageSourcesArray: [FlaneurImageSource] = [
-
Title displayed for the image source selection button.
If
nil
andimageForImageSource
is alsonil
, it defaults toFlaneurImageSource.rawValue
.Declaration
Swift
public var titleForImageSource: ((FlaneurImageSource) -> (String?)) = { imageSource in
-
Image displayed for the image source selection button.
Declaration
Swift
public var imageForImageSource: ((FlaneurImageSource) -> (UIImage?)) = { _ in
-
Title color for the image source selection buttons.
Defaults to
.blue
.Declaration
Swift
public var imageSourcesTitleColor: UIColor = .blue
-
Background color for the image source selection buttons.
Defaults to
.white
.Declaration
Swift
public var imageSourcesBackgroundColor: UIColor = .white
-
Background color for a specific collectionView in a section.
Defaults to
.gray
.Declaration
Swift
public var backgroundColorForSection: ((FlaneurImagePickerSection) -> (UIColor)) = { _ in
-
Color of the not selected dots of the pageControl
Declaration
Swift
public var pageControlTintColor: UIColor = .black
-
Color of the currently selected dot of the pageControl
Declaration
Swift
public var pageControlCurrentIndexColor: UIColor = .white
-
Size of each thumbnail image shown in the .pickerView section, defaults to 1:4 of the screen’s width
Declaration
Swift
public var sizeForImagesPickerView: ((CGSize) -> (CGSize)) = { collectionContextSize in
-
Padding for each image shown in the .pickerView section, defaults to 0
Declaration
Swift
public var paddingForImagesPickerView: UIEdgeInsets?
-
Size of each image source’s cell shown in the .imageSources section, defaults to the screen’s width divided by the total number of image sources so that the width of the screen can contain them all
Declaration
Swift
public var imageSourcesCellWidth: CGFloat?
-
Content Mode for images in the .selectedImages section, defaults to .scaleAspectFill
Declaration
Swift
public var selectedImagesContentMode: UIViewContentMode = .scaleAspectFill
-
Changes the order of the sections shown on the screen
Declaration
Swift
public var sectionsOrderArray: [FlaneurImagePickerSection] = [
-
Class of the custom view to use for authorization view.
IMPORTANT
Your class must conform to the FlaneurAuthorizationView’s Protocol
Declaration
Swift
public var authorizationViewCustomClass: UIView.Type?


It's possible to login using session OAuth or cookies.
OAuth (Recommended)
Authenticating with OAuth
Cookies (Deprecated)
Authenticating with Cookies


I have become sickened by all the Tarantino rip-offs, too many to mention. Almost all have none of the grace, wit or humanity that dear Quentin invests in his own works. They are like well-designed wallpapers flung with graphic violence, countless obscenities, and numerous rock n' roll/rap songs and packaged as something shocking and new. Some star Michael Madsen, Martin Sheen or Dennis Hopper. "Out of Sight" was the most dazzling but that had the advantage of a great author, Elmore Leonard, as its basis, and Steven Soderbergh, a stylish director. The new "Go" is different - it's as symmetrically close to "Pulp Fiction" as you can imagine but it has an electric energy and volume all its own.
The film begins with a supermarket checkout girl named Ronna (soft-voiced and droopy-eyed Sarah Polley from "Sweet Hereafter") who establishes a drug connection for two handsome soap opera stars, Adam (Scott Wolf) and Zack (Jay Mohr). Ronna's drug of choice is ecstasy, which one member of her elite group nearly overdoses on and imagines speaking to a cat with Zen subtitles. Ronna has to deal with the seedy drug dealer, Todd (Timothy Olyphant), who has a propensity for sexual favors. But when her good friend, Claire (Katie Holmes), another supermarket checkout girl, is left alone with this devil, things truly go haywire.
After Ronna's predicament, we flash back to the beginning of the story told from the point-of-view of a thick-accented, red-haired Brit, Simon (Desmond Askew). Simon is a drug connection for Todd (Ronna is the replacement) and goes off to Vegas with his pals, including the suave Marcus (Taye Diggs) and a stoner who thinks he's black, Tiny (Breckin Meyer - always the pothead). Unfortunately, after a debacle involving backroom lap-dancers ("Do not touch!"), they are now on the run from a vicious gangster (the terrifically oily J.E. Freeman). And it is here where we experience one of the most dazzling car chases ever filmed to the tune of Steppenwolf's "Magic Carpet Ride."
Then the story flashes back again and we see the story told from the point-of-view of the two soap opera stars, who are working undercover under the tutelage of the Teutonic cop Burke (William Fichtner), a character that makes you squirm. Burke invites the pair to a Christmas dinner that is fraught with misunderstandings and unclear intentions. Let's just say it is a howler of a sequence, guaranteed to keep you laughing at its inevitable payoff.
The characters, as well as the audience, experience one near-catastrophe after another, and all the characters seem intent to make a whole 24-hour, Rashomon-like experience as dangerously exciting as possible with no inhibitions - they will do absolutely anything for thrills. There are gangsters, awry drug deals, dances to the tune of "Macarena," distorted visions, extreme violence, conversations about Tantric sex and the comic "The Family Circus," and lots more to feast the eyes and the ears.
"Go" is suffused with electric energy throughout - there is not a moment that is not thrilling or kinetic in any way. Director Doug Liman ("Swingers") frames his charismatic actors with tension abounding every step of the way by means of a constantly roving camera. The opening titles show a stroboscopic club where silhouetted patrons dance the night away in light blue hues, and the editing is lightning-paced. This brilliantly sets up the rest of the film's pace, and sometimes Liman will slow down long enough to study the actor's faces.
I enjoyed all the actors on screen, but Sarah Polley has a dole-like quality that is more realistic than the cardboard teens shown in other films - I could not stop looking at her. Katie Holmes displays a sensuousness and a charm that made me swoon. I also liked the merry soul of Taye Diggs, a definite star-in-the-making.
"Go" may remind many of "Pulp Fiction," but this film has its own momentum, and plenty of style to spare. It's a crazy film that will keep you on edge - funny, energetic, joyous, jolting, ironic, and tense. You can't ask for a better time at the movies.
For more reviews, please check out JERRY AT THE MOVIES at http://buffs.moviething.com/buffs/faust/
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Robo Dojo is a simple virus-programming game. It clones the 1998 game RoboCom.
| Semantics | Subtracts b from a, then stores the result in a |
| Data types | a must be writable b can be any parameter |
| Instruction set | Basic |
| Number of cycles | 6 |
| Runtime exceptions | None |
In this situation, we flip a coin to decide which program moves ahead in the tournament.
Labels mark places in your program for jump and bjump instructions.
@foo
add #1, 1
jump @foo
bank main ; bank 1
bjump 4, @start
bank foo ; 2
bank bar ; 3
bank baz ; 4
create 1, 1, 1
@start
turn 1
bank main
@start
; Register #1 = "empty", or "opponent", or "friend"
scan #1
; if "opponent" goto @foe
; else goto @friend-or-empty
comp #1, 1
jump @friend-or-empty
jump @foe
@friend-or-empty
; if "friend" skip the follow create instruction
comp #1, 2
create 2,2,0
; Disinfect / initialize new bot
trans 1,1
trans 2,2
set %active, 1
turn 1
jump @start
@foe
; Transfer crash-malware to the opponent
trans 2,1
; Make sure the opponent is active, so it can execute the foe bank
set %active, 1
jump @start
bank foe
crash
Recall, Super Diamond and Bank Jumper defeat individual bots by infecting them with crash malware:
bank foe
crash
We are going to replace that payload with a simple virus:
bank foe
trans 1,1
turn 1
Here’s the complete program.
This virus spreads quickly because its execution time is small compared to the disinfection routine. Here are some snapshots of Prototype Virus 1 taking on Super Diamond: 1, 2, 3, 4, 5, 6, 7, 8,
Unfortunately, the virus is so effective it ends up infecting Blue’s bots at the frontier.
Furthermore, Prototype Virus 1 has no mechanism to crash its opponent; it merely spreads a virus.
There are four editors, one for each color: blue, red, green, and yellow.
The blue editor edits the blue bot’s program, etc.
To select your editor, click the “Blue bot” drop down menu.
The trans
instruction uploads one bank from one bot to another.
There are two parameters:
During the trans
instruction’s last cycle, if the forward cell is occupied,
then the bot copies its Source bank into the forward bot’s Destination bank,
overwriting any bank that might already be there.
Thus trans 1,1
copies the main bank from parent to child.
| Semantics | Removes the bot from the board |
| Data types | N/A |
| Instruction set | Basic |
| Number of cycles | 1 |
| Runtime exceptions | None |
For any given bot, at any given moment: the bot is either active or deactivated.
If a bot is active, then it will execute a cycle during its turn during the current step.
If a bot is deactivated, then it will not execute anything — until it becomes activated.
For a bot to become activated, its #active
register must be set to 1 or
greater. Note: a bot cannot activate itself since it cannot execute. To
activate a deactivated bot, another but must set #active
by using
Remote Access.
bank launcher ; 1
; LOOK HERE: jump to bank 3 to evade Super Diamond's attack
bjump 3,1
bank 2
bank main ; 3
@start
; Register #1 = "empty", or "opponent", or "friend"
scan #1
; if "opponent" goto @foe
; else goto @friend-or-empty
comp #1, 1
jump @friend-or-empty
jump @foe
@friend-or-empty
; if "friend" skip the follow create instruction
comp #1, 2
create 2,3,0
; LOOK HERE: Disinfect / initialize new bot
trans 1,1
trans 3,3
set %active, 1
turn 1
jump @start
@foe
set #2, 1
@foe-loop
comp #2, 51
jump @foe-infect
; end of loop
jump @start
@foe-infect
trans 2, #2
set %active, 1
add #2, 1
scan #3
comp #3, 1
jump @start
jump @foe-loop
When a parameter is local, that means that the value is stored inside the bot that is executing the instruction.
Local parameters begin with either #
or $
, or are an integer literal such as
5
.
Parameters that begin with #
are writable.
Parameters that begin with $
are not writable — they are local constants.
-32768 … 32767 |
These are 16-bit integer literals. |
#active |
This is a special register: setting #active to 0 or negative deactivates the bot. |
$banks |
The number of banks in the local bot. |
$instrset |
The instruction set of the local bot. 0 signifies
the Basic instruction set; 1 signifies the
Advanced instruction
set; 2 signifies the Super instruction set. |
$mobile |
0 if the bot is immobile; 1
if the bot is mobile. |
$fields |
The number of rows on the board. |
Say the Robo Dojo result for a match is 0-2-5, but the RoboCom result is 0-0-7. We then wonder: “is it even possible for the second player to win in this match in Robo Com?”” In such situations, we go into overtime, which means retrying the match in RoboCom until either: (a) the second player scores a win (which definitely answers out question), or (b) the second player never scores a win and we reach a total of 14 matches.
| Semantics | During the last cycle of the instruction, the bot transfers bank a to the forward bot’s bank b. If the forward cell is empty, then does nothing. If the forward bot doesn’t have a bank b , then does nothing. |
| Data types | a and b can be any parameter |
| Instruction set | Advanced |
| Number of cycles | 5 + 3 * N, where N is the number of instructions in bank a |
| Runtime exceptions | The bot crashes if:
|
Robo Dojo is a simple virus-programming game. It clones the 1998 game RoboCom.
The red squares indicate a Red bot has just tapped out there.
When executed, the crash
instruction causes the bot to exit the board.
| Semantics | Sets the instruction pointer to bank bank, instruction instruction |
| Data types | bank and instruction can be any parameter. instruction can also be a label |
| Instruction set | Basic |
| Number of cycles | 5 |
| Runtime exceptions |
|
If a bot finds an empty first bank after an Auto Reboot, or upon activation for the first time, then the bot taps out from “Data Hunger.”
Bank Jumper modified to use virus instead of crash
bank launcher ; 1
; jump to bank 3 to evade Super Diamond's attack
bjump 3,1
bank 2
bank main ; 3
@start
; Register #1 = "empty", or "opponent", or "friend"
scan #1
; if "opponent" goto @foe
; else goto @friend-or-empty
comp #1, 1
jump @friend-or-empty
jump @foe
@friend-or-empty
; if "friend" skip the follow create instruction
comp #1, 2
create 2,4,0
; Disinfect / initialize new bot
trans 1,1
trans 3,3
trans 4,4
set %active, 1
turn 1
jump @start
@foe
; LOOK HERE: Transfer wave virus to the opponent
trans 4,1
; Make sure the opponent is active, so it can execute the foe bank
set %active, 1
jump @start
bank wave-virus ;4
turn 1
trans 1,1
bjump 3,1
Wave Virus with submission hold
bank launcher ; 1
; LOOK HERE: jump to bank 3 to evade Super Diamond's attack
bjump 3,1
bank 2
bank main ; 3
@start
; Register #1 = "empty", or "opponent", or "friend"
scan #1
; if "opponent" goto @foe
; else goto @friend-or-empty
comp #1, 1
jump @friend-or-empty
jump @foe
@friend-or-empty
; if "friend" skip the follow create instruction
comp #1, 2
create 2,5,0
; LOOK HERE: Disinfect / initialize new bot
trans 1,1
trans 3,3
trans 4,4
trans 5,5
set %active, 1
turn 1
jump @start
@foe
; LOOK HERE: Transfer self-destruct virus to the opponent
trans 4,1
; Make sure the opponent is active, so it can execute the foe bank
set %active, 1
trans 5,1
jump @start
bank virus ;4
trans 1,1
turn 1
bjump 3,1
bank crash ;5
crash
The following program causes your bot to clone itself, then its child clones itself, and so on:
bank main
create 2,1,0
trans 1,1
set %active, 1
Most instructions take parameters. For example…
Every parameter has the data type of 16-bit integer.
Every parameter is readable.
Some parameters are writable, local, or remote.
-32768 … 32767 |
These are 16-bit integer literals. |
#1 … #20 |
These local registers store arbitrary integer values |
#active |
This is a special register: setting #active to 0 or negative deactivates the bot. |
%active |
%active is the only remote parameter that is writable. Setting %active to 0 or negative
deactivates the forward bot. In contrast, setting %active to a positive value activates the forward bot. |
$banks |
The number of banks in the local bot. |
%banks |
The number of banks in the forward bot. |
$fields |
The number of rows on the board. |
$instrset |
The instruction set of the local bot. 0 signifies
the Basic instruction set; 1 signifies the
Advanced instruction
set; 2 signifies the Super instruction set. |
%instrset |
The instruction set of the forward bot. 0 signifies
the Basic instruction set; 1 signifies the
Advanced instruction
set; 2 signifies the Super instruction set. |
$mobile |
0 if the bot is immobile; 1
if the bot is mobile. |
%mobile |
0 if the forward bot is immobile; 1
if the forward bot is mobile. |
We point out the differences from Super Diamond by putting “LOOK HERE” in the comments.
bank launcher ; 1
; LOOK HERE: jump to bank 3 to evade Super Diamond's attack
bjump 3,1
bank 2
bank main ; 3
@start
; Register #1 = "empty", or "opponent", or "friend"
scan #1
; if "opponent" goto @foe
; else goto @friend-or-empty
comp #1, 1
jump @friend-or-empty
jump @foe
@friend-or-empty
; if "friend" skip the follow create instruction
comp #1, 2
create 2,4,0
; LOOK HERE: Disinfect / initialize new bot
trans 1,1
trans 3,3
trans 4,4
set %active, 1
turn 1
jump @start
@foe
; LOOK HERE: Transfer self-destruct malware to the opponent
trans 4,1
; Make sure the opponent is active, so it can execute the foe bank
set %active, 1
jump @start
bank foe ; 4
crash
Click the color-selection drop down, then choose your color.
Then click the “Load Program” button.
set %active, 1
has parameters %active
and 1
.
Here’s how to read the results. The brackets are little wonky, but that’s OK.
Match Robo Dojo RoboCom Footnotes
--------------------------------------------------------------------
Activator3 vs. Alien3.4 0-2-5 0-1-7 *
Alpha vs. Fruchtzwerk 2 2-0-5 1-0-6
Conciler vs. Kommari 2.1 6-0-1 6-0-1
Delusion 3.7 vs. Einfachst-DM.DV 7-0-0 7-0-0
DoomMob 1.6 vs. Flooder 1.0 0-7-0 0-7-0
Geza's McRobi vs. Goody2 0-7-0 0-7-0
Martins Echter vs. Goodymorph 0-0-7 0-0-7
HotBot V2 vs. inter#active 6-0-1 5-0-2
LastHopeC vs. <Jo's little> 6-0-1 8-0-1 *
Liquid Ice 1.2 vs. Lauf und Mine 0-7-1 0-4-3 *
Mikrovirus vs. The Masterkiller 1 0-6-1 0-5-2
Das Geschwür vs. TheMob.NextG2 0-0-7 0-0-7
The Overkiller vs. Nullen2 4-1-2 14-0-0 * +
Rainman vs. RecruteIT 6-1-0 5-2-0
Simple vs. Seuche3 0-0-7 0-0-7
Styx vs. Sweeper 0-0-7 0-0-7
Tie Fighter vs. Test 3-1 0-7-0 0-7-0
UltimaDefender vs. Tom Himself 0-0-7 0-0-7
Zwei Arten vs. Zellwucher4 7-0-0 7-0-0
Match Robo Dojo RoboCom Footnotes
----------------------------------------------------------------------
Alien3.4 vs. Alpha 7-0-1 6-0-1 *
Conciler vs. Delusion 3.7 0-7-0 0-7-0
Flooder 1.0 vs. Goody2 1-2-4 1-0-13 * + -
Goodymorph vs. HotBot V2 0-2-5 0-2-5
LastHopeC vs. Lauf und Mine 7-0-0 7-0-0
The Masterkiller 1 vs. TheMob.NextG2 5-0-2 6-0-1
The Overkiller vs. Rainman 7-0-0 7-0-0
Seuche3 vs. Sweeper 2-0-5 1-0-6
Test 3-1 vs. Tom Himself 7-0-0 7-0-0
Zwei Arten (bye) ..... .....
Match Robo Dojo RoboCom Footnotes
----------------------------------------------------------------------
Alien3.4 (bye) ..... .....
Delusion 3.7 (bye) ..... .....
Goody2 (bye) ..... .....
HotBot V2 (bye) ..... .....
LastHopeC (bye) ..... .....
The Masterkiller (bye) ..... .....
The Overkiller vs. Seuche3 1-7-1 12-0-2 * + -
Test 3-1 vs. Zwei Arten 3-4-0 4-3-0 -
Match Robo Dojo RoboCom Footnotes
----------------------------------------------------------------------
Alien3.4 vs. Delusion 3.7 11-3-0 2-4-1 * + -
Goody2 vs. HotBot V2 0-7-0 0-7-0
LastHopeC vs. The Masterkiller 0-1-7 0-2-5 *
The Overkiller vs. Test 3-1 7-0-0 7-0-0
Match Robo Dojo RoboCom Footnotes
----------------------------------------------------------------------
Alien 3.4 vs. HotBot V2 0-7-0 0-7-0
The Masterkiller vs. The Overkiller 6-0-1 3-0-4
Match Robo Dojo RoboCom Footnotes
----------------------------------------------------------------------
HotBot V2 vs. The Masterkiller 0-4-3 0-14-0 * +
The Masterkiller
PV3 modifies PV2 so that sometimes it taps out opponents. Thus, it is able to both infect and eliminate Super Diamond bots.
In PV2 the @foe
section of the program infects opponents with the virus.
For PV3, we rewrite @foe
as follows:
If (#20 == 0) {
#20 = 1
infect with crash malware
} else {
#20 = 0
infect with virus
}
Here’s the actual code for the @foe
section, and here’s the
complete program.
PV3 successfully completely eliminates Super Diamond.
PV2 modifies PV1 so that it heals from self-infection.
We replace the old payload with a new payload:
bank foe
trans 1,1
turn 1
bjump 3, 1
Here is the complete program.
For Super Diamond bots, the new payload behaves similar to the old payload.
For PV2 bots, the new payload behaves differently compared to the old payload.
Consequently, PV2 bots don’t become stuck and they completely surround the infected Super Diamond bots (screenshot).
But, the PV2 bots still don’t have a mechanism to tap out the infected Super Diamond bots.
Every program is segmented into banks; every instruction belongs to exactly one bank.
A bot can have a maximum of 50 banks.
The bjump instruction is used to jump between banks.
The trans instruction is used to transfer a bank from one bot to its forward bot.
If a bot’s execution reaches the end of a bank, then the bot performs an Auto Reboot.
| Semantics | If a == b, then the next instruction is skipped; otherwise, the next instruction is executed as normal. |
| Data types | a and b can be any parameter. |
| Instruction set | Basic |
| Number of cycles | 3 |
| Runtime exceptions | None |
Simulations progress one step at a time.
Each step, each bot on the board executes a single cycle. The bots are executed in order from oldest bot to youngest bot.
Every instruction requires a certain number of cycles before it executes.
For example the turn instruction requires 5 cycles. On its 5th cycle, the turn operation actually goes into effect.
The following program causes your bot to move across the board:
bank main
move
Activator3 (orange/red) and Alien 1.4 (blue)
There are three instruction sets: Basic (0), Advanced (1), and Super (2).
Different instructions belong to different instruction sets. For example.
Each bot is either Basic, Advanced, or Super — which effects which instructions each bot may execute.
The first parameter of the create
instruction specifies the instruction set
for the child bot.
In our Replication program, we use the parameter 2 to specify that the child
should have the Super instruction set, since we want the child to be able to
create
a child of its own.
bank launcher ; 1
; LOOK HERE: jump to bank 3 to evade Super Diamond's attack
bjump 3,1
bank 2
bank main ; 3
@start
; Register #1 = "empty", or "opponent", or "friend"
scan #1
; if "opponent" goto @foe
; else goto @friend-or-empty
comp #1, 1
jump @friend-or-empty
jump @foe
@friend-or-empty
; if "friend" skip the follow create instruction
comp #1, 2
create 2,4,0
; LOOK HERE: Disinfect / initialize new bot
trans 1,1
trans 3,3
trans 4,4
set %active, 1
turn 1
jump @start
@foe
; LOOK HERE: Transfer self-destruct malware to the opponent
trans 4,1
; Make sure the opponent is active, so it can execute the foe bank
set %active, 1
jump @start
bank foe ; 4
trans 1,1
turn 1
bjump 3, 1
@foe
section of PV3@foe
comp #20, 0
jump @infect-with-virus
set #20, 1
trans 5,1
jump @restart
@infect-with-virus
; LOOK HERE: Transfer self-destruct malware to the opponent
set #20, 0
trans 4,1
@restart
; Make sure the opponent is active, so it can execute the foe bank
set %active, 1
jump @start
While the simulation is paused, you can inspect any bot simply by clicking on it.
Inspecting a bot opens up the debugger beneath the board.
The debugger highlights the current instruction that is being executed, the cycle number for that instruction, and the values for all the possible parameters.
You have now learned all 12 Robo Dojo instructions.
add #a, b
bjump a, b
comp a, b
create a, b, c
jump a
move
scan #a
set #a, b
sub #a, b
crash
trans a, b
turn a
You have also learned about Auto Reboot, Data Hunger, and some design patterns for Robo Dojo programs.
You can learn more by studying the Reference Manual and other Robo Dojo programs (which you can access via Robo Dojo itself).
Bots can read and write registers.
Each bot has 20 registers: #1
… #20
set #1, 0
turn #1
This program segment sets #1
equal to zero. Then turn #1
is equivalent to
turn 0
.
There are 12 Robo Dojo instructions
When debugging a program it helps to have the bots start at the same position & facing the same direction every time.
This way, every time you launch the simulation, the simulation will always progress the exact same way.
To set the starting position for a bot, open your JavaScript console, and enter the following:
app.initBot("robo", color, row, col, direction)
app.initBot("robo", "blue", 1, 2, "right")
The above command will cause the initial blue bot to always appear at row 1, column 2, facing the right.
I loaded up two robots from the July Package, and placed them in the same starting position in both Robo Dojo and RoboCom.
Then, the simulations diverged between Robo Dojo and RoboCom.
TODO: explain how I know my semantics are correct
I investigated several changes to Robo Dojo to see if I could get the simulations to converge, but none of the changes worked.
Each bot is either mobile or immobile (i.e. whether or not it can execute the
move
instruction).
The third parameter to the create
instruction specifies whether or not the
child should be mobile:
Different instructions belong to different Instruction Sets.
There are three instruction sets:
Each bot has an instruction-set constant: $instrset
$instrset
== 0, then the bot can only execute Basic instructions$instrset
== 1, then the bot can execute Basic and Advanced instructions$instrset
== 2, then the bot can execute all instructionsThe $instrset
value is determined when the bot is created. See the
create instruction.
Each bot contains one or more banks.
The second parameter to the create
instruction specifies how many banks
the child should have.
These will all be empty banks, which is to say every bank will have zero instructions.
At first glance, it might not seem possible that Prototype Virus 1 could end up infecting its own bots — since PV1 spreads its virus through bank 1 and PV1 operates out of bank 3.
A little debugging shows what happens:
bank main
if (forward cell is empty)
clone self
turn
else if (forward cell is an opponent)
infect the opponent with crash malware
else if (forward cell is friendly)
disinfect friend
turn
bank crash malware
crash
Use the speed slider.
| Semantics | If the forward cell contains…
|
| Data types | a must be writable |
| Instruction set | Advanced |
| Number of cycles | 6 |
| Runtime exceptions | If the bot’s instruction set is less than Advanced, then the bot taps out. |
The move
instruction tells the bot to move forward one cell.
It takes 18 cycles to execute; on the 18th cycle the bot attempts to move forward.
If the forward cell is occupied on the 18th cycle, then the move
instruction
does nothing.
Bank Jumper taught us that we can’t get away with just attacking the first bank — since our opponent may be operating out of any bank.
So now let’s build a program that can defeat Bank Jumper variants operating out of any bank.
The idea is to fork Bank Jumper and replace its @foe
routine with the
following pseudo code:
for (int i = 1; i <= 50; i++) {
transfer [empty bank] to bank i
if (forward cell does not contain opponent) {
break
}
}
The routine causes Data Hunger in the opponent, which causes the opponent to tap out.
To implement the new @foe
routine, we need to learn the
add instruction.
Here is the complete program.
The July Package contains a corpus of 50 RoboCom Classic programs, released in 1998.
We selected a subset of these programs for out tournament, based on the following criteria:
Several programs appeared under different version numbers. For example, the package includes both Alien1.4 and Alien3.4/. For such program families, we only include the latest program (excluding the earlier programs in the family. )
Lastly, we excluded Activator5 because it fails to compile under Robo Dojo.
TODO: Explain failed compilation
When you click Compile, the board clears itself then uploads your program to a fresh bot, then randomly places the bot on the board.
Most writable parameters begin with #
. The only exception is the writable
parameter %active
.
#1 … #20 |
These local registers store arbitrary integer values |
#active |
This is a special register: setting #active to 0 or negative deactivates the bot. |
%active |
A reference to the forward bot’s #active register.
%active is the only remote parameter that is writable. Setting %active to 0 or negative
deactivates the forward bot. In contrast, setting %active to a positive value activates the forward bot. |
bank launcher ; 1
; LOOK HERE: jump to bank 3 to evade Super Diamond's attack
bjump 3,1
bank 2
bank main ; 3
@start
; Register #1 = "empty", or "opponent", or "friend"
scan #1
; if "opponent" goto @foe
; else goto @friend-or-empty
comp #1, 1
jump @friend-or-empty
jump @foe
@friend-or-empty
; if "friend" skip the follow create instruction
comp #1, 2
create 2,5,0
; LOOK HERE: Disinfect / initialize new bot
trans 1,1
trans 3,3
trans 4,4
trans 5,5
set %active, 1
turn 1
jump @start
@foe
comp #20, 0
jump @infect-with-virus
set #20, 1
trans 5,1
jump @restart
@infect-with-virus
; LOOK HERE: Transfer self-destruct malware to the opponent
set #20, 0
trans 4,1
@restart
; Make sure the opponent is active, so it can execute the foe bank
set %active, 1
jump @start
bank foe ; 4
trans 1,1
turn 1
bjump 3, 1
bank crash; 5
crash
For each program pairing, we ran a match under Robo Dojo and a match under RoboCom. A match consists of seven or more bouts — where a bout is a single program execution that ends once one color has been eliminated from the board, or the bout times out at 80,000 steps.
The results of a match are denoted A-B-C, where:
*, +, and - denote “unusual” matches.
* denotes an overtime match.
+ denotes an overtime match where overtime times-out after 14 bouts.
- denotes a match where the winners are different in Robo Com and Robo Dojo.
You can launch different-colored bots on the board, each color with a different program.
To edit the program for a color, select a color from the color editor drop-down menu.
For this experiment:
The result should look like this, or this, this, or maybe this.
The Red bots overwhelm the Blue bots, and infect them with Red’s code banks.
Sometimes Blue bots infect Red bots, but Red bots quickly disinfect themselves.
Notice the Red bot that has been infected by Blue.
Each bot is either mobile or immobile.
Parent bots determine whether their children are mobile or immobile.
The $mobile
constant is 1
if the bot is mobile, and 0
if the bot
is immobile.
An immobile bot taps out if it attempts to move.
Blue is stuck because its frontier bots are infected with the virus.
The virus begins to spread.
The Blue team appears to be closing in on Red.
The Red team is completely infected with the virus.
Blue infects two Red bots with the virus.
Blue and Red make contact.
bank launcher ; 1
; LOOK HERE: jump to bank 3 to evade Super Diamond's attack
bjump 3,1
bank 2
bank main ; 3
@start
; Register #1 = "empty", or "opponent", or "friend"
scan #1
; if "opponent" goto @foe
; else goto @friend-or-empty
comp #1, 1
jump @friend-or-empty
jump @foe
@friend-or-empty
; if "friend" skip the follow create instruction
comp #1, 2
create 2,4,0
; LOOK HERE: Disinfect / initialize new bot
trans 1,1
trans 3,3
trans 4,4
set %active, 1
turn 1
jump @start
@foe
; LOOK HERE: Transfer self-destruct malware to the opponent
trans 4,1
; Make sure the opponent is active, so it can execute the foe bank
set %active, 1
jump @start
bank foe ; 4
trans 1,1
turn 1
You can include comments in your program with semicolons.
For example:
bank main ; bank #1
comp 1, #2 ; if #2 == 1, skip the next instruction
Example usage:
@foo
turn 1
move
jump @foo
The bot turns and moves in an endless loop.
An Auto Reboot is when a bot jumps to bank 1, instruction 1 due to a non-fatal error. There are four events that can lead to an Auto Reboot.
bjump
jumps to a bank that couldn’t possibly exist
(such as bank 51), then the bot taps out.Every program is segmented into banks; every instruction belongs to exactly one bank.
For our hello-world program, our program has only one bank, which we have named the main bank.
When the simulation launches, each bot begins executing at the first instruction of the first bank of the program.
Adding a turn
instruction to the Replication program builds a cluster of
bots in a diamond shape.
bank main
create 2,1,0
trans 1,1
set %active, 1
turn 1
| Semantics | Stores the value from b into a. |
| Data types | a must be writable |
| Instruction set | Basic |
| Number of cycles | 5 |
| Runtime exceptions | None |
In one board cycle, the selected bot becomes activated and executes one
cycle of the set
instruction.
You might think that a bot shouldn’t be able to become activated and execute a bot-cycle in the same board-cycle, however these semantics are intentional.
I have investigated preventing bots from executing a cycle immediately after their activation, however this change did not effect convergence.
| Semantics | Sums a and b, then stores the result in a |
| Data types | a must be writable b can be any parameter |
| Instruction set | Basic |
| Number of cycles | 6 |
| Runtime exceptions | None |
The board is the 16 x 16 toroidal universe where bots play.
Each cell can hold only one bot at a time.
The board executes one step at a time.
During each board step, the board executes one cycle for each bot, in order from oldest bot to newest bot.
Whenever a bot reaches the end of its bank, the bot Auto Reboots — which means the bot’s execution starts over at the first instruction of the first bank.
In our Hello World program, Auto Reboot causes the bot to repeatedly execute the move instruction.
There are several events that can trigger an Auto Reboot.
Among them, if a bot executes a bjump
instruction to a bank that doesn’t
exist, then the bot will Auto Reboot.
A bot reboots by jumping to the first instruction of the first bank.
If the first bank is empty, then the bot taps out from “Data Hunger.”
Up until now, minor timing issues haven’t played a role in the development of our programs. But viruses must be quick, in order to overwhelm disinfection.
We can develop a program that defeats Super Diamond, by forking Super Diamond and making a few small changes.
Basically, we use the bjump instruction to jump away from the first bank. Since Super Diamond attacks the first bank, it easily evades Super Diamond’s attack.
The Bank Jumper program looks like this.
 Of course, the attacker can target every bank, but that leads to a slower attack.
Let’s build a program that defeats the Diamond program.
The general idea is to infect Diamond bots with malware that causes the infected bots to “tap out” — i.e. exit the board.
The pseudo code for our Super Diamond program is straightforward and simple.
To implement it, we need to learn about registers and four new instructions:
Putting it all together, here is the Super Diamond program.
The battle should look something like this.
The Reference-manual entries for:
Typically, the create
instruction requires at least several hundred cycles.
Super Diamond bots never have a third bank, so when they execute bjump 3,1
it causes a Auto Reboot, which results in the bot
restarting at bank 1.
Therefore, the new payload does not affect the way Super Diamond bots execute
the new virus payload (except for timing, since bjump
takes up a few cycles).
We this because:
This is because every Red bot is more-or-less surrounded by other Red bots who are constantly propagating their Red banks. Thus, when a Red bot becomes infected, its neighboring Red bots disinfect the infected Red bot.
Each Blue bot has a Red circle inside it, which indicates each Blue bot is executing a bank that originated from Red’s program.
This happens because Red and Blue indiscriminately transfer their first bank to the bots in front of them.
So, when a Blue bot is infected with a Red bank, the Blue bot begins to turn as it reproduces, propagating Red’s bank along the way.
Through 8 case studies, this guide teaches you the essentials of Robo Dojo programming. This guide assumes you are already a programmer.
Click the color-selection drop down, then choose your color.
add #a, b
adds #a
and b
together, then stores the result in #a
.
sub #a, b
subtracts b
from #a
, then stores the result in #a
.
At this time Robo Dojo does not provide any mechanism for you to save your programs in Robo Dojo (this is a beta release).
Just copy and paste into your text editor and save there.
Sorry.
The following instructions are in the Basic Instruction Set:
To begin, two bots are randomly placed on a 16 × 16 board — one bot is loaded with your program, the other is loaded with your opponent’s program.
When you press the play button, the bots begin executing — moving, turning, looking, multiplying, infecting, disinfecting, crashing, emergent phenomena arising …
You are declared the victor once all your opponent’s bots have crashed.
The game is simple: there are only 12 instructions and only a handful of concepts. The game is also complex: it is challenging to craft winning programs.
The game is not solved. Is it possible to develop a program that defeats all other programs? Does every strategy & tactic imply an effective counter?
Click the demo, then click the Play button
RoboCom is no longer actively maintained but its website is archived here. Here’s a screenshot.
Robo Dojo only implements the “Original” instruction set from RoboCom.
Robo Dojo uses the “Classic” timing model from RoboCom.
I have strove to make the Robo Dojo simulation semantics identical to RoboCom — however I could not create a cycle-for-cycle duplicate of RoboCom.
Nevertheless, Robo Dojo and RoboCom have similar semantics.
Remote parameters refer to values in the forward bot.
If the remote cell is empty though, then every remote parameter yields the
value 0
.
Every remote parameter begins with %
.
There is only one writable remote parameter:
%active
. The rest are read-only.
set %active, 1
sets the forward bot’s #active
register to 1.set #3, %banks
sets the local register #3
to the number-of-banks
in the forward bot. Or, sets #3
to zero if the forward cell is
empty.%active |
%active is the only remote parameter that is writable. Setting %active to 0 or negative
deactivates the forward bot. In contrast, setting %active to a positive value activates the forward bot. |
%banks |
The number of banks in the forward bot. |
%instrset |
The instruction set of the forward bot. 0 signifies
the Basic instruction set; 1 signifies the
Advanced instruction
set; 2 signifies the Super instruction set. |
%mobile |
0 if the forward bot is immobile; 1
if the forward bot is mobile. |
You can set a breakpoint on an instruction by clicking the gutter to the left of the instruction.
A blue circle will appear there, indicating the breakpoint.
Click the blue circle to remove the breakpoint.
To see how closely Robo Dojo matches RoboCom semantics, I ran a Tournament of programs using programs from the July Package.
The results show that Robo Dojo semantics are similar to RoboCom semantics: of the 38 matches in the tournament, Robo Dojo and RoboCom produced different victors only four times.
| Semantics |
On its final cycle:
|
| Data types | iset, banks, & mobile can be any parameter |
| Instruction set | Super |
| Number of cycles |
(50 + 20 * banks) * (if (mobile == 1) 2 else 1) + (if (iset == Advanced) 40 else 0) + (if (iset == Super) 80 else 0) |
| Runtime exceptions |
The parent bot taps out if any of the following events occur:
|
| Semantics | During its final cycle, if the forward cell is empty, the bot moves into that cell. Otherwise, the instruction does nothing. |
| Data types | N/A |
| Instruction set | Basic |
| Number of cycles | 18 |
| Runtime exceptions | None |
It usually takes at least several hundred cycles to create a new bot.
On the other hand, it only takes several tens of cycles to infect a bot with a small code bank.
So, commandeering a bot is more efficient than creating a bot by an order of magnitude.
Every bot can remotely access its forward bot’s data to a limited extent.
The key is using remote parameters.
For example, a bot can obtain the number of banks in the forward bot, by
using the %banks
parameter.
If an instruction attempts to read a remote value, but the forward cell is empty, then the remote value is read as zero.
Every instruction requires a certain number of cycles to execute.
When an instruction accesses a remote parameter (either reading or writing) then the instruction takes longer to execute.
Specifically, the number of required cycles increases by 8
for every
remote parameter that is accessed.
The stepTo JavaScript command sets a breakpoint at a particular step.
To use this command, open your JavaScript console and enter the following:
app.stepTo("robo", stepNumber)
app.stepTo("robo", 1000)
The above command will set a breakpoint at step number 1000.
We are going to fork Bank Jumper, and modify it to use a virus to defeat Super Diamond.
s
The comp a, b
instruction compares a
and b
.
If a
and b
are equal, then the following instruction is skipped.
Otherwise, the following instruction is executed as normal.
comp #1, 0
turn 1
move
If #1
== 0, then the bot does not turn.
Otherwise, the bot does turn.
move
instruction belongs to the Basic instruction setcreate
instruction belongs to the Super instruction set| Semantics | If a is a label, then jump to the first instruction that appears after that label. Otherwise (if a is an integer), then jump a instructions forward or backward (depending on if a is positive or negative). For example, if a is 3, then jump to the third instruction that appears after the jump instruction. |
| Data types | a can be any parameter. Also, it can be a label. |
| Instruction set | Basic |
| Number of cycles | 2 |
| Runtime exceptions | If the instruction jumps out of bounds (i.e. out side of its bank), then an Auto Reboot happens, possibly leading to Data Hunger. |
The problem is at least twofold:
Here is one example of mysterious RoboCom semantics.
To execute an instruction, the bot must execute one or more cycles for the instruction.
For example, the move
instruction requires 18 cycles.
During the 18th cycle, the move
instruction will actually execute.
Before the 18th cycle, the move
instruction does nothing.
Say Bot X is some bot on the board.
Relative to Bot X, the term forward cell refers to the cell directly in front of Bot X.
If there is a bot in that cell, it is referred to as the forward bot.
Since bank 3 is the main bank for PV2 bots, when a PV2 bot executes the virus payload it causes the PV2 bot to resume its execution as normal.
The turn
instruction takes one parameter.
The scan
instruction looks at the cell in front of the bot.
scan variable
sets variable
to either 0, 1, or 2, depending on what is
in front of the bot.
variable
= 0 if the front cell is emptyvariable
= 1 if the front cell contains an opponentvariable
= 2 if the front cell contains a friendscan #1
sets #1
to either 0, 1, or 2.
We this because:
I forgot about setting up byes until Round 2. In contrast to typical tournament brackets, I added the byes in Round 2 and 3. For our purposes, it doesn’t really matter.
The create
instruction builds a new bot in front of the builder.
There are three parameters:
The create
instruction is the slowest instruction.
During the create
instruction’s last cycle, if the forward cell is empty, then
the child will be created in front of the parent. The child bot will have empty
banks and will be “inactive” (which is why
we need to execute the trans
and set
instructions after create
).
Thus, create 2,1,0
creates an immobile bot with the Super instruction set and
one empty bank.
The set
instruction assigns a value to a variable.
There are two parameters:
Thus, set %active, 1
assigns the value 1
to the variable %active
.
%active
is a special variable: setting it to 1
(or greater)
causes the forward bot to become activated.
Reference-manual entries for:
On the right side: a Red bot has a Blue circle — indicating that the Red bot has been infected by Blue.
Notice: the Red bot that was previously infected is now free of the Blue circle; the Red bot has been disinfected.
Also, the Red square indicates that a Red bot had recently crashed in that cell.
The following instructions are in the Advanced Instruction Set:
The bjump
instruction jumps from one bank to another.
It takes two parameters:
bank one
bjump 3, 1
bank two
bank three
move
This causes the bot to jump to the first instruction of the third bank.
| Semantics |
|
| Data types | a can be any parameter |
| Instruction set | Basic |
| Number of cycles | 5 |
| Runtime exceptions | None |


Class: Aws::Budgets::Client
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
::Seahorse::Client::Base
|
|
|
Instance Chain:
|
|
| Inherits: |
Seahorse::Client::Base
|
| Defined in: | (unknown) |
Overview
An API client for AWS Budgets. To construct a client, you need to configure a :region
and :credentials
.
budgets = Aws::Budgets::Client.new(
region: region_name,
credentials: credentials,
# ...
)
See #initialize
for a full list of supported configuration options.
Region
You can configure a default region in the following locations:
ENV['AWS_REGION']
Aws.config[:region]
Go here for a list of supported regions.
Credentials
Default credentials are loaded automatically from the following locations:
ENV['AWS_ACCESS_KEY_ID']
andENV['AWS_SECRET_ACCESS_KEY']
Aws.config[:credentials]
- The shared credentials ini file at
~/.aws/credentials
(more information) - From an instance profile when running on EC2
You can also construct a credentials object from one of the following classes:
- ::Aws::Credentials
- ::Aws::SharedCredentials
- ::Aws::InstanceProfileCredentials
- ::Aws::AssumeRoleCredentials
Alternatively, you configure credentials with :access_key_id
and
:secret_access_key
:
# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))
Aws::Budgets::Client.new(
access_key_id: creds['access_key_id'],
secret_access_key: creds['secret_access_key']
)
Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.
Class Method Summary
-
.new(options = {}) ⇒ Aws::Budgets::Client
constructor
Constructs an API client.
::Seahorse::Client::Base - Inherited
| .add_plugin | Registers a plugin with this client. |
| .api, .clear_plugins, .define, | |
| .extend | Alias for Seahorse::Client::Base.define. |
| .new | See additional method definition at line 18. |
| .plugins | Returns the list of registered plugins for this Client. |
| .remove_plugin, .set_api, .set_plugins |
Instance Attribute Summary
::Seahorse::Client::Base - Inherited
Instance Method Summary
-
#create_budget(options = {}) ⇒ Struct
Create a new budget.
-
#create_notification(options = {}) ⇒ Struct
Create a new Notification with subscribers for a budget.
-
#create_subscriber(options = {}) ⇒ Struct
Create a new Subscriber for a notification.
-
#delete_budget(options = {}) ⇒ Struct
Delete a budget and related notifications.
-
#delete_notification(options = {}) ⇒ Struct
Delete a notification and related subscribers.
-
#delete_subscriber(options = {}) ⇒ Struct
Delete a Subscriber for a notification.
-
#describe_budget(options = {}) ⇒ Types::DescribeBudgetResponse
Get a single budget.
-
#describe_budgets(options = {}) ⇒ Types::DescribeBudgetsResponse
Get all budgets for an account.
-
#describe_notifications_for_budget(options = {}) ⇒ Types::DescribeNotificationsForBudgetResponse
Get notifications of a budget.
-
#describe_subscribers_for_notification(options = {}) ⇒ Types::DescribeSubscribersForNotificationResponse
Get subscribers of a notification.
-
#update_budget(options = {}) ⇒ Struct
Update the information of a budget already created.
-
#update_notification(options = {}) ⇒ Struct
Update the information about a notification already created.
-
#update_subscriber(options = {}) ⇒ Struct
Update a subscriber.
-
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
-
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters.
::Seahorse::Client::Base - Inherited
| #build_request | Builds and returns a |
| #operation, #operation_names |
::Seahorse::Client::HandlerBuilder - Included
Constructor Details
.new(options = {}) ⇒ Aws::Budgets::Client
Constructs an API client.
Instance Method Details
#create_budget(options = {}) ⇒ Struct
Create a new budget
#create_notification(options = {}) ⇒ Struct
Create a new Notification with subscribers for a budget
#create_subscriber(options = {}) ⇒ Struct
Create a new Subscriber for a notification
#delete_budget(options = {}) ⇒ Struct
Delete a budget and related notifications
#delete_notification(options = {}) ⇒ Struct
Delete a notification and related subscribers
#delete_subscriber(options = {}) ⇒ Struct
Delete a Subscriber for a notification
#describe_budget(options = {}) ⇒ Types::DescribeBudgetResponse
Get a single budget
#describe_budgets(options = {}) ⇒ Types::DescribeBudgetsResponse
Get all budgets for an account
#describe_notifications_for_budget(options = {}) ⇒ Types::DescribeNotificationsForBudgetResponse
Get notifications of a budget
#describe_subscribers_for_notification(options = {}) ⇒ Types::DescribeSubscribersForNotificationResponse
Get subscribers of a notification
#update_budget(options = {}) ⇒ Struct
Update the information of a budget already created
#update_notification(options = {}) ⇒ Struct
Update the information about a notification already created
#update_subscriber(options = {}) ⇒ Struct
Update a subscriber
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
Basic Usage
Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.
# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)
Configuration
You can configure the maximum number of polling attempts, and the
delay (in seconds) between each polling attempt. You configure
waiters by passing a block to #wait_until
:
# poll for ~25 seconds
client.wait_until(...) do |w|
w.max_attempts = 5
w.delay = 5
end
Callbacks
You can be notified before each polling attempt and before each
delay. If you throw :success
or :failure
from these callbacks,
it will terminate the waiter.
started_at = Time.now
client.wait_until(...) do |w|
# disable max attempts
w.max_attempts = nil
# poll for 1 hour, instead of a number of attempts
w.before_wait do |attempts, response|
throw :failure if Time.now - started_at > 3600
end
end
Handling Errors
When a waiter is successful, it returns true
. When a waiter
fails, it raises an error. All errors raised extend from
::Aws::Waiters::Errors::WaiterFailed.
begin
client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
#waiter_names ⇒ Array
<Symbol
>
Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:
| Waiter Name | Client Method | Default Delay: | Default Max Attempts: |
|---|


datestyle
Values (Default in Bold)
Format specification (ISO, Postgres, SQL, or German), and year/month/day ordering (DMY, MDY, YMD).
ISO, MDY
Description
Sets the display format for date and time values as well as the rules for interpreting ambiguous date input values. The string contains two parameters that can be changed separately or together.
Example
show datestyle; DateStyle ----------- ISO, MDY (1 row) set datestyle to 'SQL,DMY';


Dashboard
Reports
Headcount
The report displays the number of active employees for each month including the month of contract expiration or termination.
Headcount
This report shows the amount of internal employees in your workforce (external employees are not included).
Headcount
This report shows the amount of internal employees in your workforce (external employees are not included).
Headcount
This report shows the amount of internal employees in your workforce (external employees are not included).
Headcount
This report shows the amount of internal employees in your workforce (external employees are not included).
Headcount
This report shows the amount of internal employees in your workforce (external employees are not included).
Headcount
This report shows the amount of internal employees in your workforce (external employees are not included).
Headcount
This report shows the amount of internal employees in your workforce (external employees are not included).
Headcount
This report shows the amount of internal employees in your workforce (external employees are not included).
Headcount
This report shows the amount of internal employees in your workforce (external employees are not included).
Headcount
This report shows the amount of internal employees in your workforce (external employees are not included).
Headcount
This report shows the amount of internal employees in your workforce (external employees are not included).
Headcount
This report shows the amount of internal employees in your workforce (external employees are not included).
Exports
Trial Daten
- When: Disabled
- What: Employee selection
- Format: First name, Last name, Gender, Email, Status, Employment type, Hire date, Supervisor, Sub-company, Office, Department, Position, Contract ends, Cost center, Length of probation, Weekly hours, Children, Birthday, dynamic_724812, dynamic_724811, dynamic_724833, LinkedIn, Employee ID, dynamic_724819, Nationality, Enrollment certificate valid until, Notice period, Occupation type, Street and house number, Postal code, City, Private email, dynamic_724820, dynamic_724821, Tax ID, Social security number, Wage tax class, Marital status, Religious denomination, dynamic_724814, dynamic_724815, Type of health insurance, Name of health insurance, Main or secondary occupation, Child allowance, dynamic_724825, Wage-tax allowance, Salary type, Holder of bank account, IBAN, BIC, dynamic_724816, Emergency contact name, Emergency contact phone number, dynamic_724817, Emergency contact relationship to the employee, Key number / ID, dynamic_724827, dynamic_724828


Go to http://babun.github.io/ and follow the instructions to download Babun.
Unzip Babun and launch the install.bat
file. This should open a cmd
window and print a lot of text.
If you have an error that says something like .babun folder already exists
, then you can delete this folder (in C:\Users\_YOUR_NAME_
) and everything it contains.
Run the following commands in the Babun shell:
babun update
You are now ready to use Babun! Babun comes with a lot of good preinstalled packages, including git
, zsh
with oh-my-zsh
, vim
, and a lot of others. But IMO, the best feature of Babun over Cygwin is its ability to install and update packages directly from the command line.
pact install _YOUR_DREAM_PACKAGE_HERE_
Have fun using Babun (sorry you're on Windows).


GOT CASH BUT DON'T KNOW HOW TO SPEND IT?
Here's a welcome solution
BUY OUR EXCLUSIVE SUV'S
GOT CASH BUT DON'T KNOW HOW TO SPEND IT?
MODEL
PICTURE
PRICE
REVIEWS
Porsche Cayenne
$500000
So good its worth spending all u're cash
Mercedes-Benz GLK 350
Don't ask
Don't ask
SPECIAL OFFER! BUY AN SUV AND GET AN LCD TV FREE!


--- layout: post title: "Ad hoc Arbitraries with FsCheck.Xunit" description: "When using FsCheck with xUnit.net, you can define ad hoc Arbitraries in-line in your test functions." date: 2015-09-08 11:11 UTC tags: [Unit Testing, xUnit.net, F#, FsCheck] --- {% include JB/setup %}
{{ page.description }}
Writing properties with FsCheck and using xUnit.net as a test host is a nice combination. Properties are written as normal functions annotated with the Property attribute:
[<Property>] let ``findNeighbors returns 8 cells`` (cell : int * int) = let actual : Set<int * int> = findNeighbors cell 8 =! actual.Count
FsCheck takes care of generating values for the cell
argument. This works well in many cases, but sometimes you need a bit more control over the range of values being generated by FsCheck.
You may already have guessed it from the above code snippet, but the example for this article is a property-based approach to Conway's Game of Life. One of the properties of the game is that any live cell with more than three live neighbours dies.
This means that you have to write a property where one of the values is the number of live neighbours. That number must be a (randomly generated) number between 4 and 8 (including both ends), because the maximum number of neighbours in a cell grid is eight. How do you get FsCheck to give you a number between 4 and 8?
There are various solutions to the problem of getting fine control over certain values generated by FsCheck, but the ones I first learned turn out to be problematic.
One attempt is to use conditional properties, where you supply a boolean expression, and FsCheck will throw away all properties that fail the boolean test:
[<Property>] let ``Any live cell with more than three live neighbors dies`` (cell : int * int) (neighborCount : int) = (3 < neighborCount && neighborCount <= 8) ==> lazy let neighborCells = findNeighbors cell |> pickRandom neighborCount let actual = calculateNextState (cell :: neighborCells) cell Dead =! actual
The ==>
operator is an FsCheck-specific operator that indicates that FsCheck should disregard all properties where the input arguments don't satisfy the boolean condition on the left side. The use of lazy ensures that FsCheck will only attempt to evaluate the property when the condition is true.
That's simple and tidy, but unfortunately doesn't work. If you attempt to run this property, you'll get a result like this:
Test 'Ploeh.Katas.GameOfLifeProperties.Any live cell with more than three live neighbors dies' failed: Arguments exhausted after 34 tests.
The reason is that FsCheck generates random integers for neighborCount
, and most of these values (statistically) fall outside of the range 4-8. After a (default) maximum of 1000 attempts, FsCheck gives up, because at that time, it's only managed to find 34 values that satisfy the condition, but it wants to find 100.
What a disappointment.
Another apparent solution is to define a custom Arbitrary for FsCheck.Xunit. The mechanism is to define a static class with your custom rule, and register that with the Property attribute. The class must have a static method that returns an Arbitrary<'a>.
In this particular example, you'll need to define a custom Arbitrary that only picks random numbers between 4 and 8. That's easy, but there's a catch: if you change the way int
values are generated, you're also going to impact the generated cell
values, because a cell here is an int * int
tuple.
Since you only need a small number, you can cheat and customize byte values instead:
type ByteBetween1and8 = static member Byte () = Gen.elements [1uy .. 8uy] |> Arb.fromGen [<Property(Arbitrary = [| typeof<ByteBetween1and8> |])>] let ``Any live cell with more than three live neighbors dies`` (cell : int * int) (neighborCount : byte) = neighborCount > 3uy ==> lazy let neighborCells = findNeighbors cell |> pickRandom (int neighborCount) let actual = calculateNextState (cell :: neighborCells) cell Dead =! actual
The ByteBetween1and8 type is a static class with a single static member that returns Arbitrary<byte>. By using the Arbitrary property of the Property attribute (!), you can register this custom Arbitrary with the Property.
This 'solution' side-steps the issue by using a substitute data type instead of the desired data type. There are several problems with this:
int neighborCount
.3uy
is less readable than 3
.neighborCount
is a byte instead of an int.This way works, but is hardly elegant or safe.
There's a safe way to define ad hoc, in-line Arbitraries with FsCheck.Xunit:
[<Property>] let ``Any live cell with > 3 live neighbors dies`` (cell : int * int) = let nc = Gen.elements [4..8] |> Arb.fromGen Prop.forAll nc (fun neighborCount -> let liveNeighbors = cell |> findNeighbors |> shuffle |> Seq.take neighborCount |> Seq.toList let actual : State = calculateNextState (cell :: liveNeighbors |> shuffle |> set) cell Dead =! actual)
Using Prop.forAll enables you to execute your property with a custom Arbitrary, but mixed with the 'normally' generated values that the function receives via its arguments. In this example, nc
is an Arbitrary<int>. Notice how it's explicitly used to populate the neighborCount
value of the property, whereas the cell
value arrives via normal means.
This is type-safe, because nc
is an Arbitrary<int>, which means that neighborCount
is statically inferred to be an int
.
If you need more than a single ad hoc Arbitrary, you can always create Arbitraries for each of them, and then use Gen.map2, Gen.map3, and so on, to turn those individual Arbitraries into a single Arbitrary of a tuple. You can then use that tuple with Prop.forAll.
FsCheck is a well-designed library that you can combine in lots of interesting ways. In this article you learned how to use Prop.forAll to evaluate a property with a mix of normal, arbitrarily generated values, and an ad hoc, in-line Arbitrary.
Addendum 2016-03-01: You can write such properties slightly better using the backward pipe operator.


Becel Recipes
Start by choosing the type of Heart healthy recipe
Browse our collection of recipes by type.
Back
Becel Recipes
Back
Becel Recipes
Prepare:
10 Mins
Cooking:
15 Mins
Makes:
Ingredients:
Instrunctions:
Tips:
Back
Becel Recipes


[gecode-users] Sets difference
Mauricio Toro
mauriciotorob at gmail.com
Fri Feb 29 12:18:43 CET 2008
Hello,
I am trying to make a little program for set's difference.
I found some info at sudoko's example.. but I have not
been able to make the difference work :(
I have this code:
SetVar a = SetVar(this);
SetVar b = SetVar(this);
SetVar c = SetVar(this);
SetVarArray answer = SetVarArray(this,2);
dom (this, a, SRT_EQ , 1, 5);
dom (this, b, SRT_EQ , 3, 10);
//c = a - b
// answer = c ??
rel (this, a, SOT_MINUS, b, SRT_EQ, c);
rel (this, SOT_UNION, answer, c);
//SET_VAR_MIN_CARD With smallest unknown set.
//SET_VAL_MIN Select smallest value in unknown set
branch(this, answer, SET_VAR_NONE, SET_VAL_MIN);
--
Mauricio Toro Bermudez
Estudiante de Ingeniería de Sistemas
Pontificia Universidad Javeriana, Colombia
Stagiare à l'Ircam
1, place Igor-Stravinsky 75004 Paris,
France de 2008 à 2009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20080229/e013d98e/attachment.htm>
More information about the gecode-users
mailing list


{% extends "organizations/details.html" %} {% block title %}Invite — {{ org.name }} — {{ super() }}{% endblock %} {% block main_inner %}
Invite users to join your organization.


Implementing a Parser and PSI
Parsing files in IntelliJ Platform is a two-step process. First, an abstract syntax tree (AST) is built, defining the structure of the program. AST nodes are created internally by the IDE and are represented by instances of the ASTNode class. Each AST node has an associated element type IElementType instance, and the element types are defined by the language plugin. The top-level node of the AST tree for a file needs to have a special element type, implementing the IFileElementType interface.
The AST nodes have a direct mapping to text ranges in the underlying document. The bottom-most nodes of the AST match individual tokens returned by the lexer, and higher level nodes match multiple-token fragments. Operations performed on nodes of the AST tree, such as inserting, removing, reordering nodes and so on, are immediately reflected as changes to the text of the underlying document.
Second, a PSI, or Program Structure Interface, tree is built on top of the AST, adding semantics and methods for manipulating specific language constructs. Nodes of the PSI tree are represented by classes implementing the PsiElement interface and are created by the language plugin in the ParserDefinition.createElement() method. The top-level node of the PSI tree for a file needs to implement the PsiFile interface, and is created in the ParserDefinition.createFile() method.
Example: ParserDefinition for Properties language plugin
The lifecycle of the PSI is described in more detail in Architectural Overview.
The base classes for the PSI implementation, including PsiFileBase, the base implementation of PsiFile, and ASTWrapperPsiElement, the base implementation of PsiElement, are provided by IntelliJ Platform.
There is currently no ready way to reuse existing language grammars, for example, from ANTLR, for creating custom language parsers. The parsers need to be coded manually.
Custom language parser and PSI classes can be generated from grammars using Grammar-Kit plugin. Besides code generation it provides various features for editing grammar files: syntax highlighting, quick navigation, refactorings and more. The Grammar-Kit plugin is built using its own engine and its source code can be found on GitHub.
The language plugin provides the parser implementation as an implementation of the
PsiParser
interface, returned from
ParserDefinition.createParser().
The parser receives an instance of the
PsiBuilder
class, which is used to get the stream of tokens from the lexer and to hold the intermediate state of the AST being built.
The parser must process all tokens returned by the lexer up to the end of stream, in other words until
PsiBuilder.getTokenType()
returns null
, even if the tokens are not valid according to the language syntax.
Example: PsiParser implementation for Properties language plugin.
The parser works by setting pairs of markers ( PsiBuilder.Marker instances) within the stream of tokens received from the lexer. Each pair of markers defines the range of lexer tokens for a single node in the AST tree. If a pair of markers is nested in another pair (starts after its start and ends before its end), it becomes the child node of the outer pair.
The element type for the marker pair and for the AST node created from it is specified when the end marker is set, which is done by making call to
PsiBuilder.Marker.done().
Also, it is possible to drop a start marker before its end marker has been set.
The drop()
method drops only a single start marker without affecting any markers added after it, and the rollbackTo()
method drops the start marker and all markers added after it and reverts the lexer position to the start marker.
These methods can be used to implement lookahead when parsing.
The method
PsiBuilder.Marker.precede()
is useful for right-to-left parsing when you don’t know how many markers you need at a certain position until you read more input.
For example, a binary expression a+b+c
needs to be parsed as ( (a+b) + c )
.
Thus, two start markers are needed at the position of the token ‘a’, but that is not known until the token ‘c’ is read.
When the parser reaches the ‘+’ token following ‘b’, it can call precede()
to duplicate the start marker at ‘a’ position, and then put its matching end marker after ‘c’.
An important feature of
PsiBuilder
is its handling of whitespace and comments.
The types of tokens which are treated as whitespace or comments are defined by the methods getWhitespaceTokens()
and getCommentTokens()
in the
ParserDefinition
class.
PsiBuilder
automatically omits whitespace and comment tokens from the stream of tokens it passes to
PsiParser,
and adjusts the token ranges of AST nodes so that leading and trailing whitespace tokens are not included in the node.
The token set returned from ParserDefinition.getCommentTokens() is also used to search for TODO items.
In order to better understand the process of building a PSI tree for a simple expression, you can refer to the following diagram:
In general, there is no single right way to implement a PSI for a custom language, and the plugin author can choose the PSI structure and set of methods which are the most convenient for the code which uses the PSI (error analysis, refactorings and so on).
However, there is one base interface which needs to be used by a custom language PSI implementation in order to support features like rename and find usages.
Every element which can be renamed or referenced (a class definition, a method definition and so on) needs to implement the
PsiNamedElement
interface, with methods getName()
and setName()
.
A number of functions which can be used for implementing and using the PSI can be found in the com.intellij.psi.util
package, and in particular in the
PsiUtil
and
PsiTreeUtil
classes.
A very helpful tool for debugging the PSI implementation is the PsiViewer plugin. It can show you the structure of the PSI built by your plugin, the properties of every PSI element and highlight its text range.
Please see Indexing and PSI Stubs for advanced topics.


Ringo Kamotenojutsu
Ringo
nyak!
Dec 12, 2009 Sat 11:28 PM
Ringo
Tell your friends what you're doing right now...anu nangyari sa freindster!!!? ampanget! bwehehehe
Dec 04, 2009 Fri 07:32 AM
|
Downloaded by Ringo Kamotenojutsu (http://profiles.friendster.com/rinzell) on May 02, 2011 at 06:53 AM


Toggle navigation
connect
disconnect
Action
Account settings
Refresh Gateways
Update Gateway List
Select
Country
City
PPTP host
Response Time
×
Purvpn Account settings
Username
Password