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": { | |
"name": "test", | |
"students": [{ | |
"id": 13, | |
"name": "John 1" | |
}, { | |
"id": 14, | |
"name": "John 2" | |
}, { |
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
around 85ms in total: | |
Started GET "/portal/students/2/status.json" for 127.0.0.1 at 2016-02-25 18:28:24 -0800 | |
Processing by Portal::StudentsController#status as JSON | |
Parameters: {"id"=>"2"} | |
User Load (1.2ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 10 AND (`users`.`state` NOT IN ('disabled')) LIMIT 1 | |
Portal::Teacher Load (1.1ms) SELECT `portal_teachers`.* FROM `portal_teachers` WHERE `portal_teachers`.`user_id` = 10 LIMIT 1 | |
Portal::Student Load (1.0ms) SELECT `portal_students`.* FROM `portal_students` WHERE `portal_students`.`user_id` = 10 LIMIT 1 | |
Portal::Student Load (1.2ms) SELECT `portal_students`.* FROM `portal_students` WHERE `portal_students`.`id` = 2 LIMIT 1 | |
Portal::Learner Load (1.2ms) SELECT `portal_learners`.* FROM `portal_learners` WHERE `portal_learners`.`student_id` = 2 ORDER BY student_id ASC |
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
around 40ms in total: | |
Started GET "/portal/students/2/status.json" for 127.0.0.1 at 2016-02-25 17:33:34 -0800 | |
Processing by Portal::StudentsController#status as JSON | |
Parameters: {"id"=>"2"} | |
User Load (1.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 10 AND (`users`.`state` NOT IN ('disabled')) LIMIT 1 | |
Portal::Teacher Load (1.2ms) SELECT `portal_teachers`.* FROM `portal_teachers` WHERE `portal_teachers`.`user_id` = 10 LIMIT 1 | |
Portal::Student Load (1.2ms) SELECT `portal_students`.* FROM `portal_students` WHERE `portal_students`.`user_id` = 10 LIMIT 1 | |
Portal::Student Load (1.2ms) SELECT `portal_students`.* FROM `portal_students` WHERE `portal_students`.`id` = 2 LIMIT 1 | |
Report::Learner Load (1.3ms) SELECT `report_learners`.* FROM `report_learners` WHERE `report_learners`.`student_id` = 2 |
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
around 160ms in total: | |
Started GET "/portal/students/2/status.json" for 127.0.0.1 at 2016-02-25 17:30:23 -0800 | |
Processing by Portal::StudentsController#status as JSON | |
Parameters: {"id"=>"2"} | |
User Load (1.2ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 10 AND (`users`.`state` NOT IN ('disabled')) LIMIT 1 | |
Portal::Teacher Load (1.2ms) SELECT `portal_teachers`.* FROM `portal_teachers` WHERE `portal_teachers`.`user_id` = 10 LIMIT 1 | |
Portal::Student Load (1.1ms) SELECT `portal_students`.* FROM `portal_students` WHERE `portal_students`.`user_id` = 10 LIMIT 1 | |
Portal::Student Load (1.1ms) SELECT `portal_students`.* FROM `portal_students` WHERE `portal_students`.`id` = 2 LIMIT 1 | |
Portal::Learner Load (1.0ms) SELECT `portal_learners`.* FROM `portal_learners` WHERE `portal_learners`.`student_id` = 2 ORDER BY student_id ASC |
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
Around 50ms in total: | |
Started GET "/portal/students/5/status.json" for 127.0.0.1 at 2016-02-25 17:27:03 -0800 | |
Processing by Portal::StudentsController#status as JSON | |
Parameters: {"id"=>"5"} | |
User Load (1.3ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 14 AND (`users`.`state` NOT IN ('disabled')) LIMIT 1 | |
Portal::Teacher Load (1.1ms) SELECT `portal_teachers`.* FROM `portal_teachers` WHERE `portal_teachers`.`user_id` = 14 LIMIT 1 | |
Portal::Student Load (1.0ms) SELECT `portal_students`.* FROM `portal_students` WHERE `portal_students`.`user_id` = 14 LIMIT 1 | |
Portal::Student Load (1.0ms) SELECT `portal_students`.* FROM `portal_students` WHERE `portal_students`.`id` = 5 LIMIT 1 | |
Portal::Learner Load (1.1ms) SELECT `portal_learners`.* FROM `portal_learners` WHERE `portal_learners`.`student_id` = 5 ORDER BY student_id ASC |
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
Around 35ms in total: | |
Started GET "/portal/students/5/status.json" for 127.0.0.1 at 2016-02-25 17:22:59 -0800 | |
Processing by Portal::StudentsController#status as JSON | |
Parameters: {"id"=>"5"} | |
User Load (1.2ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 14 AND (`users`.`state` NOT IN ('disabled')) LIMIT 1 | |
Portal::Teacher Load (1.0ms) SELECT `portal_teachers`.* FROM `portal_teachers` WHERE `portal_teachers`.`user_id` = 14 LIMIT 1 | |
Portal::Student Load (1.0ms) SELECT `portal_students`.* FROM `portal_students` WHERE `portal_students`.`user_id` = 14 LIMIT 1 | |
Portal::Student Load (1.0ms) SELECT `portal_students`.* FROM `portal_students` WHERE `portal_students`.`id` = 5 LIMIT 1 | |
Report::Learner Load (1.1ms) SELECT `report_learners`.* FROM `report_learners` WHERE `report_learners`.`student_id` = 5 |
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
// Load font file to string. | |
import fontDef from 'raw!three/examples/fonts/helvetiker_regular.typeface.js'; | |
// Load font in a sync way, using webpack raw-loader. Based on async THREE JS loader: | |
// https://github.com/mrdoob/three.js/blob/ddab1fda4fd1e21babf65aa454fc0fe15bfabc33/src/loaders/FontLoader.js#L20 | |
let font = new THREE.Font(JSON.parse(fontDef.substring(65, fontDef.length - 2))); | |
let geometry = new THREE.TextGeometry(txt, { | |
size: 50000000 * c.SF, | |
height: 1000000 * c.SF, | |
font: font |
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
main = do | |
print $ (rpn "1 2 + 10 * 13 52 - 12 /") | |
rpn :: (Read a, Fractional a) => String -> a | |
rpn input = rpnProcess (words input) [] | |
rpnProcess :: (Read a, Fractional a) => [String] -> [a] -> a | |
rpnProcess [] stack = head stack | |
rpnProcess (x:inputTail) stack = if x `elem` ["+", "-", "*", "/"] then | |
rpnProcess inputTail (action x stack) |
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
export default class PressureInteractive extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
properties: { | |
temperature: 200 | |
} | |
outputs: { | |
pressure: 0 | |
} |
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
eploy@ip-10-187-42-151:/web/portal/current$ bundle exec rails console | |
create | |
create app/controllers | |
create app/helpers | |
create app/models | |
create app/views/layouts | |
create config/environments | |
create config/initializers | |
create config/locales | |
create db |