This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deadlock Detection: | |
No deadlocks found. | |
Thread t@312: (state = BLOCKED) | |
- org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.addShardFailure(int, java.lang.Throwable) @bci=80, line=336 (Interpreted frame) | |
- org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(int, org.elasticsearch.cluster.routing.ShardRouting, org.elasticsearch.cluster.routing.ShardIterator, java.lang.Throwable) @bci=4, line=249 (Compiled frame) | |
- org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onFailure(java.lang.Throwable) @bci=17, line=220 (Compiled frame) | |
- org.elasticsearch.search.action.SearchServiceTransportAction$2.handleException(org.elasticsearch.transport.TransportException) @bci=5, line=161 (Compiled frame) | |
- org.elasticsearch.transport.TransportService$2.run() @bci=8, line=207 (Compiled frame) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import spyral | |
from functools import partial | |
def source(f): | |
return partial(f, '') | |
def dest(f): | |
return partial(f, '_dest') | |
class View(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RegisterForm(spyral.Form): | |
name = spyral.TextInputWidget(self, 50, "Name") | |
password = spyral.TextInputWidget(self, 50, "Pass") | |
user_type = spyral.RadioGroup(self, map(partial(spyral.RadioButtonWidget, self), ["Admin", "User", "Guest"])) | |
remember_me = spyral.CheckboxWidget(self) | |
okay = spyral.ButtonWidget(self, "Okay") | |
cancel = spyral.ButtonWidget(self, "Cancel") | |
form = RegisterForm(scene) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spyral: | |
spyral.form | |
- Buttons | |
- Checkboxes | |
- Radio Boxes | |
- A complete example | |
spyral.group | |
- Obsolete, move code from the groups into spyral.camera | |
spyral.event | |
- All kinds of stuff, update to be modern, handlers, managers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TextInput] | |
font: %(path)s/fonts/DejaVuSans.ttf | |
font_size: 42 | |
font_color: (255, 255, 255) | |
font_color_hilight: (255, 255, 0) | |
font_color_hilight_background: (255, 255, 255, 0) | |
padding: 8 | |
background: %(path)/images/TextInputWidget.png | |
background_focused: %(path)/images/TextInputWidget_focused.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if orientation in ('left', 'right'): | |
selector = Vec2D(1,0) | |
else: | |
selector = Vec2D(0,1) | |
if orientation in ('left', 'above'): | |
reversed(sequence) | |
if type(padding) in (float, int, long): | |
padding = [padding] * len(sequence) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from spyral import Sprite, AggregateSprite | |
class FormWidget(object): | |
def get_value(self): | |
pass | |
def set_value(self, value): | |
pass | |
class TextInputWidget(Sprite, FormWidget): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reset_Requests_table = db.Table('Reset_Requests', db.Model.metadata, | |
db.Column('student_id', db.Integer, db.ForeignKey('user.id')), | |
db.Column('teacher_id', db.Integer, db.ForeignKey('user.id')), | |
db.Column('approved', db.Boolean) | |
) | |
class Reset_Requests(object): | |
pass | |
mapper(Reset_Requests, Reset_Requests_table, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Alternative forms of collision detection | |
- Possible use of algorithms like quadtrees and spatial hashing | |
Positioning based on tuples/numpy arrays vs Rects | |
Anchor points | |
Improved layering system | |
"Automated" dirty rendering | |
A Group which implements the Sprite protocol (aggregate sprites) | |
Properties which change sprites in various ways: | |
- angle of rotation | |
- scale (zoom in or out) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def __call__(self, *args): | |
from spyral import director | |
frame = director.get_tick() | |
if director.get_scene() is not self.scene: | |
self.scene = director.get_scene() | |
self.cache = {} | |
if frame - self.last_clear > 100: | |
self.cache = dict((key,value) for key,value in self.cache.items() if frame - value[1] > 250) | |
self.last_clear = frame | |
try: |