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
""" | |
Check the units of the pyplot specgram to determine if the | |
output is in terms of the original unit or unit-squared. | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt | |
def find_nearest(array, value): |
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
App.TagsController = Ember.ArrayController.extend { | |
filterOn: null | |
setFilterOn: (tagId)-> | |
if this.get('filterOn') == tagId | |
this.set 'filterOn', null | |
else | |
this.set 'filterOn', tagId | |
console.log('in tagscontroller') |
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
App.TasksListController = Ember.ArrayController.extend { | |
needs: ['tasks'] | |
contentBinding: 'controllers.tasks.filteredContent' | |
sortProperties: ['priority'] | |
sortAscending: false | |
updatePrioritiesByOrder: (orderedTasks)-> | |
orderedTasks.forEach( (item, index) -> | |
console.log item | |
) |
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 wx | |
import rsvg | |
import numpy | |
try: | |
import wx.lib.wxcairo | |
import cairo | |
haveCairo = True | |
except ImportError: | |
haveCairo = False |
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 wx | |
import rsvg | |
import numpy | |
try: | |
import wx.lib.wxcairo | |
import cairo | |
haveCairo = True | |
except ImportError: | |
haveCairo = False |
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
Library.BooksNewController = Ember.ObjectController.extend | |
save: (book)-> | |
book.one 'didCreate', this, -> | |
@transitionToRoute('books.book', book) | |
console.log 'here' | |
@get('model').save() |
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
LibraryAdapter = Ember.RESTAdapter.extend | |
didFind: (record, id, data)-> | |
console.log 'here' | |
rootKey = get(record.constructor, 'rootKey') | |
dataToLoad = if rootKey then data[rootKey] else data | |
if /^code:/.test(id) | |
id = dataToLoad.id | |
record.load(id, dataToLoad) |
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
{"id"=>nil, "status"=>"out", "closed_at"=>nil, "created_at"=>nil, "book"=>{"id"=>1, "code"=>"123", "volume"=>2, "stock"=>1, "title"=>"A Road Ago", "adult"=>true, "notes"=>nil, "checkout_ids"=>[22]}, "patron"=>{"id"=>1, "code"=>"1", "name"=>"Chen Kenichi", "gender"=>nil, "email"=>nil}, "checkout"=>{"book"=>{"id"=>1, "code"=>"123", "volume"=>2, "stock"=>1, "title"=>"A Road Ago", "adult"=>true, "notes"=>nil, "checkout_ids"=>[22]}, "patron"=>{"id"=>1, "code"=>"1", "name"=>"Chen Kenichi", "gender"=>nil, "email"=>nil}, "status"=>"out", "closed_at"=>nil, "created_at"=>nil}} |