text
stringlengths
7
3.69M
import USER from '../data/user.json'; import AppShell from '../components/templates/AppShell'; import AppSection from '../components/molecules/AppSection'; import AppHeader from '../components/organisms/AppHeader'; const Contact = () => ( <AppShell title={`X MIPA 5 | ${USER.contact.title}`} description={USER.contact.description} keyword="contact me, contact, social media" cta={false} > <AppHeader title={USER.contact.title} description={USER.contact.description} /> <AppSection title="Connect With Us"> <div className="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4"> {USER.contact.contents.map((item) => ( <a key={item.id} href={item.url} target="_blank" rel="noopener noreferrer" className="flex flex-col items-center border border-light-gray rounded-lg py-6 px-4 transition duration-300 hover:shadow-lg" > <div className="w-12 h-12 rounded-full border border-orange grid place-items-center"> <i className={`${item.icon} text-xl`} /> </div> <h3 className="text-black font-semibold mt-3">{item.name}</h3> <p className="text-gray text-xs md:text-sm">{item.username}</p> </a> ))} </div> </AppSection> </AppShell> ); export default Contact;
import { rules } from './rule.js' import { readFileSync, writeFileSync } from 'fs' const gcodeFile = process.argv[2] console.log('processing', gcodeFile) const gcode = readFileSync(gcodeFile, { encoding: 'utf-8' }) || '' let currentCode = gcode for (const rule of rules) { currentCode = currentCode.replace(rule.find, rule.replace || '') } console.log(currentCode) writeFileSync(gcodeFile + '.gcode', currentCode)
import Background from "../../PixiUtility/Background"; import { Sprite } from "pixi.js"; export default class MenuBackground extends Background { constructor() { super(); this.background = this.createBackgroundSprite("menu_background"); } createBackgroundSprite(url) { const backgroundSprite = Sprite.fromImage(url); return this.addChild(backgroundSprite); } }
"use strict"; var Layout = function () { var a = localStorage.getItem("sidenav-state") ? localStorage.getItem("sidenav-state") : "pinned"; if ($(window).on({ "load resize": function () { $(window).width() < 1200 ? t($(".sidenav-toggler")) : "pinned" == a ? e($(".sidenav-toggler")) : "unpinned" == a && t($(".sidenav-toggler")) } }), $("body").on("click", "[data-action]", function (a) { a.preventDefault(); var n = $(this), i = n.data("action"), s = n.data("target"); switch (i) { case "offcanvas-open": s = n.data("target"), $(s).addClass("open"), $("body").append('<div class="body-backdrop" data-action="offcanvas-close" data-target=' + s + " />"); break; case "offcanvas-close": s = n.data("target"), $(s).removeClass("open"), $("body").find(".body-backdrop").remove(); break; case "aside-open": s = n.data("target"), n.addClass("active"), $(s).addClass("show"), $("body").append('<div class="mask-body mask-body-light" data-action="aside-close" data-target=' + s + " />"); break; case "aside-close": s = n.data("target"), n.removeClass("active"), $(s).removeClass("show"), $("body").find(".body-backdrop").remove(); break; case "omnisearch-open": s = n.data("target"), n.addClass("active"), $(s).addClass("show"), $(s).find(".form-control").focus(), $("body").addClass("omnisearch-open").append('<div class="mask-body mask-body-dark" data-action="omnisearch-close" data-target="' + s + '" />'); break; case "omnisearch-close": s = n.data("target"), $('[data-action="search-open"]').removeClass("active"), $(s).removeClass("show"), $("body").removeClass("omnisearch-open").find(".mask-body").remove(); break; case "search-open": s = n.data("target"), n.addClass("active"), $(s).addClass("show"), $(s).find(".form-control").focus(); break; case "search-close": s = n.data("target"), $('[data-action="search-open"]').removeClass("active"), $(s).removeClass("show"); break; case "sidenav-pin": e(n); break; case "sidenav-unpin": t(n) } }), $("[data-offset-top]").length) { var n = $("[data-offset-top]"), i = $(n.data("offset-top")).height(); n.css({ "padding-top": i + "px" }) } }(), TextareaAutosize = function () { var e = $('[data-toggle="autosize"]'); e.length && autosize(e) }(); if ($('[data-toggle="widget-calendar"]')[0]) { $('[data-toggle="widget-calendar"]').fullCalendar({ contentHeight: "auto", theme: !1, buttonIcons: { prev: " fas fa-angle-left", next: " fas fa-angle-right" }, header: { right: "next", center: "title, ", left: "prev" }, defaultDate: "2018-12-01", editable: !0, events: [{ title: "Call with Dave", start: "2018-11-30", end: "2018-11-30", className: "bg-danger" }, { title: "Lunch meeting", start: "2018-11-21", end: "2018-11-22", className: "bg-warning" }, { title: "All day conference", start: "2018-11-29", end: "2018-11-29", className: "bg-success" }, { title: "Meeting with Mary", start: "2018-12-01", end: "2018-12-01", className: "bg-info" }, { title: "Winter Hackaton", start: "2018-12-03", end: "2018-12-03", className: "bg-danger" }, { title: "Digital event", start: "2018-12-07", end: "2018-12-09", className: "bg-warning" }, { title: "Marketing event", start: "2018-12-10", end: "2018-12-10", className: "bg-primary" }, { title: "Dinner with Family", start: "2018-12-19", end: "2018-12-19", className: "bg-danger" }, { title: "Black Friday", start: "2018-12-23", end: "2018-12-23", className: "bg-info" }, { title: "Cyber Week", start: "2018-12-02", end: "2018-12-02", className: "bg-warning" }] }); var mYear = moment().format("YYYY"), mDay = moment().format("dddd, MMM D"); $(".widget-calendar-year").html(mYear), $(".widget-calendar-day").html(mDay) } var Countdown = function () { var e = $(".countdown"); e.length && e.each(function () { var e, t; t = (e = $(this)).data("countdown-date"), e.countdown(t).on("update.countdown", function (e) { $(this).html(e.strftime('<div class="countdown-item"><span class="countdown-digit">%-D</span><span class="countdown-label countdown-days">day%!D</span></div><div class="countdown-item"><span class="countdown-digit">%H</span><span class="countdown-separator">:</span><span class="countdown-label">hours</span></div><div class="countdown-item"><span class="countdown-digit">%M</span><span class="countdown-separator">:</span><span class="countdown-label">minutes</span></div><div class="countdown-item"><span class="countdown-digit">%S</span><span class="countdown-label">seconds</span></div>')) }) }) }(); ! function (e) { e.fn.countTo = function (t) { return t = t || {}, e(this).each(function () { var a = e.extend({}, e.fn.countTo.defaults, { from: e(this).data("from"), to: e(this).data("to"), speed: e(this).data("speed"), refreshInterval: e(this).data("refresh-interval"), decimals: e(this).data("decimals") }, t), n = Math.ceil(a.speed / a.refreshInterval), i = (a.to - a.from) / n, s = this, l = e(this), o = 0, d = a.from, r = l.data("countTo") || {}; function c(e) { var t = a.formatter.call(s, e, a); l.text(t) } l.data("countTo", r), r.interval && clearInterval(r.interval), r.interval = setInterval(function () { o++, c(d += i), "function" == typeof a.onUpdate && a.onUpdate.call(s, d), o >= n && (l.removeData("countTo"), clearInterval(r.interval), d = a.to, "function" == typeof a.onComplete && a.onComplete.call(s, d)) }, a.refreshInterval), c(d) }) }, e.fn.countTo.defaults = { from: 0, to: 0, speed: 1e3, refreshInterval: 100, decimals: 0, formatter: function (e, t) { return e.toFixed(t.decimals) }, onUpdate: null, onComplete: null } }(jQuery); var Counter = function () { var e, t = ".counter", a = $(t); a.length && (e = a, inView(t).on("enter", function () { e.hasClass("counting-finished") || e.countTo({ formatter: function (e, t) { return e.toFixed(t.decimals) }, onUpdate: function (e) {}, onComplete: function (e) { $(this).addClass("counting-finished") } }) })) }(), Datepicker = function () { var e = $('[data-toggle="date"]'), t = $('[data-toggle="datetime"]'), a = $('[data-toggle="time"]'); e.length && e.each(function () { $(this).flatpickr({ enableTime: !1, allowInput: !0 }) }), t.length && t.each(function () { $(this).flatpickr({ enableTime: !0, allowInput: !0 }) }), a.length && a.each(function () { $(this).flatpickr({ noCalendar: !0, enableTime: !0, allowInput: !0 }) }) }(); ! function (e) { var t = function () { this.$body = e("body") }; t.prototype.init = function () { e('[data-toggle="dragula"]').each(function () { var t = e(this).data("containers"), a = []; if (t) for (var n = 0; n < t.length; n++) a.push(e("#" + t[n])[0]); else a = [e(this)[0]]; var i = e(this).data("handle-class"); i ? dragula(a, { moves: function (e, t, a) { return a.classList.contains(i) } }) : dragula(a) }) }, e.Dragula = new t, e.Dragula.Constructor = t }(window.jQuery), window.jQuery.Dragula.init(); var Dropzones = function () { var e = $('[data-toggle="dropzone"]'), t = $(".dz-preview"); e.length && (Dropzone.autoDiscover = !1, e.each(function () { var e, a, n, i, s; e = $(this), a = void 0 !== e.data("dropzone-multiple"), n = e.find(t), i = void 0, s = { url: e.data("dropzone-url"), thumbnailWidth: null, thumbnailHeight: null, previewsContainer: n.get(0), previewTemplate: n.html(), maxFiles: a ? null : 1, acceptedFiles: a ? null : "image/*", init: function () { this.on("addedfile", function (e) { !a && i && this.removeFile(i), i = e }) } }, n.html(""), e.dropzone(s) })) }(), Fullcalendar = function () { var e, t, a = $('[data-toggle="calendar"]'); a.length && (t = { header: { right: "", center: "", left: "" }, buttonIcons: { prev: "calendar--prev", next: "calendar--next" }, theme: !1, selectable: !0, selectHelper: !0, editable: !0, events: [{ id: 1, title: "Call with Dave", start: "2019-04-18", allDay: !0, className: "bg-danger", description: "Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus." }, { id: 2, title: "Lunch meeting", start: "2019-04-21", allDay: !0, className: "bg-warning", description: "Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus." }, { id: 3, title: "All day conference", start: "2019-04-29", allDay: !0, className: "bg-success", description: "Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus." }, { id: 4, title: "Meeting with Mary", start: "2019-05-01", allDay: !0, className: "bg-info", description: "Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus." }, { id: 5, title: "Winter Hackaton", start: "2019-05-03", allDay: !0, className: "bg-danger", description: "Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus." }, { id: 6, title: "Digital event", start: "2019-05-07", allDay: !0, className: "bg-warning", description: "Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus." }, { id: 7, title: "Marketing event", start: "2019-05-10", allDay: !0, className: "bg-primary", description: "Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus." }, { id: 8, title: "Dinner with Family", start: "2019-05-19", allDay: !0, className: "bg-danger", description: "Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus." }, { id: 9, title: "Black Friday", start: "2019-05-23", allDay: !0, className: "bg-info", description: "Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus." }, { id: 10, title: "Cyber Week", start: "2019-05-02", allDay: !0, className: "bg-yellow", description: "Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus." }], dayClick: function (e) { var t = moment(e).toISOString(); $("#new-event").modal("show"), $(".new-event--title").val(""), $(".new-event--start").val(t), $(".new-event--end").val(t) }, viewRender: function (t) { e.fullCalendar("getDate").month(), $(".fullcalendar-title").html(t.title) }, eventClick: function (e, t) { $("#edit-event input[value=" + e.className + "]").prop("checked", !0), $("#edit-event").modal("show"), $(".edit-event--id").val(e.id), $(".edit-event--title").val(e.title), $(".edit-event--description").val(e.description) } }, (e = a).fullCalendar(t), $("body").on("click", ".new-event--add", function () { var t = $(".new-event--title").val(), a = { Stored: [], Job: function () { var e = Date.now().toString().substr(6); return this.Check(e) ? this.Job() : (this.Stored.push(e), e) }, Check: function (e) { for (var t = 0; t < this.Stored.length; t++) if (this.Stored[t] == e) return !0; return !1 } }; "" != t ? (e.fullCalendar("renderEvent", { id: a.Job(), title: t, start: $(".new-event--start").val(), end: $(".new-event--end").val(), allDay: !0, className: $(".event-tag input:checked").val() }, !0), $(".new-event--form")[0].reset(), $(".new-event--title").closest(".form-group").removeClass("has-danger"), $("#new-event").modal("hide")) : ($(".new-event--title").closest(".form-group").addClass("has-danger"), $(".new-event--title").focus()) }), $("body").on("click", "[data-calendar]", function () { var t = $(this).data("calendar"), a = $(".edit-event--id").val(), n = $(".edit-event--title").val(), i = $(".edit-event--description").val(), s = $("#edit-event .event-tag input:checked").val(), l = e.fullCalendar("clientEvents", a); "update" === t && ("" != n ? (l[0].title = n, l[0].description = i, l[0].className = [s], console.log(s), e.fullCalendar("updateEvent", l[0]), $("#edit-event").modal("hide")) : ($(".edit-event--title").closest(".form-group").addClass("has-error"), $(".edit-event--title").focus())), "delete" === t && ($("#edit-event").modal("hide"), setTimeout(function () { swal({ title: "آیا مطمئن هستید؟", text: "بعد از حذف نمی توانید آنرا بازگردانید!", type: "warning", showCancelButton: !0, buttonsStyling: !1, confirmButtonClass: "btn btn-danger", confirmButtonText: "Yes, delete it!", cancelButtonClass: "btn btn-secondary" }).then(function (t) { t.value && (e.fullCalendar("removeEvents", a), swal({ title: "Deleted!", text: "The event has been deleted.", type: "success", buttonsStyling: !1, confirmButtonClass: "btn btn-primary" })) }) }, 200)) }), $("body").on("click", "[data-calendar-view]", function (t) { t.preventDefault(), $("[data-calendar-view]").removeClass("active"), $(this).addClass("active"); var a = $(this).attr("data-calendar-view"); e.fullCalendar("changeView", a) }), $("body").on("click", ".fullcalendar-btn-next", function (t) { t.preventDefault(), e.fullCalendar("next") }), $("body").on("click", ".fullcalendar-btn-prev", function (t) { t.preventDefault(), e.fullCalendar("prev") })) }();
/** * @file demos/xui-checkbox.js * @author leeight */ import {defineComponent} from 'san'; import {Row, CheckBox, RadioBox, Switch} from 'san-xui'; /* eslint-disable */ const template = `<template> <x-row label="checked=true"> <xui-checkbox checked="{=checkbox.checked=}" title="the label" /> <xui-switch checked="{=checkbox.checked=}" /> <xui-radiobox checked="{=checkbox.checked=}" title="the radiobox label" /> </x-row> <x-row label="[default]checked=false"> <xui-checkbox /> <xui-checkbox disabled /> <xui-radiobox disabled /> </x-row> </template>`; /* eslint-enable */ export default defineComponent({ template, components: { 'x-row': Row, 'xui-switch': Switch, 'xui-radiobox': RadioBox, 'xui-checkbox': CheckBox }, initData() { return { checkbox: { checked: true } }; } });
//start ./js/index.js Ext.regApplication('App', { defaultTarget: 'viewport', defaultUrl : 'Viewport/index', name : 'App', useHistory : false, useLoadMask : true, launch: function() { Ext.Viewport.init(); Ext.Viewport.onOrientationChange(); var token_el = document.getElementById('CHANNEL_TOKEN'); var token = token_el.value; var post_url_el = document.getElementById('POST_URL'); var post_url = post_url_el.value; var words_el = document.getElementById('GAME_WORDS'); var words = words_el.value.split(','); // words = ['AB','CD']; // words = ['AB','CAPRAZZI', 'ROX', 'MARTELLA', 'SUX']; var client = new App.util.GameClient({channel_token:token, post_url:post_url }); var game = new App.util.Game({ words: words, client:client }); this.viewport = new App.View.Viewport({ application: this }); console.log('[App.launch] invoking Viewport.index'); Ext.dispatch({ controller: 'Viewport', action : 'index', game: game }); } }); //end ./js/index.js //start ./js/lib/App.util.Game.js Ext.ns('App.util'); App.util.Game = Ext.extend(Ext.util.Observable, { constructor: function(options) { console.log('[util.Game] constructor', options); App.util.GameClient.superclass.constructor.call( this ); this.initWords(options.words); this.initClient(options.client); this.player = { progress: 0, connected: false, completed: false, win: false, request_replay: false, accept_replay: false }; this.opponent = { progress: 0, connected: false, completed: false, win: false, request_replay: false, accept_replay: false }; }, initWords: function(words) { console.log('[util.Game] initWords', words); this.words = words; this.current_word = -1; this.letter_count = this.words.join('').length; this.letters_picked = 0; function case_insensitive_comp(strA, strB) { return strA.toLowerCase().localeCompare(strB.toLowerCase()); } function sortWord(word) { word = word.split(''); word = word.sort(); word = word.sort(case_insensitive_comp); return word.join(''); } this.words_sorted = []; for(var i=0; i < words.length;i++) { this.words_sorted.push(sortWord(words[i])); } console.log('[util.Game] sorted words', this.words_sorted); console.log('[util.Game] words initialized', this); this.words_picked = []; }, initClient: function(client) { console.log('[util.Game] initClient', client); this.client = client; // attach handlers to client events this.client.on( 'player-connected', function() { console.log('[util.Game] client.on.player-connected'); this.player.connected = true; this.fireEvent('player-connected'); }, this ); this.client.on( 'player-started', function() { console.log('[util.Game] client.on.player-started'); this.player.started = true; this.fireEvent('player-started'); if (this.opponent.started) { this.fireEvent('game-on'); } }, this ); this.client.on( 'player-request-replay', function() { console.log('[util.Game] client.on.player-request-replay'); this.player.request_replay = true; this.fireEvent('player-request-replay'); }, this ); this.client.on( 'player-accept-replay', function() { console.log('[util.Game] client.on.player-accept-replay'); this.player.accept_replay = true; this.fireEvent('player-accept-replay'); }, this ) this.client.on( 'opponent-request-replay', function() { console.log('[util.Game] client.on.opponent-request-replay'); this.opponent.request_replay = true; if (this.player.request_replay) { this.client.playerAcceptReplay(); return; } this.fireEvent('opponent-request-replay'); }, this ); this.client.on( 'opponent-connected', function(opponent) { console.log('[util.Game] client.on.opponent-connected') this.opponent.connected = true; this.opponent.name = opponent.name; this.fireEvent('opponent-connected'); }, this ); this.client.on( 'opponent-started', function() { console.log('[util.Game] client.on.opponent-started'); this.opponent.started = true; this.fireEvent('opponent-started'); if (this.player.started) { this.fireEvent('game-on'); } }, this ); this.client.on( 'opponent-win', function() { console.log('[util.Game] client.on.opponent-win'); this.opponent.completed = true; this.opponent.win = true; this.fireEvent('opponent-win'); }, this ); this.client.on( 'player-win', function() { console.log('[util.Game] client.on.player-win'); this.player.win = true; this.fireEvent('player-win'); }, this ); this.client.on( 'opponent-update-progress', function(pct) { console.log('[util.Game] client.on.opponent-update-progress'); this.opponent.progress = pct; this.fireEvent('opponent-update-progress', pct); }, this ); }, /**** methods exposed to application ****/ // connect to server connect: function() { console.log('[util.Game] connect'); this.client.connect(); }, // user pressed button start playerStart: function() { console.log('[util.Game] playerStart'); this.client.playerStart(); }, // start game startGame: function() { console.log('[util.Game] startGame'); this.nextWord(); }, playerRequestReplay: function() { console.log('[util.Game] playerRequestReplay'); this.client.playerRequestReplay(); }, nextWord: function() { console.log('[util.Game] nextWord'); if (this.isGameComplete()) { console.log('[util.Game] no more words: game complete'); return; } this.current_word += 1; this.words_picked.push(0); this.fireEvent('next-word'); }, pickLetter: function(n_letter) { console.log('[util.Game] pickLetter ', n_letter); var word = this.getCurrentWord(); var sorted = this.getCurrentWordSorted(); var picked = this.getCurrentWordPicked(); var letter = word[n_letter]; var correct = (letter == sorted[picked]); if (!correct) { this.pickedKo(); return; } this.pickedOk(n_letter); if (this.isGameComplete()) { this.gameComplete(); return; } if (this.isCurrentWordComplete()) { this.wordComplete(); return; } }, /**** private methods ****/ getCurrentWord: function() { return this.words[this.current_word]; }, getCurrentWordSorted: function() { return this.words_sorted[this.current_word]; }, getCurrentWordPicked: function() { return this.words_picked[this.current_word]; }, isCurrentWordComplete: function() { return (this.getCurrentWordPicked() == this.getCurrentWord().length); }, isGameComplete: function() { return this.isGameStarted() && (this.isCurrentWordComplete() && this.current_word == this.words.length - 1); }, isGameStarted: function() { return this.current_word >= 0; }, updatePlayerProgress: function() { this.player.progress = (100 / this.letter_count) * this.letters_picked; this.fireEvent('player-update-progress', this.player.progress); this.client.updatePlayerProgress(this.player.progress); }, setPickedCorrect: function() { this.letters_picked += 1; this.words_picked[this.current_word] += 1; }, pickedOk: function(n_letter) { console.log('[util.Game] picked ok', n_letter); this.setPickedCorrect(); this.fireEvent('player-picked-ok', n_letter); this.updatePlayerProgress(); }, pickedKo: function(n_letter) { console.log('[util.Game] picked ko', n_letter); this.fireEvent('player-picked-ko', n_letter); }, gameComplete: function() { console.log('[util.Game] player game complete'); this.player.completed = true; this.fireEvent('player-game-completed'); this.client.playerGameCompleted(); }, wordComplete: function() { console.log('[util.Game] word completed', this.getCurrentWord(), this.current_word); this.fireEvent('player-word-completed', this.current_word); } }); Ext.reg('App.util.Game', App.util.Game); //end ./js/lib/App.util.Game.js //start ./js/lib/App.util.GameClient.js Ext.ns('App.util'); /** * Socket.io wrapper class * @class App.util.ChatClient * @extends Ext.util.Observable * * Events: * 'player-connected': when this client is connected to the server */ App.util.GameClient = Ext.extend(Ext.util.Observable, { constructor: function(options){ console.log('[util.GameClient] constructor ', options) options = options || {}; this.throttle_ms = options.throttle_ms || 5000; App.util.GameClient.superclass.constructor.call( this ); this.channel_token = options.channel_token; this.post_url = options.post_url; this.socket = null; this.update_timer = 0; }, /** * connect */ connect: function() { console.log('[util.GameClient] connect'); var channel = new goog.appengine.Channel(this.channel_token); var that = this; this.socket = channel.open({ onopen: function() { console.log('[util.GameClient] socket.onopen'); that.fireEvent('player-connected'); }, onmessage: function(msg) { console.log('[util.GameClient] socket.onmessage', msg); that.processServerMessage(Ext.util.JSON.decode(msg.data)); }, onerror: function(err) { console.log(err); }, onclose: function() { console.log('channel closed'); that.onDisconnect(); } }); console.log('[util.GameClient] channel opened'); }, send: function(data, callback) { console.log(data + ' [send-begin]'); Ext.Ajax.request({ method: 'POST', url: this.post_url, success: function() { console.log(data + ' [send-success]'); if (callback) callback(); }, failure: function() { console.log(data + ' [send-failure]'); }, params: data }); console.log(data + ' [send-invoked]'); }, processServerMessage: function(message) { console.log('[util.GameClient] rcv message', message); // other player joined if (message.cmd == 'opponent-connected') { this.fireEvent('opponent-connected', { name: message.name }); return; } // other player pressed start button if (message.cmd == 'opponent-started') { this.fireEvent('opponent-started'); return; } if (message.cmd == 'player-win') { this.fireEvent('player-win'); return; } if (message.cmd == 'opponent-win') { this.fireEvent('opponent-win'); return; } if (message.cmd == 'opponent-update-progress') { this.fireEvent('opponent-update-progress', message.progress); return; } if (message.cmd == 'opponent-request-replay') { this.fireEvent('opponent-request-replay'); return; } if (message.cmd == 'redirect') { window.location = message.location; return; } if (message.cmd == 'leave') { this.onOpponentLeave(); return; } }, playerStart: function() { console.log('[util.GameClient] playerStart'); this.update_timer = new Date().getTime(); var that = this; this.send({cmd:'start'}, function() { console.log('[util.GameClient] playerStart.success'); that.fireEvent('player-started'); }); }, playerRequestReplay: function() { console.log('[util.GameClient] playerRequestReplay'); var that = this; this.send({cmd: 'player-request-replay'}, function() { console.log('[util.GameClient] playerRequestReplay.success'); that.fireEvent('player-request-replay'); }); }, playerAcceptReplay: function() { console.log('[util.GameClient] playerAcceptReplay'); var that = this; this.send({cmd: 'player-accept-replay'}, function() { console.log('[util.GameClient] playerAcceptReplay.success'); that.fireEvent('player-accept-replay'); }); }, playerGameCompleted: function() { console.log('[util.GameClient] playerGameCompleted sending'); var that = this; this.send({cmd: 'player-completed'}, function() { console.log('[util.GameClient] playerGameCompleted.success'); }); }, updatePlayerProgress: function(pct) { var update_elapsed = ((new Date().getTime()) - this.update_timer); if (update_elapsed < this.throttle_ms) { console.log('[util.GameClient] updatePlayerProgress skipping', update_elapsed); return; } this.update_timer = new Date().getTime(); console.log('[util.GameClient] updatePlayerProgress'); var that = this; this.send({cmd: 'player-update-progress', progress: pct}, function() { console.log('[util.GameClient] updatePlayerProgress.success'); }); }, disconnect: function(){ if (this.socket != null) this.socket.close(); } }); Ext.reg('App.util.GameClient', App.util.GameClient); //end ./js/lib/App.util.GameClient.js //start ./js/controllers/Controller.Game.js Ext.regController('Game', { index: function(options) { console.log('[Controller.Game] index', options); if (options.game) this.initGame(options.game); this.initView(); }, initGame: function(game) { this.game = game; this.game.on( 'next-word', function() { this.viewGame.setWord(this.game.getCurrentWord()); }, this ); this.game.on( 'player-picked-ko', function(n_letter) { console.log('[Controller.Game] game.on.picked-ko', n_letter); this.viewGame.showPickedKo(n_letter); }, this ); this.game.on( 'player-picked-ok', function(n_letter) { console.log('[Controller.Game] game.on.picked-ok', n_letter); this.viewGame.showPickedOk(n_letter); }, this ); this.game.on( 'player-word-completed', function(n_word) { console.log('[Controller.Game] game.on.word-completed', n_word); this.game.nextWord(); }, this ); this.game.on( 'player-update-progress', function(pct) { console.log('[Controller.Game] game.on.player-update-progress', pct); this.viewGame.updatePlayerProgress(pct); }, this ); this.game.on( 'opponent-update-progress', function(pct) { console.log('[Controller.Game] game.on.opponent-update-progress', pct); this.viewGame.updateOpponentProgress(pct); }, this ); }, initView: function() { console.log('[Controller.Game] initView'); if (!this.viewGame) { this.viewGame = this.render({ xtype: 'App.View.Game' }); this.viewGame.on( 'ready', function() { console.log('[Controller.Game] ViewGame.on.ready'); this.game.startGame(); this.update_timer = new Date().getTime(); }, this ); this.viewGame.on( 'pick-letter', function(n_letter) { console.log('[Controller.Game] wordView.on.pick-letter', n_letter); this.game.pickLetter(n_letter); }, this ); } }, showGame: function() { console.log('[Controller.Game] showGame'); } }); //end ./js/controllers/Controller.Game.js //start ./js/controllers/Controller.GameOver.js Ext.regController('GameOver', { index: function(options) { console.log('[Controller.GameOver] index', options); if (options.game) this.initGame(options.game); this.initView(); App.on( 'player-replay-button', function() { console.log('[Controller.GameOver] pressed replay button'); this.game.playerRequestReplay(); }, this ); }, initGame: function(game) { this.game = game; this.game.on( 'player-win', function() { this.viewGameOver.showPlayerWin(); }, this ); this.game.on( 'player-request-replay', function() { this.viewGameOver.showPlayerRequestReplay(); }, this ); this.game.on( 'opponent-request-replay', function() { this.viewGameOver.showOpponentRequestReplay(); }, this ) this.game.on( 'opponent-win', function() { this.viewGameOver.showOpponentWin(); }, this ); }, initView: function() { console.log('[Controller.GameOver] initView'); if (!this.viewGameOver) { this.viewGameOver = this.render({ xtype: 'App.View.GameOver' }); if (this.game.player.win) { this.viewGameOver.showPlayerWin(); } else if (this.game.opponent.win) { this.viewGameOver.showOpponentWin(); } } } }); //end ./js/controllers/Controller.GameOver.js //start ./js/controllers/Controller.Start.js // Controller.Start.js Ext.regController('Start', { index: function(options) { console.log('[Controller.Start] index'); if (options.game && !this.game) this.initGame(options.game); // this user ready to play App.on( 'player-button-start', function() { console.log('Controller.Start pressed button start'); this.game.playerStart(); }, this ); this.showStart(); }, initGame: function(game) { console.log('[Controller.Start] initGame'); this.game = game; this.game.on( 'player-connected', function() { console.log('[Controller.Start] game.on.player-connected'); this.viewStart.showPlayerConnected(this.game); }, this ); this.game.on( 'player-started', function() { console.log('[Controller.Start] game.on.player-started'); this.viewStart.showPlayerStarted(); }, this ); this.game.on( 'opponent-connected', function() { console.log('[Controller.Start] game.on.opponent-connected'); this.viewStart.showOpponentConnected(this.game); }, this ); this.game.on( 'opponent-started', function(game) { console.log('[Controller.Start] game.on.opponent-started', game); this.viewStart.showOpponentStarted(); }, this ); this.game.on( 'game-on', function() { console.log('[Controller.Start] game.on.opponent-started', game); this.viewStart.showGameOn(); }, this ); this.game.connect(); }, showStart: function() { console.log('[Controller.Start] showStart'); if (!this.viewStart) { this.viewStart = this.render({ xtype: 'App.View.Start' }); /* example bind tap: this.viewChat.query('#settingsButton')[0].on( 'tap', this.showConfig, this ); */ } /* example set active item: this.application.viewport.setActiveItem( this.viewStart, { type: 'slide', direction: 'left' } ); */ }, showGame: function() { Ext.dispatch({ controller: 'Viewport', action : 'showGame' }); } }); //end ./js/controllers/Controller.Start.js //start ./js/controllers/Controller.Viewport.js Ext.regController('Viewport', { index: function(options) { console.log('[Controller.Viewport] index', options); this.game = options.game; this.game.on( 'game-on', function() { console.log('[Controller.Viewport] game.on.game.on'); this.showGame(); }, this ); this.game.on( 'player-game-completed', function() { console.log('[Controller.Game] game.on.game-completed'); this.showGameOver(); }, this ); this.game.on( 'opponent-win', function() { this.showGameOver(); }, this ); this.showStart(); }, showStart: function() { console.log('[Controller.Viewport] showStart'); Ext.dispatch({ controller: 'Start', action : 'index', game: this.game }); }, showGame: function() { console.log('[Controller.Viewport] showGame'); Ext.dispatch({ controller: 'Game', action: 'index', game: this.game }); }, showGameOver: function() { console.log('[Controller.Viewport] showGameOver'); Ext.dispatch({ controller: 'GameOver', action: 'index', game: this.game }); } }); //end ./js/controllers/Controller.Viewport.js //start ./js/models/Model.Player.js // screen name // score //end ./js/models/Model.Player.js //start ./js/models/Model.Game.js // word list // stats //end ./js/models/Model.Game.js //start ./js/views/View.GameWord.js // deprecated // View.Game.js Ext.ns('App.View'); App.View.GameWord = Ext.extend(Ext.Panel, { initComponent: function(word) { console.log("[View.GameWord] initComponent"); var config = { layout: 'hbox', items: [] } Ext.apply(this, config); App.View.GameWord.superclass.initComponent.call(this); console.log("[View.GameWord] component ready"); }, setWord: function(word) { this.buttons = []; console.log("[View.GameWord] setWord " + word); var that = this; word = word.split(''); for (var i=0; i<word.length; i++) { function handle(el) { var n_letter = el.n_letter; console.log('[View.GameWord] tap letter ' + n_letter + '(' + word[n_letter] + ')') that.fireEvent('pick-letter', n_letter); } var button = { xtype: 'button', text: word[i], itemId: 'letter' + i, handler: handle, n_letter: i }; this.add(button); this.buttons.push(this.query('#letter'+i)[0]); } this.doLayout(); }, showPickedKo: function(n_letter) { console.log("[View.GameWord] showPickedKo", n_letter); for(var i=0; i<this.buttons.length; i++) { var btn = this.buttons[i]; if (btn != null) { btn.disable(); } } var that = this; setTimeout(function() { for(var i=0; i<that.buttons.length; i++) { var btn = that.buttons[i]; if (btn != null) { btn.enable(); } } }, 500); }, showPickedOk: function(n_letter) { console.log("[View.GameWord] showPickedOk", n_letter); this.buttons[n_letter].disable(); this.buttons[n_letter] = null; } }); Ext.reg('App.View.GameWord', App.View.GameWord); //end ./js/views/View.GameWord.js //start ./js/views/View.Game.js // View.Game.js Ext.ns('App.View'); App.View.Game = Ext.extend(Ext.Panel, { initComponent: function() { console.log("[View.Game] initComponent"); var config = { layout: 'vbox', items: [ { html: 'Play Wordgame' }, { html: 'Tap the letters in alphabetical order' }, { xtype: 'spacer' }, { xtype: 'panel', align: 'stretch', itemId: 'current-word', layout: 'hbox', items: [] }, { xtype: 'spacer' }, { xtype: 'panel', layout: 'vbox', width: 250, style: { border: '1px solid black' }, items: [ { xtype: 'panel', layout: 'hbox', width: 250, items: [ { itemId: 'player-progress', html: '&nbsp;', style: { width: '10', backgroundColor: 'green', color: 'black', align: 'left' } }, { html: 'you', backgroundColor: 'green', color: 'white' }, ] }, { xtype: 'panel', layout: 'hbox', width: 250, items: [ { itemId: 'opponent-progress', html: '&nbsp;', style: { width: '10', backgroundColor: 'red', color: 'black', align: 'left' } }, { html: 'opponent', backgroundColor: 'red', color: 'white' }, ] }]}, { xtype: 'spacer' } ] }; Ext.apply(this, config); App.View.Game.superclass.initComponent.call(this); this.wordPanel = this.query('#current-word')[0]; // notify to client that ui is ready console.log("[View.Game] component ready"); var that = this; setTimeout(function() { //this.on('ready', function() { // console.log('[View.Game] trigger-read'); //}, this); that.fireEvent('ready'); }, 1000); }, setWord: function(word) { while(f = this.wordPanel.items.first()) { this.wordPanel.remove(f, true); } this.buttons = []; console.log("[View.Game] setWord " + word); var that = this; word = word.split(''); for (var i=0; i<word.length; i++) { function handle(el) { var n_letter = el.n_letter; console.log('[View.Game] tap letter ' + n_letter + '(' + word[n_letter] + ')') that.fireEvent('pick-letter', n_letter); } var button = { xtype: 'button', text: word[i], itemId: 'letter' + i, handler: handle, n_letter: i, margin: 5 }; this.wordPanel.add(button); this.buttons.push(this.query('#letter'+i)[0]); } this.doLayout(); }, showPickedKo: function(n_letter) { console.log("[View.Game] showPickedKo", n_letter); for(var i=0; i<this.buttons.length; i++) { var btn = this.buttons[i]; if (btn != null) { btn.disable(); } } var that = this; setTimeout(function() { for(var i=0; i<that.buttons.length; i++) { var btn = that.buttons[i]; if (btn != null) { btn.enable(); } } }, 500); }, showPickedOk: function(n_letter) { console.log("[View.Game] showPickedOk", n_letter); this.buttons[n_letter].disable(); this.buttons[n_letter] = null; }, updatePlayerProgress: function(pct) { console.log("[View.Game] updatePlayerProgress", pct); this.query('#player-progress')[0].setWidth(pct * 2.5); }, updateOpponentProgress: function(pct) { console.log("[View.Game] updateOpponentProgress", pct); this.query('#opponent-progress')[0].setWidth(pct * 2.5); } }); Ext.reg('App.View.Game', App.View.Game); //end ./js/views/View.Game.js //start ./js/views/View.GameOver.js // View.Game.js Ext.ns('App.View'); App.View.GameOver = Ext.extend(Ext.Panel, { initComponent: function() { console.log("[View.GameOver] initComponent"); var config = { layout: 'vbox', items: [ {xtype: 'spacer'}, { html: 'Game Over' }, { itemId: 'playerWin', html: 'You WIN!', hidden: true }, { itemId: 'opponentWin', html: 'You LOSE!', hidden: true }, { xtype: 'spacer' }, { itemId: 'player-confirm-replay-request', xtype: 'button', html: 'Opponent wants to replay. Tap to replay.', hidden: true, handler: function() { console.log('[View.GameOver] #player-confirm-replay-request.handler'); App.fireEvent('player-replay-button'); } }, { itemId: 'player-replay-button', xtype: 'button', html: 'Play again', hidden: true, handler: function() { console.log('[View.GameOver] #player-replay-button.handler'); App.fireEvent('player-replay-button'); } }, { itemId: 'replay-spinner', html: 'Wait for opponent to accept...', hidden: true }, { xtype: 'spacer' } ] } Ext.apply(this, config); App.View.GameOver.superclass.initComponent.call(this); console.log("[View.GameOver] component ready"); }, showPlayerWin: function() { this.query('#playerWin')[0].show(); this.query('#player-replay-button')[0].show(); }, showOpponentWin: function() { this.query('#opponentWin')[0].show(); this.query('#player-replay-button')[0].show(); }, showPlayerRequestReplay: function() { this.query('#player-replay-button')[0].disable(); this.query('#replay-spinner')[0].show(); }, showOpponentRequestReplay: function() { this.query('#player-replay-button')[0].hide(); this.query('#replay-spinner')[0].hide(); this.query('#player-confirm-replay-request')[0].show(); } }); Ext.reg('App.View.GameOver', App.View.GameOver); //end ./js/views/View.GameOver.js //start ./js/views/View.Start.js Ext.ns('App.View'); App.View.Start = Ext.extend(Ext.Panel, { initComponent: function() { var config = { layout: 'vbox', items: [ { xtype: 'spacer' }, { html: 'Wordgame' }, { xtype: 'spacer' }, { itemId: 'showConnecting', html: 'connecting...' }, { itemId: 'showConnected', hidden: true, html: '' }, { itemId: 'showWaitOpponent', hidden: true, html: 'Hold on while you opponent joins...' }, { itemId: 'showOpponent', hidden: true, html: 'Your opponent joined.' }, { html: 'Yout opponent is ready to start', itemId: 'opponent-started', hidden: true }, { xtype: 'spacer' }, { itemId: 'pressStart', hidden: true, html: 'Press PLAY when you are ready' }, { xtype: 'spacer' }, { xtype: 'button', itemId: 'start-button', disabled: true, text: "PLAY", handler: function() { console.log('[View.Start] #start-button.handler'); App.fireEvent('player-button-start'); } }, { html: 'Waiting for opponent...', itemId: 'startSpinner', hidden: true }, { html: 'Game On!', itemId: 'game-on', hidden: true }, { xtype: 'spacer'} ] } Ext.apply(this, config); App.View.Start.superclass.initComponent.call(this); }, showPlayerConnected: function(game) { console.log("[View.Start] player connected"); this.query('#showConnecting')[0].hide(); this.query('#showConnected')[0].show(); this.query('#showWaitOpponent')[0].show(); }, showPlayerStarted: function(game) { console.log('[View.Start] show player started'); this.query('#startSpinner')[0].show(); this.query('#start-button')[0].disable(); this.query('#start-button')[0].setText('Starting...'); }, showOpponentConnected: function(game) { console.log('[View.Start] opponent connected'); this.query('#pressStart')[0].show(); this.query('#showWaitOpponent')[0].hide(); this.query('#showOpponent')[0].show(); this.query('#start-button')[0].enable(); }, showOpponentStarted: function(game) { console.log('[View.Start] opponent started'); this.query('#startSpinner')[0].hide(); this.query('#opponent-started')[0].show(); }, showGameOn: function() { console.log('[View.Start] game on'); this.query('#game-on')[0].show(); } }); Ext.reg('App.View.Start', App.View.Start); // //end ./js/views/View.Start.js //start ./js/views/View.Viewport.js Ext.ns('App.View'); App.View.Viewport = Ext.extend(Ext.Panel, { id : 'viewport', layout : 'card', fullscreen: true, initComponent: function() { var config = {}; Ext.apply(this, config); App.View.Viewport.superclass.initComponent.call(this); } }); Ext.reg('App.View.Viewport', App.View.Viewport); //end ./js/views/View.Viewport.js
'use strict'; var _ = require('lodash'); var Shoppinglist = require('./shoppinglist.model'); // Get list of shoppinglists exports.index = function(req, res) { Shoppinglist.find(function (err, shoppinglists) { if(err) { return handleError(res, err); } return res.status(200).json(shoppinglists); }); }; // Get a single shoppinglist exports.show = function(req, res) { Shoppinglist.findById(req.params.id, function (err, shoppinglist) { if(err) { return handleError(res, err); } if(!shoppinglist) { return res.status(404).send('Not Found'); } return res.json(shoppinglist); }); }; // Creates a new shoppinglist in the DB. exports.create = function(req, res) { console.log(req); Shoppinglist.create(req.body, function(err, shoppinglist) { if(err) { return handleError(res, err); } return res.status(201).json(shoppinglist); }); }; // Updates an existing shoppinglist in the DB. exports.update = function(req, res) { Shoppinglist.update({_id:req.body._id}, req.body, {new: true}, function(err, shoppinglist) { if (err) { return handleError(res, err); } return res.status(200).json(shoppinglist); }); /*if(req.body._id) { delete req.body._id; } Shoppinglist.findById(req.params.id, function (err, shoppinglist) { if (err) { return handleError(res, err); } if(!shoppinglist) { return res.status(404).send('Not Found'); } console.log('shoppinglist and req.body: ' + shoppinglist + ' - ' + req.body); var updated = _.merge(shoppinglist, req.body); console.log('updated: ' + updated); updated.save(function (err) { console.log('err is ' + err); if (err) { return handleError(res, err); } console.log('res is ' + shoppinglist); return res.status(200).json(shoppinglist); }); });*/ }; // Deletes a shoppinglist from the DB. exports.destroy = function(req, res) { Shoppinglist.findById(req.params.id, function (err, shoppinglist) { if(err) { return handleError(res, err); } if(!shoppinglist) { return res.status(404).send('Not Found'); } shoppinglist.remove(function(err) { if(err) { return handleError(res, err); } return res.status(204).send('No Content'); }); }); }; function handleError(res, err) { return res.status(500).send(err); }
import React from "react" import { Nav } from "reactstrap" import { StaticQuery, graphql, Link } from "gatsby" import Img from "gatsby-image/withIEPolyfill" import styled from "styled-components" import { logout } from "src/utils/auth.js" import { MdDashboard, MdSchool, MdExitToApp } from "react-icons/md" import { FaSchool, FaHandsHelping, FaArchive, FaWpforms } from "react-icons/fa" import { IconContext } from "react-icons" let StyledImg = styled(props => <Img {...props} />)` width: 50%; display: block; margin-top: 10px; margin-left: auto; margin-right: auto; transition: all 0.2s ease-in-out; &:hover { transform: scale(1.05); } ` let StyledNavBlock = styled(props => <div {...props} />)` width: 100%; color: white; transition: all 0.2s ease-in-out; text-align: center; font-size: 12px; font-weight: bold; display: block; margin-left: auto; margin-right: auto; padding-top: 1vh; padding-bottom: 1vh; width: 100%; &:hover { transform: scale(1.05); background-color: ${props => props.theme.secondaryGreen}; } ` const StyledSidebar = styled.div` box-shadow: 1px 0 0 rgba(0, 0, 0, 0.1); height: 100%; width: 100px; position: fixed; z-index: 1; top: 0; left: 0; background-color: ${props => props.theme.primaryGreen}; overflow-x: hidden; padding-top: 1vh; ` const Line = styled.hr` border: 0; border-top: 2px solid #feb81c; width: 100px; ` const IconStyle = { color: "white", size: "1.5em" } let Sidebar = ({ data }) => ( <StyledSidebar> <Link to="/dashboard/home"> <StyledImg fluid={data.file.childImageSharp.fluid} objectFit="contain" objectPosition="50% 50%" alt="School Logo" /> </Link> <Line /> <Nav vertical> <Link to="/dashboard/home" activeClassName={"activeSidebar"}> <StyledNavBlock> <div style={{ display: "block", marginLeft: "auto", marginRight: "auto", }} > <IconContext.Provider value={IconStyle}> <MdDashboard /> </IconContext.Provider> </div> Home </StyledNavBlock> </Link> <Link to="/dashboard/professors" activeClassName={"activeSidebar"}> <StyledNavBlock> <div style={{ display: "block", marginLeft: "auto", marginRight: "auto", }} > <IconContext.Provider value={IconStyle}> <FaSchool /> </IconContext.Provider> </div> Professors </StyledNavBlock> </Link> <Link to="/dashboard/students" activeClassName={"activeSidebar"}> <StyledNavBlock> <div style={{ display: "block", marginLeft: "auto", marginRight: "auto", }} > <IconContext.Provider value={IconStyle}> <MdSchool /> </IconContext.Provider> </div> Students </StyledNavBlock> </Link> <Link to="/dashboard/sponsors" activeClassName={"activeSidebar"}> <StyledNavBlock> <div style={{ display: "block", marginLeft: "auto", marginRight: "auto", }} > <IconContext.Provider value={IconStyle}> <FaHandsHelping /> </IconContext.Provider> </div> Sponsors </StyledNavBlock> </Link> <Link to="/dashboard/forms" activeClassName={"activeSidebar"}> <StyledNavBlock> <div style={{ display: "block", marginLeft: "auto", marginRight: "auto", }} > <IconContext.Provider value={IconStyle}> <FaWpforms /> </IconContext.Provider> </div> Forms </StyledNavBlock> </Link> <Link to="/dashboard/imageUpload" activeClassName={"activeSidebar"}> <StyledNavBlock> <div style={{ display: "block", marginLeft: "auto", marginRight: "auto", }} > <IconContext.Provider value={IconStyle}> <FaWpforms /> </IconContext.Provider> </div> Image Library </StyledNavBlock> </Link> <Link to="/" onClick={logout} activeClassName={"activeSidebar"}> <StyledNavBlock> <div style={{ display: "block", marginLeft: "auto", marginRight: "auto", }} > <IconContext.Provider value={IconStyle}> <MdExitToApp /> </IconContext.Provider> </div> Log Out </StyledNavBlock> </Link> </Nav> </StyledSidebar> ) export default () => ( <StaticQuery query={graphql` query { file(relativePath: { eq: "Baylor_Logo_Yellow.png" }) { id childImageSharp { fluid(maxWidth: 300, quality: 100) { ...GatsbyImageSharpFluid_withWebp } } } } `} render={data => <Sidebar data={data} />} /> )
Ext.define('AM.view.operation.MaintenanceSchedule', { extend: 'AM.view.Worksheet', alias: 'widget.maintenancescheduleProcess', layout : { type : 'hbox', align : 'stretch' }, items : [ // { // type : 'panel', // html : 'this is the operation order' // } { xtype : 'maintenanceschedulelist' , flex : 1 }, { xtype : 'maintenancescheduleentrylist', flex : 1 } ] });
import Footer from "../Footer/Footer"; import Header from "../Header/Header"; import Container from "../shared/Container"; export default function History() { return ( <> <Header></Header> <Container> <h1>Histórico</h1> <p>Em breve você poderá ver o histórico dos seus hábitos aqui!</p> </Container> <Footer></Footer> </> ); }
'use strict'; // Dependencies var server = require( './../server' ).server; // Router // Index route - usually served as static via express server.get( '/', require( './main' ) ); // Example route server.get( '/route/:route', require( './example' ) ); // Example database route server.get( '/db', require( '../db/example' ) ); // Catch all //server.get( '*', require( './main' ) ); var devices = [ {id:0, name: "iphone", assetTag:"a23456", owner:"dev", desc:"iOS4.2"}, {id:1, name: "loaner-laptop-1", assetTag:"a13936", owner:"dev", desc:""}, {id:2, name: "loaner-laptop-3", assetTag:"a43056", owner:"qa", desc:""}, {id:3, name: "android", assetTag:"a33756", owner:"dev", desc:"android2.4"}, {id:4, name: "galaxy tab", assetTag:"a53356", owner:"dev", desc:"android"}, {id:5, name: "loaner-laptop-2", assetTag:"a63556", owner:"qa", desc:""}, {id:6, name: "iphone", assetTag:"a73856", owner:"dev", desc:"iOS5"} ]; // Read server.get('/devices', function(req, res) { res.send(devices); }); // View one device server.get('/device/:id', function(req, res) { res.send(devices[req.params.id]); });
var menuButton = document.getElementById("menuButton"); function menuShow () { var menuItems = document.getElementsByClassName("mItem"); console.log("menu called"); // go through each element in menuItems and change class to display for (var i = 0; i < menuItems.length; i++) { if (menuItems[i].className === "mItem li-hide"){ // if a hidden list item SHOW menuItems[i].className = "mItem li-show"; console.log(`${i} was shown`); } else { // else hide menuItems[i].className = "mItem li-hide"; } } return menuItems; } menuButton.onclick = function () { menuShow(); }
// import * as React from 'react'; // import { render } from 'react-dom'; // import TypeIt from 'typeit-react'; // import ScrollTrigger from '../../src'; // import { // styled, // AppBar, // Box, // Button, // CssBaseline, // Drawer, // FormControlLabel, // IconButton, // MenuItem, // Select, // Stack, // Switch, // TextField, // Tooltip, // Typography, // Toolbar, // useMediaQuery, // } from '@mui/material'; // import { createTheme, ThemeProvider } from '@mui/material/styles'; // import { createSvgIcon } from '@mui/material/utils'; // import '@fontsource/fira-code'; // const theme = createTheme({ // typography: { // fontFamily: ['Fira Code', 'monospace'].join(','), // }, // palette: { // primary: { main: '#2979ff' }, // }, // }); // const NpmIcon = createSvgIcon( // <path d="M0 7.334v8h6.666v1.332H12v-1.332h12v-8H0zm6.666 6.664H5.334v-4H3.999v4H1.335V8.667h5.331v5.331zm4 0v1.336H8.001V8.667h5.334v5.332h-2.669v-.001zm12.001 0h-1.33v-4h-1.336v4h-1.335v-4h-1.33v4h-2.671V8.667h8.002v5.331zM10.665 10H12v2.667h-1.335V10z" />, // 'NpmIcon' // ); // const GitHubIcon = createSvgIcon( // <path d="M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27" />, // 'GitHubIcon' // ); // const CodeIcon = createSvgIcon( // <path d="M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z" />, // 'CodeIcon' // ); // const CodeOffIcon = createSvgIcon( // <path d="m19.17 12-4.58-4.59L16 6l6 6-3.59 3.59L17 14.17 19.17 12zM1.39 4.22l4.19 4.19L2 12l6 6 1.41-1.41L4.83 12 7 9.83l12.78 12.78 1.41-1.41L2.81 2.81 1.39 4.22z" />, // 'CodeOffIcon' // ); // const Line = styled(Box)({ // display: 'flex', // alignItems: 'center', // '& .MuiTextField-root': { // margin: '0 8px', // }, // }); // const Output = styled('article')({ // display: 'flex', // justifyContent: 'center', // alignItems: 'center', // height: '100%', // overflow: 'hidden', // }); // const DRAWER_WIDTH = 325; // const DEFAULT_IMAGE = 674; // const SHOW_LOADING = false; // const ERROR_ICON = true; // const HEIGHT = '100%'; // const WIDTH = '100%'; // const SHIFT = false; // const DISTANCE = '100px'; // const SHIFT_DURATION = null; // const DURATION = 3000; // const EASING = 'cubic-bezier(0.7, 0, 0.6, 1)'; // const FIT = 'cover'; // const BG_COLOR = 'inherit'; // export default function Demo() { // const [currentPhoto, setCurrentPhoto] = React.useState(DEFAULT_IMAGE); // const [showPhoto, setShowPhoto] = React.useState(true); // const [showLoading, setShowLoading] = React.useState(SHOW_LOADING); // const [errorIcon, setErrorIcon] = React.useState(ERROR_ICON); // const [height, setHeight] = React.useState(HEIGHT); // const [width, setWidth] = React.useState(WIDTH); // const [shift, setShift] = React.useState(SHIFT); // const [distance, setDistance] = React.useState(DISTANCE); // const [shiftDuration, setShiftDuration] = React.useState(SHIFT_DURATION); // const [duration, setDuration] = React.useState(DURATION); // const [easing, setEasing] = React.useState(EASING); // const [fit, setFit] = React.useState(FIT); // const [bgColor, setBgColor] = React.useState(BG_COLOR); // function getNewPhoto() { // if (mobileOpen) setMobileOpen(false); // const newPhoto = Math.floor(Math.random() * 1051); // setShowPhoto(false); // setCurrentPhoto(newPhoto); // setTimeout(() => { // setShowPhoto(true); // }, 100); // } // function refreshPhoto() { // if (mobileOpen) setMobileOpen(false); // setShowPhoto(false); // setTimeout(() => { // setShowPhoto(true); // }, 100); // } // function resetDefaults() { // setShowLoading(SHOW_LOADING); // setErrorIcon(ERROR_ICON); // setHeight(HEIGHT); // setWidth(WIDTH); // setShift(SHIFT); // setDistance(DISTANCE); // setShiftDuration(SHIFT_DURATION); // setDuration(DURATION); // setEasing(EASING); // setFit(FIT); // setBgColor(BG_COLOR); // } // const [mobileOpen, setMobileOpen] = React.useState(false); // const mobile = useMediaQuery('@media (max-width: 900px)'); // function handleDrawerToggle() { // setMobileOpen(!mobileOpen); // } // return ( // <Box sx={{ display: 'flex', height: '100vh' }}> // <CssBaseline /> // <AppBar // elevation={0} // position="fixed" // sx={{ zIndex: (theme) => theme.zIndex.drawer + 1 }} // > // <Toolbar> // <IconButton // color="inherit" // aria-label="open drawer" // edge="start" // onClick={handleDrawerToggle} // sx={{ mr: 2, display: { md: 'none' } }} // > // {mobileOpen ? <CodeOffIcon /> : <CodeIcon />} // </IconButton> // <Typography // variant="h6" // noWrap // component="div" // sx={{ flexGrow: 1, display: { xs: 'none', md: 'inline-block' } }} // > // <TypeIt // getBeforeInit={(instance) => { // instance // .pause(3500) // .type('npm install mui-scroll-trigger') // .pause(1500) // .delete() // .type("import ScrollTrigger from 'mui-scroll-trigger'"); // return instance; // }} // options={{ speed: 120, cursor: false }} // /> // </Typography> // <Typography // variant="h6" // noWrap // component="div" // sx={{ flexGrow: 1, display: { xs: 'inline-block', md: 'none' } }} // > // mui-scroll-trigger // </Typography> // <Box display="flex"> // <IconButton // onClick={() => // window.open('https://npmjs.com/package/mui-scroll-trigger') // } // color="inherit" // > // <NpmIcon fontSize="large" color="inherit" /> // </IconButton> // <IconButton // onClick={() => // window.open('https://github.com/benmneb/mui-scroll-trigger') // } // color="inherit" // > // <GitHubIcon fontSize="large" color="inherit" /> // </IconButton> // </Box> // </Toolbar> // </AppBar> // <Drawer // variant={mobile ? 'temporary' : 'permanent'} // open={mobile ? mobileOpen : true} // onClose={handleDrawerToggle} // ModalProps={{ keepMounted: true }} // sx={{ // width: DRAWER_WIDTH, // maxWidth: '100vw', // flexShrink: 0, // '& .MuiDrawer-paper': { // width: DRAWER_WIDTH, // maxWidth: '100vw', // boxSizing: 'border-box', // }, // }} // > // <Toolbar /> // <Stack // spacing={2} // component="section" // padding={2} // sx={{ minWidth: '100%' }} // > // <Box component="div" variant="h6"> // {'<ScrollTrigger'} // </Box> // <Stack spacing={1} sx={{ pl: 2 }}> // <Line component="div"> // src="https://picsum.photos/id/{currentPhoto}/2000" // </Line> // <Tooltip title="Any valid CSS `height` property" placement="right"> // <Line component="div"> // height=" // <TextField // variant="standard" // value={height} // onChange={(e) => setHeight(e.target.value)} // /> // " // </Line> // </Tooltip> // <Tooltip title="Any valid CSS `width` property" placement="right"> // <Line component="div"> // width=" // <TextField // variant="standard" // value={width} // onChange={(e) => setWidth(e.target.value)} // /> // " // </Line> // </Tooltip> // <Tooltip // title="Any valid CSS `object-fit` property" // placement="right" // > // <Line component="div"> // fit= // <Select // variant="standard" // value={fit} // onChange={(e) => setFit(e.target.value)} // sx={{ minWidth: 100 }} // > // <MenuItem value="fill">"fill"</MenuItem> // <MenuItem value="contain">"contain"</MenuItem> // <MenuItem value="cover">"cover"</MenuItem> // <MenuItem value="none">"none"</MenuItem> // <MenuItem value="scale-down">"scale-down"</MenuItem> // </Select> // </Line> // </Tooltip> // <Tooltip title="Number of milliseconds" placement="right"> // <Line component="div"> // duration={'{'} // <TextField // variant="standard" // value={duration} // onChange={(e) => setDuration(e.target.value)} // /> // {'}'} // </Line> // </Tooltip> // <Tooltip // title="Any valid CSS `transition-timing-function` property" // placement="right" // > // <Line component="div"> // easing= // <Select // variant="standard" // value={easing} // onChange={(e) => setEasing(e.target.value)} // sx={{ minWidth: 100 }} // > // <MenuItem value="cubic-bezier(0.7, 0, 0.6, 1)"> // "cubic-bezier(0.7, 0, 0.6, 1)" // </MenuItem> // <MenuItem value="ease">"ease"</MenuItem> // <MenuItem value="ease-in">"ease-in"</MenuItem> // <MenuItem value="ease-out">"ease-out"</MenuItem> // <MenuItem value="ease-in-out">"ease-in-out"</MenuItem> // <MenuItem value="linear">"linear"</MenuItem> // </Select> // </Line> // </Tooltip> // <Tooltip // title="Once installed you can add a custom loading indicator" // placement="right" // > // <Line component="div"> // showLoading= // <FormControlLabel // sx={{ ml: 0 }} // control={ // <Switch // checked={showLoading} // onChange={(e) => setShowLoading(e.target.checked)} // /> // } // label={`{ ${showLoading} }`} // labelPlacement="start" // /> // </Line> // </Tooltip> // <Tooltip // title="Once installed you can add a custom error icon" // placement="right" // > // <Line component="div"> // errorIcon= // <FormControlLabel // sx={{ ml: 0 }} // control={ // <Switch // checked={errorIcon} // onChange={(e) => setErrorIcon(e.target.checked)} // /> // } // label={`{ ${errorIcon} }`} // labelPlacement="start" // /> // </Line> // </Tooltip> // <Tooltip // title="Direction to shift image after it loads" // placement="right" // > // <Line component="div"> // shift= // <Select // variant="standard" // value={shift || 'null'} // onChange={(e) => setShift(e.target.value)} // sx={{ minWidth: 100 }} // > // <MenuItem value={'null'}>{'{ null }'}</MenuItem> // <MenuItem value="top">"top"</MenuItem> // <MenuItem value="right">"right"</MenuItem> // <MenuItem value="bottom">"bottom"</MenuItem> // <MenuItem value="left">"left"</MenuItem> // </Select> // </Line> // </Tooltip> // <Tooltip title="Any valid CSS `length` property" placement="right"> // <Line component="div"> // distance=" // <TextField // variant="standard" // value={distance} // onChange={(e) => setDistance(e.target.value)} // /> // " // </Line> // </Tooltip> // <Tooltip // title="Number of milliseconds the shift takes" // placement="right" // > // <Line component="div"> // shiftDuration={'{'} // <TextField // variant="standard" // value={shiftDuration || duration * 0.3} // onChange={(e) => setShiftDuration(e.target.value)} // /> // {'}'} // </Line> // </Tooltip> // <Tooltip // title="Color the image transitions in from" // placement="right" // > // <Line component="div"> // bgColor=" // <TextField // variant="standard" // value={bgColor} // onChange={(e) => setBgColor(e.target.value)} // /> // " // </Line> // </Tooltip> // </Stack> // <Box component="div" variant="h6"> // {'/>'} // </Box> // <Button // disabled={showPhoto === 'refresh'} // variant="contained" // onClick={refreshPhoto} // disableElevation // > // Refresh photo // </Button> // <Button // disabled={showPhoto === 'new'} // variant="outlined" // onClick={getNewPhoto} // > // Random photo // </Button> // <Button onClick={resetDefaults}>Reset defaults</Button> // </Stack> // </Drawer> // <Box component="section" sx={{ flexGrow: 1, backgroundColor: bgColor }}> // <Toolbar /> // <Output // sx={{ // maxHeight: { xs: 'calc(100vh - 56px)', sm: 'calc(100vh - 64px)' }, // }} // > // {showPhoto && ( // <ScrollTrigger // threshold={threshold} // disableHysteresis={disableHysteresis} // target={target} // transition={transition} // onScroll={onScroll} // disabled={disabled} // /> // )} // </Output> // </Box> // </Box> // ); // } // render( // <ThemeProvider theme={theme}> // <CssBaseline /> // <Demo /> // </ThemeProvider>, // document.querySelector('#demo') // );
import React from 'react'; import './spinner.css' export const Fullscreen = () => { return ( <div className="spinner_con"> <div className="step1"> <div className="step2"> <div className="step3"> </div> </div> </div> </div> ) }
/********************************************************************************************** * Copyright (C) 2013 - 2015 * United Services Automobile Association * All Rights Reserved * * File: IRAProd_Decision_Tool.js ********************************************************************************************** * Rls Date Chg Date Name Description * ========== ========== ============== ================== * 05/11/2016 Rod Luevano * 08/19/2015 04/29/2016 Ryan Goree Added showContextualAdvice() and hideContextualAdvice() * 08/19/2015 08/19/2015 Claudia Maldonado Update * 00/00/2015 04/29/2015 USAA IT - Dev Initial creation- Provided to EDS **********************************************************************************************/ /** * @file this allows table cells be highlighted * @requires no requirements */ var currentPanel = ""; var nextPanel = ""; var prevPanel =""; var employerPlan; var selfEmployed; var filingStatus; var income; var toolmenu; function actb(bstatus){ var bstatus,cl; toolmenu=document.querySelectorAll('.chooseTool-progLine')[0]; var menu=toolmenu.children; switch(bstatus){ case 'p': for(i=0;i<menu.length;i++){ cl=menu[i].className; if(cl===''&& i>0){ menu[i].className='active'; break; } else if(cl==='last'){ menu[i].className='activeLast'; break; } } break; case 'm': for(i=0;i<menu.length;i++){ cl=menu[i].className; if((cl===''&& i>0)||(cl==='last')){ menu[i-1].className=''; break; } } break; case 'r': for(i=0;i<menu.length;i++){ cl=menu[i].className; if(cl==='active'){ menu[i].className=''; } else if(cl==='activeLast'){ menu[i].className='last'; } } break; } } function next(){ document.getElementById("panel2").style.left="800px"; document.getElementById("panel3").style.left="800px"; document.getElementById("panel4").style.left="800px"; var currentPanelId = document.querySelectorAll('.show')[0].id; var panelelement=document.getElementById(currentPanelId).nextSibling; if(panelelement.nodeType=='3'){ var nextPanelId = document.getElementById(currentPanelId).nextSibling.nextSibling.id; }else{ var nextPanelId = document.getElementById(currentPanelId).nextSibling.id; } currentPanel = document.getElementById(currentPanelId); nextPanel = document.getElementById(nextPanelId); var currentPanelRadioButtons = document.getElementsByName(currentPanelId + "_radio"); if (currentPanelRadioButtons.length != 0){ for (var i=0; i<currentPanelRadioButtons.length; i++){ if(currentPanelRadioButtons[i].checked){ if(currentPanelId =='panel1'){ employerPlan = currentPanelRadioButtons[i].value; var contextualAdvice = document.querySelector('.contextual-advice.showing'); }else if(currentPanelId == 'panel2'){ selfEmployed = currentPanelRadioButtons[i].value; }else if(currentPanelId == 'panel3'){ filingStatus = currentPanelRadioButtons[i].value; }else if(currentPanelId == 'panel4'){ income = currentPanelRadioButtons[i].value; } document.getElementById("errorMessage").style.display = "none"; slideLeft(); currentPanel.className = "hidden"; nextPanel.className = "show"; document.getElementById("previouseButton").style.display = "inline-block"; if(nextPanelId == 'panel4'){ document.getElementById("panel5").style.left = "650px" } if(nextPanelId == 'panel5'){ document.getElementById("nextButton").style.display = "none"; document.getElementById("previouseButton").style.display = "none"; document.getElementById("openAcctLink").style.display = "inline-block"; document.getElementById("startOverButton").style.display = "inline-block"; document.getElementById("panelSet").style.height = "230px"; result (employerPlan, selfEmployed, filingStatus, income); } actb('p'); return; } } document.getElementById("errorMessage").style.display = "block"; document.getElementById("panel2").style.left="0px"; document.getElementById("panel3").style.left="0px"; document.getElementById("panel4").style.left="0px"; } } function previous(){ document.getElementById("panel2").style.left="-500px"; document.getElementById("panel3").style.left="-500px"; document.getElementById("panel4").style.left="-500px"; var currentPanelId = document.querySelectorAll('.show')[0].id; var panelelement=document.getElementById(currentPanelId).previousSibling; if(panelelement.nodeType=='3'){ var prevPanelId = document.getElementById(currentPanelId).previousSibling.previousSibling.id; }else{ var prevPanelId = document.getElementById(currentPanelId).previousSibling.id; } currentPanel = document.getElementById(currentPanelId); prevPanel = document.getElementById(prevPanelId); slideRight(); currentPanel.className = "hidden"; prevPanel.className = "show"; actb('m'); if(prevPanelId == 'panel1'){ document.getElementById("previouseButton").style.display = "none"; } } function slideLeft(){ var stopPosition = 0; if(currentPanel.id=="panel1") { currentPanel.style.left="10px"; } if (parseInt(nextPanel.style.left) > stopPosition ) { currentPanel.style.left = parseInt(currentPanel.style.left) - 10 + "px"; nextPanel.style.left = parseInt(nextPanel.style.left) - 10 +"px"; setTimeout(slideLeft, 1); } } function slideRight(){ var stopPosition = 0; if (parseInt(prevPanel.style.left) < stopPosition ) { currentPanel.style.left = parseInt(currentPanel.style.left) + 10 + "px"; prevPanel.style.left = parseInt(prevPanel.style.left) + 10 + "px"; setTimeout(slideRight, 1); } } function showContextualAdvice() { var contextualAdvice = document.querySelector('.tool-container .contextual-advice'); contextualAdvice.style.display = 'block'; setTimeout(function() { contextualAdvice.style.height = '155px'; }, 1); setTimeout(function() { contextualAdvice.className += ' showing'; }, 500); } function hideContextualAdvice() { var contextualAdvice = document.querySelector('.tool-container .contextual-advice'); contextualAdvice.style.height = 0; setTimeout(function() { contextualAdvice.style.display = 'none'; contextualAdvice.className = contextualAdvice.className.replace(' showing', ''); }, 500); } function clearRadioButtons(radioButtons){ radioButtons1 = document.querySelectorAll(radioButtons); for (var i=0; i<radioButtons1.length; i++){ radioButtons1[i].checked = false; } } function startOver(){ var currentPanelId = document.querySelectorAll('.show')[0].id; currentPanel = document.getElementById(currentPanelId); nextPanel = document.getElementById("panel1"); nextPanel.style.left = "650px"; slideLeft(); currentPanel.className = "hidden"; nextPanel.className = "show"; document.getElementById("panelSet").style.height = "auto"; document.getElementById("nextButton").style.display = "inline-block"; document.getElementById("openAcctLink").style.display = "none"; document.getElementById("startOverButton").style.display = "none"; clearRadioButtons(".panel_radio"); document.getElementById("panel2").style.left = "650px"; document.getElementById("panel3").style.left = "650px"; document.getElementById("panel4").style.left = "650px"; document.getElementById("optionA").style.display = 'none'; document.getElementById("optionB").style.display = 'none'; document.getElementById("optionC").style.display = 'none'; document.getElementById("optionD").style.display = 'none'; actb('r'); } function filingStatusChange (){ statusRadioButtons = document.getElementsByName("panel4_radio"); for (var i=0; i<statusRadioButtons.length; i++){ statusRadioButtons[i].checked = false; } if (document.getElementById("panel3_radio_single").checked || document.getElementById("panel3_radio_head").checked) { document.getElementById("income_a").style.display = "block"; document.getElementById("income_b").style.display = "block"; document.getElementById("income_c").style.display = "block"; document.getElementById("income_d").style.display = "none"; document.getElementById("income_e").style.display = "none"; document.getElementById("income_f").style.display = "none"; document.getElementById("income_g").style.display = "none"; document.getElementById("income_h").style.display = "none"; } else if (document.getElementById("panel3_radio_jointly").checked) { document.getElementById("income_a").style.display = "none"; document.getElementById("income_b").style.display = "none"; document.getElementById("income_c").style.display = "none"; document.getElementById("income_d").style.display = "block"; document.getElementById("income_e").style.display = "block"; document.getElementById("income_f").style.display = "block"; document.getElementById("income_g").style.display = "none"; document.getElementById("income_h").style.display = "none"; } else if (document.getElementById("panel3_radio_separately").checked){ document.getElementById("income_a").style.display = "none"; document.getElementById("income_b").style.display = "none"; document.getElementById("income_c").style.display = "none"; document.getElementById("income_d").style.display = "none"; document.getElementById("income_e").style.display = "none"; document.getElementById("income_f").style.display = "none"; document.getElementById("income_g").style.display = "block"; document.getElementById("income_h").style.display = "block"; } } function result(employerPlan, selfEmployed, filingStatus, income){ switch (selfEmployed){ /* Question 2: Are you a self-Employed or a small business owner? - YES */ case 'yes': document.getElementById("optionC").style.display = 'block'; break; /* Question 2: Are you a self-Employed or a small business owner? - NO */ case 'no': switch (filingStatus){ /* Question 3: What is your tax filling status? - Single */ case 'single': switch (income){ /* Question 4: What is your Modified Adjusted Gross Income? - Less than $116,000 */ case 'a': document.getElementById("optionD").style.display = 'block'; break; /* Question 4: What is your Modified Adjusted Gross Income? - $116,000 - $131,000 */ case 'b': document.getElementById("optionD").style.display = 'block'; break; /* Question 4: What is your Modified Adjusted Gross Income? - Over $131,000 */ case 'c': document.getElementById("optionB").style.display = 'block'; break; } /* Question 3: What is your tax filling status? - Head of Household */ case 'head': switch (income){ /* Question 4: What is your Modified Adjusted Gross Income? - Less than $116,000 */ case 'a': document.getElementById("optionD").style.display = 'block'; break; /* Question 4: What is your Modified Adjusted Gross Income? - $116,000 - $131,000 */ case 'b': document.getElementById("optionD").style.display = 'block'; break; /* Question 4: What is your Modified Adjusted Gross Income? - Over $131,000 */ case 'c': document.getElementById("optionB").style.display = 'block'; break; } /* Question 3: What is your tax filling status? - Married Filing Jointly */ case 'jointly': switch (income){ /* Question 4: What is your Modified Adjusted Gross Income? - Less than $116,000 */ case 'd': document.getElementById("optionD").style.display = 'block'; break; /* Question 4: What is your Modified Adjusted Gross Income? - $116,000 - $131,000 */ case 'e': document.getElementById("optionD").style.display = 'block'; break; /* Question 4: What is your Modified Adjusted Gross Income? - Over $131,000 */ case 'f': document.getElementById("optionB").style.display = 'block'; break; } /* Question 3: What is your tax filling status? - Married Filing Separately */ case 'separately': switch (income){ /* Question 4: What is your Modified Adjusted Gross Income? - Less than $10,000 */ case 'g': document.getElementById("optionB").style.display = 'block'; break; /* Question 4: What is your Modified Adjusted Gross Income? - Over $10,000 */ case 'h': document.getElementById("optionB").style.display = 'block'; break; } } } }
const compose = (fun1,fun2) => (x) => fun1(fun2(x)); square = x => x *x; double = x => 2 * x; var f1 = compose(square,double); console.log(f1(5)); console.log(f1(10)); var f2 = compose(double,square); console.log(f2(5)); console.log(f2(10));
var students=['John', 'Mike', 'Peter']; var yearBorn= new Array (2000,1999,2005); var mike= ['Mike', 'Smith', 2001, 9.5, true]; console.log(students); console.log(yearBorn); console.log(mike); //Posisición en el vector. console.log(students[2]); console.log(mike[3]); //CAMBIAR VALOR mike[3]=7.5 console.log(mike[3]); //AGREGAR ELEMENTO AL FINAL DEL VECTOR console.log('Agregar un elemento al final del vector students'); students.push('Rob'); console.log(students); //AGREGAR UN ELEMENTO AL INICIO DEL VECTOR console.log('Agregar elemento al inicio del vector'); yearBorn.unshift(2003); console.log(yearBorn); //ELIMINAR UN ELEMENTO QUE ESTÁ AL FINAL DEL VECTOR console.log('Eliminar el ultimo elemento de un vector'); students.pop(); console.log(students); //ELIMINAR UN ELEMENTO AL INICIO DEL VECTOR console.log('Eliminar el primer elemento de un vector'); yearBorn.shift(); console.log(yearBorn); //ENCONTRAR UN ELEMENTO EN EL VECTOR console.log('Encontrar un elemento dentro del vector'); var i1=students.indexOf('Peter'); var i2=students.indexOf('Steve'); console.log(i1); console.log(i2); //Si no existe regresa -1 //ARRAY console.log('Insertar un elemento en el vector'); students.splice(1,0,'Steve'); //Desde que posición elimina/ cuantos/ y que se agrega console.log(students); console.log('Eliminar un elemento del vector'); students.splice(1,1); //Elimiar sin agregar nada console.log(students); console.log('Reemplazar un elemento'); students.splice(1,1, 'Bob'); console.log(students);
import { graphql } from 'react-apollo' import gql from 'graphql-tag' import objFragment from '../fragments/obj' import { ObjsQuery } from '../queries/objs' export const CreateObjMutation = gql` mutation createObj( $organization: OrganizationInput! $localId: String $pullFromCustomApi: Boolean ) { createObj( organization: $organization localId: $localId pullFromCustomApi: $pullFromCustomApi ) { ...ObjFragment } } ${objFragment} ` export const mutationConfig = { props: ({ mutate, ownProps: { router: { query: { subdomain } } } }) => ({ createObj: variables => { return mutate({ variables: { organization: { subdomain }, localId: variables.localId, pullFromCustomApi: variables.pullFromCustomApi } }) } }) } export default graphql(CreateObjMutation, mutationConfig)
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import _extends from "@babel/runtime/helpers/esm/extends"; var _excluded = ["scrollingEnabled", "useNativeScrolling"]; import { createComponentVNode, normalizeProps } from "inferno"; import { InfernoWrapperComponent } from "@devextreme/vdom"; import { FormProps } from "./form_props"; import { combineClasses } from "../../utils/combine_classes"; import { Widget } from "../common/widget"; import { LayoutManager } from "./layout_manager"; import { Scrollable } from "../scroll_view/scrollable"; export var viewFunction = viewModel => { var aria = { role: "form" }; var cssClasses = combineClasses({ "dx-form": true }); var { props: { scrollingEnabled, useNativeScrolling }, restAttributes } = viewModel; var rootLayoutManager = createComponentVNode(2, LayoutManager); return scrollingEnabled ? createComponentVNode(2, Scrollable, { "aria": aria, "classes": cssClasses, "useNative": !!useNativeScrolling, "useSimulatedScrollbar": !useNativeScrolling, "useKeyboard": false, "direction": "both", "bounceEnabled": false, children: rootLayoutManager }) : normalizeProps(createComponentVNode(2, Widget, _extends({ "aria": aria, "classes": cssClasses }, restAttributes, { children: rootLayoutManager }))); }; export class Form extends InfernoWrapperComponent { constructor(props) { super(props); this.state = {}; } get restAttributes() { var _this$props = this.props, restProps = _objectWithoutPropertiesLoose(_this$props, _excluded); return restProps; } render() { var props = this.props; return viewFunction({ props: _extends({}, props), restAttributes: this.restAttributes }); } } Form.defaultProps = _extends({}, FormProps);
// general regex const mi_open = '<m[ion]( *[a-z]+ *= *"[-# a-z]+")*>'; const mi_open_nattr = '<m[ion](?: *[a-z]+ *= *"[-# a-z]+")*>'; const mo_invis = '(<mo>&(?:(?:#x206[0-9])|(?:i[ct]));</mo>)*'; const mo_invis_nattr = '(?:<mo>&(?:(?:#x206[0-9])|(?:i[ct]));</mo>)*'; const mi_close = '</m[ion]>'; const space = '[\s \t\r\n]*'; // apply various functions to clean up mathml code from word paste function format_mathml() { // read in uploaded file as string let file_reader = new FileReader(); let html_file = document.getElementById("html_file").files[0]; file_reader.onload = function(event) { let word_mathml = event.target.result.replaceAll("\r\n", "\n"); // fix word-generated mathml tags let cleaned_mathml = word_mathml.replaceAll("mml:", "").replaceAll(' xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"', "").replaceAll(" ", " ").replaceAll("&#xA0", " "); // remove mathvariant if needed if (document.getElementById("rm_mathvariant").checked) { cleaned_mathml = cleaned_mathml.replaceAll(' mathvariant="normal"', ""); } // fix summations if formatting is valid if (document.getElementById("correct_indent").checked) { cleaned_mathml = format_summations(cleaned_mathml); } // remove extra spaces cleaned_mathml = replace_invisible_nbsp(cleaned_mathml); cleaned_mathml = rm_multispace(cleaned_mathml); // remove existing mspace and &af; so they can be readded later without duplicating cleaned_mathml = cleaned_mathml.replaceAll(/ *<mspace *\/ *>/g, "<mi> </mi>"); cleaned_mathml = cleaned_mathml.replaceAll("<mo>&af;</mo>", "") // get array of multicharacter words let multichar_arr = document.getElementById("multichar").value.split("\n"); // fix multicharacter words let cleaned_mathml_multichar = join_multichar_mi(cleaned_mathml, multichar_arr); // add mspace back in let replace_mspace_regex = new RegExp(mi_open + ' *' + mi_close, "g"); let cleaned_mathml_multichar_mspace = cleaned_mathml_multichar.replaceAll(replace_mspace_regex, "<mspace />"); download(cleaned_mathml_multichar_mspace, "mathml.html", "text/html"); } file_reader.readAsText(html_file); } /* helper functions */ /* ============================ Padding ============================ */ // add padding around mrow which has input regex, including indentation as its first group and remaining content as second function add_mrow_padding(mathml_html, input_regex) { let padded_html = mathml_html; // each value in matches is a subarray where index 0 is the full match of the regex string, index 1 is the munder(over) before the summation, index 2 is the indentation before the summation, index 3 is the full summation, index 4 is the values inside the summation let matches = [...padded_html.matchAll(input_regex)]; for (let i = 0; i < matches.length; i++) { // get closing mrow of text (based on having same indentation as input line) let mrow_close = matches[i][2] + "</mrow>"; // fix the first row of the summation, which should be the summation's bottom value if there is just one row let bot_regex = new RegExp(matches[i][0] + space + "<mrow>((.|\n)*?)\n" + mrow_close, "g"); // add padding around contents of the mrow - remove spacing after newlines (i.e. proper indentation) so it won't be matched again later padded_html = padded_html.replace(bot_regex, matches[i][1] + "\n" + matches[i][3] + '<mrow><mpadded lspace="-0.7em" voffset="-1ex">$1</mpadded></mrow>'); // fix the second row of the summation, which, if it exists, means there are both top and bottom values let bot_top_regex = new RegExp('</mpadded></mrow>' + space + "<mrow>((.|\n)*?)\n" + mrow_close, "g"); // add padding around contents of the mrow - remove spacing after newlines (i.e. proper indentation) so it won't be matched again later padded_html = padded_html.replace(bot_top_regex, "\n " + '</mpadded> </mrow><mrow><mpadded lspace="-0.7em" voffset="1ex">$1</mpadded> </mrow>'); } return padded_html; } // format summations, putting their text above and below function format_summations(mathml_text) { // remove padding for now let edited_html = mathml_text.replaceAll(/<mpadded lspace="-0.7em" voffset="(?:.*?)ex">((.|\n)*?)<\/mpadded>/g, "$1"); edited_html = edited_html.replaceAll(/<mpadded height="\+2ex" voffset="1ex">((.|\n)*?)<\/mpadded>/g, "$1") // pad each top + bottom text summation edited_html = add_mrow_padding(edited_html, /(<munder(?:over)*>) *\n( *)(<mo stretchy="false">(.*?)<\/mo>)/g); // pad spacing around summation edited_html = edited_html.replaceAll(/(<munder(over)*>(.|\n)*?<\/munder(over)*>)/g, '<mpadded height="+2ex" voffset="1ex">$1</mpadded>'); return edited_html; } /* ============================ Joining variables ============================ */ // helper function for sorting - assign type priorities so that joining variables (a/v/f) is done after adding separators (m/c), since joining variables takes priority function type_prio(x) { if ((x.type === "m") || (x.type === "c")) { return 0; } if ((x.type === "a") || (x.type === "v") || (x.type === "f")) { return 1; } } // sort to deal with longer words first within the same type priority, so that shorter words being joined earlier doesn't prevent longer words from being recognized later function sort_words(a, b) { // if two words are treated the same, sort by length in reverse if (type_prio(a) === type_prio(b)) { return a.val.length - b.val.length; } return type_prio(b) - type_prio(a); } // join consecutive mi/mo/mn for words in list function join_multichar_mi(mathml_text, multichar_list) { let multichar_mathml_text = mathml_text; /* ============================ Create list of words to be joined ============================ */ // get list of objects containing two properties: word value and type of word let word_arr = []; for (i = 0; i < multichar_list.length; i++) { let multichar_word = multichar_list[i].trim(); if (multichar_word.length > 2) { let multichar_val = multichar_word.substring(0, multichar_word.length - 2).trim(); let multichar_type = multichar_word.substring(multichar_word.length - 1, multichar_word.length); word_arr.push({val: multichar_val, type: multichar_type}); } } // sort list of words word_arr.sort(sort_words).reverse(); // loop through each word for (i = 0; i < word_arr.length; i++) { let curr_word = word_arr[i]; /* ============================ Split each word into a character array to search for each character in an <m[ion]> tag Make html entities count as a single character in the character array ============================ */ // get values of html entities let special_char_vals = match_with_empty(curr_word.val, /&[#a-zA-Z0-9]+;/g); // loop through html entities one by one and get their indices let curr_word_no_special = curr_word.val; let special_char_inds = []; for (j = 0; j < special_char_vals.length; j++) { let curr_special_val = special_char_vals[j]; let special_val_ind = curr_word_no_special.indexOf(curr_special_val); special_char_inds.push(special_val_ind); curr_word_no_special = curr_word_no_special.replace(curr_special_val, " "); } // split word up to individual characters let multichar_arr = curr_word_no_special.split(""); // add html entities back in for (j = 0; j < special_char_inds.length; j++) { let curr_ind = special_char_inds[j]; let curr_val = special_char_vals[j]; multichar_arr[curr_ind] = curr_val; } // escape regex characters for (j = 0; j < multichar_arr.length; j++) { multichar_arr[j] = escape_regex_chars(multichar_arr[j]); } /* ============================ Create regex statements to search for m[ion] tags to join ============================ */ // join character array, with with <m[ion]> and invisible tags in between each character, into string let mi_split_str = "(?:" + mi_close + mo_invis_nattr + space + mi_open_nattr + ")*"; let mi_regex = new RegExp(mi_open + multichar_arr.join(mi_split_str) + mi_close, "g"); // also look for instances where the last character contains a superscript/subscript let main_char_regex = mi_open + multichar_arr.slice(0, multichar_arr.length - 1).join(mi_split_str); let last_char_regex = mi_close + space + '((?:<msubsup>)|(?:<msub>)|(?:<msup>))' + space + '<mrow>' + space + mi_open_nattr + multichar_arr[multichar_arr.length - 1] + mi_close + space + '</mrow>'; let mi_script_regex = new RegExp(main_char_regex + last_char_regex, "g"); /* ============================ Join m[ion] tags ============================ */ // set replacement values for multi-char words (v, a, f) let mi_multichar_replace = "<mi$1>" + curr_word.val + "</mi>"; let mi_multichar_script_replace = "$2<mrow>" + mi_multichar_replace + "</mrow>"; // multiplication if (curr_word.type === "m") { // add invisible multiplication between variables let var_mult = "<mi>" + multichar_arr.join("</mi><mo>&it;</mo><mi>") + "</mi>"; multichar_mathml_text = multichar_mathml_text.replaceAll(mi_regex, var_mult); multichar_mathml_text = multichar_mathml_text.replaceAll(mi_script_regex, "$2<mrow>" + var_mult + "</mrow>"); } // comma else if (curr_word.type === "c") { // add invisible comma between variables let var_comma = "<mi>" + multichar_arr.join("</mi><mo>&ic;</mo><mi>")+ "</mi>"; multichar_mathml_text = multichar_mathml_text.replaceAll(mi_regex, var_comma); multichar_mathml_text = multichar_mathml_text.replaceAll(mi_script_regex, "$2<mrow>" + var_comma + "</mrow>"); } // variable else if (curr_word.type === "v" || curr_word.type === "a") { // join consecutive mi/mo/mn tags multichar_mathml_text = multichar_mathml_text.replaceAll(mi_regex, mi_multichar_replace); multichar_mathml_text = multichar_mathml_text.replaceAll(mi_script_regex, mi_multichar_script_replace); } // function else if (curr_word.type === "f") { // add string for invisible function application let invis_func = "<mo>&af;</mo>"; // join consecutive mi/mo/mn tags multichar_mathml_text = multichar_mathml_text.replaceAll(mi_regex, mi_multichar_replace + invis_func); multichar_mathml_text = multichar_mathml_text.replaceAll(mi_script_regex, mi_multichar_script_replace + invis_func); } } // remove consecutive instances of invisible function multichar_mathml_text = multichar_mathml_text.replaceAll(/(<mo>&af;<\/mo>)+/g, "<mo>&af;</mo>"); return multichar_mathml_text; }
var promise = new Promise((resolve,reject) => { resolve('I FIRED'); reject(new Error('I DID NOT FIRE')); }); function onRejected(error) { return console.log(error.message); } promise.then(console.log,onRejected);
import { expect } from "chai"; import sinon from 'sinon' import { shallowMount } from "@vue/test-utils"; import game from "@/views/game" describe("game component", () => { it("if gameId is undefined calls endGame", () => { let stub = sinon.stub() shallowMount(game,{propsData:{ gameId: undefined, playerId: 'playerOne' },methods:{ endGame: stub }}); expect(stub.called).to.equal(true) }); it("if playerId is playerOne the opponentId is playerTwo", () => { let wrapper= shallowMount(game,{propsData:{ gameId: undefined, playerId: 'playerOne' },methods:{ endGame: sinon.stub() }}); expect(wrapper.vm.opponentId).to.equal('playerTwo') }); });
// JavaScript Document function checkAll(obj){ var count = document.getElementById('count').value; if(obj.checked==false){ for(var i=0;i<count;i++){ document.getElementById('chkId'+i).checked=false; } } else if(obj.checked==true){ for(var i=0;i<count;i++){ document.getElementById('chkId'+i).checked=true; } } } function showMenuPos(obj){ if(obj.value=='' || obj.value=='0'){ document.getElementById('menuPos').style.display='block'; }else{ document.getElementById('menuPos').style.display='none'; } }
Grailbird.data.tweets_2014_04 = [ { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Simon Hope", "screen_name" : "mapbutcher", "indices" : [ 0, 11 ], "id_str" : "16034664", "id" : 16034664 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "461019179257053184", "geo" : { }, "id_str" : "461029496926130176", "in_reply_to_user_id" : 16034664, "text" : "@mapbutcher Your cynicism is justified. But cynicism of the merits of monocultures, genetic modification and 'food science' are also valid.", "id" : 461029496926130176, "in_reply_to_status_id" : 461019179257053184, "created_at" : "2014-04-29 06:29:32 +0000", "in_reply_to_screen_name" : "mapbutcher", "in_reply_to_user_id_str" : "16034664", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Simon Hope", "screen_name" : "mapbutcher", "indices" : [ 0, 11 ], "id_str" : "16034664", "id" : 16034664 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "460907134016692224", "geo" : { }, "id_str" : "460966475776290817", "in_reply_to_user_id" : 16034664, "text" : "@mapbutcher Criticism of home made food for using mains electricity and water is reductive and absolutist.", "id" : 460966475776290817, "in_reply_to_status_id" : 460907134016692224, "created_at" : "2014-04-29 02:19:06 +0000", "in_reply_to_screen_name" : "mapbutcher", "in_reply_to_user_id_str" : "16034664", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Andhegames", "screen_name" : "AndHeGames", "indices" : [ 0, 11 ], "id_str" : "2380526706", "id" : 2380526706 }, { "name" : "Lucas Pope", "screen_name" : "dukope", "indices" : [ 12, 19 ], "id_str" : "520685404", "id" : 520685404 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "460935430465400832", "geo" : { }, "id_str" : "460939743144861696", "in_reply_to_user_id" : 2380526706, "text" : "@AndHeGames @dukope Same! Papers Please is amazing with a stylus.", "id" : 460939743144861696, "in_reply_to_status_id" : 460935430465400832, "created_at" : "2014-04-29 00:32:53 +0000", "in_reply_to_screen_name" : "AndHeGames", "in_reply_to_user_id_str" : "2380526706", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ { "indices" : [ 21, 44 ], "url" : "https:\/\/t.co\/x0spEBI9ln", "expanded_url" : "https:\/\/github.com\/jaforbes\/ld29", "display_url" : "github.com\/jaforbes\/ld29" } ] }, "geo" : { }, "id_str" : "460688429995409408", "text" : "Here's the game man! https:\/\/t.co\/x0spEBI9ln", "id" : 460688429995409408, "created_at" : "2014-04-28 07:54:15 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ { "expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/460430930117554176\/photo\/1", "indices" : [ 6, 28 ], "url" : "http:\/\/t.co\/aMFQ7bK8CP", "media_url" : "http:\/\/pbs.twimg.com\/media\/BmPHfYTCEAE48DO.png", "id_str" : "460430928834072577", "id" : 460430928834072577, "media_url_https" : "https:\/\/pbs.twimg.com\/media\/BmPHfYTCEAE48DO.png", "sizes" : [ { "h" : 620, "resize" : "fit", "w" : 549 }, { "h" : 150, "resize" : "crop", "w" : 150 }, { "h" : 620, "resize" : "fit", "w" : 549 }, { "h" : 383, "resize" : "fit", "w" : 340 }, { "h" : 620, "resize" : "fit", "w" : 549 } ], "display_url" : "pic.twitter.com\/aMFQ7bK8CP" } ], "hashtags" : [ { "text" : "ld48", "indices" : [ 0, 5 ] } ], "urls" : [ ] }, "geo" : { }, "id_str" : "460430930117554176", "text" : "#ld48 http:\/\/t.co\/aMFQ7bK8CP", "id" : 460430930117554176, "created_at" : "2014-04-27 14:51:02 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ { "text" : "ld48", "indices" : [ 44, 49 ] } ], "urls" : [ { "indices" : [ 110, 132 ], "url" : "http:\/\/t.co\/QPmOF2F6hQ", "expanded_url" : "http:\/\/jaforbes.github.io\/ld29\/", "display_url" : "jaforbes.github.io\/ld29\/" } ] }, "geo" : { }, "id_str" : "460414924825456640", "text" : "I can only afford to spend a few hours this #ld48 as I'm moving interstate. But this is what I have so far. http:\/\/t.co\/QPmOF2F6hQ", "id" : 460414924825456640, "created_at" : "2014-04-27 13:47:26 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ { "text" : "ld48", "indices" : [ 103, 108 ] } ], "urls" : [ ] }, "geo" : { }, "id_str" : "460354645617938432", "text" : "I was loading all our furniture and belongings into a van all day. Last night I worked a few hours on #ld48 \rI'm hoping I can submit it.", "id" : 460354645617938432, "created_at" : "2014-04-27 09:47:55 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ { "expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/460245374003728384\/photo\/1", "indices" : [ 11, 33 ], "url" : "http:\/\/t.co\/8Pr3GBzzJS", "media_url" : "http:\/\/pbs.twimg.com\/media\/BmMeuqJCAAATAIW.jpg", "id_str" : "460245373856907264", "id" : 460245373856907264, "media_url_https" : "https:\/\/pbs.twimg.com\/media\/BmMeuqJCAAATAIW.jpg", "sizes" : [ { "h" : 150, "resize" : "crop", "w" : 150 }, { "h" : 1024, "resize" : "fit", "w" : 577 }, { "h" : 1024, "resize" : "fit", "w" : 577 }, { "h" : 1024, "resize" : "fit", "w" : 577 }, { "h" : 603, "resize" : "fit", "w" : 340 } ], "display_url" : "pic.twitter.com\/8Pr3GBzzJS" } ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "460245374003728384", "text" : "Derelicte! http:\/\/t.co\/8Pr3GBzzJS", "id" : 460245374003728384, "created_at" : "2014-04-27 02:33:42 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ { "text" : "ld48", "indices" : [ 0, 5 ] } ], "urls" : [ ] }, "geo" : { }, "id_str" : "460071828271013891", "text" : "#ld48 I made a fishing line and a jellyfish that runs away from it. I do not know why.", "id" : 460071828271013891, "created_at" : "2014-04-26 15:04:06 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "459683822196367360", "text" : "I just drove from Sydney to Melbourne. I'm so tired I forget how to sleep.", "id" : 459683822196367360, "created_at" : "2014-04-25 13:22:18 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Pat Cartelli", "screen_name" : "patcartelli", "indices" : [ 3, 15 ], "id_str" : "14420643", "id" : 14420643 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "459639398695325696", "text" : "RT @patcartelli: LIFEHACK -\n\nGo to bed", "retweeted_status" : { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "459546086756323328", "text" : "LIFEHACK -\n\nGo to bed", "id" : 459546086756323328, "created_at" : "2014-04-25 04:14:59 +0000", "user" : { "name" : "Pat Cartelli", "screen_name" : "patcartelli", "protected" : false, "id_str" : "14420643", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/578183151928754176\/QRGyCbCt_normal.jpeg", "id" : 14420643, "verified" : false } }, "id" : 459639398695325696, "created_at" : "2014-04-25 10:25:47 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "459111050315456514", "text" : "Airport food is recycled lost luggage. \rAirport Coffee is the byproduct of a cutting edge waste re-use program.\rVery innovative.", "id" : 459111050315456514, "created_at" : "2014-04-23 23:26:18 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Zoe Calton", "screen_name" : "ZoeAppleseed", "indices" : [ 3, 16 ], "id_str" : "2268581455", "id" : 2268581455 } ], "media" : [ { "expanded_url" : "http:\/\/twitter.com\/ZoeAppleseed\/status\/458183161315217409\/photo\/1", "indices" : [ 82, 104 ], "url" : "http:\/\/t.co\/tYOj21pVOb", "media_url" : "http:\/\/pbs.twimg.com\/media\/BlvLKFyCUAAeURv.jpg", "id_str" : "458183161319411712", "id" : 458183161319411712, "media_url_https" : "https:\/\/pbs.twimg.com\/media\/BlvLKFyCUAAeURv.jpg", "sizes" : [ { "h" : 453, "resize" : "fit", "w" : 340 }, { "h" : 533, "resize" : "fit", "w" : 400 }, { "h" : 150, "resize" : "crop", "w" : 150 }, { "h" : 533, "resize" : "fit", "w" : 400 }, { "h" : 533, "resize" : "fit", "w" : 400 } ], "display_url" : "pic.twitter.com\/tYOj21pVOb" } ], "hashtags" : [ { "text" : "art", "indices" : [ 63, 67 ] }, { "text" : "illustration", "indices" : [ 68, 81 ] } ], "urls" : [ ] }, "geo" : { }, "id_str" : "458188561456439296", "text" : "RT @ZoeAppleseed: A piece I'm working on to go on the website. #art #illustration http:\/\/t.co\/tYOj21pVOb", "retweeted_status" : { "source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ { "expanded_url" : "http:\/\/twitter.com\/ZoeAppleseed\/status\/458183161315217409\/photo\/1", "indices" : [ 64, 86 ], "url" : "http:\/\/t.co\/tYOj21pVOb", "media_url" : "http:\/\/pbs.twimg.com\/media\/BlvLKFyCUAAeURv.jpg", "id_str" : "458183161319411712", "id" : 458183161319411712, "media_url_https" : "https:\/\/pbs.twimg.com\/media\/BlvLKFyCUAAeURv.jpg", "sizes" : [ { "h" : 453, "resize" : "fit", "w" : 340 }, { "h" : 533, "resize" : "fit", "w" : 400 }, { "h" : 150, "resize" : "crop", "w" : 150 }, { "h" : 533, "resize" : "fit", "w" : 400 }, { "h" : 533, "resize" : "fit", "w" : 400 } ], "display_url" : "pic.twitter.com\/tYOj21pVOb" } ], "hashtags" : [ { "text" : "art", "indices" : [ 45, 49 ] }, { "text" : "illustration", "indices" : [ 50, 63 ] } ], "urls" : [ ] }, "geo" : { }, "id_str" : "458183161315217409", "text" : "A piece I'm working on to go on the website. #art #illustration http:\/\/t.co\/tYOj21pVOb", "id" : 458183161315217409, "created_at" : "2014-04-21 09:59:13 +0000", "user" : { "name" : "Zoe Calton", "screen_name" : "ZoeAppleseed", "protected" : false, "id_str" : "2268581455", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/577990416483545088\/mhOWEjUQ_normal.jpeg", "id" : 2268581455, "verified" : false } }, "id" : 458188561456439296, "created_at" : "2014-04-21 10:20:40 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "greggman", "screen_name" : "greggman", "indices" : [ 3, 12 ], "id_str" : "11781582", "id" : 11781582 }, { "name" : "zep", "screen_name" : "lexaloffle", "indices" : [ 14, 25 ], "id_str" : "42566089", "id" : 42566089 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ { "indices" : [ 90, 113 ], "url" : "https:\/\/t.co\/89imGLLOjS", "expanded_url" : "https:\/\/www.youtube.com\/watch?v=NhwNTo_Yr3k", "display_url" : "youtube.com\/watch?v=NhwNTo\u2026" } ] }, "geo" : { }, "id_str" : "458188527398707201", "text" : "RT @greggman: @lexaloffle \u61D0\u304B\u3057\u3044\uFF01 Here's the one I mentioned about the licensing of Tetris. https:\/\/t.co\/89imGLLOjS", "retweeted_status" : { "source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "zep", "screen_name" : "lexaloffle", "indices" : [ 0, 11 ], "id_str" : "42566089", "id" : 42566089 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ { "indices" : [ 76, 99 ], "url" : "https:\/\/t.co\/89imGLLOjS", "expanded_url" : "https:\/\/www.youtube.com\/watch?v=NhwNTo_Yr3k", "display_url" : "youtube.com\/watch?v=NhwNTo\u2026" } ] }, "in_reply_to_status_id_str" : "457938043068891136", "geo" : { }, "id_str" : "458110465868955649", "in_reply_to_user_id" : 42566089, "text" : "@lexaloffle \u61D0\u304B\u3057\u3044\uFF01 Here's the one I mentioned about the licensing of Tetris. https:\/\/t.co\/89imGLLOjS", "id" : 458110465868955649, "in_reply_to_status_id" : 457938043068891136, "created_at" : "2014-04-21 05:10:21 +0000", "in_reply_to_screen_name" : "lexaloffle", "in_reply_to_user_id_str" : "42566089", "user" : { "name" : "greggman", "screen_name" : "greggman", "protected" : false, "id_str" : "11781582", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/522463711655505920\/HT8zzJ1U_normal.jpeg", "id" : 11781582, "verified" : false } }, "id" : 458188527398707201, "created_at" : "2014-04-21 10:20:32 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "458179127799848960", "text" : "Grilling bread. \nLooks good. \nChecks twitter. \n\nBURNNING!! SMOKE!! BRIMFIRE!!!!!", "id" : 458179127799848960, "created_at" : "2014-04-21 09:43:11 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ { "text" : "gamedev", "indices" : [ 132, 140 ] } ], "urls" : [ { "indices" : [ 109, 131 ], "url" : "http:\/\/t.co\/EUOO1pXUDc", "expanded_url" : "http:\/\/www.sevenson.com.au\/actionscript\/sat\/", "display_url" : "sevenson.com.au\/actionscript\/s\u2026" } ] }, "geo" : { }, "id_str" : "458157497182740480", "text" : "Today I read several amazing articles on collision detection and then proceeded to ignore them. One of them: http:\/\/t.co\/EUOO1pXUDc #gamedev", "id" : 458157497182740480, "created_at" : "2014-04-21 08:17:14 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ { "text" : "gamedev", "indices" : [ 120, 128 ] } ], "urls" : [ ] }, "geo" : { }, "id_str" : "458156731143438336", "text" : "I never said:\n\"Well that collision detection was a breeze. I feel 100% confident that this function will always work.\" #gamedev", "id" : 458156731143438336, "created_at" : "2014-04-21 08:14:11 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Zoe Calton", "screen_name" : "ZoeAppleseed", "indices" : [ 3, 16 ], "id_str" : "2268581455", "id" : 2268581455 } ], "media" : [ { "expanded_url" : "http:\/\/twitter.com\/ZoeAppleseed\/status\/457824691546099712\/photo\/1", "indices" : [ 139, 140 ], "url" : "http:\/\/t.co\/Befbwjy4kr", "media_url" : "http:\/\/pbs.twimg.com\/media\/BlqFIZ2CEAEAk-k.jpg", "id_str" : "457824691554488321", "id" : 457824691554488321, "media_url_https" : "https:\/\/pbs.twimg.com\/media\/BlqFIZ2CEAEAk-k.jpg", "sizes" : [ { "h" : 225, "resize" : "fit", "w" : 400 }, { "h" : 150, "resize" : "crop", "w" : 150 }, { "h" : 191, "resize" : "fit", "w" : 340 }, { "h" : 225, "resize" : "fit", "w" : 400 }, { "h" : 225, "resize" : "fit", "w" : 400 } ], "display_url" : "pic.twitter.com\/Befbwjy4kr" } ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "457832656495849472", "text" : "RT @ZoeAppleseed: Walking in the park today i saw something shiny hidden on a tree,was a choc egg. Ate it. Some child missed out. http:\/\/t.\u2026", "retweeted_status" : { "source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ { "expanded_url" : "http:\/\/twitter.com\/ZoeAppleseed\/status\/457824691546099712\/photo\/1", "indices" : [ 112, 134 ], "url" : "http:\/\/t.co\/Befbwjy4kr", "media_url" : "http:\/\/pbs.twimg.com\/media\/BlqFIZ2CEAEAk-k.jpg", "id_str" : "457824691554488321", "id" : 457824691554488321, "media_url_https" : "https:\/\/pbs.twimg.com\/media\/BlqFIZ2CEAEAk-k.jpg", "sizes" : [ { "h" : 225, "resize" : "fit", "w" : 400 }, { "h" : 150, "resize" : "crop", "w" : 150 }, { "h" : 191, "resize" : "fit", "w" : 340 }, { "h" : 225, "resize" : "fit", "w" : 400 }, { "h" : 225, "resize" : "fit", "w" : 400 } ], "display_url" : "pic.twitter.com\/Befbwjy4kr" } ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "457824691546099712", "text" : "Walking in the park today i saw something shiny hidden on a tree,was a choc egg. Ate it. Some child missed out. http:\/\/t.co\/Befbwjy4kr", "id" : 457824691546099712, "created_at" : "2014-04-20 10:14:47 +0000", "user" : { "name" : "Zoe Calton", "screen_name" : "ZoeAppleseed", "protected" : false, "id_str" : "2268581455", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/577990416483545088\/mhOWEjUQ_normal.jpeg", "id" : 2268581455, "verified" : false } }, "id" : 457832656495849472, "created_at" : "2014-04-20 10:46:26 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "457796484121911296", "text" : "Hmmm, we could just use Maths?", "id" : 457796484121911296, "created_at" : "2014-04-20 08:22:41 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ { "text" : "gamedev", "indices" : [ 129, 137 ] } ], "urls" : [ ] }, "geo" : { }, "id_str" : "457702244591235072", "text" : "I've been using Entity Component Systems for the past month. And I \"get it\" now (phew!). Now working on making it less clumsy. #gamedev", "id" : 457702244591235072, "created_at" : "2014-04-20 02:08:13 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Siena Somerset", "screen_name" : "doktorgoogle", "indices" : [ 0, 13 ], "id_str" : "486414259", "id" : 486414259 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "457527807719899137", "geo" : { }, "id_str" : "457528180643864576", "in_reply_to_user_id" : 486414259, "text" : "@doktorgoogle No, but someone else must have, they drove down here soon after. All is quiet here again.", "id" : 457528180643864576, "in_reply_to_status_id" : 457527807719899137, "created_at" : "2014-04-19 14:36:33 +0000", "in_reply_to_screen_name" : "doktorgoogle", "in_reply_to_user_id_str" : "486414259", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Siena Somerset", "screen_name" : "doktorgoogle", "indices" : [ 0, 13 ], "id_str" : "486414259", "id" : 486414259 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "457523528854560768", "geo" : { }, "id_str" : "457523710228832256", "in_reply_to_user_id" : 486414259, "text" : "@doktorgoogle Bit rattled, but okay. It's not the first time. But I had never heard it so close.", "id" : 457523710228832256, "in_reply_to_status_id" : 457523528854560768, "created_at" : "2014-04-19 14:18:47 +0000", "in_reply_to_screen_name" : "doktorgoogle", "in_reply_to_user_id_str" : "486414259", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "457521853976686592", "text" : "Just heard a definite gunshot on my street. Don't know how to feel.", "id" : 457521853976686592, "created_at" : "2014-04-19 14:11:24 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/windows.microsoft.com\/\" rel=\"nofollow\"\u003EWindows 8\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Nathan Stapley", "screen_name" : "natelbagel", "indices" : [ 3, 14 ], "id_str" : "39097590", "id" : 39097590 } ], "media" : [ { "expanded_url" : "http:\/\/twitter.com\/natelbagel\/status\/456807669114748928\/photo\/1", "indices" : [ 59, 81 ], "url" : "http:\/\/t.co\/YqDz29zu7e", "media_url" : "http:\/\/pbs.twimg.com\/media\/BlboJvvIIAA2jKk.jpg", "id_str" : "456807666355281920", "id" : 456807666355281920, "media_url_https" : "https:\/\/pbs.twimg.com\/media\/BlboJvvIIAA2jKk.jpg", "sizes" : [ { "h" : 453, "resize" : "fit", "w" : 340 }, { "h" : 1024, "resize" : "fit", "w" : 768 }, { "h" : 150, "resize" : "crop", "w" : 150 }, { "h" : 800, "resize" : "fit", "w" : 600 }, { "h" : 1024, "resize" : "fit", "w" : 768 } ], "display_url" : "pic.twitter.com\/YqDz29zu7e" } ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "456954407864000513", "text" : "RT @natelbagel: Love these olde time-y Robert Henri tweets http:\/\/t.co\/YqDz29zu7e", "retweeted_status" : { "source" : "\u003Ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003ETwitter for iPhone\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ { "expanded_url" : "http:\/\/twitter.com\/natelbagel\/status\/456807669114748928\/photo\/1", "indices" : [ 43, 65 ], "url" : "http:\/\/t.co\/YqDz29zu7e", "media_url" : "http:\/\/pbs.twimg.com\/media\/BlboJvvIIAA2jKk.jpg", "id_str" : "456807666355281920", "id" : 456807666355281920, "media_url_https" : "https:\/\/pbs.twimg.com\/media\/BlboJvvIIAA2jKk.jpg", "sizes" : [ { "h" : 453, "resize" : "fit", "w" : 340 }, { "h" : 1024, "resize" : "fit", "w" : 768 }, { "h" : 150, "resize" : "crop", "w" : 150 }, { "h" : 800, "resize" : "fit", "w" : 600 }, { "h" : 1024, "resize" : "fit", "w" : 768 } ], "display_url" : "pic.twitter.com\/YqDz29zu7e" } ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "456807669114748928", "text" : "Love these olde time-y Robert Henri tweets http:\/\/t.co\/YqDz29zu7e", "id" : 456807669114748928, "created_at" : "2014-04-17 14:53:30 +0000", "user" : { "name" : "Nathan Stapley", "screen_name" : "natelbagel", "protected" : false, "id_str" : "39097590", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/2810729873\/b752eb431b9f0c75da8843aa10b26479_normal.jpeg", "id" : 39097590, "verified" : false } }, "id" : 456954407864000513, "created_at" : "2014-04-18 00:36:35 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Zoe Calton", "screen_name" : "ZoeAppleseed", "indices" : [ 3, 16 ], "id_str" : "2268581455", "id" : 2268581455 } ], "media" : [ { "expanded_url" : "http:\/\/twitter.com\/ZoeAppleseed\/status\/456722535539691520\/photo\/1", "indices" : [ 26, 48 ], "url" : "http:\/\/t.co\/nlYERcKp4s", "media_url" : "http:\/\/pbs.twimg.com\/media\/BlaaueFCIAAw4xZ.jpg", "id_str" : "456722535363518464", "id" : 456722535363518464, "media_url_https" : "https:\/\/pbs.twimg.com\/media\/BlaaueFCIAAw4xZ.jpg", "sizes" : [ { "h" : 1024, "resize" : "fit", "w" : 1536 }, { "h" : 150, "resize" : "crop", "w" : 150 }, { "h" : 682, "resize" : "fit", "w" : 1024 }, { "h" : 226, "resize" : "fit", "w" : 340 }, { "h" : 400, "resize" : "fit", "w" : 600 } ], "display_url" : "pic.twitter.com\/nlYERcKp4s" } ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "456768026977636352", "text" : "RT @ZoeAppleseed: amazing http:\/\/t.co\/nlYERcKp4s", "retweeted_status" : { "source" : "\u003Ca href=\"http:\/\/www.apple.com\/\" rel=\"nofollow\"\u003EOS X\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ { "expanded_url" : "http:\/\/twitter.com\/ZoeAppleseed\/status\/456722535539691520\/photo\/1", "indices" : [ 8, 30 ], "url" : "http:\/\/t.co\/nlYERcKp4s", "media_url" : "http:\/\/pbs.twimg.com\/media\/BlaaueFCIAAw4xZ.jpg", "id_str" : "456722535363518464", "id" : 456722535363518464, "media_url_https" : "https:\/\/pbs.twimg.com\/media\/BlaaueFCIAAw4xZ.jpg", "sizes" : [ { "h" : 1024, "resize" : "fit", "w" : 1536 }, { "h" : 150, "resize" : "crop", "w" : 150 }, { "h" : 682, "resize" : "fit", "w" : 1024 }, { "h" : 226, "resize" : "fit", "w" : 340 }, { "h" : 400, "resize" : "fit", "w" : 600 } ], "display_url" : "pic.twitter.com\/nlYERcKp4s" } ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "456722535539691520", "text" : "amazing http:\/\/t.co\/nlYERcKp4s", "id" : 456722535539691520, "created_at" : "2014-04-17 09:15:12 +0000", "user" : { "name" : "Zoe Calton", "screen_name" : "ZoeAppleseed", "protected" : false, "id_str" : "2268581455", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/577990416483545088\/mhOWEjUQ_normal.jpeg", "id" : 2268581455, "verified" : false } }, "id" : 456768026977636352, "created_at" : "2014-04-17 12:15:58 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Zoe Calton", "screen_name" : "ZoeAppleseed", "indices" : [ 0, 13 ], "id_str" : "2268581455", "id" : 2268581455 }, { "name" : "Zoe Calton", "screen_name" : "ZoeAppleseed", "indices" : [ 80, 93 ], "id_str" : "2268581455", "id" : 2268581455 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "456714271951310848", "in_reply_to_user_id" : 2268581455, "text" : "@ZoeAppleseed: \"All geniuses are crazy\"\rMe: \"Not all crazy people are geniuses\"\r@ZoeAppleseed: \"Not all of them.\"", "id" : 456714271951310848, "created_at" : "2014-04-17 08:42:22 +0000", "in_reply_to_screen_name" : "ZoeAppleseed", "in_reply_to_user_id_str" : "2268581455", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Jonathan Blow", "screen_name" : "Jonathan_Blow", "indices" : [ 0, 14 ], "id_str" : "107336879", "id" : 107336879 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ { "indices" : [ 102, 124 ], "url" : "http:\/\/t.co\/lwuXnmUvgw", "expanded_url" : "http:\/\/blogs.msdn.com\/b\/b8\/archive\/2011\/10\/11\/reflecting-on-your-comments-on-the-start-screen.aspx", "display_url" : "blogs.msdn.com\/b\/b8\/archive\/2\u2026" } ] }, "in_reply_to_status_id_str" : "456463920232820736", "geo" : { }, "id_str" : "456601026678640641", "in_reply_to_user_id" : 107336879, "text" : "@Jonathan_Blow \nThe relative positioning and color of neighbouring tiles are useful for recognition.\n\nhttp:\/\/t.co\/lwuXnmUvgw", "id" : 456601026678640641, "in_reply_to_status_id" : 456463920232820736, "created_at" : "2014-04-17 01:12:22 +0000", "in_reply_to_screen_name" : "Jonathan_Blow", "in_reply_to_user_id_str" : "107336879", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "456575766612828161", "text" : "I wish javascript unicode supported superscripts. So I could write A\u00B2 instead of Math.pow(A,2)", "id" : 456575766612828161, "created_at" : "2014-04-16 23:32:00 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "satya krishna kumar ", "screen_name" : "satya0206", "indices" : [ 0, 10 ], "id_str" : "871395517", "id" : 871395517 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "456317166267015169", "geo" : { }, "id_str" : "456355496589393920", "in_reply_to_user_id" : 871395517, "text" : "@satya0206 will try it out again tomorrow. But I installed it only today. Thanks", "id" : 456355496589393920, "in_reply_to_status_id" : 456317166267015169, "created_at" : "2014-04-16 08:56:43 +0000", "in_reply_to_screen_name" : "satya0206", "in_reply_to_user_id_str" : "871395517", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "456302857457655808", "text" : "Also shocked how good the developer tools are in IE11. Really shocked.", "id" : 456302857457655808, "created_at" : "2014-04-16 05:27:33 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "456302633246932992", "text" : "I've been testing mass uploads on IE11, Firefox and Chrome. IE stayed responsive throughout. Every other browser crashed repeatedly.", "id" : 456302633246932992, "created_at" : "2014-04-16 05:26:40 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "455695188933885952", "text" : "Watched the iTunes festival (seriously?) Soundgarden performance. And then compared it to their 92 Pinkpop performance. Depressed me.", "id" : 455695188933885952, "created_at" : "2014-04-14 13:12:54 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/windows.microsoft.com\/\" rel=\"nofollow\"\u003EWindows 8\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "455682708799512576", "text" : "Imagine if your birthday was on April 1st. So many cruel jokes would ensue.", "id" : 455682708799512576, "created_at" : "2014-04-14 12:23:18 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ { "indices" : [ 112, 135 ], "url" : "https:\/\/t.co\/IynFB38NIc", "expanded_url" : "https:\/\/www.youtube.com\/watch?v=4F2nPh-6Hxk", "display_url" : "youtube.com\/watch?v=4F2nPh\u2026" } ] }, "geo" : { }, "id_str" : "455557949398597632", "text" : "The fascinating story of a US citizen assassinated by an obama ordered drone strike. There was no indictment.\n\nhttps:\/\/t.co\/IynFB38NIc", "id" : 455557949398597632, "created_at" : "2014-04-14 04:07:33 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Anonymous", "screen_name" : "YourAnonNews", "indices" : [ 3, 16 ], "id_str" : "279390084", "id" : 279390084 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "455545382047457281", "text" : "RT @YourAnonNews: Every day this week days is gonna be the same backwards:\n\n4\/13\/14\n4\/14\/14\n4\/15\/14\n4\/16\/14\n4\/17\/14\n4\/18\/14\n4\/19\/14", "retweeted_status" : { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "455525582596370433", "text" : "Every day this week days is gonna be the same backwards:\n\n4\/13\/14\n4\/14\/14\n4\/15\/14\n4\/16\/14\n4\/17\/14\n4\/18\/14\n4\/19\/14", "id" : 455525582596370433, "created_at" : "2014-04-14 01:58:56 +0000", "user" : { "name" : "Anonymous", "screen_name" : "YourAnonNews", "protected" : false, "id_str" : "279390084", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/583484761991163904\/5A7vJJD3_normal.png", "id" : 279390084, "verified" : false } }, "id" : 455545382047457281, "created_at" : "2014-04-14 03:17:37 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/windows.microsoft.com\/\" rel=\"nofollow\"\u003EWindows 8\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "adam", "screen_name" : "ADAMATOMIC", "indices" : [ 0, 11 ], "id_str" : "70587360", "id" : 70587360 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "455367594019536896", "geo" : { }, "id_str" : "455541687419301888", "in_reply_to_user_id" : 70587360, "text" : "@ADAMATOMIC That was a brilliant read. Thanks.", "id" : 455541687419301888, "in_reply_to_status_id" : 455367594019536896, "created_at" : "2014-04-14 03:02:56 +0000", "in_reply_to_screen_name" : "ADAMATOMIC", "in_reply_to_user_id_str" : "70587360", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/windows.microsoft.com\/\" rel=\"nofollow\"\u003EWindows 8\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "adam", "screen_name" : "ADAMATOMIC", "indices" : [ 3, 14 ], "id_str" : "70587360", "id" : 70587360 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ { "indices" : [ 90, 112 ], "url" : "http:\/\/t.co\/zqZFWGfMEq", "expanded_url" : "http:\/\/NYTimes.com", "display_url" : "NYTimes.com" }, { "indices" : [ 113, 135 ], "url" : "http:\/\/t.co\/PgvEyzy5AP", "expanded_url" : "http:\/\/www.nytimes.com\/2014\/04\/06\/magazine\/flash-boys-michael-lewis.html", "display_url" : "nytimes.com\/2014\/04\/06\/mag\u2026" } ] }, "geo" : { }, "id_str" : "455536696570834944", "text" : "RT @ADAMATOMIC: An Adaptation From \u2018Flash Boys: A Wall Street Revolt,\u2019 by Michael Lewis - http:\/\/t.co\/zqZFWGfMEq http:\/\/t.co\/PgvEyzy5AP AMA\u2026", "retweeted_status" : { "source" : "\u003Ca href=\"http:\/\/tapbots.com\/tweetbot\" rel=\"nofollow\"\u003ETweetbot for iOS\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ { "indices" : [ 74, 96 ], "url" : "http:\/\/t.co\/zqZFWGfMEq", "expanded_url" : "http:\/\/NYTimes.com", "display_url" : "NYTimes.com" }, { "indices" : [ 97, 119 ], "url" : "http:\/\/t.co\/PgvEyzy5AP", "expanded_url" : "http:\/\/www.nytimes.com\/2014\/04\/06\/magazine\/flash-boys-michael-lewis.html", "display_url" : "nytimes.com\/2014\/04\/06\/mag\u2026" } ] }, "geo" : { }, "id_str" : "455367594019536896", "text" : "An Adaptation From \u2018Flash Boys: A Wall Street Revolt,\u2019 by Michael Lewis - http:\/\/t.co\/zqZFWGfMEq http:\/\/t.co\/PgvEyzy5AP AMAZING story, wow", "id" : 455367594019536896, "created_at" : "2014-04-13 15:31:09 +0000", "user" : { "name" : "adam", "screen_name" : "ADAMATOMIC", "protected" : false, "id_str" : "70587360", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/583782677561507840\/w_Y9WDjX_normal.jpg", "id" : 70587360, "verified" : false } }, "id" : 455536696570834944, "created_at" : "2014-04-14 02:43:06 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/windows.microsoft.com\/\" rel=\"nofollow\"\u003EWindows 8\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "455521073644060673", "text" : "Sometimes having a Surface Pro is like a bionic arm that can reach so far into the future that the things it retrieves are often useless.", "id" : 455521073644060673, "created_at" : "2014-04-14 01:41:01 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Paolo Pedercini", "screen_name" : "molleindustria", "indices" : [ 0, 15 ], "id_str" : "173155110", "id" : 173155110 }, { "name" : "Sync.com", "screen_name" : "Sync", "indices" : [ 46, 51 ], "id_str" : "551224728", "id" : 551224728 }, { "name" : "Dropbox", "screen_name" : "Dropbox", "indices" : [ 105, 113 ], "id_str" : "14749606", "id" : 14749606 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "455347393681440768", "geo" : { }, "id_str" : "455503939501166592", "in_reply_to_user_id" : 173155110, "text" : "@molleindustria Good to know. Do you know if @sync has an API? I couldn't see it on their site. I use @Dropbox's API, and it is superb.", "id" : 455503939501166592, "in_reply_to_status_id" : 455347393681440768, "created_at" : "2014-04-14 00:32:56 +0000", "in_reply_to_screen_name" : "molleindustria", "in_reply_to_user_id_str" : "173155110", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Jeremy Ashkenas", "screen_name" : "jashkenas", "indices" : [ 3, 13 ], "id_str" : "123323498", "id" : 123323498 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ { "indices" : [ 88, 111 ], "url" : "https:\/\/t.co\/JE70CuLg9x", "expanded_url" : "https:\/\/github.com\/groupon\/cson-safe", "display_url" : "github.com\/groupon\/cson-s\u2026" } ] }, "geo" : { }, "id_str" : "455207362790313984", "text" : "RT @jashkenas: Nifty! Groupon used CoffeeScriptRedux to implement a \u201CCSON-Safe\u201D parser: https:\/\/t.co\/JE70CuLg9x\n\n... making CSON a real for\u2026", "retweeted_status" : { "source" : "\u003Ca href=\"http:\/\/tapbots.com\/software\/tweetbot\/mac\" rel=\"nofollow\"\u003ETw\u0435\u0435tbot for Mac\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ { "indices" : [ 73, 96 ], "url" : "https:\/\/t.co\/JE70CuLg9x", "expanded_url" : "https:\/\/github.com\/groupon\/cson-safe", "display_url" : "github.com\/groupon\/cson-s\u2026" } ] }, "geo" : { }, "id_str" : "454738760010563584", "text" : "Nifty! Groupon used CoffeeScriptRedux to implement a \u201CCSON-Safe\u201D parser: https:\/\/t.co\/JE70CuLg9x\n\n... making CSON a real format, finally.", "id" : 454738760010563584, "created_at" : "2014-04-11 21:52:23 +0000", "user" : { "name" : "Jeremy Ashkenas", "screen_name" : "jashkenas", "protected" : false, "id_str" : "123323498", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/436965007981420544\/JGJx90PF_normal.jpeg", "id" : 123323498, "verified" : false } }, "id" : 455207362790313984, "created_at" : "2014-04-13 04:54:27 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Michael Pollan", "screen_name" : "michaelpollan", "indices" : [ 0, 14 ], "id_str" : "24223641", "id" : 24223641 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "455198172898287616", "in_reply_to_user_id" : 24223641, "text" : "@michaelpollan saying: unsaturated fat is healthy, but bad for bread because it is oxidises.\r\rBut it is carcinogenic for this same reason.", "id" : 455198172898287616, "created_at" : "2014-04-13 04:17:56 +0000", "in_reply_to_screen_name" : "michaelpollan", "in_reply_to_user_id_str" : "24223641", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "455191724348809216", "text" : "I'm sitting on a disassembled couch. Surprisingly comfortable.", "id" : 455191724348809216, "created_at" : "2014-04-13 03:52:18 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Casey Muratori", "screen_name" : "cmuratori", "indices" : [ 16, 26 ], "id_str" : "26452299", "id" : 26452299 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "455170555579482112", "geo" : { }, "id_str" : "455190908183384064", "in_reply_to_user_id" : 355958960, "text" : "@PizzaTheHutEsq @cmuratori Because they are the winners.", "id" : 455190908183384064, "in_reply_to_status_id" : 455170555579482112, "created_at" : "2014-04-13 03:49:04 +0000", "in_reply_to_screen_name" : "DogDisruption", "in_reply_to_user_id_str" : "355958960", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "455176116777390080", "text" : "I thought Melbourne had a different spirit to Sydney. But it is the same cynical, fraudulent facade, just with a fresh coat of paint.", "id" : 455176116777390080, "created_at" : "2014-04-13 02:50:17 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "455162168162279424", "text" : "Please don't link your twitter accounts with Facebook, Instagram etc. I don't want to go to an external site to read the rest of your post.", "id" : 455162168162279424, "created_at" : "2014-04-13 01:54:52 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Paolo Pedercini", "screen_name" : "molleindustria", "indices" : [ 0, 15 ], "id_str" : "173155110", "id" : 173155110 }, { "name" : "Dropbox", "screen_name" : "Dropbox", "indices" : [ 16, 24 ], "id_str" : "14749606", "id" : 14749606 }, { "name" : "Sync.com", "screen_name" : "Sync", "indices" : [ 94, 99 ], "id_str" : "551224728", "id" : 551224728 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "454651782342651904", "geo" : { }, "id_str" : "455140718932000769", "in_reply_to_user_id" : 173155110, "text" : "@molleindustria @Dropbox \rI'd switch too, but I have never found a comparable service. Does @sync have _direct_ links to hosted files?", "id" : 455140718932000769, "in_reply_to_status_id" : 454651782342651904, "created_at" : "2014-04-13 00:29:38 +0000", "in_reply_to_screen_name" : "molleindustria", "in_reply_to_user_id_str" : "173155110", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "454984888538509312", "text" : "Bacteria have the most beautiful names.", "id" : 454984888538509312, "created_at" : "2014-04-12 14:10:25 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "454887530261786624", "text" : "Someone tweeted using all sorts of useless shorthand and then adding phrases like \"imho\". I rewrote their tweet and nearly sent it to them.", "id" : 454887530261786624, "created_at" : "2014-04-12 07:43:33 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "jon klassen", "screen_name" : "burstofbeaden", "indices" : [ 3, 17 ], "id_str" : "64783035", "id" : 64783035 } ], "media" : [ { "expanded_url" : "http:\/\/twitter.com\/burstofbeaden\/status\/454770010066415616\/photo\/1", "indices" : [ 92, 114 ], "url" : "http:\/\/t.co\/PKuzOrfLY4", "media_url" : "http:\/\/pbs.twimg.com\/media\/Bk-q46UCcAA7KOv.jpg", "id_str" : "454769982090407936", "id" : 454769982090407936, "media_url_https" : "https:\/\/pbs.twimg.com\/media\/Bk-q46UCcAA7KOv.jpg", "sizes" : [ { "h" : 255, "resize" : "fit", "w" : 340 }, { "h" : 150, "resize" : "crop", "w" : 150 }, { "h" : 612, "resize" : "fit", "w" : 816 }, { "h" : 450, "resize" : "fit", "w" : 600 }, { "h" : 612, "resize" : "fit", "w" : 816 } ], "display_url" : "pic.twitter.com\/PKuzOrfLY4" } ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "454788330844983297", "text" : "RT @burstofbeaden: gap-face Samuel Beckett's been making things weird in here all afternoon http:\/\/t.co\/PKuzOrfLY4", "retweeted_status" : { "source" : "\u003Ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003ETwitter for Android\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ { "expanded_url" : "http:\/\/twitter.com\/burstofbeaden\/status\/454770010066415616\/photo\/1", "indices" : [ 73, 95 ], "url" : "http:\/\/t.co\/PKuzOrfLY4", "media_url" : "http:\/\/pbs.twimg.com\/media\/Bk-q46UCcAA7KOv.jpg", "id_str" : "454769982090407936", "id" : 454769982090407936, "media_url_https" : "https:\/\/pbs.twimg.com\/media\/Bk-q46UCcAA7KOv.jpg", "sizes" : [ { "h" : 255, "resize" : "fit", "w" : 340 }, { "h" : 150, "resize" : "crop", "w" : 150 }, { "h" : 612, "resize" : "fit", "w" : 816 }, { "h" : 450, "resize" : "fit", "w" : 600 }, { "h" : 612, "resize" : "fit", "w" : 816 } ], "display_url" : "pic.twitter.com\/PKuzOrfLY4" } ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "454770010066415616", "text" : "gap-face Samuel Beckett's been making things weird in here all afternoon http:\/\/t.co\/PKuzOrfLY4", "id" : 454770010066415616, "created_at" : "2014-04-11 23:56:34 +0000", "user" : { "name" : "jon klassen", "screen_name" : "burstofbeaden", "protected" : false, "id_str" : "64783035", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/561269982286188544\/uxJ4krnr_normal.jpeg", "id" : 64783035, "verified" : false } }, "id" : 454788330844983297, "created_at" : "2014-04-12 01:09:22 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "454037915597676544", "text" : "I wish github\/bitbucket\/etc issues were stored on the repo. A lot of lost information if you need to move the repo off hosting.", "id" : 454037915597676544, "created_at" : "2014-04-09 23:27:29 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Brandon Dillon", "screen_name" : "Noughtceratops", "indices" : [ 0, 15 ], "id_str" : "14477443", "id" : 14477443 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "452696516314951680", "geo" : { }, "id_str" : "452940894711205890", "in_reply_to_user_id" : 14477443, "text" : "@Noughtceratops That was so therapeutic. I need more!", "id" : 452940894711205890, "in_reply_to_status_id" : 452696516314951680, "created_at" : "2014-04-06 22:48:19 +0000", "in_reply_to_screen_name" : "Noughtceratops", "in_reply_to_user_id_str" : "14477443", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "452664755786743808", "text" : "I keep trying to wipe sunlight off of my leg.", "id" : 452664755786743808, "created_at" : "2014-04-06 04:31:02 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ { "text" : "gamedev", "indices" : [ 24, 32 ] } ], "urls" : [ ] }, "geo" : { }, "id_str" : "452609270769389568", "text" : "It's always collision.\n\n#gamedev", "id" : 452609270769389568, "created_at" : "2014-04-06 00:50:33 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "452441713286463489", "text" : "It's not amazing how much code you can change without changing a single end result. It is amazing how excited a programmer gets about it.", "id" : 452441713286463489, "created_at" : "2014-04-05 13:44:45 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "452416764903559168", "geo" : { }, "id_str" : "452417875404275712", "in_reply_to_user_id" : 2351661865, "text" : "@AlobarNon I'm using a Hash so retrieving components by type is quite fast. I'll optimize if it slows down though. Thanks for the help :)", "id" : 452417875404275712, "in_reply_to_status_id" : 452416764903559168, "created_at" : "2014-04-05 12:10:01 +0000", "in_reply_to_screen_name" : "bora_kasap", "in_reply_to_user_id_str" : "2351661865", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "452415195588354048", "geo" : { }, "id_str" : "452415785957224450", "in_reply_to_user_id" : 2351661865, "text" : "@AlobarNon Modularity and iteration as opposed to performance. I've since realised that each collision reaction is just another system.", "id" : 452415785957224450, "in_reply_to_status_id" : 452415195588354048, "created_at" : "2014-04-05 12:01:43 +0000", "in_reply_to_screen_name" : "bora_kasap", "in_reply_to_user_id_str" : "2351661865", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Eli Brody", "screen_name" : "elibrody", "indices" : [ 0, 9 ], "id_str" : "9969582", "id" : 9969582 }, { "name" : "Gal Pasternak", "screen_name" : "galman33", "indices" : [ 10, 19 ], "id_str" : "35447386", "id" : 35447386 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "452377587248267264", "geo" : { }, "id_str" : "452377907566886912", "in_reply_to_user_id" : 9969582, "text" : "@elibrody @galman33 Haha thanks Eli! Hook me up with the info!\uD83D\uDE0A", "id" : 452377907566886912, "in_reply_to_status_id" : 452377587248267264, "created_at" : "2014-04-05 09:31:12 +0000", "in_reply_to_screen_name" : "elibrody", "in_reply_to_user_id_str" : "9969582", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ { "text" : "gamedev", "indices" : [ 90, 98 ] }, { "text" : "ld48", "indices" : [ 99, 104 ] } ], "urls" : [ ] }, "geo" : { }, "id_str" : "452376487862087680", "text" : "Are there any component entity system people I could talk to out there? Via email or DM? #gamedev #ld48", "id" : 452376487862087680, "created_at" : "2014-04-05 09:25:34 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "452330511550005248", "geo" : { }, "id_str" : "452372004851552256", "in_reply_to_user_id" : 2351661865, "text" : "@AlobarNon I was thinking the same thing. But isn't that glue code non-reusable? Should there be different systems for various reactions?", "id" : 452372004851552256, "in_reply_to_status_id" : 452330511550005248, "created_at" : "2014-04-05 09:07:45 +0000", "in_reply_to_screen_name" : "bora_kasap", "in_reply_to_user_id_str" : "2351661865", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ { "text" : "gamedev", "indices" : [ 110, 118 ] } ], "urls" : [ ] }, "geo" : { }, "id_str" : "452319272375549952", "text" : "If you want custom reactions to various collisions in a component entity system, where do you put that logic? #gamedev", "id" : 452319272375549952, "created_at" : "2014-04-05 05:38:12 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Siena Somerset", "screen_name" : "doktorgoogle", "indices" : [ 0, 13 ], "id_str" : "486414259", "id" : 486414259 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "452034001432084481", "geo" : { }, "id_str" : "452317191191289856", "in_reply_to_user_id" : 486414259, "text" : "@doktorgoogle usually 3 or 4.", "id" : 452317191191289856, "in_reply_to_status_id" : 452034001432084481, "created_at" : "2014-04-05 05:29:56 +0000", "in_reply_to_screen_name" : "doktorgoogle", "in_reply_to_user_id_str" : "486414259", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Siena Somerset", "screen_name" : "doktorgoogle", "indices" : [ 0, 13 ], "id_str" : "486414259", "id" : 486414259 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "452281746071887872", "geo" : { }, "id_str" : "452312196265943041", "in_reply_to_user_id" : 486414259, "text" : "@doktorgoogle I love them! Aren't they the ones that wrote that song about the \"good good good guys?\"", "id" : 452312196265943041, "in_reply_to_status_id" : 452281746071887872, "created_at" : "2014-04-05 05:10:05 +0000", "in_reply_to_screen_name" : "doktorgoogle", "in_reply_to_user_id_str" : "486414259", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "452284227057238016", "text" : "EU investigates the monopoly of Zombies &amp; brain consumption. \n\"Not only Zombies need more brains. Europeans needs brains too.\"", "id" : 452284227057238016, "created_at" : "2014-04-05 03:18:57 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ { "indices" : [ 55, 78 ], "url" : "https:\/\/t.co\/HzzxaGijHp", "expanded_url" : "https:\/\/www.nytimes.com\/books\/first\/p\/pendergrast-grounds.html", "display_url" : "nytimes.com\/books\/first\/p\/\u2026" } ] }, "geo" : { }, "id_str" : "452281635577163776", "text" : "The cultural and historical significance of coffee. \n https:\/\/t.co\/HzzxaGijHp", "id" : 452281635577163776, "created_at" : "2014-04-05 03:08:39 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "Siena Somerset", "screen_name" : "doktorgoogle", "indices" : [ 0, 13 ], "id_str" : "486414259", "id" : 486414259 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "452279958270795776", "geo" : { }, "id_str" : "452280775694487552", "in_reply_to_user_id" : 486414259, "text" : "@doktorgoogle Thanks but I wasn't actually in the mood for choc, just stating how my brain is polluted with corporate corrupted melodies.", "id" : 452280775694487552, "in_reply_to_status_id" : 452279958270795776, "created_at" : "2014-04-05 03:05:14 +0000", "in_reply_to_screen_name" : "doktorgoogle", "in_reply_to_user_id_str" : "486414259", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "452277152696643584", "text" : "Gorilla'd cheese on toast.", "id" : 452277152696643584, "created_at" : "2014-04-05 02:50:50 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "452276448787587073", "text" : "\uD83C\uDFB5 Wouldn't it be nice if my brain was brain washed \uD83C\uDFB5\rHmmm for some reason I really feel like some Cadbury Dairy Milk Chocolate.", "id" : 452276448787587073, "created_at" : "2014-04-05 02:48:02 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ { "name" : "MRS. NESBITT GAMES", "screen_name" : "UdellGames", "indices" : [ 0, 11 ], "id_str" : "1609105514", "id" : 1609105514 } ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_status_id_str" : "452059050927464448", "geo" : { }, "id_str" : "452059189326934016", "in_reply_to_user_id" : 1609105514, "text" : "@UdellGames Thanks I'll check it out.", "id" : 452059189326934016, "in_reply_to_status_id" : 452059050927464448, "created_at" : "2014-04-04 12:24:44 +0000", "in_reply_to_screen_name" : "UdellGames", "in_reply_to_user_id_str" : "1609105514", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ { "text" : "gamedev", "indices" : [ 74, 82 ] } ], "urls" : [ ] }, "geo" : { }, "id_str" : "452057728945364992", "text" : "Finding it really hard to get my head around Component Entity Systems. \n\n#gamedev", "id" : 452057728945364992, "created_at" : "2014-04-04 12:18:56 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "451823093082636290", "text" : "Literally woke up to Jackhammers this morning at 7:30am. Went down to talk to them. They said they are allowed to start at 7!?", "id" : 451823093082636290, "created_at" : "2014-04-03 20:46:34 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ { "indices" : [ 115, 137 ], "url" : "http:\/\/t.co\/hO6s2Jm7J7", "expanded_url" : "http:\/\/cbpowell.wordpress.com\/2012\/10\/30\/entity-component-game-programming-using-jruby-and-libgdx-part-1\/", "display_url" : "cbpowell.wordpress.com\/2012\/10\/30\/ent\u2026" } ] }, "geo" : { }, "id_str" : "451673694025179136", "text" : "Trying out a component, entity, system instead of OOP. Mind was blown. Seeing where it goes. \n\nThis was my ref:\nhttp:\/\/t.co\/hO6s2Jm7J7", "id" : 451673694025179136, "created_at" : "2014-04-03 10:52:55 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "451672260391079937", "text" : "I hate when people say 'much?' at the end of sentences. Annoying much?", "id" : 451672260391079937, "created_at" : "2014-04-03 10:47:13 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "451665411755347968", "text" : "Credit card surcharges make sense. They have to move all those zeros and ones around the ENTIRE PLANET! $7.50 is a very reasonable fee.", "id" : 451665411755347968, "created_at" : "2014-04-03 10:20:00 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ { "text" : "gamedev", "indices" : [ 18, 26 ] } ], "urls" : [ ] }, "geo" : { }, "id_str" : "451325515006095360", "text" : "I love triangles! #gamedev", "id" : 451325515006095360, "created_at" : "2014-04-02 11:49:22 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ { "text" : "gamedev", "indices" : [ 94, 102 ] } ], "urls" : [ ] }, "geo" : { }, "id_str" : "450939298838114304", "text" : "I've got a shaking black square on a larger grey square. Now I am really, _really_ excited. #gamedev", "id" : 450939298838114304, "created_at" : "2014-04-01 10:14:41 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ { "text" : "gamedev", "indices" : [ 77, 85 ] } ], "urls" : [ ] }, "geo" : { }, "id_str" : "450917624717647872", "text" : "All I've got is a grey square on the screen so far. But I am very excited! #gamedev", "id" : 450917624717647872, "created_at" : "2014-04-01 08:48:34 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } }, { "source" : "\u003Ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003ETweetDeck\u003C\/a\u003E", "entities" : { "user_mentions" : [ ], "media" : [ ], "hashtags" : [ ], "urls" : [ ] }, "geo" : { }, "id_str" : "450619144312856576", "text" : "Tried to go to sleep but just discovered the Entity,Component,System pattern and I am kind of excited!\nAnd my mind is so, so blown.", "id" : 450619144312856576, "created_at" : "2014-03-31 13:02:30 +0000", "user" : { "name" : "James Forbes", "screen_name" : "james_a_forbes", "protected" : false, "id_str" : "16025792", "profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg", "id" : 16025792, "verified" : false } } ]
import React, { useState } from "react"; import Validator from "validator"; import PasswordValidator from "password-validator"; import { Button, Form } from "react-bootstrap"; import { Link, useHistory } from "react-router-dom"; const validatepassword = new PasswordValidator(); validatepassword .is() .min(6) .is() .max(20) .has() .uppercase() .has() .lowercase() .has() .digits() .has() .not() .spaces(); export const validate = (data) => { const errors = {}; if (data.username.length < 3) errors.username = "username must be at least 3 characters"; if (Validator.isNumeric(data.username)) errors.username = "username can't be numbers"; if (!Validator.isAlphanumeric(data.username)) errors.username = "username can only contain letters and numbers"; if (!Validator.isEmail(data.email) || Validator.isEmpty(data.email)) errors.email = "please provide a valid email"; if (Validator.isEmpty(data.password)) errors.password = "Password can't be blank"; if (!validatepassword.validate(data.password)) errors.password = "password should not have spaces, must be more than 6 characters contain numbers and both lower and uppercase letters"; if (!Validator.equals(data.password, data.conPassword)) errors.password = "passwords do not match"; return errors; }; const formInputstyle = { color: "white", fontSize: "15px", letterspacing: "1px", }; const SignupForm = () => { const [user, setUser] = useState({ username: "", email: "", password: "", conPassword: "", }); const [errors, setErrors] = useState({}); const [loading, setLoading] = useState(false); // const reg = useSelector((state) => state.reg); // const dispatch = useDispatch(); const history = useHistory(); const onChange = (e) => { setUser((prev) => ({ ...prev, [e.target.name]: e.target.value })); }; const handleSubmit = (e) => { e.preventDefault(); console.log(); // const errors = validate(user); // setErrors({ errors }); // if (Object.keys(errors).length === 0) { // try { // setLoading(true); // dispatch(userRegister(user)); // history.push('/auth/login'); // } catch (err) { // if (err.request.status === 500) { // setErrors({ // message: 'Service is unavailable, please try again later' // }); // setLoading(false); // } else { // setErrors({ errors: err.response.data }); // } // } // } }; return ( <div id="backgroundimg"> <div className="ui grid"> <div className="five wide column" /> <div className="six wide column formBackground"> <h1>Signup Page</h1> <Form onSubmit={handleSubmit}> <Form.Group className="mb-3" controlId="formBasicUsername"> <Form.Label>Username</Form.Label> <Form.Control id="userSign" name="username" value={user.username} type="text" placeholder="Enter username" onChange={onChange} /> {/* {errors.username && <p message={errors.username} ></p>} */} </Form.Group> <Form.Group className="mb-3" controlId="formBasicEmail"> <Form.Label>Email address</Form.Label> <Form.Control id="signupEmail" name="email" value={user.email} type="email" placeholder="Enter email" onChange={onChange} /> {errors.email && <p message={errors.email}></p>} </Form.Group> <Form.Group className="mb-3" controlId="formBasicPassword"> <Form.Label>Password</Form.Label> <Form.Control id="signupPass" name="password" value={user.password} type="password" placeholder="Password" onChange={onChange} /> {errors.password && <p message={errors.password}></p>} </Form.Group> <Form.Group className="mb-3" controlId="formBasicCnPassword"> <Form.Label>Confirm Password</Form.Label> <Form.Control id="conPass" name="conPassword" value={user.conPassword} type="password" placeholder="Password" onChange={onChange} /> </Form.Group> <Button variant="primary" type="submit" id="signupSubmit"> Submit </Button> <p style={formInputstyle}> Already registered? <Link className="auth" to="/auth/login"> Login </Link> </p> </Form> </div> </div> </div> ); }; export default SignupForm;
$(document).ready(function() { // VARIABlES // ======================================================================================================= var number; var intervalID; var questionsArray = [ "How many times has Liverpool won the Champions League?", "When was the last time Liverpool won the English Premier League?", "How many times has Liverpool won the English Premier League?", "Who has the most first-team goals for Liverpool?", "When did 'You'll Never Walk Alone' become Liverpool's anthem?" ]; var index = 0; var answers = [ ["5 Times", "2 Times", "7 Times", "1 Time"], ["2009", "2013", "1990", "1997"], ["3 Times", "18 Times", "9 Times", "12 Times"], ["Steven Gerrard", "Ian Rush", "Kenny Dalglish", "Robbie Fowler"], ["1949", "1969", "1955", "1962"], ["5 Times", "1990", "18 Times", "Ian Rush", "1962"] ]; var gifArray = [ "https://media.giphy.com/media/l0Iy294JIZv3s2FEs/giphy.gif", "assets/images/dalglish.gif", "assets/images/1990.jpeg", "assets/images/ianrush.gif", "assets/images/scarves.jpeg", "https://media.giphy.com/media/6Wqg7wOTcZnxK/giphy.gif" ]; var correctAnswers = 0; // FUNCTIONS // ====================================================================================================== // New Question function: empties all DOM elements, appends new question, and calls the runTimer function to start the 15 second timer function newQuestion() { $(".click-btn").hide(); number = 16; question = questionsArray[index]; console.log(question); runTimer(); $(".image-display").empty(); $(".question-display") .empty() .append(questionsArray[index]); $("#answer-1") .empty() .append(answers[index][0]); $("#answer-2") .empty() .append(answers[index][1]); $("#answer-3") .empty() .append(answers[index][2]); $("#answer-4") .empty() .append(answers[index][3]); } // runTimer function: function runTimer() { clearInterval(intervalID); intervalID = setInterval(decrement, 1000); } // threeSeconds function: runs for 5 seconds between questions and displays images during that time function threeSeconds() { clearInterval(intervalID); var questionTimeout = setTimeout(newQuestion, 5000); $(".question-display").empty(); $("#answer-1").empty(); $("#answer-2").empty(); $("#answer-3").empty(); $("#answer-4").empty(); if (index < questionsArray.length - 1) { index++; } else { $(".time-display") .empty() .append( "That's the final whistle.<br> You put " + correctAnswers / 6 + " of 5 chances into the back of the net." ); clearTimeout(questionTimeout); } } function decrement() { number--; $(".time-display") .empty() .append("Time Remaining: " + number); if (number === 0) { // stop(); $(".time-display") .empty() .append("Time's Up- Please wait for the next question."); clearInterval(intervalID); threeSeconds(); } } // checkAnswer function- checks to see if user answer is correct - displays proper image depending if answer is right or wrong. function checkAnswer(num) { var clickAnswer = answers[index][num]; for (var i = 0; i <= answers[5].length; i++) { if (answers[5].indexOf(clickAnswer) === -1) { $(".time-display") .empty() .append("Are you a wool?"); $(".image-display") .empty() .append("<img src=" + gifArray[5] + " />"); } else { correctAnswers++; $(".time-display") .empty() .append("Boss Tha!"); $(".image-display") .empty() .append("<img src=" + gifArray[index] + " />"); } } } // MAIN PROCESS // ============================================================================================================ // click Start Button - kick off the game. $(".click-btn").on("click", function() { newQuestion(); }); // click Answer 1 $("#answer-1").on("click", function() { checkAnswer(0); threeSeconds(); }); // click Answer 2 $("#answer-2").on("click", function() { checkAnswer(1); threeSeconds(); }); // click Answer 3 $("#answer-3").on("click", function() { checkAnswer(2); threeSeconds(); }); // click Answer 4 $("#answer-4").on("click", function() { checkAnswer(3); threeSeconds(); }); });
function arrayOutput(arr) { for (let i = 0; i < arr.length; i++) { console.log(arr[i]); } console.log(arr.length); return; } module.exports = arrayOutput;
function getVideos(css, path, videoArray, index) { clearContent(); getVideo(css, path, videoArray, index); } async function getVideo(css, path, videoArray, index) { let video = loadBanner(css, path, videoArray, index); } function loadVideo(css, path, videoArray, index) { let url = path + videoArray[index].file; document.getElementById("resume").innerHTML += "<video id='vid" + index + "' class='ad' loop preload='none' width='" + videoArray[index].width + "' height='" + videoArray[index].height + "'>"+ "<source src='assets/banners/" + videoArray[index].file + "' type='video/mp4'>" + "Your browser does not support the video tag." + "</video>" + "<button id='button" + index + "' type='button' class='btn btn-default btn-lg videoButton play' onclick='playPause(this, " + index +")'>" + "</button>"; if (index<(videoArray.length-1)) { getVideo(css, path, videoArrayArray, (index+1)); } }
var mongoose = require('mongoose'); var schema = new mongoose.Schema( { username: {type: String, unique: true}, firstname: String, middlename: String, lastname: String, bio: String, interests: [String], age: Number, gender: {type: String, enum: ['male', 'female']}, lattitude: Number, longitude: Number, } ); mongoose.model('Profile', schema, 'profiles');
var config = { apiKey: "AIzaSyBmN_71PdhQQzPTjhJQdvsKNXKxBFEBGCQ", authDomain: "domicilios-51b83.firebaseapp.com", databaseURL: "https://domicilios-51b83.firebaseio.com", projectId: "domicilios-51b83", storageBucket: "domicilios-51b83.appspot.com", messagingSenderId: "312925872478" }; firebase.initializeApp(config);
'use strict'; const $ = require('jquery'); const Backbone = require('backbone'); const Marionette = require('backbone.marionette'); const App = require('namespace'); const {parseData} = require('utils'); const UserModel = require('models/User'); const RegisterLayout = require('layouts/Register'); const RegisterTitleModel = require('models/RegisterTitle'); const RegisterTitleView = require('views/RegisterTitle'); const RegisterMethodSelectView = require('views/RegisterMethodSelect'); const RegisterEnterEmailView = require('views/RegisterEnterEmail'); const RegisterEnterInviteView = require('views/RegisterEnterInvite'); const SellersCollection = require('collections/Sellers'); module.exports = Marionette.Object.extend({ initialize() { App.Model.User = App.Model.User || new UserModel(); this.models = { title: new RegisterTitleModel() }; this.views = { title: new RegisterTitleView({model: this.models.title}), Index: RegisterMethodSelectView, Email: RegisterEnterEmailView, Invite: RegisterEnterInviteView }; this.layout = new RegisterLayout(); this.layout.on('before:show', () => { this.layout.showChildView('title', this.views.title); }); App.root.getRegion('content').show(this.layout); this.channel.vent .on('auth:social', type => { App.Model.User[`${type}Auth`](); }) .on('auth:email', $.proxy(this, '_emailAuth')) .on('seller:register', $.proxy(this, '_sellerRegister')); }, channel: Backbone.Wreqr.radio.channel('register'), globalChanel: Backbone.Wreqr.radio.channel('global'), _emailAuth(email) { App.Model.User.registerEmail(email).then(this._registerCallback); }, _sellerRegister(code) { const sellers = App.Collection.Sellers || new SellersCollection(); sellers.addSeller(code).then(res => { const {data} = parseData(res); sellers.add(data); sellers.upgrade() .done(() => { console.log('Коллекция магазинов успешно обновлена'); this.globalChanel.vent.trigger('content:select'); }) .fail(() => { console.log('Ошибка при обновлении коллекции магазинов'); }); }); }, _registerCallback(res) { console.log(res); const {already_exist: isAlreadyExist, user} = parseData(res).data; if (isAlreadyExist) { App.Model.User.restore(); } else { App.Model.User.set(user); App.Model.User.save(); Backbone.history.navigate('profile', {trigger: true}); } }, index() { App.root.displayToggle(() => { this.models.title.set('title', 'Выберите способ входа'); this.layout.showChildView('content', new this.views.Index()); }); }, email() { App.root.displayToggle(() => { this.models.title.set('title', 'Введите Ваш адрес электронной почты'); this.layout.showChildView('content', new this.views.Email()); }); }, seller() { App.root.displayToggle(() => { this.models.title.set('title', 'Введите номер приглашения для добавления нового магазина'); this.layout.showChildView('content', new this.views.Invite()); }); } });
import socket from 'socket.io'; import { List, Map } from 'immutable'; import { ADD_COMMENT_REQUEST, ADD_COMMENT_RESULT, REMOVE_COMMENT_REQUEST, REMOVE_COMMENT, NEW_COMMENT, SET_COMMENTS } from '../../common/constants/Comments'; import { GET_CLIENT_TOKEN, SET_CLIENT_TOKEN } from '../../common/constants/Socket'; const PORT = 3001; const io = socket.listen(PORT); let db = List([]); let addComment = (client, comment) => { comment.id = db.size; comment.token = client.token; comment = Map(comment); db = db.push(comment); return db.get(db.indexOf(comment)); }; let removeComment = (client, comment) => { db = db.filter((dbComment) => { return ( dbComment.toJS().id !== comment.id && dbComment.toJS().token !== comment.token ); }); return comment; }; let convertCommentToClient = (client, comment) => { if(client && client.token == comment.token) comment.canRemove = true; else delete comment.token; return comment; }; io.sockets.on('connection', (socket) => { //at first lets get client token socket.emit('action', { type: GET_CLIENT_TOKEN }); socket.on('action', (action) => { switch (action.type) { case SET_CLIENT_TOKEN: { socket.token = action.payload; socket.emit('action', { type: SET_COMMENTS, payload: db.map((comment) => { return convertCommentToClient(socket, comment.toJS()); }) }); break; } case ADD_COMMENT_REQUEST: { let comment = addComment(socket, action.payload); let error = false; setTimeout(() => { if(error) { socket.emit('action', { type: ADD_COMMENT_RESULT, payload: { success: false, error: 'Ошибка, тащемта.' } }); } else { //result of adding socket.emit('action', { type: ADD_COMMENT_RESULT, payload: { success: true } }); //only for me socket.emit('action', { type: NEW_COMMENT, payload: convertCommentToClient(socket, comment.toJS()) }); //to all socket.broadcast.emit('action', { type: NEW_COMMENT, payload: convertCommentToClient(null, comment.toJS()) }); } }, 1000); break; } case REMOVE_COMMENT_REQUEST: { let comment = removeComment(socket, action.payload); setTimeout(() => { io.emit('action', { type: REMOVE_COMMENT, payload: convertCommentToClient(socket, comment) }); }, 1000); break; } } }); });
import { sep } from "path" import { pipe } from "../pipe/pipe" import { trim } from "../trim/trim" import { split } from "../split/split" import { push } from "../push/push" import { join } from "../join/join" import { dropLast } from "../drop-last/drop-last" const removeTrailingSlash = source => source[source.length - 1] === sep ? source.slice(0, -1) : source /** * Rename a file * * @param {string} newName New file name * @param {string} filePath Absolute file path * * @returns {string} */ const renameFile = newName => pipe( removeTrailingSlash, split(sep), dropLast, push(trim(sep)(newName)), join(sep) ) export { renameFile }
var app = require('../../src/index.js') // var chai = require('chai') // var should = require('should') var request = require('supertest') var db = require('../../src/db') describe('GET /pricing-models', function () { it('responds with staic string', function (done) { request(app) .get('/pricing-models') .set('Accept', 'application/json') // .expect('Content-Type', /json/) .expect(200) .end(function (err, res) { if (err) return done(err) // res.text.should.equal('[GET]pricing-models'); res.status.should.equal(200) done() }) }) }) describe('POST /pricing-models', function () { it('responds with staic string', function (done) { request(app) .post('/pricing-models') .send({ pricing: { name: 'newPricing', prices: [1, 2] } }) .set('Accept', 'application/json') .expect('Content-Type', /json/) .expect(200) .end(function (err, res) { if (err) return done(err) // res.text.should.equal('[GET]pricing-models'); res.status.should.equal(200) done() }) }) }) describe('GET /pricing-models/:pm-id', function () { it('responds with staic string', function (done) { request(app) .get('/pricing-models/1') .set('Accept', 'application/json') .expect('Content-Type', /json/) .expect(200) .end(function (err, res) { if (err) return done(err) res.text.should.equal('{"id":"1","name":"Super Value Option","pricing":[{"id":"1","price":3,"name":"10 minutes","value":10},{"id":"2","price":5,"name":"20 minutes","value":20}]}') res.status.should.equal(200) console.log(res.body) done() }) }) }) describe('PUT /pricing-models/:pm-id', function () { it('responds with staic string', function (done) { request(app) .put('/pricing-models/4') .send({ pricing: { name: 'updatedName' } }) .set('Accept', 'application/json') .expect('Content-Type', /json/) .expect(200) .end(function (err, res) { if (err) return done(err) // res.text.should.equal(`{"id":"4","name":"updatedName","pricing":[{"id":"1","price":3,"name":"10 minutes","value":10}]}`) res.status.should.equal(200) console.log(res.body) done() }) }) }) describe('GET /pricing-models/:pm-id/prices', function () { it('responds with staic string', function (done) { request(app) .get('/pricing-models/1/prices') .set('Accept', 'application/json') .expect('Content-Type', /json/) .expect(200) .end(function (err, res) { if (err) return done(err) res.status.should.equal(200) console.log(res.body) done() }) }) }) describe('POST /pricing-models/:pm-id/prices', function () { it('responds with staic string', function (done) { request(app) .post('/pricing-models/4/prices') .send({ price: { price: 25, name: 'New Price', value: 120 } }) .set('Accept', 'application/json') .expect('Content-Type', /json/) .expect(200) .end(function (err, res) { if (err) return done(err) res.status.should.equal(200) console.log(res.body) done() }) }) }) describe('DELETE /pricing-models/:pm-id/prices/:price-id', function () { it('normal', function (done) { db.query('select pricing_id, price_id from pricing_price pp order by id desc limit 1') .then(function (result) { if (!result.rowCount) return done() var pricingId = result.rows[0].pricing_id var priceId = result.rows[0].price_id request(app) .delete(`/pricing-models/${pricingId}/prices/${priceId}`) .set('Accept', 'application/json') .expect(204) .end(function (err, res) { if (err) return done(err) console.log(res.body) done() }) }) .catch(function (err) { console.log(err) }) }) it('responds with not found (Price Model)', function (done) { request(app) .delete('/pricing-models/9999/prices/1') .set('Accept', 'application/json') .expect(404) .end(function (err, res) { if (err) return done(err) done() }) }) it('responds with not found (Price Configuration)', function (done) { request(app) .delete('/pricing-models/4/prices/999') .set('Accept', 'application/json') .expect(404) .end(function (err, res) { if (err) return done(err) done() }) }) })
const passport = require('passport'); // const LocalStrategy = require('passport-local').Strategy; const db = require('../models'); // require strava strategy const StravaStrategy = require('passport-strava-oauth2').Strategy // Strava Strategy passport.use(new StravaStrategy({ clientID: 57767, clientSecret: '4f5669e3201a690c9e1f74ab0da07ad37b73a36d', callbackURL: "http://127.0.0.1:3000/auth/strava/callback" }, function(accessToken, refreshToken, profile, done) { console.log('my image url', profile._json.profile_medium) db.user.findOrCreate({ where: { strava_id: profile.id }, defaults: { name: profile.displayName, email: "aEmail@email.com", strava_id: profile.id, profileImage: profile._json.profile_medium } }).then(async user => { console.log(accessToken); user[0].access_token = accessToken; await user[0].save() // if profile doesn't match the db update it // To keep the example simple, the user's Strava profile is returned to // represent the logged-in user. In a typical application, you would want // to associate the Strava account with a user record in your database, // and return that user instead. done(null, user); }).catch(done); } )); /* * Passport "serializes" objects to make them easy to store, converting the * user to an identifier (id) */ passport.serializeUser((user, cb) => { cb(null, user[0].id); }); /* * Passport "deserializes" objects by taking the user's serialization (id) * and looking it up in the database */ passport.deserializeUser((id, cb) => { db.user.findByPk(id).then(user => { cb(null, user); }).catch(cb); }); // export the Passport configuration from this module module.exports = passport;
const mongoose = require('mongoose') const participerSchema = new mongoose.Schema({ idProf : { type : mongoose.ObjectId, required : true}, idCreneau : { type: mongoose.ObjectId, required : true}, }) module.exports = mongoose.model('Participer', participerSchema)
'use strict'; (function () { gl.tpl.loadInto('menu-top', '.menu-top') gl.tpl.loadInto('logs', '.logs') gl.tpl.loadInto('transfer', '.transfer') // initialize tabs gl.splitbox.tabRestore() })()
/* eslint-disable no-console */ //////////////////////////////////////// ///////////// GETTING MODULE. const express = require('express'); const morgan = require('morgan'); const rateLimit = require('express-rate-limit'); const helmet = require('helmet'); const mongoSanitize = require('express-mongo-sanitize'); const xss = require('xss-clean'); const hpp = require('hpp'); const AppError = require('./utils/appError'); const globalErrorHandler = require('./controller/errorController'); const userRouter = require('./routes/userRoutes'); ////////////////////////////////////////////////// //////////// CREATING A SERVER USING EXPRESS const app = express(); ///////////////////////////////////////////////// /////////////// USING GLOBAL MIDDLE WARE // 1). Set security HTTP headers app.use(helmet()); // Development logging if (process.env.NODE_ENV === 'development') { app.use(morgan('dev')); } // 2). RATE-LIMIT : Rate Limiting will prevent the making too many request from same IP address to our ApI const limiter = rateLimit({ max: 100, // 100 request windowMs: 60 * 60 * 1000, // In 1 Hour message: 'Too many requests from this IP, please try again in an hour', }); // 3). Limit reqeust from same IP to the API app.use('/api', limiter); // 4). Body parser, reading data from body into req.body app.use(express.json({ limit: '10kb' })); // setting data limit to 10KB in req.body // 5). Data sanitization against NoSQL query injection app.use(mongoSanitize()); // 6). Data sanitization against against cross-side-scripting(XSS) attack app.use(xss()); // clean any user input from malacious html code // 7). prevent parameter pollution using hpp middleware app.use( hpp({ whitelist: [ 'duration', 'ratingsQuantity', 'ratingAverage', 'maxGroupSize', 'difficulty', 'price', ], }) ); // 8). Test Middleware app.use((req, res, next) => { req.requestTime = new Date().toISOString(); next(); }); ///////////////////////////////////////// ////////////// ROUTES app.use('/api/v1/users', userRouter); ///////////////////////////////////////////////////////////////////// //////////// HANDLING UNDEFINED ROUTES using user defined middleware app.all('*', (req, res, next) => { next(new AppError(`can't find ${req.originalUrl} on this server! `, 404)); }); ////////////////////////////////////////////////////////////////////// ////////////// GLOBAL ERROR HANDLING MIDDLEWARE app.use(globalErrorHandler); module.exports = app; // Data Sanitization: it basically means to clean all the data that comes into the application from the malacious soures.
/** * @fileoverview Common auth actions to facilitate testing * @author Gabriel Womble */ import { auth, common, routes, } from 'e2e/constants'; const { values } = common; /** * Helper to signup in E2E tests * @param {Class} page - puppeteer page class */ export const signup = (async (page) => { await page.goto(routes.signup); await page.waitForSelector(auth.selectors.page.attr); await page.waitForSelector(auth.selectors.formSignup.attr); await page.type(auth.selectors.username.attr, values.username); await page.type(auth.selectors.password.attr, values.password); await page.type(auth.selectors.confirm.attr, values.password); await page.click(auth.selectors.tos.attr); await page.click(auth.selectors.btnPrimary.attr); }); /** * Helper to login in E2E tests * @param {Class} page - puppeteer page class */ export const login = (async (page) => { await page.goto(routes.login); await page.waitForSelector(auth.selectors.page.attr); await page.waitForSelector(auth.selectors.formLogin.attr); await page.type(auth.selectors.username.attr, values.username); await page.type(auth.selectors.password.attr, values.password); await page.click(auth.selectors.btnPrimary.attr); }); /** * Helper to logout in E2E tests * @param {Class} page - puppeteer page class */ export const logout = (async (page) => { await page.goto(routes.login); });
var express =require("express"); var app=express(); var cors=require("cors"); app.use(cors()); app.use(express.json()); app.use(express.urlencoded()); require('es6-promise').polyfill(); require('isomorphic-fetch'); app.use(express.static(__dirname+"/public")); var Unsplash=require("unsplash-js").default; var unsplash=new Unsplash({ applicationId:'e8bc558b59499171328426f70bb880653ec720f3b3f6b0146f5f017287239e26', secret:'59a0af3619aa0a32dda5eeee5168e85a3848bd1bd57012d17c4a1812de79ee60' }); app.get("/",function(req,res){ res.send("index.html"); }); app.post("/getPhoto",function(req,res){ unsplash.search.photos(req.body.keyword,1).then(function(result){ res.send({url:result.url}); }).catch(function(err){ console.log(err); }) }); app.listen(process.env.PORT||3000,function(){ console.log("Server running"); });
/** * @file san-xui/x/components/StopScroll.js * @author leeight */ import {DataTypes, defineComponent} from 'san'; export default defineComponent({ template: '<div on-wheel="onWheel"><slot/></div>', initData() { return { disabled: false }; }, dataTypes: { /** * 组件的禁用状态 * @default false */ disabled: DataTypes.bool }, onWheel(e) { const disabled = this.data.get('disabled'); if (disabled) { return; } const layer = e.currentTarget; if (!layer) { return; } if (layer.scrollTop + e.deltaY + layer.clientHeight >= layer.scrollHeight) { e.preventDefault(); layer.scrollTop = layer.scrollHeight; } if (layer.scrollTop + e.deltaY <= 0) { e.preventDefault(); layer.scrollTop = 0; } } });
var html = require('choo/html') var headerView = require('../components/header') var todoListView = require('../components/todo-list') var footerView = require('../components/footer') module.exports = (state, emit) => { return html ` <body> <section class="todoapp"> ${headerView(state, emit)} ${todoListView(state, emit)} ${footerView(state, emit)} </section> <footer class="info"> <p>Double-click to edit a todo</p> <p>Created by <a href="http://twitter.com/dbtek">Ismail Demirbilek</a></p> </footer> </body> ` }
/*---------------------------------------------- swgSpringMassAnimal.js 仮想動物のバネ質点モデル -----------------------------------------------*/ var gravity = 9.8; function SpringMassAnimal() { this.type = 0;//4足動物、昆虫型、恐竜型 this.mode = 0;//歩行モード this.numSpring = 1; this.numPoint = this.numSpring + 1; this.mass = 0.1;//質点1個当たりの質量(kg) this.constK = 200;//構造バネ1個当たりのバネ定数 this.drctnK = 20;//方向バネ this.damping = 0.1;//0.5; this.drag = 0.1; this.length0 = 1.2;//脚バネの自然長 this.radius = 0.1 ;//バネの半径 this.dir;//進行方向(x軸からの偏角) this.dir0;//バネの初期設定方向 this.theta1 = 20;//前傾角 this.vPos = this.vPos0 = new Vector3(); this.vVel = new Vector3(); this.vForce = new Vector3();//外力の初期値 this.vForce0 = new Vector3();//外力の初期値 this.spring = []; this.point = []; this.shadow = 0; this.rootNo = 1; } //----------------------------------------------------------------- SpringMassAnimal.prototype.create = function() { var len = this.length0; var wid = 0.2 * len; var rad = this.radius; //質点のサイズ,質量 for(var i = 0; i < 22; i++) { this.point[i] = new Rigid(); this.point[i].kind = "SPHERE"; this.point[i].mass = this.mass; } //バネ for(var i = 0; i < 21; i++) { this.spring[i] = new Rigid(); this.spring[i].kind = "CYLINDER"; this.spring[i].radius = rad; this.spring[i].radiusRatio = 1; } if(this.type == 0) {//4足動物 this.numSpring = 12; this.numPoint = 13; var lenTrunk = 0.5 * len; this.rootNo = 5;//中心胴体 //point //後足 this.point[0].vPos = add(new Vector3(-wid, -lenTrunk, rad), this.vPos);//左 this.point[1].vPos = add(new Vector3( wid, -lenTrunk, rad), this.vPos);//右 this.point[0].vSize = this.point[1].vSize = mul(new Vector3(2.0, 2.0, 2.0), rad); //腰 this.point[2].vPos = add(new Vector3(-wid, -lenTrunk, rad + len), this.vPos);//左腰 this.point[3].vPos = add(new Vector3( wid, -lenTrunk, rad + len), this.vPos);//右腰 this.point[2].vSize = this.point[3].vSize = mul(new Vector3(3.0, 3.0, 3.0), rad); //後胴体 this.point[4].vPos = add(new Vector3( 0.0, -lenTrunk, rad + len), this.vPos); this.point[4].vSize = mul(new Vector3(5.0, 5.0, 5.0), rad); //中心胴体 this.point[5].vPos = add(new Vector3( 0.0, 0.0, rad + len), this.vPos); this.point[5].vSize = mul(new Vector3(5.0, 5.0, 5.0), rad); //前胴体 this.point[6].vPos = add(new Vector3( 0.0, lenTrunk, rad + len), this.vPos); this.point[6].vSize = mul(new Vector3(5.0, 5.0, 5.0), rad); //頭 this.point[7].vPos = add(new Vector3( 0.0, 2.0*lenTrunk, rad + 1.5*len), this.vPos);//頭 this.point[7].vSize = mul(new Vector3(8.0, 8.0, 8.0), rad); //肩 this.point[8].vPos = add(new Vector3(-wid, lenTrunk, rad + len), this.vPos);//左 this.point[9].vPos = add(new Vector3( wid, lenTrunk, rad + len), this.vPos);//右 this.point[8].vSize = this.point[9].vSize = mul(new Vector3(3.0, 3.0, 3.0), rad); //前足 this.point[10].vPos = add(new Vector3(-wid, lenTrunk, rad), this.vPos); this.point[11].vPos = add(new Vector3( wid, lenTrunk, rad), this.vPos); this.point[10].vSize = this.point[11].vSize = mul(new Vector3(2.0, 2.0, 2.0), rad); //尾の先端 this.point[12].vPos = add(new Vector3( 0, -lenTrunk*1.8, rad + len * 1.2), this.vPos); this.point[12].vSize = mul(new Vector3(2.0, 3.0, 3.0), rad); //spring //後脚(spring) this.spring[0].row1 = 0; this.spring[0].row2 = 2;//左 this.spring[1].row1 = 1; this.spring[1].row2 = 3;//右 //腰(spring) this.spring[2].row1 = 2; this.spring[2].row2 = 4;//左 this.spring[3].row1 = 4; this.spring[3].row2 = 3;//右 //後背骨 this.spring[4].row1 = 4; this.spring[4].row2 = 5; //前背骨 this.spring[5].row1 = 5; this.spring[5].row2 = 6; //首 this.spring[6].row1 = 6; this.spring[6].row2 = 7; //鎖骨 this.spring[7].row1 = 8; this.spring[7].row2 = 6; this.spring[8].row1 = 6; this.spring[8].row2 = 9; //前脚 this.spring[9].row1 = 8; this.spring[9].row2 = 10;//左 this.spring[10].row1 = 9; this.spring[10].row2 = 11;//右 //尾 this.spring[11].row1 = 4; this.spring[11].row2 = 12; } if(this.type == 1)//昆虫型 { this.numSpring = 16; this.numPoint = 17; var lenTrunk = 0.5 * len; this.rootNo = 9;//中心胴体 //point //後足 this.point[0].vPos = add(new Vector3(-2.0*wid, -lenTrunk, rad), this.vPos);//左 this.point[1].vPos = add(new Vector3( 2.0*wid, -lenTrunk, rad), this.vPos);//右 this.point[0].vSize = this.point[1].vSize = mul(new Vector3(2.0, 2.0, 2.0), rad); //後膝 this.point[2].vPos = add(new Vector3(-wid, -lenTrunk, rad + len), this.vPos);//左 this.point[3].vPos = add(new Vector3( wid, -lenTrunk, rad + len), this.vPos);//右 this.point[2].vSize = this.point[3].vSize = mul(new Vector3(1.5, 1.5, 1.5), rad); //後胴体 this.point[4].vPos = add(new Vector3( 0.0, -lenTrunk, rad + len * 0.7), this.vPos); this.point[4].vSize = mul(new Vector3(5.0, 5.0, 5.0), rad); //中足 this.point[5].vPos = add(new Vector3(-1.5*wid, 0.0, rad), this.vPos);//左 this.point[6].vPos = add(new Vector3( 1.5*wid, 0.0, rad), this.vPos);//右 this.point[5].vSize = this.point[6].vSize = mul(new Vector3(2.0, 2.0, 2.0), rad); //中膝 this.point[7].vPos = add(new Vector3(-wid, 0.0, rad + len), this.vPos);//左 this.point[8].vPos = add(new Vector3( wid, 0.0, rad + len), this.vPos);//右 this.point[7].vSize = this.point[8].vSize = mul(new Vector3(1.5, 1.5, 1.5), rad); //中心胴体 this.point[9].vPos = add(new Vector3( 0.0, 0.0, rad + len * 0.7), this.vPos); this.point[9].vSize = mul(new Vector3(3.0, 3.0, 3.0), rad); //前足 this.point[10].vPos = add(new Vector3(-2.0*wid, lenTrunk, rad), this.vPos);//左 this.point[11].vPos = add(new Vector3( 2.0*wid, lenTrunk, rad), this.vPos);//右 this.point[10].vSize = this.point[11].vSize = mul(new Vector3(2.0, 2.0, 2.0), rad); //前肘(膝) this.point[12].vPos = add(new Vector3(-wid, lenTrunk, rad + len*1.2), this.vPos);//左 this.point[13].vPos = add(new Vector3( wid, lenTrunk, rad + len*1.2), this.vPos);//右 this.point[12].vSize = this.point[13].vSize = mul(new Vector3(1.5, 1.5, 1.5), rad); //前胴体 this.point[14].vPos = add(new Vector3( 0.0, lenTrunk, rad + len), this.vPos); this.point[14].vSize =mul( new Vector3(5.0, 5.0, 5.0), rad); //頭 this.point[15].vPos = add(new Vector3( 0.0, 2.0*lenTrunk, rad + 1.5*len), this.vPos);//頭 this.point[15].vSize = mul(new Vector3(8.0, 8.0, 8.0), rad); //尾の先端 this.point[16].vPos = add(new Vector3( 0, -lenTrunk*1.8, rad + len * 1.0), this.vPos); this.point[16].vSize = mul(new Vector3(2.0, 3.0, 3.0), rad); //spring //後脛 this.spring[0].row1 = 0; this.spring[0].row2 = 2;//左 this.spring[1].row1 = 1; this.spring[1].row2 = 3;//右 //後腿 this.spring[2].row1 = 2; this.spring[2].row2 = 4;//左 this.spring[3].row1 = 3; this.spring[3].row2 = 4;//右 //中脛 this.spring[5].row1 = 5; this.spring[5].row2 = 7;//左 this.spring[6].row1 = 6; this.spring[6].row2 = 8;//右 //中腿 this.spring[7].row1 = 7; this.spring[7].row2 = 9;//左 this.spring[8].row1 = 8; this.spring[8].row2 = 9;//右 //前脛 this.spring[10].row1 = 10; this.spring[10].row2 = 12;//左 this.spring[11].row1 = 11; this.spring[11].row2 = 13;//右 //前腿 this.spring[12].row1 = 12; this.spring[12].row2 = 14;//左 this.spring[13].row1 = 13; this.spring[13].row2 = 14;//右 //後背骨 this.spring[4].row1 = 4; this.spring[4].row2 = 9; //前背骨 this.spring[9].row1 = 9; this.spring[9].row2 = 14; //首 this.spring[14].row1 = 14; this.spring[14].row2 = 15; //尾 this.spring[15].row1 = 4; this.spring[15].row2 = 16; } else if(this.type == 2)//恐竜型 { this.numSpring = 21; this.numPoint = 22; var len1 = 0.25 * len; this.rootNo = 5; var lambda = 1.3 * len; //質点の位置 for(var i = 0; i <= 9; i++) {//背骨(胴体) this.point[i].vPos = add(new Vector3(0.0, -(i-5) * len1, rad + len - (i-5) * len1 + 0.2 * Math.cos(2.0 * Math.PI * (i-5)*len1 / lambda + Math.PI/3.0) ), this.vPos); this.point[i].vSize = mul(new Vector3(2.0, 2.0, 2.0) , rad); } this.point[0].vSize = mul(new Vector3(5.0, 5.0, 5.0) , rad);//頭 //腰 this.point[10].vPos = add(new Vector3(-wid, 0.0, rad + 1.2 * len), this.vPos);//左腰 this.point[11].vPos = add(new Vector3( wid, 0.0, rad + 1.2 * len), this.vPos);//右腰 this.point[10].vSize = this.point[11].vSize = mul(new Vector3(3.0, 3.0, 3.0), rad); //膝 this.point[12].vPos = add(new Vector3(-wid, 0.0, rad + len * 0.6), this.vPos);//左 this.point[13].vPos = add(new Vector3( wid, 0.0, rad + len * 0.6), this.vPos);//右 this.point[12].vSize = this.point[13].vSize = mul(new Vector3(2.0, 2.0, 2.0), rad); //足 this.point[14].vPos = add(new Vector3(-wid*len, 0.0, rad), this.vPos);//左足 this.point[15].vPos = add(new Vector3( wid*len, 0.0, rad), this.vPos);//右足 this.point[14].vSize = this.point[15].vSize = mul(new Vector3(2.0, 2.0, 2.0), rad); //肩 this.point[16].vPos = add(this.point[3].vPos, new Vector3(-wid, 0.0, 0.0)); this.point[17].vPos = add(this.point[3].vPos, new Vector3( wid, 0.0, 0.0)); this.point[16].vSize = this.point[17].vSize = mul(new Vector3(2.0, 2.0, 2.0), rad); //肘 this.point[18].vPos = add(this.point[16].vPos, new Vector3(0.0, 0.0, - len * 0.3)); this.point[19].vPos = add(this.point[17].vPos, new Vector3(0.0, 0.0, - len * 0.3)); this.point[18].vSize = this.point[19].vSize = mul(new Vector3(2.0, 2.0, 2.0), rad); //手 this.point[20].vPos = add(this.point[18].vPos, new Vector3(0.0, len * 0.2, len * 0.1)); this.point[21].vPos = add(this.point[19].vPos, new Vector3(0.0, len * 0.2, len * 0.1)); this.point[20].vSize = this.point[21].vSize = mul(new Vector3(2.0, 2.0, 2.0), rad); //spring for(i = 0; i <= 8; i++) {//背骨 this.spring[i].row1 = i; this.spring[i].row2 = i+1; } //腰 this.spring[9].row1 = 10; this.spring[9].row2 = 5;//左腰 this.spring[10].row1 = 5; this.spring[10].row2 = 11;//右腰 //腿 this.spring[11].row1 = 10; this.spring[11].row2 = 12;//左 this.spring[12].row1 = 11; this.spring[12].row2 = 13;//右 //脛 this.spring[13].row1 = 12; this.spring[13].row2 = 14;//左 this.spring[14].row1 = 13; this.spring[14].row2 = 15;//右 //鎖骨 this.spring[15].row1 = 16; this.spring[15].row2 = 3; this.spring[16].row1 = 3; this.spring[16].row2 = 17; //上腕 this.spring[17].row1 = 16; this.spring[17].row2 = 18; this.spring[18].row1 = 17; this.spring[18].row2 = 19; //前腕 this.spring[19].row1 = 18; this.spring[19].row2 = 20; this.spring[20].row1 = 19; this.spring[20].row2 = 21; } //バネの自然長と方向ベクトル var n1, n2; for(var i = 0; i < this.numSpring; i++) { n1 = this.spring[i].row1; n2 = this.spring[i].row2; this.spring[i].length0 = distance(this.point[n1].vPos, this.point[n2].vPos); this.spring[i].vDir0 = direction(this.point[n1].vPos, this.point[n2].vPos); } //進行方向初期値がy軸方向でないとき質点の位置/バネの方向ベクトルも変える var alpha = this.dir0 - Math.PI/2.0; if(alpha != 0.0) { for(var i = 0; i < this.numSpring; i++) this.spring[i].vDir0.rotZ_rad(alpha); //質点の座標 for(var i = 0; i < this.numPoint; i++) this.point[i].vPos.rotZ_radC(this.point[this.rootNo].vPos, alpha); } } //----------------------------------------------------------------- SpringMassAnimal.prototype.draw = function(gl) { var i, r1, r2; //ばね質点表示 //質点 var n = this.point[0].initVertexBuffers(gl); for(i = 0; i < this.numPoint; i++) // for(i = 0; i < 18; i++) { if(this.point[i].flagFixed == true) { this.point[i].diffuse = [0.8, 0.2, 0.2, 1.0]; this.point[i].ambient = [0.4, 0.1, 0.1, 1.0]; } else { this.point[i].diffuse = [0.2, 0.9, 0.9, 1.0]; this.point[i].ambient = [0.1, 0.5, 0.5, 1.0]; } this.point[i].shadow = this.shadow; this.point[i].draw(gl, n); } var rad = this.radius; //バネ n = this.spring[0].initVertexBuffers(gl); for(i = 0; i < this.numSpring ; i++) { r1 = this.spring[i].row1; r2 = this.spring[i].row2; this.spring[i].vPos = div(add(this.point[r1].vPos, this.point[r2].vPos), 2); var len = distance(this.point[r1].vPos, this.point[r2].vPos); this.spring[i].vSize = new Vector3(rad, rad, len); this.spring[i].vEuler = getEulerZ(this.point[r1].vPos, this.point[r2].vPos); this.spring[i].shadow = this.shadow; this.spring[i].draw(gl, n); } } //------------------------------------------------------------------- SpringMassAnimal.prototype.walk0 = function(tt) { var i, theta, thetaDegL, thetaDegR, dist; var cc = Math.cos(this.dir); var ss = Math.sin(this.dir); var vDirection = new Vector3(cc, ss , 0.0);//進行方向のベクトル //左脚の水平方向距離(符号付き) dist = dot(sub(this.point[2].vPos, this.point[0].vPos), vDirection); //左脚の角度 theta = Math.atan2(dist, this.point[2].vPos.z - this.point[0].vPos.z); thetaDegL = theta * RAD_TO_DEG; //右脚の水平方向距離(符号付き) dist = dot(sub(this.point[3].vPos, this.point[1].vPos), vDirection); //右脚の角度 theta = Math.atan2(dist, this.point[3].vPos.z - this.point[1].vPos.z); thetaDegR = theta * RAD_TO_DEG; for(i = 2; i < this.numPoint; i++) { this.point[i].vVel.x = this.speed * cc; this.point[i].vVel.y = this.speed * ss; } if(this.mode == 0) {//後左足/前右足を固定,後右足/前左足出す this.point[0].flagFixed = true;//後左足 this.point[11].flagFixed = true;//前右足 this.point[1].flagFixed = false;//後右足 this.point[10].flagFixed = false;//前左足 this.point[1].vVel.x = 2.0*this.speed * cc; this.point[1].vVel.y = 2.0*this.speed * ss; this.point[1].vForce0.z = 100.0 * this.mass; this.point[10].vVel.x = 2.0*this.speed * cc; this.point[10].vVel.y = 2.0*this.speed * ss; this.point[10].vForce0.z = 100.0 * this.mass; if(thetaDegL > this.theta1/2.0) this.mode = 1; } else if(this.mode == 1) {//後左足/前右足を固定,後右足/前左足出す, this.point[0].flagFixed = true;//後左足 this.point[11].flagFixed = true;//前右足 this.point[1].flagFixed = false;//後右足 this.point[10].flagFixed = false;//前左足 this.point[1].vVel.x = 2.0*this.speed * cc; this.point[1].vVel.y = 2.0*this.speed * ss; this.point[1].vForce0.z = 0.0; this.point[10].vVel.x = 2.0*this.speed * cc; this.point[10].vVel.y = 2.0*this.speed * ss; this.point[10].vForce0.z = 0.0; if(thetaDegL > this.theta1) this.mode = 2; } else if(this.mode == 2) {//後右足/前左足固定,後左足/前右足出す this.point[0].flagFixed = false; this.point[11].flagFixed = false; this.point[1].flagFixed = true; this.point[10].flagFixed = true; this.point[0].vVel.x = 2.0*this.speed * cc; this.point[0].vVel.y = 2.0*this.speed * ss; this.point[0].vForce0.z = 200.0 * this.mass; this.point[11].vVel.x = 2.0*this.speed * cc; this.point[11].vVel.y = 2.0*this.speed * ss; this.point[11].vForce0.z = 100.0 * this.mass; if(thetaDegR > this.theta1/2.0) this.mode = 3; } else if(this.mode == 3) {//後右足/前左足固定,後左足/前右足出す this.point[0].flagFixed = false; this.point[11].flagFixed = false; this.point[1].flagFixed = true; this.point[10].flagFixed = true; this.point[0].vVel.x = 2.0*this.speed * cc; this.point[0].vVel.y = 2.0*this.speed * ss; this.point[0].vForce0.z = 0.0; this.point[11].vVel.x = 2.0*this.speed * cc; this.point[11].vVel.y = 2.0*this.speed * ss; this.point[11].vForce0.z = 0.0; if(thetaDegR > this.theta1) this.mode = 0; } //進行方向が変化したときバネの方向ベクトル,質点の位置も変える var alpha = this.dir - this.dir0; if(alpha != 0.0) { //バネの方向 for(i = 0; i < this.numSpring; i++) this.spring[i].vDir0.rotZ_rad(alpha); //質点の座標 for(i = 0; i < this.numPoint; i++) this.point[i].vPos.rotZ_radC(this.point[this.rootNo].vPos, alpha); this.dir0 = this.dir; } this.calcSpringMass(tt); } //------------------------------------------------------------------- SpringMassAnimal.prototype.walk1 = function(tt) { var i, theta, thetaDegL, thetaDegR, dist; var cc = Math.cos(this.dir); var ss = Math.sin(this.dir); var vDirection = new Vector3(cc, ss , 0.0);//進行方向のベクトル //左脚の水平方向距離(符号付き) dist = dot(sub(this.point[2].vPos, this.point[0].vPos), vDirection); //左脚の角度 theta = Math.atan2(dist, this.point[2].vPos.z - this.point[0].vPos.z); thetaDegL = theta * RAD_TO_DEG; //右脚の水平方向距離(符号付き) dist = dot(sub(this.point[3].vPos, this.point[1].vPos), vDirection); //右脚の角度 theta = Math.atan2(dist, this.point[3].vPos.z - this.point[1].vPos.z); thetaDegR = theta * RAD_TO_DEG; for(i = 2; i < this.numPoint; i++) { this.point[i].vVel.x = this.speed * cc; this.point[i].vVel.y = this.speed * ss; } if(this.mode == 0) {//後左足/中右足/前左足を固定,後右足/中左足/前右足出す this.point[0].flagFixed = true;//後左足 this.point[6].flagFixed = true;//中右足 this.point[10].flagFixed = true;//前左足 this.point[1].flagFixed = false;//後右足 this.point[5].flagFixed = false;//中左足 this.point[11].flagFixed = false;//前右足 this.point[1].vVel.x = 2.0*this.speed * cc; this.point[1].vVel.y = 2.0*this.speed * ss; this.point[1].vForce0.z = 100.0 * this.mass; this.point[5].vVel.x = 2.0*this.speed * cc; this.point[5].vVel.y = 2.0*this.speed * ss; this.point[5].vForce0.z = 100.0 * this.mass; this.point[11].vVel.x = 2.0*this.speed * cc; this.point[11].vVel.y = 2.0*this.speed * ss; this.point[11].vForce0.z = 100.0 * this.mass; if(thetaDegL > this.theta1/2.0) this.mode = 1; } else if(this.mode == 1) {//後左足/中右足/前左足を固定,後右足/中左足/前右足出す this.point[0].flagFixed = true;//後左足 this.point[6].flagFixed = true;//中右足 this.point[10].flagFixed = true;//前左足 this.point[1].flagFixed = false;//後右足 this.point[5].flagFixed = false;//中左足 this.point[11].flagFixed = false;//前右足 this.point[1].vVel.x = 2.0*this.speed * cc; this.point[1].vVel.y = 2.0*this.speed * ss; this.point[1].vForce0.z = 0.0; this.point[5].vVel.x = 2.0*this.speed * cc; this.point[5].vVel.y = 2.0*this.speed * ss; this.point[5].vForce0.z = 0.0; this.point[11].vVel.x = 2.0*this.speed * cc; this.point[11].vVel.y = 2.0*this.speed * ss; this.point[11].vForce0.z = 0.0; if(thetaDegL > this.theta1) this.mode = 2; } else if(this.mode == 2) {//後右足/中左/前右足固定,後左足/中右足/前左足出す this.point[0].flagFixed = false;//後左足 this.point[6].flagFixed = false;//中右足 this.point[10].flagFixed = false;//前左足 this.point[1].flagFixed = true;//後右足 this.point[5].flagFixed = true;//中左足 this.point[11].flagFixed = true;//前右足 this.point[0].vVel.x = 2.0*this.speed * cc; this.point[0].vVel.y = 2.0*this.speed * ss; this.point[0].vForce0.z = 100.0 * this.mass; this.point[6].vVel.x = 2.0*this.speed * cc; this.point[6].vVel.y = 2.0*this.speed * ss; this.point[6].vForce0.z = 100.0 * this.mass; this.point[10].vVel.x = 2.0*this.speed * cc; this.point[10].vVel.y = 2.0*this.speed * ss; this.point[10].vForce0.z = 100.0 * this.mass; if(thetaDegR > this.theta1/2.0) this.mode = 3; } else if(this.mode == 3) {//後右足/中左/前右足固定,後左足/中右足/前左足出す this.point[0].flagFixed = false;//後左足 this.point[6].flagFixed = false;//中右足 this.point[10].flagFixed = false;//前左足 this.point[1].flagFixed = true;//後右足 this.point[5].flagFixed = true;//中左足 this.point[11].flagFixed = true;//前右足 this.point[0].vVel.x = 2.0*this.speed * cc; this.point[0].vVel.y = 2.0*this.speed * ss; this.point[0].vForce0.z = 100.0 * this.mass; this.point[6].vVel.x = 2.0*this.speed * cc; this.point[6].vVel.y = 2.0*this.speed * ss; this.point[6].vForce0.z = 0.0; this.point[10].vVel.x = 2.0*this.speed * cc; this.point[10].vVel.y = 2.0*this.speed * ss; this.point[10].vForce0.z = 0.0 ; if(thetaDegR > this.theta1) this.mode = 0; } //進行方向が変化したときバネの方向ベクトル,質点の位置も変える var alpha = this.dir - this.dir0; if(alpha != 0.0) { //バネの方向 for(i = 0; i < this.numSpring; i++) this.spring[i].vDir0.rotZ_rad(alpha); //質点の座標 for(i = 0; i < this.numPoint; i++) this.point[i].vPos.rotZ_radC(this.point[this.rootNo].vPos, alpha); this.dir0 = this.dir; } this.calcSpringMass(tt); } //------------------------------------------------------------------- SpringMassAnimal.prototype.walk2 = function(tt) { var i, theta, thetaDegL, thetaDegR, dist; var cc = Math.cos(this.dir); var ss = Math.sin(this.dir); var vDirection = new Vector3(cc, ss , 0.0);//進行方向のベクトル //左脚の水平方向距離(符号付き) dist = dot(sub(this.point[10].vPos, this.point[14].vPos), vDirection); //左脚の角度 theta = Math.atan2(dist, this.point[10].vPos.z - this.point[14].vPos.z); thetaDegL = theta * RAD_TO_DEG; //右脚の水平方向距離(符号付き) dist = dot(sub(this.point[11].vPos, this.point[15].vPos), vDirection); //右脚の角度 theta = Math.atan2(dist, this.point[11].vPos.z - this.point[15].vPos.z); thetaDegR = theta * RAD_TO_DEG; for(i = 0; i < this.numPoint; i++) { this.point[i].vVel.x = this.speed * cc; this.point[i].vVel.y = this.speed * ss; } if(this.mode == 0) {//左足を固定,右足/左手出す, this.point[14].flagFixed = true; this.point[15].flagFixed = false; this.point[15].vVel.x = 2.0*this.speed * cc; this.point[15].vVel.y = 2.0*this.speed * ss; this.point[13].vVel.x = 2.0*this.speed * cc; this.point[13].vVel.y = 2.0*this.speed * ss; this.point[13].vForce0.z = 200.0 * this.mass;//右ひざ上げる this.point[20].vVel.x = 2.3*this.speed * cc; this.point[20].vVel.y = 2.3*this.speed * ss; this.point[21].vVel = new Vector3(); if(thetaDegL > this.theta1/2.0) this.mode = 1; } else if(this.mode == 1) {//左足を固定,右足/左手出す, this.point[14].flagFixed = true; this.point[15].flagFixed = false; this.point[15].vVel.x = 2.0*this.speed * cc; this.point[15].vVel.y = 2.0*this.speed * ss; this.point[13].vVel.x = 2.0*this.speed * cc; this.point[13].vVel.y = 2.0*this.speed * ss; this.point[13].vForce0.z = 0.0;//右ひざ下げる this.point[20].vVel.x = 2.3*this.speed * cc; this.point[20].vVel.y = 2.3*this.speed * ss; this.point[21].vVel = new Vector3(); if(thetaDegL > this.theta1) this.mode = 2; } else if(this.mode == 2) {//右足固定,左足/右手出す this.point[14].flagFixed = false; this.point[15].flagFixed = true; this.point[14].vVel.x = 2.0*this.speed * cc; this.point[14].vVel.y = 2.0*this.speed * ss; this.point[12].vVel.x = 2.0*this.speed * cc; this.point[12].vVel.y = 2.0*this.speed * ss; this.point[12].vForce0.z = 200.0 * this.mass;//左ひざ上げる this.point[21].vVel.x = 2.3*this.speed * cc; this.point[21].vVel.y = 2.3*this.speed * ss; this.point[20].vVel = new Vector3(); if(thetaDegR > this.theta1/2.0) this.mode = 3; } else if(this.mode == 3) {//右足固定,左足/右手出す this.point[14].flagFixed = false; this.point[15].flagFixed = true; this.point[14].vVel.x = 2.0*this.speed * cc; this.point[14].vVel.y = 2.0*this.speed * ss; this.point[12].vVel.x = 2.0*this.speed * cc; this.point[12].vVel.y = 2.0*this.speed * ss; this.point[12].vForce0.z = 0.0 * this.mass;//左ひざ下げる this.point[21].vVel.x = 2.3*this.speed * cc; this.point[21].vVel.y = 2.3*this.speed * ss; this.point[20].vVel = new Vector3(); if(thetaDegR > this.theta1) this.mode = 0; } //進行方向が変化したときバネの方向ベクトル,質点の位置も変える var alpha = this.dir - this.dir0; if(alpha != 0.0) { //バネの方向 for(i = 0; i < this.numSpring; i++) this.spring[i].vDir0.rotZ_rad(alpha); //質点の座標 for(i = 0; i < this.numPoint; i++) this.point[i].vPos.rotZ_radC(this.point[this.rootNo].vPos, alpha); this.dir0 = this.dir; } this.calcSpringMass(tt); } //----------------------------------------------------------------------------- //1次元のバネマスモデル(方向バネも考慮,3次元空間で運動) SpringMassAnimal.prototype.calcSpringMass = function(tt) { var i, j, r1, r2; var vDir1 = new Vector3();//hinge中心から#1へ向かう単位方向ベクトル(他にも使用) var vDir2 = new Vector3();//hinge中心から#2へ向かう単位方向ベクトル(他にも使用) var vFF = new Vector3(); var vRelativeVel = new Vector3(); var vNormal = new Vector3(); var vG = new Vector3(0.0, 0.0, -gravity * this.mass);//重力ベクトル var dampingF, len, len1, len2, angle; var angle0 = Math.PI; var rad = this.radius; //力の初期値を重力だけとする for(i = 0; i < this.numPoint; i++) this.point[i].vForce = add(this.point[i].vForce0, vG); //バネによる力 for(i = 0; i < this.numSpring; i++) { //構造バネの弾性力 r1 = this.spring[i].row1; r2 = this.spring[i].row2; vDir1 = direction(this.point[r1].vPos , this.point[r2].vPos);//#1から#2への単位ベクトル len = distance(this.point[r1].vPos, this.point[r2].vPos); vFF = mul(this.constK * (len - this.spring[i].length0) , vDir1) ; this.point[r1].vForce.add(vFF) ;//vDirと同方向 this.point[r2].vForce.sub(vFF) ;//反対方向 //減衰力 vRelativeVel = sub(this.point[r1].vVel , this.point[r2].vVel); dampingF = this.damping * dot(vRelativeVel, vDir1); this.point[r1].vForce.sub(mul(dampingF , vDir1));//相対速度とは反対方向 this.point[r2].vForce.add(mul(dampingF , vDir1));//同方向 //方向バネを考慮 vDir1 = direction(this.point[r1].vPos, this.point[r2].vPos); vNormal = cross(this.spring[i].vDir0, vDir1); vDir2 = cross(vNormal, vDir1); angle = getAngle_rad(this.spring[i].vDir0, vDir1); vFF = mul(this.drctnK * angle / len, vDir2); this.point[r2].vForce.sub(vFF) ; this.point[r1].vForce.add(vFF);//vDir2と同方向 } //粘性抵抗,床面処理,数値計算 for(i = 0; i < this.numPoint; i++) { if(this.point[i].flagFixed) continue; //空気粘性抵抗(全ての質点に一様と仮定) this.point[i].vForce.sub(mul(this.drag, this.point[i].vVel)); //床面処理 if(this.point[i].vPos.z < rad) { //床面上に制限 this.point[i].vPos.z = rad; } //Euler法 //加速度 var vAcc = div(this.point[i].vForce , this.mass); //速度 this.point[i].vVel.add(mul(vAcc, tt)); //位置 this.point[i].vPos.add(mul(this.point[i].vVel, tt)); } this.vPos = this.point[0].vPos; }
/** @format */ import { AppRegistry, StyleSheet, Component, Text, View, Navigator, TouchableOpacity, } from 'react-native'; import {name as appName} from './app.json'; import Config from './src/config'; // import App from './src/App'; import { StackNavigator } from 'react-navigation'; export const AppNavigator = StackNavigator(Config.navigation); AppRegistry.registerComponent(appName, () => AppNavigator); // AppRegistry.registerComponent(appName, () => App);
angular.module("MainApp").directive('date', function(){ return { restrict: "E", scope:{ endDate: '@', startDate: '@', ngModel:'=', ngChange:'&' }, template: "<div class='input-group date'>" + "<input ng-model='ngModel' type='text' class='form-control' name='date' ng-pattern='/^(([0][1-9]|[12][0-9]|3[01])[\/]([0][1-9]|1[012])[\/]([0-9]{4}))$/'>" + "<span class='input-group-addon'>" + "<i class='fa fa-calendar-o'></i></span></div>", link: function(scope, iElement, iAttrs) { $element=iElement.children('.input-group.date') $element.datepicker({ format: "dd/mm/yyyy" , autoclose: true , showOnFocus: false, todayHighlight: true , forceParse:false , startDate : scope.startDate , endDate: scope.endDate , orientation: "auto right" , weekStart:1 }).on('changeDate', function(e){ scope.ngChange(); scope.$apply(); }); $element.children('input').focus(function() { $element.datepicker('hide') }); } } });
App.match_status = App.cable.subscriptions.create("MatchStatusChannel", { connected: function() { // Called when the subscription is ready for use on the server var matchId; if (matchId = $('.match-body').data('match-id')) { return this.perform("follow", { match_id: matchId}) } else { return this.perform("nofollow"); }; }, disconnected: function() { // Called when the subscription has been terminated by the server }, received: function(data) { // Called when there's incoming data on the websocket for this channel $(".match-body").data( "match-status", data['new_match_status'] ); console.log(data['new_match_status'] ); if (data['new_match_status'] === "UPCOMING") { var new_match = `<p class="alert alert-danger">MATCH NOT YET STARTED.</p>` var clock = $('.clock').html(""); }; if (data['new_match_status'] === "LIVE") { var new_match = `<p class="alert alert-success">MATCH IN PROGRESS. FIRST PERIOD</p>` var clock = $('.clock').FlipClock({clockFace: 'MinuteCounter'}); }; if (data['new_match_status'] === "END OF QUARTER") { var new_match = `<p class="alert alert-success">MATCH IN PROGRESS. QUARTER INTERVAL</p>` var clock = $('.clock').html(""); }; if (data['new_match_status'] === "HALF TIME") { var new_match = `<p class="alert alert-success">MATCH IN PROGRESS. HALF TIME</p>` var clock = $('.clock').html(""); }; if (data['new_match_status'] === "2ND") { var new_match = `<p class="alert alert-success">MATCH IN PROGRESS. SECOND PERIOD</p>` var clock = $('.clock').FlipClock({clockFace: 'MinuteCounter'}); }; if (data['new_match_status'] === "3RD") { var new_match = `<p class="alert alert-success">MATCH IN PROGRESS. THIRD PERIOD</p>` var clock = $('.clock').FlipClock({clockFace: 'MinuteCounter'}); }; if (data['new_match_status'] === "4TH") { var new_match = `<p class="alert alert-success">MATCH IN PROGRESS. FOURTH PERIOD</p>` var clock = $('.clock').FlipClock({clockFace: 'MinuteCounter'}); }; if (data['new_match_status'] === "COMPLETED") { var new_match = `<p class="alert alert-warning">MATCH COMPLETED.</p>` var clock = $('.clock').html(""); }; $(".match-state").html(new_match); }, update: function() { return this.perform('update'); } });
var gulp = require('gulp'), livereload = require('gulp-livereload'), connect = require('gulp-connect'); gulp.task('connect', function() { connect.server({ livereload: true }); }); //html gulp.task('html', function () { return gulp.src('*.html') .pipe(connect.reload()) }) //css gulp.task('css', function () { return gulp.src('css/*.css') .pipe(connect.reload()) }); //js gulp.task('js', function () { return gulp.src('js/*.js') .pipe(connect.reload()) }); //watch gulp.task('watch', function () { gulp.watch('css/*.css', ['css']) gulp.watch('*.html', ['html']) gulp.watch('js/*.js', ['js']) }) //default gulp.task('default', ['connect','watch'])
import React from 'react' import {withRouter} from 'react-router-dom' class deleteBookmark extends React.Component { render () { return (<button onClick={(e)=>{ this.props.onClickDelete(e.target.parentNode.parentNode.id); this.props.history.push('/'); }}>Delete</button>) } } export default withRouter(deleteBookmark)
import { sleep } from './common' import set from 'lodash/set' export const asyncValidator = schema => async (formValues, props) => { const context = props.context || {} try { await schema.validate(formValues, { abortEarly: false, context }) return Promise.resolve({}) } catch (errors) { const resultErrors = errors.inner.reduce( (errors, err) => ({ ...errors, [err.path]: err.message }), {}) return Promise.reject(resultErrors) } } // export const syncValidator = schema => (formValues, props) => { // const context = props.context || {} // try { // schema.validateSync(formValues, { abortEarly: false, context }) // return {} // } catch (errors) { // const resultErrors = errors.inner.reduce( // (errors, err) => ({ // ...errors, // [err.path]: err.message // }), {}) // return resultErrors // } // } export const syncValidator = schema => (formValues, props) => { // console.log('props', props) const context = props.context || {} // console.log("context", context) try { schema.validateSync(formValues, { abortEarly: false, context }) return {} } catch (errors) { // console.log('errors', errors) let resultErrors = {} errors.inner.forEach((error) => { // console.log('error.path', error.path) // Checks whether it's an array or not. // If a $ sign is in a path, it's an array if (/\$/.test(error.path)) { // Checks if it's a top level of an array // If a path ends with a $ sign, it's a top level of an array if (/\$$/.test(error.path)) { set(resultErrors, error.path + '[_error]', error.message); // If the path includes the $ sign and number wrapped with square brackets, // it's a multilevel path } else if (/\$\[\d+\]/.test(error.path)) { set(resultErrors, error.path, error.message); } } else { set(resultErrors, error.path, error.message); // resultErrors[error.path] = error.message } }) // console.log('resultErrors', resultErrors) return resultErrors } } export const required = (message = 'Required') => value => value ? undefined : message // eslint-disable-next-line no-template-curly-in-string export const maxLength = (max, message = 'Must be ${max} characters or less') => (value) => { // eslint-disable-next-line no-template-curly-in-string const regexMax = new RegExp('\\${max}', 'gi') // eslint-disable-next-line no-template-curly-in-string const regexValue = new RegExp('\\${value}', 'gi') // eslint-disable-next-line no-template-curly-in-string const regexLength = new RegExp('\\${length}', 'gi') return value && value.length > max ? message .replace(regexMax, max) .replace(regexValue, value) .replace(regexLength, value.length) : undefined } // eslint-disable-next-line no-template-curly-in-string export const minLength = (min, message = 'Must be ${min} characters or more') => (value = '') => { // eslint-disable-next-line no-template-curly-in-string const regexMin = new RegExp('\\${min}', 'gi') // eslint-disable-next-line no-template-curly-in-string const regexValue = new RegExp('\\${value}', 'gi') // eslint-disable-next-line no-template-curly-in-string const regexLength = new RegExp('\\${length}', 'gi') return value.length < min ? message .replace(regexMin, min) .replace(regexValue, value) .replace(regexLength, value.length) : undefined } export const number = (message = 'Must be a number') => value => { // eslint-disable-next-line no-template-curly-in-string const regexValue = new RegExp('\\${value}', 'gi') return value && isNaN(Number(value)) ? message.replace(regexValue, value) : undefined } // eslint-disable-next-line no-template-curly-in-string export const minValue = (min, message = 'Must be at least ${min}') => value => { // eslint-disable-next-line no-template-curly-in-string const regexMin = new RegExp('\\${min}', 'gi') // eslint-disable-next-line no-template-curly-in-string const regexValue = new RegExp('\\${value}', 'gi') return value && value < min ? message .replace(regexMin, min) .replace(regexValue, value) : undefined } export const email = (message = 'Invalid email address') => value => value && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(value) ? message : undefined export const tooYoung = (age = 0, message = 'You do not meet the minimum age requirement!') => value => { // eslint-disable-next-line no-template-curly-in-string const regexAge = new RegExp('\\${age}', 'gi') return value && value < age ? message.replace(regexAge, age) : undefined } export const aol = (message = 'Really? You still use AOL for your email?') => value => value && /.+@aol\.com/.test(value) ? message : undefined export const alphaNumeric = (message = 'Only alphanumeric characters') => value => value && /[^a-zA-Z0-9 ]/i.test(value) ? message : undefined export const russianPhoneNumberPattern = ( pattern = '+7 (XXX) XXX-XX-XX', // eslint-disable-next-line no-template-curly-in-string message = 'Invalid phone number, a format of a phone number must be ${pattern} ' ) => (value) => { // eslint-disable-next-line no-template-curly-in-string const regexLength = new RegExp('\\${pattern}', 'gi') return value && !/^(\+7 \([0-9]{3}\)\s[0-9]{3}-[0-9]{2}-[0-9]{2})$/i.test(value) ? message.replace(regexLength, pattern) : undefined } const checkUserName = (username, props) => { if (['john', 'paul', 'george', 'ringo'].includes(username)) { // eslint-disable-next-line no-throw-literal throw { ...props.asyncErrors, username: 'That username is taken' } } } const checkUserEmail = (email, props) => { if (['john@mail.com', 'paul@mail.com', 'george@mail.com', 'ringo@mail.com'] .includes(email)) { // eslint-disable-next-line no-throw-literal throw { ...props.asyncErrors, email: 'That email is already taken' } } } const checkUserAge = (age, props) => { if (age < 16) { // eslint-disable-next-line no-throw-literal throw { ...props.asyncErrors, age: 'You are too young :(' } } } export const asyncValidate = (values, dispatch, props, blurredField) => { console.log(props) return sleep(1000).then(() => { if (blurredField === 'username') { checkUserName(values.username, props) } if (blurredField === 'email') { checkUserEmail(values.email, props) } if (blurredField === 'age') { checkUserAge(values.age, props) } }) } // const checkUserName = async ({username}, dispatch, props, field) => { // console.log(props) // await sleep(1000) // if (['john', 'paul', 'george', 'ringo'].includes(username)) { // // eslint-disable-next-line no-throw-literal // return Promise.reject( {...props.asyncErrors, username: 'That username is taken' }) // } // return Promise.resolve() // } // const checkUserEmail = async ({email}, dispatch, props, field) => { // await sleep(1000) // if (['john@mail.com', 'paul@mail.com', 'george@mail.com', 'ringo@mail.com'] // .includes(email)) { // // eslint-disable-next-line no-throw-literal // return Promise.reject( {...props.asyncErrors, email: 'That email is already taken' }) // } // return Promise.resolve() // } // const checkUserAge = async ({age}, dispatch, props, field) => { // await sleep(1000) // if (age < 16) { // // eslint-disable-next-line no-throw-literal // return Promise.reject( {...props.asyncErrors, age: 'You are too young :(' }) // } // return Promise.resolve() // } // const composeAsyncValidators = (validatorFns) => { // return async (values, dispatch, props, field) => { // const validatorFn = validatorFns[field] // await validatorFn(values, dispatch, props, field); // }; // } // export const asyncValidate = composeAsyncValidators({ // username: checkUserName, // email: checkUserEmail, // age: checkUserAge // })
/*!build time : 2014-10-14 4:03:42 PM*/
let txtExample = document.getElementById("txtExample"); function calcScores() { var stringVals = txtExample.value; let myArray = stringVals.split(" "); // reduce let sum = 0; for (let count = 0; count < myArray.length; count++) { sum += Number(myArray[count]); } console.log(sum); }
function StreamReader(bytes) { var bytes = bytes; var index = 0; this.readLine = function() { var str = ""; while(index < bytes.length && bytes[index] != 0xD && bytes[index] != 0xD) str += String.fromCharCode(bytes[index++]); if(index + 1 < bytes.length && bytes[index] == 0xD && bytes[index + 1] == 0xA) index += 2; // Skip CrLf else if(index < bytes.length && (bytes[index] == 0xD || bytes[index + 1] == 0xA)) ++index; // Skip Cr or Lf return str; } } function getBoundsF32(floats) { var fmin = Number.MAX_VALUE, fmax = Number.MIN_VALUE; floats.forEach(function(f) { fmin = Math.min(fmin, f); fmax = Math.max(fmax, f); }); return [fmin, fmax]; } function getBoundsI16(words) { return [0, 1]; //EDIT } function normalizeF32(floats, bounds) { var voffset = -bounds[0], vscale = 1 / (bounds[1] - bounds[0]); for(var i = 0, numpixels = floats.length; i < numpixels; ++i) floats[i] = (floats[i] + voffset) * vscale; } function F32toI24(floats, bounds) { var bytes = new Uint8Array(4 * floats.length); var i = 0, vscale = 0xFFFFFE / (bounds[1] - bounds[0]); floats.forEach(function(f) { var value = Math.floor((f - bounds[0]) * vscale) + 1; bytes[i + 0] = (value >> 16) & 0xFF; bytes[i + 1] = (value >> 8) & 0xFF; bytes[i + 2] = (value >> 0) & 0xFF; bytes[i + 3] = 255; i += 4; }); return bytes; } function F32toI24flipY(floats, bounds, width, height) { var bytes = new Uint8Array(4 * floats.length); var i = 0, vscale = 0xFFFFFE / (bounds[1] - bounds[0]); for(var y = 0; y < height; ++y) for(var x = 0; x < width; ++x) { var value = Math.floor((floats[(height - y - 1) * width + x] - bounds[0]) * vscale) + 1; bytes[i + 0] = (value >> 16) & 0xFF; bytes[i + 1] = (value >> 8) & 0xFF; bytes[i + 2] = (value >> 0) & 0xFF; bytes[i + 3] = 255; i += 4; } return bytes; } function I16toI24(words, bounds) { var bytes = new Uint8Array(4 * words.length); var i = 0; words.forEach(function(word) { bytes[i + 0] = 0; bytes[i + 1] = (word >> 8) & 0xFF; bytes[i + 2] = (word >> 0) & 0xFF; bytes[i + 3] = 255; i += 4; }); return bytes; } function readImImage(bytes) { var sr = new StreamReader(bytes); var readline = sr.readLine(); if(!readline.startsWith("Image type: ")) return null; var imageType = readline.substring("Image type: ".length); readline = sr.readLine(); if(!readline.startsWith("Name: ")) return null; var name = readline.substring("Name: ".length); readline = sr.readLine(); if(!readline.startsWith("Image size (x*y): ")) return null; var imageSize = readline.substring("Image size (x*y): ".length).split('*'); var width, height; if(imageSize.length != 2 || (width = parseInt(imageSize[0])) == NaN || width <= 0 || (height = parseInt(imageSize[1])) == NaN || height <= 0) // Error: Illegal value for 'Image size' return null; readline = sr.readLine(); if(!readline.startsWith("File size (no of images): ")) return null; var numImages = readline.substring("File size (no of images): ".length); var numpixels = width * height; var values = new Float32Array(bytes.buffer, 0x200, numpixels); var vmin = Number.MAX_VALUE, vmax = Number.MIN_VALUE; for(var i = 0; i < numpixels; ++i) { vmin = Math.min(vmin, values[i]); vmax = Math.max(vmax, values[i]); } var vscale = 0xFFFFFE / (vmax - vmin); bytes = new Uint8Array(4 * numpixels); var i = 0; for(var y = 0; y < height; ++y) for(var x = 0; x < width; ++x) { var value = Math.floor((values[(height - y - 1) * width + x] - vmin) * vscale) + 1; bytes[i + 0] = (value >> 16) & 0xFF; bytes[i + 1] = (value >> 8) & 0xFF; bytes[i + 2] = (value >> 0) & 0xFF; bytes[i + 3] = 255; i += 4; } return { bytes: bytes, width: width, height: height, vmin: vmin, vmax: vmax }; } function readFitsImage(filename, onerr, onreceivebytes, onreceivefloats) { var fits = new astro.FITS(filename, function() { var dataunit = this.getDataUnit(); console.log("width = " + dataunit.width); console.log("height = " + dataunit.height); console.log("depth = " + dataunit.depth); console.log("bzero = " + dataunit.bzero); console.log("bscale = " + dataunit.bscale); console.log("bitpix = " + dataunit.bitpix); dataunit.getFrame(0, function(array) { switch(dataunit.bitpix) { case 16: var bounds = getBoundsI16(array); array = I16toI24(array, bounds); onreceivebytes(array, dataunit.width, dataunit.height, bounds[0], bounds[1]); break; case -32: if(true) //EDIT: if(float texture supported) { var bounds = getBoundsF32(array); normalizeF32(array, bounds); for(var i = 0, numpixels = array.length; i < numpixels; ++i) array[i] = Math.sqrt(array[i]); onreceivefloats(array, dataunit.width, dataunit.height, bounds[0], bounds[1]); } else { var bounds = getBoundsF32(array); array = F32toI24(array, bounds); onreceivebytes(array, dataunit.width, dataunit.height, bounds[0], bounds[1]); } break; default: onerr("FIPS pixel format not implemented: " + dataunit.bitpix); } }); }); }
import RedditApi from '../api/reddit.api'; function decodeEntities(encodedString) { const textArea = document.createElement('textarea'); textArea.innerHTML = encodedString; return textArea.value; } const Reddit = { /** * Get the images feed from the selected set of communities * * Reddit.getFeed(['Art', 'mildlyinteresting', 'listentothis']) * @param communities array of community titles * @returns {void[]} */ getFeed: async (communities) => { const result = await RedditApi.getCommunityPosts(communities); return { items: result.items .filter(Reddit.isMediaEntry) .map((entry) => ({ // TODO: is it available? // TODO: it may be gif animation; previews are static; src: decodeEntities(entry.data.preview.images[0].source.url), type: 'image', community: entry.data.subreddit_name_prefixed, title: entry.data.title, author: entry.data.author, link: entry.data.url, post: `https://reddit.com${entry.data.permalink}`, embed: decodeEntities(Reddit.getMediaEmbed(entry)), })), after: result.after, }; }, getMediaEmbed(entry) { try { return entry.data.secure_media_embed.content || entry.data.crosspost_parent_list[0].secure_media_embed.content; } catch { return null; } }, isMediaEntry(entry) { return entry.data.selftext === ''; } }; export default Reddit;
const instance = new GLSlideshow( ['IMG_2648.jpg', 'IMG_2240.jpg', 'pfp.jpg'], { canvas: document.getElementById( 'slideshow-container' ) // more options here // width and height of the slideshow width: 1024, height: 576, // duration time in ms duration: 1000, // interval time in ms interval: 5000, // aspect ratio imageAspect: null, // 'crossFade' // 'crossZoom' // 'directionalWipe' // 'wind' // 'ripple' // 'pageCurl' effect: 'crossZoom' } );
var utils = require('gmdp').init_gmdp.core_app_utils; var spawn = require('child_process').spawn; // 转换编码工具 var iconv_lite = require('iconv-lite'); exports.sendMessage = function(phone,msg){ // msg = "尊敬的用户,您找回密码的验证码为:"; msg = iconv_lite.decode(new Buffer(msg), 'gbk'); // msg = iconv_lite.encode(msg, 'GBK').toString(); // jar 参数 var args = []; args.push("-jar"); //固定,不要改动 args.push("cmcc-uip-client-node2.0.0.jar"); //jar 名称 args.push("http://218.201.202.242:9013/uip/ws/uipWSServer"); //访问接口地址 args.push('bap0001'); // 接口编码 args.push('CTAgKoX6IklKf12OF9AKFw=='); // 秘钥串 args.push("\"{'phone':'"+ phone +"', 'msg':'"+ msg +"'}\""); //具体组装参数 //\"{'phone':'15885095210','msg':'fgfgg'}\" //改参数为新增参数 args.push("MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKM/QGXXfRdHbpYWCusIgH43YOwl5XkSSmEHTozrldc4O7GQvTZEcG+QGv7J19te/rdKYl8dDHoKmAuB5cVg68Zz4AYYu/t/BBTiI8C8aouUpxZzW7ehDiWehZmhaSDhQZCdlCGAhCRZxy3ci0g8A5vPS4UJ9wZ6pdwWmSLPSM8PAgMBAAECgYBasHDeIvBjVlOhHW3DVF3NwIYfqo3ozLh1XtHMh7QedCb1Zis3Up4D3FKi6Q7517Q5ryEnJcQgqHH/MpKrLETOf7CFwfzC3Z7oQxU7HgYciRdv7VZmOPlVoVuFIQKv5iXkxI5pcN2ZkcyLkTjUPR4vKn+8gzVF36pZbYTiTHsRwQJBANDY1ZDe5IsCa+diK3vLNs15HYAXXmoQlFZRh27fQ/exbilcjg+fYPiGa202r2O8HHzQcxySiVUg5oHwz2NhUwMCQQDIGshysgXy0A+uNzeglB6ARmDehaGdXwE0DqywJi3aKmlepoSKGdjtq24+Bfm5YVfFzcQ5NPLm913ti+uSZhAFAkBhSXELIFm0S7d6POfmrf5kbxQH9Frd68U+BJKjWkvuGXAowl3G90aT3wIyCPRg8GMQ3YWR/M0Oo9ndFBF3yQGDAkBdVWC5Xp+3qaQmtkqT84Jmgm0cXWgMZwvApDeX0bcBU1bidvjLEVNFR/ibpV3dQbIW6OrlY/UIFckRy3mNR12hAkEAttUVTsmBlJwPoM6QYJsnzFrpx/UWdEOwR9v5CAgtl77cJNWHh83IPgIThd8NXa47i+/LzN2agAq3QF4a7zZsIg=="); //privateStr : 私钥, 新增RSA加密私钥, 本次只新增该参数 // 命令参数 var option = { cwd: __dirname +'./' }; // 调用 var callJar = spawn("java", args, option); console.log(callJar) // 调用错误 var e = null; callJar.on('error', function (error) { e = error; }); // 标准错误输出 var error = []; callJar.stderr.on('error', function (data) { error.push(data); }); // 标准正常输出 var stdout = []; callJar.stdout.on('data', function (data) { stdout.push(data); }); // 关闭 callJar.on('close', function (code) { if(e){ console.error("发送失败"+e) //utils.respMsg(res, false, '2000', '发送验证码出错', null, e); return; } // 这里是调用jar控制台的所有打印消息 // var data = iconv_lite.decode(Buffer.concat(stdout), 'utf-8'); var data = iconv_lite.decode(Buffer.concat(stdout), 'GBK'); // var data = Buffer.concat(stdout).toString(); console.log(data); // 截取UIP返回值 var start = "=====start====="; var end = "=====end====="; if(data.indexOf(start) != -1 && data.indexOf(end) != -1){ data = data.substring(data.indexOf(start) + start.length, data.indexOf(end)); } // 转换JSON data = JSON.parse(data); // 发送失败 if(!data.success){ //utils.respMsg(res, false, '2000', '发送失败', null, null); console.error("发送失败") return; } }); }
import React from 'react'; import './Balance.css'; export default ({ balance }) => ( <h2> Current Balance: <span className={balance < 0 ? "negative balance" : "balance"}> ${balance.toFixed(2)} </span> </h2> );
import React, {useState, useEffect} from 'react'; import {ScrollView, StyleSheet, Text, View, TextInput} from 'react-native'; import Icon from 'react-native-vector-icons/dist/FontAwesome'; import MIcon from 'react-native-vector-icons/dist/MaterialIcons'; import ResultCards from '../components/ResultCards'; import axios from 'axios'; import moment from 'moment'; function Results({navigation}) { const [allData, setAllData] = useState([]); // const [searchTerm, setSearchTerm] = useState(''); const [searchQuery, setSearchQuery] = useState(''); const [searchData, setSearchData] = useState([]); const [loading, setLoading] = useState(false); const [isFocused, setIsFocused] = useState(false); // const handleChange = event => { // setSearchTerm(event); // console.log(searchTerm); // }; function searchMovie(text) { if (text !== '') { axios .get( 'https://api.themoviedb.org/3/search/movie?api_key=8aa112291918d981bc0206b734023546&page=1' + '&query=' + text, ) .then(response => { console.log(response.data.results); setSearchData(response.data.results); }) .then(setLoading(true)) .catch(err => console.log(err)); } else { setLoading(false); } } useEffect(() => { axios .get( 'https://api.themoviedb.org/3/trending/movies/week?api_key=8aa112291918d981bc0206b734023546', ) .then(response => { // console.log(response.data.results); setAllData(response.data.results); }) .catch(error => { console.log('error', error); }); }, []); // useEffect(() => { // const results = allData.filter( // movie => movie.original_title.indexOf(searchTerm) !== -1, // ); // console.log(searchTerm); // setAllData(results); // }, [searchTerm]); return ( <ScrollView> <View style={styles.header}> <Icon name="chevron-left" size={20} color="#fff" style={styles.icon} onPress={() => navigation.navigate('Home')} /> <Text style={styles.title}>Results </Text> <MIcon name="tune" size={25} color="#fff" style={styles.icon} /> </View> <View style={styles.searchbar}> <TextInput style={[ styles.input, isFocused && { borderWidth: 2, borderColor: '#f08989', backgroundColor: '#fff', }, ]} onBlur={() => setIsFocused(false)} onFocus={() => setIsFocused(true)} placeholder="Avengers" value={searchQuery} onChangeText={text => { setSearchQuery(text); searchMovie(text); }}> {/* <Icon name="search" size={20} color="#000" /> */} </TextInput> </View> {loading === false ? ( <ScrollView> {allData.map(movies => { return ( <View key={movies.id}> <ResultCards imgSrc={`https://image.tmdb.org/t/p/w500/${movies.poster_path}`} movieName={movies.original_title} moviedesc="Action &#8226; Adventure &#8226; Drama" year={moment(movies.release_date).format('YYYY')} views={`${movies.vote_count} +`} stars={`⭐${movies.vote_average}`} duration="🕒 3h 01min" /> </View> ); })} </ScrollView> ) : ( <View> {searchData.map(movies => { return ( <View key={movies.id}> <ResultCards imgSrc={`https://image.tmdb.org/t/p/w500/${movies.poster_path}`} movieName={movies.original_title} moviedesc="Action &#8226; Adventure &#8226; Drama" year={moment(movies.release_date).format('YYYY')} views={`${movies.vote_count} +`} stars={`⭐${movies.vote_average}`} duration="🕒 3h 01min" /> </View> ); })} </View> )} </ScrollView> ); } const styles = StyleSheet.create({ header: { height: 90, width: '100%', display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', }, icon: { backgroundColor: '#f08989', marginVertical: 15, marginHorizontal: 30, paddingVertical: 15, paddingHorizontal: 18, borderRadius: 20, }, title: { textAlign: 'center', fontSize: 18, fontWeight: 'bold', }, searchbar: { display: 'flex', flexDirection: 'row', alignItems: 'center', marginHorizontal: 30, marginVertical: 10, }, input: { fontSize: 18, color: '#000', backgroundColor: '#e5e5e5', borderColor: '#bdbdbd', borderRadius: 20, borderWidth: 2, height: 60, width: '100%', paddingHorizontal: 10, }, }); export default Results;
'use strict' var Koa = require('koa'); var Router = require('koa-router'); var app = new Koa(); var router = new Router(); router .get('/', function(ctx, next) { ctx.body = 'Hello World!'; }) .post('/user', function(ctx, next) { ctx.body = "Test 1"; // ... }) .put('/user/:id', function(ctx, next) { ctx.body = "Test 2"; // ... }) .del('/user/:id', function(ctx, next) { ctx.body = "Test 3"; // ... }) .all('/user/:id', function(ctx, next) { ctx.body = "Test 4"; // ... }); app .use(router.routes()) .use(router.allowedMethods()); app.listen(3000);
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; import Header from './components/Header'; import Dashboard from './components/Dashboard'; import TaskList from './components/TaskList'; import AddTaskView from './components/AddTaskView'; import StatusStrip from './components/StatusStrip'; const App = (props) => ( <Router> <Header appName="TaskManager" /> <main className="container-fluid p-4"> <Switch> <Route path="/" exact component={Dashboard} /> <Route path="/addTask" component={AddTaskView} /> <Route path="/taskList" component={TaskList} /> </Switch> </main> <StatusStrip /> </Router> ); export default App;
import React, { useState } from "react"; // Elements import Button from "@material-ui/core/Button"; import TextField from "@material-ui/core/TextField"; // Icons import SaveIcon from "@material-ui/icons/Save"; // Components import EncodedPayload from "../EncodedPayload/EncodedPayload" export default function EncoderTransferOwnership({ web3, account }) { const [newOwner, setNewOwner] = useState(""); const [encodedPayload, setEncodedPayload] = useState(""); return ( <> <TextField label="new owner" defaultValue="0x..." value={newOwner} fullWidth onChange={(event) => setNewOwner(event.target.value)} /> <div style={{ height: 300, width: "100%", marginBottom: 10, marginTop: 10 }} > <Button variant="contained" color="primary" size="large" startIcon={<SaveIcon />} onClick={() => { setEncodedPayload( account.methods .transferOwnership(newOwner) .encodeABI() ); }} > Encode ABI </Button> <EncodedPayload payload={encodedPayload} /> </div> </> ); }
import DropDown from "./Dropdown.vue"; import Parallax from "./Parallax.vue"; import NavTabsCard from "./cards/NavTabsCard.vue"; import Tabs from "./Tabs.vue"; export { DropDown, Parallax, NavTabsCard, Tabs };
import { configure, addDecorator, addParameters } from '@storybook/react'; import { withConsole } from '@storybook/addon-console'; addDecorator((storyFn, context) => withConsole()(storyFn)(context)); const viewports = { smallScreenViewport: { name: 'small screen viewport', styles: { width: '1280px', height: '100vh' }, type: 'desktop' }, middleScreenViewport: { name: 'middle screen viewport', styles: { width: '1660px', height: '100vh' }, type: 'desktop' }, largeScreenViewport: { name: 'large screen viewport', styles: { width: '2560px', height: '100vh' }, type: 'desktop' } }; addParameters({ viewport: { viewports: viewports } }); // automatically import all files in stories folder const req = require.context('../src/stories', true, /\.stories\.tsx$/); function loadStories() { req.keys().forEach(req); } configure(loadStories, module);
import React, { Component } from 'react'; import ActivityItem from './ActivityItem.js'; class Content extends Component { render() { const {activities} = this.props; return ( <div className="content"> <div className="line"></div> {activities.map((activity) => { return ( <ActivityItem activity={activity} /> ); })} </div> ); } } export default Content;
var class_collar = [ [ "Collar", "class_collar.html#a38686bdf479c4632510dfc8588269117", null ], [ "~Collar", "class_collar.html#a01eb61e5442322342d2823e3238a6b49", null ], [ "getLength", "class_collar.html#a7a3537b6d6e035de830f307213197cf4", null ], [ "operator=", "class_collar.html#ae3d58b50687cdb9437cc463da1a839c9", null ], [ "show", "class_collar.html#a62cb1fca94648c11289d7cf883929dd0", null ], [ "wczytaj", "class_collar.html#afc3896d8ee90af37df36c85e79618708", null ], [ "operator<<", "class_collar.html#ab4b9fefd9ac78c7174cb532598c41d33", null ] ];
import React, {Component, PropTypes} from 'react'; import {connect} from 'react-redux'; import Layout from '../../components/Layout' @connect( state => { return { menus: state.menus } }, {} ) export default class App extends Component { constructor(props) { super(props); } render() { return <Layout menus={this.props.menus}> {this.props.children} </Layout> } }
/** * Maps a user profile to a Slack-based identity. * (Drastically modified version of https://github.com/auth0/node-samlp/blob/0b29f97b3c36e706d15822e043d3affad1a7609c/lib/claims/PassportProfileMapper.js) * * @param {Object} user - the user profile */ export default function mapSlackUserAttributes(user) { return { getClaims() { return { 'User.Email': user.email, 'User.Username': user.handle, first_name: user.firstName, last_name: user.lastName, } }, getNameIdentifier() { return { nameIdentifier: user.id, nameIdentifierFormat: 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent', } }, } }
// JavaScript Document (function($) { "use strict"; //Hidden Bar Menu Config function hiddenBarMenuConfig() { var menuWrap = $('.hidden-bar .side-menu'); // appending expander button menuWrap.find('.dropdown').children('a').append(function () { return '<button type="button" class="btn expander"><i class="icon fa fa-bars"></i></button>'; }); // hidding submenu menuWrap.find('.dropdown').children('ul').hide(); // toggling child ul menuWrap.find('.btn.expander').each(function () { $(this).on('click', function () { $(this).parent() // return parent of .btn.expander (a) .parent() // return parent of a (li) .children('ul').slideToggle(); // adding class to expander container $(this).parent().toggleClass('current'); // toggling arrow of expander $(this).find('i').toggleClass('fa-minus fa-bars'); return false; }); }); } /*--------------------------------------- featured product, bestseller, carousel ----------------------------------------- */ $('.feartured-carousel, .bestseller-carousel').owlCarousel({ items : 4, itemsDesktop : [1199,4], itemsDesktopSmall : [991,2], itemsTablet: [767,1], itemsMobile : [480,1], autoPlay : true, stopOnHover: true, navigation: true, pagination: false, navigationText: ['<img src="/Content/StarIndiaHoliday/images/prevarrow.png">', '<img src="/Content/StarIndiaHoliday/images/nextarrow.png">'] }); /*--------------------------------------- featured product, bestseller, carousel ----------------------------------------- */ $('.feartured-carouse2').owlCarousel({ items: 4, itemsDesktop: [1199, 4], itemsDesktopSmall: [991, 2], itemsTablet: [767, 1], itemsMobile: [480, 1], autoPlay: true, stopOnHover: true, navigation: true, pagination: false, navigationText: ['<img src="/Content/StarIndiaHoliday/images/prevarrow.png">', '<img src="/Content/StarIndiaHoliday/images/nextarrow.png">'] }); /*--------------------------------------- featured product, bestseller, carousel ----------------------------------------- */ $('.hot-tour-package').owlCarousel({ items : 2, itemsDesktop : [1199,2], itemsDesktopSmall : [991,2], itemsTablet: [767,1], itemsMobile : [480,1], autoPlay : true, stopOnHover: false, navigation: true, pagination: false, navigationText: ['<img src="/Content/StarIndiaHoliday/images/prevarrow2.png">', '<img src="/Content/StarIndiaHoliday/images/nextarrow2.png">'] }); /*--------------------------------------- featured product, bestseller, carousel ----------------------------------------- */ $('.testimonial-crousal').owlCarousel({ items : 3, itemsDesktop : [1199,3], itemsDesktopSmall : [991,2], itemsTablet: [767,1], itemsMobile : [480,1], autoPlay : true, stopOnHover: false, navigation: false, pagination: true, navigationText: ['<img src="/Content/StarIndiaHoliday/images/prevarrow2.png">', '<img src="/Content/StarIndiaHoliday/images/nextarrow2.png">'] }); /*------------------------------------------------------------------------------*/ /* TopSearch /*------------------------------------------------------------------------------*/ jQuery( ".ttm-header-search-link a" ).addClass('sclose'); jQuery( ".ttm-header-search-link a" ).on('click',function(event ) { if (jQuery('.ttm-header-search-link a').hasClass('sclose')) { jQuery(this).removeClass('sclose').addClass('open'); jQuery(".ttm-search-overlay").addClass('st-show'); jQuery(".ttm-search-overlay").slideDown( 400, function() { jQuery(".field.searchform-s").focus(); }); } else { jQuery(this).removeClass('open').addClass('sclose'); jQuery(".ttm-search-overlay").slideUp( 400, function() { }); } jQuery(".ttm-search-close").on('click',function(){ jQuery('.ttm-header-search-link a').removeClass('st-show').addClass('sclose'); jQuery(".ttm-search-overlay").slideUp(400,function(){}); }); }); })(window.jQuery);
myApp.controller('cloudCalendarController', ['$scope',function ($scope) { $scope.openSidebar = function () { angular.element(document.getElementsByClassName('sidebar')).toggleClass('active'); angular.element(document.getElementById('menu-action')).toggleClass('active'); if (angular.element(document.getElementsByClassName('sidebar')).hasClass('active')) { $(this).find('i').addClass('fa-close'); $(this).find('i').removeClass('fa-bars'); } else { $(this).find('i').addClass('fa-bars'); $(this).find('i').removeClass('fa-close'); } }; $scope.events = [ { id: 1, title : "event1", start : "2016-12-2", end : "2016-12-3" }, { id: 2, title : "event2", start : "2016-12-10", end : "2016-12-10" }, { id: 3, title : "event3", start : "2016-12-11", end : "2016-12-11" }, { id: 4, title : "event4", start : "2016-12-12", end : "2016-12-12" }, { id: 5, title : "event5", start : "2016-12-13", end : "2016-12-13" }, { id: 6, title : "event6", start : "2016-12-20", end : "2016-12-20" }, { id: 7, title : "event7", start : "2016-12-25", end : "2016-12-25" }, { id: 8, title : "event8", start : "2016-12-25", end : "2016-12-25" }, { id: 9, title : "event9", start : "2016-12-25", end : "2016-12-25" }, { id: 10, title : "event10", start : "2016-12-12", end : "2016-12-12" } ]; $scope.eventClick = function (calEvent) { angular.element(document.getElementById('myModal')).modal(); angular.element(document.getElementById('eventText')).val(calEvent.title); $scope.saveEditEvent = function () { calEvent.title = angular.element(document.getElementById('eventText')).val(); angular.element(document.getElementById('calendar')).fullCalendar('updateEvent', calEvent.title); angular.element(document.getElementById('myModal')).modal('hide'); }; $scope.removeEvent = function () { angular.element(document.getElementById('calendar')).fullCalendar('removeEvents', calEvent.id); angular.element(document.getElementById('myModal')).modal('hide'); } }; $scope.dayClick = function( date ){ angular.element(document.getElementById('dialog')).dialog('open'); $scope.clickDate = date.format("yyyy-mm-dd"); angular.element(document.getElementById('start')).val($scope.clickDate); $scope.addEvent = function () { if(angular.element(document.getElementById('title')).val() != ""){ console.log($scope.events.length) $scope.obj = { id: $scope.events.length, title: angular.element(document.getElementById('title')).val(), start: angular.element(document.getElementById('start')).val(), end: angular.element(document.getElementById('end')).val() }; $scope.events.push($scope.obj) angular.element(document.getElementById('dialog')).dialog('close'); angular.element(document.getElementById('calendar')).fullCalendar('renderEvent', $scope.obj); } }; angular.element(document.getElementById('title')).val(""); angular.element(document.getElementById('end')).val(""); }; angular.element(document.getElementById('dialog')).dialog({ autoOpen: false, show:{ effect:"blind", duration:200 }, hide:{ effect:"blind", duration:200 } }); angular.element(document.getElementsByClassName('datepicker')).datepicker({ dateFormat: "yy-mm-dd" }); /* config object */ $(function() { var calendar; calendar = angular.element(document.getElementById('calendar')).fullCalendar({ selectable: true, selectHelper: true, editable: true, header: { left: 'month,agendaWeek,agendaDay', center: 'prev,title,next', right: 'today' }, dayClick: $scope.dayClick, eventClick: $scope.eventClick, events: $scope.events })}); }]);
const data = [ { category: "sent", amount: "200.00", user: "majeed", date: new Date("2020-01-01") }, { category: "recieved", amount: "5000.00", user: "frances", date: new Date("2020-02-03") }, { category: "sent", amount: "400.00", user: "daniel", date: new Date("2020-03-14") }, { category: "recieved", amount: "8000.00", user: "gideon", date: new Date("2020-05-20") }, { category: "sent", amount: "400.00", user: "daniel", date: new Date("2020-06-25") }, { category: "fail", amount: "2000.00", user: "gideon", date: new Date("2020-08-17") }, ]; module.exports = data;
/** * Copyright 2016 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ goog.provide('audioCat.state.editMode.EditModeManager'); goog.require('audioCat.state.editMode.EditModeChangedEvent'); goog.require('audioCat.state.editMode.EditModeName'); goog.require('audioCat.utility.EventTarget'); goog.require('goog.asserts'); /** * Manages the current mode of the application. * @param {!Array.<!audioCat.state.editMode.EditMode>} editModes A list of edit * modes that are to be supported. * @param {!audioCat.state.editMode.EditModeName} initialEditMode The edit mode * to be in initially. * @constructor * @extends {audioCat.utility.EventTarget} */ audioCat.state.editMode.EditModeManager = function(editModes, initialEditMode) { goog.base(this); var editModeMapping = {}; var numberOfEditModes = editModes.length; for (var i = 0; i < numberOfEditModes; ++i) { var editMode = editModes[i]; editModeMapping[editMode.getName()] = editMode; } /** * A mapping from edit mode name to the edit mode object. * @private {!Object.<!audioCat.state.editMode.EditModeName, * !audioCat.state.editMode.EditMode>} */ this.editModeMapping_ = editModeMapping; /** * The current mode. * @private {!audioCat.state.editMode.EditMode} */ this.currentEditMode_ = editModeMapping[initialEditMode]; }; goog.inherits( audioCat.state.editMode.EditModeManager, audioCat.utility.EventTarget); /** * Retrieves an edit mode given its name. * @param {audioCat.state.editMode.EditModeName} editModeName The name. * @return {!audioCat.state.editMode.EditMode} The edit mode with that name. */ audioCat.state.editMode.EditModeManager.prototype.getEditModeByName = function(editModeName) { var editMode = this.editModeMapping_[editModeName]; goog.asserts.assert(editMode); return editMode; }; /** * @return {!audioCat.state.editMode.EditMode} The current edit mode. */ audioCat.state.editMode.EditModeManager.prototype.getCurrentEditMode = function() { return this.currentEditMode_; }; /** * Sets the current edit mode. * @param {!audioCat.state.editMode.EditModeName} editModeName The name of the * edit mode to set to. */ audioCat.state.editMode.EditModeManager.prototype.setCurrentEditMode = function(editModeName) { var previousEditMode = this.currentEditMode_; var newEditMode = this.editModeMapping_[editModeName]; this.currentEditMode_ = newEditMode; this.dispatchEvent(new audioCat.state.editMode.EditModeChangedEvent( previousEditMode, newEditMode)); };
console.log("payment");
export const melbourneRoute = { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "marker-color": "#7e7e7e", "marker-size": "medium", "marker-symbol": "", "bearing": 350 }, "geometry": { "type": "Point", "coordinates": [ 144.96288299560547, -37.82171764783965 ] } }, { "type": "Feature", "properties": { "bearing": 270 }, "geometry": { "type": "Point", "coordinates": [ 144.9785041809082, -37.808359917423594 ] } }, { "type": "Feature", "properties": { "marker-color": "#7e7e7e", "marker-size": "medium", "marker-symbol": "", "bearing": 180 }, "geometry": { "type": "Point", "coordinates": [ 144.95558738708496, -37.8057830213145 ] } }, { "type": "Feature", "properties": { "marker-color": "#7e7e7e", "marker-size": "medium", "marker-symbol": "", "bearing": 90 }, "geometry": { "type": "Point", "coordinates": [ 144.94434356689453, -37.81649689372308 ] } } ] };
import React from 'react'; import FoldersList from '/imports/ui/containers/folders'; import InvitedFoldersList from '/imports/ui/containers/invited-folders'; import {FoldersHeader} from '/imports/ui/components/folders-header'; import {Loading} from '/imports/ui/components/loading'; export const FoldersView = ({foldersCollection}) => ( <div className="view-container"> <section> <FoldersHeader iconClass="fa fa-user" title="My Folders" showNewFolderBtn={true}/> <FoldersList /> <FoldersHeader iconClass="fa fa-users" title="Invited to Folders" showNewFolderBtn={false}/> <InvitedFoldersList /> </section> </div> );
import React, { useState } from "react"; import { useHistory, Link } from "react-router-dom"; import { TextField, Button } from "@material-ui/core"; import appLogo from '../../../assets/branding/logo.png'; import AlertHelper from "../../../Components/Alert/Alert"; import SignImage from '../../../Components/SignImage/SignImage.js'; import "./RestorePasswordPage.scss"; const RestorePasswordPage = () => { const history = useHistory(); const regexpEmail = /^(([^<>()[\]\\.,;:\s@']+(\.[^<>()[\]\\.,;:\s@']+)*)|('.+'))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; const [email, setEmail] = useState(""); const [openError, setError] = useState(false); const [errorText, setErrorText] = useState(false); const [alert, setAlert] = useState(""); const checkEmail = (e) => { if (!email.match(regexpEmail)) { setAlert("error"); setErrorText(`Пример: jsmith@example.com`); setError(true); } else { setAlert("success"); setErrorText(`Корректый E-mail`); setError(true); } }; return ( <div className='restore-password'> <div className="left-restore-password"> <div className="image-header-restore-password"> <Link to='/' > <img src={appLogo} alt="logo"/> </Link> </div> <p className="header-text-1">Забыли пароль?</p> <div className="input-fields-restore-password"> <TextField InputLabelProps={{ shrink: true, className: "label" }} label="Почта" type="email" className="input" variant="outlined" value={email} onChange={(e) => setEmail(e.target.value)} onBlur={() => checkEmail()} /> </div> <div className="restore-password-for-button"> <Button className="restore-password-btn" variant="outlined" onClick={() => history.push("/sign/up/2")} > Восстановить пароль </Button> </div> <div className="buttons-for-restore-password"> <p>Нет аккаунта?</p> <Link to="/sign/up"> Создать аккаунт </Link> </div> </div> <AlertHelper isOpen={openError} text={errorText} alertColor={alert} onClose={setError} /> <div className='rigth-restore-password'> <SignImage/> </div> </div> ); }; export default RestorePasswordPage;
import React, { Component } from 'react'; var FileSaver = require('file-saver'); import { CSSTransition } from 'react-transition-group'; import "../controls/RecSwitch.css" export class RecSwitch extends Component { state = {powered: true, recordOn: false, savePending: false, performanceName: ''} componentDidUpdate(prevProps, prevState) { if(prevProps.deviceOn!==this.props.deviceOn){ this.setState({powered: this.props.deviceOn}); } } toggleRecordButton = (event) => { event.preventDefault(); this.setState({recordOn: !this.state.recordOn}, () => this.operateRecorder()); } operateRecorder = () => { if(this.state.recordOn) { this.props.recorder.record(); } else { this.props.recorder.stop(); this.props.recorder.exportWAV( (blob) => { this.setState({savePending: true}); this.performancefile = blob; }); this.props.recorder.clear(); } this.styleRecButtonState(); } handleOnChange = (event) => { this.setState({performanceName: event.target.value}); } savePerformance = () => { FileSaver.saveAs(this.performancefile, this.state.performanceName || 'unnamed swarm performance'); this.setState({savePending: false}); } styleRecButtonState = () => { return `recswitch ${(this.state.recordOn && this.state.powered) ? 'pushed on': ''}`; } styleSaveButtonState = () => { return `saveswitch ${this.state.savePending ? '': 'disabled'}`; } render() { const { savePending } = this.state; return( <div className="record"> <label>REC</label> <div className={this.styleRecButtonState()} onClick={this.toggleRecordButton} onTouchStart={this.toggleRecordButton}> </div> <CSSTransition in={savePending} timeout={2000} classNames="save-as" unmountOnExit > <div className='save'> <label>Save Performance as:</label> <input type="text" value={this.state.performanceName} onChange={this.handleOnChange}/> <div className={this.styleSaveButtonState()} onClick={this.savePerformance} /> <label className="sublabel">Save</label> </div> </CSSTransition> </div> ); } }
import "./App.css"; import React, { createContext, useState } from "react"; import TabGrid from "./components/TabGrid"; import Preference from "./components/preference/Preference"; import Data from "./Data"; export const LinksData = createContext(); function App() { const [preferenceToggle, setPreferenceToggle] = useState(false); const [linkData, setLinkData] = useState(Data); const [view, setView] = useState(true); const [tabGrid, setTabGrid] = useState({ gridClass: "tabGrid", linkClass: "linkGrid", nameClass: "nameGrid", iconClass: "iconGrid", }); return ( <div className="App"> <i className="setting fas fa-cog" onClick={() => !setPreferenceToggle(!preferenceToggle)} ></i> {!view && ( <i className="view fas fa-th-large" onClick={() => { setView(true); setTabGrid({ gridClass: "tabGrid", linkClass: "linkGrid", nameClass: "nameGrid", iconClass: "iconGrid", }); }} ></i> )} {view && ( <i className="view fas fa-th-list" onClick={() => { setView(false); setTabGrid({ gridClass: "tabList", linkClass: "linkList", nameClass: "nameList", iconClass: "iconList", }); }} ></i> )} <LinksData.Provider value={{ linkData, setLinkData }}> <TabGrid tabGrid={tabGrid} /> {preferenceToggle && <Preference />} </LinksData.Provider> </div> ); } export default App;
function operationstest_Function(){ //Defining a function and naming it var randomnumber = Math.random() * 3; //Defining variable "randomnumber" and assigning its a random number (0-3) with the math.Random operation var number1 = 6; //Defining variable "number1" and assigning its the number value 6 var number2 = 10; //Defining variable "number2" and assigning its the number value 10 var number3 = 8; //Defining variable "number3" and assigning its the number value 8 var number4 = 3; //Defining variable "number4" and assigning its the number value 3 var number5 = 32; //Defining variable "number5" and assigning its the number value 32 var number6 = 15; //Defining variable "number6" and assigning its the number value 15 var number7 = 2; //Defining variable "number7" and assigning its the number value 2 number7++; //Increment variabe "number7" var number8 = 4; //Defining variable "number8" and assigning its the number value 4 number8--; //Decrement variabe "number8" var result = number1 + number2 / number3 * number4 + number5 % number6 - randomnumber + number7 - number8; //Defining variable "result" and assigning it the value of operations performed between variables "number1" to "number 8" document.getElementById("test").innerHTML = result; //Putting the value of "result" into HTML elements with "test" }
function Confirm(){ var txt1 = document.getElementById("txt1").innerHTML; var txt2 = document.getElementById("txt2").value; if (txt1 == txt2) { document.getElementById("result").innerHTML = "<h2 style='color:green;'>Its right</h2>"; }else{ document.getElementById("result").innerHTML = "<h2 style='color:red;'>not right</h2>"; } Generate(); } function Generate(){ document.getElementById("txt2").value = ""; var word = ['world','Hello','names','say','facundo','cellphone','Luis','black','lives','matter','how','are',90,12,43,2,'paralax','random','computer','robot','selfie',]; document.getElementById("txt1").innerHTML = word[Math.floor(Math.random()*word.length)]; }
'use strict'; import Base from './base.js'; import fs from 'fs'; import path from 'path'; export default class extends Base { indexAction(){ return this.display(); } async uploadAction() { let user = await this.session('userInfo'); let userpath = user[0].id; let file = think.extend({}, this.file('file')); let suffix = file.headers['content-type']; if(suffix == 'image/jpeg' || suffix == 'image/jpg') suffix = '.jpg'; if(suffix == 'image/png') suffix = '.png'; if(suffix == 'image/gif') suffix = '.gif'; let filepath = file.path; //文件上传后,需要将文件移动到项目其他地方,否则会在请求结束时删除掉该文件 let uploadPath = think.RESOURCE_PATH + '/static/upload/'+ userpath; think.mkdir(uploadPath); let basename = path.basename(filepath); if(basename.indexOf('.') == -1){ basename = basename + suffix; } fs.renameSync(filepath, uploadPath + '/' + basename); file.path = uploadPath + '/' + basename; if(think.isFile(file.path)){ console.log('is file') }else{ console.log('not exist') } this.success('/static/upload/'+ userpath + '/' + basename); } }
const axios = require('axios'); const ROUTING = { sync: '/api/marketplace_builder/marketplace_releases/sync', graph: '/api/graph' }; module.exports = { sync: data => axios.put(ROUTING.sync, data), getItems(type) { const query = `{ items: cms_items(type: ${type}) { results { type name: resource_name data }}}`; return this.graph(query); }, getItemTypes() { const query = '{ itemTypes: cms_discovery { results { name path fields }}}'; return this.graph(query); }, graph: query => { return axios.post(ROUTING.graph, { query: query }); } };
// // Loading page animation // $("img").one("load", function() { // $(".se-pre-con").fadeOut("slow"); // }).each(function() { // if(this.complete) $(this).load(); // }); // (function(){ //console.log($('.parallax').length); if($('.parallax').length != 0) { $('.parallax').waitForImages(true).done(function() { $(".se-pre-con").fadeOut("slow");// Loaded all images referenced in CSS. //console.log('???'); setTimeout(function(){ TweenMax.to(".logo", 2, {'marginTop':'0px', 'opacity': 1, ease: Power4.easeOut}); }, 200); }); } else{ if($('.img-responsive').length != 0) { $('.img-responsive').waitForImages(true).done(function() { $(".se-pre-con").fadeOut("slow");// Loaded all images referenced in CSS. //console.log('!!!'); }); } } })(); $(document).ready(function(){ if($(window).width()>450){ $('.about.full-bg1, .about.full-bg2').css('height',$('.lead.lead-large').height()+280); } //console.log($('.lead.lead-large').height()); var currentMousePos = { x: -1, y: -1 }; var flag = false; $(document).mousemove(function(event) { currentMousePos.x = event.pageX; currentMousePos.y = event.pageY; //console.log(currentMousePos.y); //console.log($('.about.full-bg1').height()); if(currentMousePos.y < $('.about.full-bg1').height()+60){ if(!flag) { TweenMax.to($('.about.full-bg1'), 0.1, {opacity:0, ease: Power1.easeOut}); flag = true; } } else { if(flag) { TweenMax.to($('.about.full-bg1'), 0.1, {opacity:1, ease: Power1.easeOut}); flag = false; } } }); $('header').css('height',$(window).height()); $('.project').css('min-height',$(window).height()); $('.password-section').css('min-height',$(window).height()*.75); // Home page data list var list = ["Tokyo, Japan", "Yilan, Taiwan", "San Francisco, CA", "New York, NY", "San Diego", "Vegas", "Grand Canyon", "Rino", "Singapore", "Hong Kong"]; var num = Math.floor((Math.random() * 4)+1); $('.header').css({"background":"url(img/bg-copy"+num+".jpg) center center no-repeat"}); $('.header').css({"background-size":"cover"}); $('.photo p').text(list[num-1]); // About page large text animation $('.lead.lead-large').delay(240).animate({opacity:1, 'margin-top':'183px'},500,'easeOutCubic'); window.onkeydown = function(e) { if(e.keyCode == 32 && e.target == document.body) { e.preventDefault(); if($('.play').hasClass('fa-play')){ $('.play').removeClass('fa-play'); $('.play').addClass('fa-pause') var video = $('.play').prev('.video'); video.get(0).play(); $('.black').fadeIn(); //$(this).delay(1000).fadeTo(.9,0); } else { $('.play').removeClass('fa-pause'); $('.play').addClass('fa-play') var video = $('.play').prev('.video'); video.get(0).pause(); $('.black').fadeOut(); } return false; } }; // Set margins var x = $(window).height()/2-350/2; $('.header').css('padding-top',x); if($(window).height()<$('section.project').children().height()){ $('section.project').children().css('margin-bottom','100px') }; var h = ($(window).height()-220)/2-($('section.project').children().height()-100)/2; if($(window).height()>$('section.project').children().height()){ $('section.project').css('margin-top',h); } var k = ($(window).height()-220)/2-380/2; if(k < 50) k = 50; if($(window).width()<991) $('.info').css('padding-top',50); else $('.info').css('padding-top',k); $('.info').css('margin-top',$(window).height()); // Progressive disclosure images $('.hideme').each( function(i){ var bottom_of_object = $(this).position().top + $(this).outerHeight()/8; var bottom_of_window = $(window).scrollTop() + $(window).height(); /* If the object is completely visible in the window, fade it it */ if( bottom_of_window > bottom_of_object ){ $(this).animate({'opacity':'1','margin-top':'-80px'},10,'easeOutQuart'); } }); $('.hideme1').each( function(i){ var bottom_of_object = $(this).position().top + $(this).outerHeight()/2; var bottom_of_window = $(window).scrollTop() + $(window).height(); /* If the object is completely visible in the window, fade it it */ if( bottom_of_window > bottom_of_object ){ $(this).animate({'opacity':'1'},10,'easeOutQuart'); } }); // onScroll $(window).scroll( function(){ /* Check the location of each desired element */ $('.hideme').each( function(i){ var bottom_of_object = $(this).position().top + $(this).outerHeight()/8; var bottom_of_window = $(window).scrollTop() + $(window).height(); /* If the object is completely visible in the window, fade it it */ if( bottom_of_window > bottom_of_object ){ $(this).animate({'opacity':'1','margin-top':'-80px'},1000,'easeOutQuart'); } }); $('.hideme1').each( function(i){ var bottom_of_object = $(this).position().top + $(this).outerHeight()/2; var bottom_of_window = $(window).scrollTop() + $(window).height(); /* If the object is completely visible in the window, fade it it */ if( bottom_of_window > bottom_of_object ){ $(this).animate({'opacity':'1'},1000,'easeOutQuart'); } }); var v = ($('.play').parent().height()+20)/2; $('.play').css('margin-top',-v); var x = $(window).height()/2-350/2; $('.header').css('padding-top',x); var h = ($(window).height()-220)/2-($('section.project').children().height()-100)/2; if($(window).height()>$('section.project').children().height()){ $('section.project').css('margin-top',h); } if($(window).height()<$('section.project').children().height()){ $('section.project').children().css('margin-bottom','100px') }; var k = ($(window).height()-220)/2-380/2; if(k < 50) k = 50; if($(window).width()<991) $('.info').css('padding-top',50); else $('.info').css('padding-top',k); $('.info').css('margin-top',$(window).height()); }); $('#cbp-fwslider').hover(function() { $('.cbp-fwslider nav').fadeIn(200); }, function() { $('.cbp-fwslider nav').fadeOut(200); }); $('#cbp-fwslider1').hover(function() { $('.cbp-fwslider nav').fadeIn(200); }, function() { $('.cbp-fwslider nav').fadeOut(200); }); $('.angle-down').hover(function() { $(this).addClass('transition-movedown'); }, function() { $(this).removeClass('transition-movedown'); }); $('.angle-up').hover(function() { $(this).addClass('transition-moveup'); }, function() { $(this).removeClass('transition-moveup'); }); $('.portfolio-item').hover(function() { $(this).children().children().first().addClass('transition'); }, function() { $(this).children().children().first().removeClass('transition'); }); $('.portfolio-item').hover(function() { $(this).children().children().last().addClass('transition-moveup'); }, function() { $(this).children().children().last().removeClass('transition-moveup'); }); $('.icontop').hover(function() { $(this).addClass('transition'); }, function() { $(this).removeClass('transition'); }); $('#logocover').hover(function() { $(this).addClass('transition'); }, function() { $(this).removeClass('transition'); }); /* video */ var timeout = null; $(document).on('mousemove', function() { if (timeout !== null) { //$(document.body).text(''); if($('.play').hasClass('fa-pause')){ $('.play').fadeTo(1,.9); } clearTimeout(timeout); } timeout = setTimeout(function() { if($('.play').hasClass('fa-pause')){ $('.play').fadeTo(1,0); } }, 2000); }); //$('.video').click(function(){this.paused?this.play():this.pause();}); $('.play').click(function(){ if($(this).hasClass('fa-play')){ $(this).removeClass('fa-play'); $(this).addClass('fa-pause') var video = $(this).prev('.video'); video.get(0).play(); $('.black').fadeIn(); //$(this).delay(1000).fadeTo(.9,0); } else { $(this).removeClass('fa-pause'); $(this).addClass('fa-play') var video = $(this).prev('.video'); video.get(0).pause(); $('.black').fadeOut(); }; }); $('.play').hover(function(){ $(this).fadeTo(1,.9); }, function() { if($(this).hasClass('fa-play')){ $(this).fadeTo(1,.5); } //else $(this).delay(1000).fadeTo(1,0); }); var rm = ""; $('.section-more .portfolio-item').hover(function(){ var add_class = ($(this).attr('class').split(' '))[1]; var remove_class = ($('section.section-more').attr('class').split(' '))[1]; rm = remove_class; $('section.section-more').removeClass(remove_class).addClass(add_class); //$(this).parent().siblings().animate({'opacity':'0.5'},250); }, function(){ var remove_class = ($(this).attr('class').split(' '))[1]; $('section.section-more').removeClass(remove_class).addClass(rm); //$(this).parent().siblings().animate({'opacity':'1'},250); }); // for ( var i = 2; i < 11; i++ ) { // $('#page-content'+i).hide(); // } /* * Global variables. */ var pageHeight = $(window).height(); var pageWidth = $(window).width(); var navigationHeight = $("#navigation").outerHeight(); /* * ON RESIZE, check again */ $(window).resize(function () { pageWidth = $(window).width(); pageHeight = $(window).height(); var t = (pageHeight-50-$('.Absolute-Center').height())/2+80; if(t <=80) t = 80; $('.Absolute-Center').css('padding-top',t); var v = ($('.play').parent().height()+20)/2; $('.play').css('margin-top',-v); var x = $(window).height()/2-350/2; $('.header').css('padding-top',x); if($(window).height()<$('section.project').children().height()){ $('section.project').children().css('margin-bottom','100px') }; $('.info').css('margin-top',$(window).height()); var h = ($(window).height()-220)/2-($('section.project').children().height()-100)/2; if($(window).height()>$('section.project').children().height()){ $('section.project').css('margin-top',h); } var k = ($(window).height()-220)/2-380/2; if(k < 50) k = 50; if($(window).width()<991) $('.info').css('padding-top',50); else $('.info').css('padding-top',k); if(pageWidth < 450){ $('.lead.lead-large').text('Interaction Designer + Creative Technologist'); $('.about.full-bg1, .about.full-bg2').css('height', '460px'); }else{ $('.lead.lead-large').text('An interaction designer and creative technologist focusing on experience design, interactive installation, and creative coding.'); $('.about.full-bg1, .about.full-bg2').css('height',$('.lead.lead-large').height()+280); } }); var t = (pageHeight-50-$('.Absolute-Center').height())/2+80; if(t <=80) t = 80; $('.Absolute-Center').css('padding-top',t); var v = ($('.play').parent().height()+20)/2; $('.play').css('margin-top',-v); /* * ON LOAD */ if(window.scrollY > 330) { $('.fixedDiv').fadeIn(); $('#logotitle').fadeIn(); $('#logotitle').css("visibility","visible"); $('.fixedDiv').css("visibility","visible"); } $('#logotitle').css('left',pageWidth/2+173); $('.gif').hover(function() { var source = $(this).attr("src"); $(this).attr("src", source); },function(){ var source = $(this).attr("ssrc"); $(this).attr("src", source); } ); // // Fix navigation. // if ( document.location.href.indexOf('blog') > -1 || document.location.href.indexOf('about') > -1) { // $('.fixedDiv').fadeIn(); // $('#logotitle').fadeIn(); // $('#logotitle').css("visibility","visible"); // $('.fixedDiv').css("visibility","visible"); // window.addEventListener("scroll",function() { // if(window.scrollY > 335) { // $('.change').removeClass('arrow-dark'); // $('.change').addClass('arrow-light'); // } // else { // $('.change').removeClass('arrow-light'); // $('.change').addClass('arrow-dark'); // } // },false); // var range = 330; // $(window).on('scroll', function() { // var st = $(this).scrollTop(); // var offset = $('.callout').offset().top; // var height = $('.callout').outerHeight(); // offset = offset + height / 1.1; // $('.callout').css({ // 'opacity': (1 - ((st - offset + range) / (range))) // }); // }); // } // else { // var pathname = document.location.pathname; // if(pathname.length > 7 || pathname.length<2){ // $(window).scroll(function() { // var height = $(window).scrollTop(); // if(height > pageHeight-25) { // $('#trigger-overlay').removeClass('changing-light'); // $('#trigger-overlay').addClass('changing-dark'); // $('.change-all').removeClass('arrow-dark'); // $('.change-all').addClass('arrow-light'); // } // else { // $('#trigger-overlay').removeClass('changing-dark'); // $('#trigger-overlay').addClass('changing-light'); // $('.change-all').removeClass('arrow-light'); // $('.change-all').addClass('arrow-dark'); // } // }); // } // if(pathname.length > 7 || pathname.length<2){ // window.addEventListener("scroll",function() { // if(window.scrollY > 330) { // $('.fixedDiv').fadeIn(); // $('#logotitle').fadeIn(); // $('#logotitle').css("visibility","visible"); // $('.fixedDiv').css("visibility","visible"); // if(window.scrollY > pageHeight-25) { // $('.change-all').removeClass('arrow-dark'); // $('.change-all').addClass('arrow-light'); // $('#trigger-overlay').removeClass('changing-light'); // $('#trigger-overlay').addClass('changing-dark'); // } // else { // $('.change-all').removeClass('arrow-light'); // $('.change-all').addClass('arrow-dark'); // $('#trigger-overlay').removeClass('changing-dark'); // $('#trigger-overlay').addClass('changing-light'); // } // } // else { // $('.fixedDiv').fadeOut(100); // $('#logotitle').fadeOut(100); // } // },false); // } // } // Paralax initialization. // Exclude for mobile. if(pageWidth > 980){ //Dont user paralax for tablet and mobile devices. /*$('#top').parallax("0%", 0.1);*/ $('parallax').parallax("0%", 0.1); $('.callout').parallax("0%", 0.3); } if(pageWidth < 450){ $('.lead.lead-large').text('Interaction Designer + Creative Technologist'); } else{ $('.lead.lead-large').text('An interaction designer and creative technologist focusing on experience design, interactive installation, and creative coding.'); } // Scroll to Top $("a[href='#top']").click(function() { //console.log("???"); $("html, body").animate({ scrollTop: 0 }, 1000, 'easeInOutCubic'); return false; }); $("a[href='#project']").click(function() { $("html, body").animate({ scrollTop: $(window).height() }, 1000, 'easeInOutCubic'); return false; }); }); // $(document).on('mouseover', function(e) { // console.log($(e.target).attr('class')); // }); /* * Ajax request. * Start loading. * Append loading notification. */ $( document ).ajaxSend( function() { // Show loader. if($(".loading").length == 0) { $("body").append('<div class="loading"><div class="progress progress-striped active"><div class="bar"></div></div></div>'); $(".loading").slideDown(); $(".loading .progress .bar").delay(300).css("width", "100%"); } }); /* * Reinitialize Scrollspy after ajax request is completed. * Refreshing will recalculate positions of each page in document. * Time delay is added to allow ajax loaded content to expand and change height of page. */ $( document ).ajaxComplete(function() { // Remove loading section. $(".loading").delay(1000).slideUp(500, function(){ $(this).remove(); }); // Portfolio details - close. $(".close-portfolio span").click(function(e) { $(".portfolio-item-details").delay(500).slideUp(500, function(){ $(this).remove(); }); window.location.hash= "!"; return false; }); }); // // var id = document.location.href.split('#')[1]; // console.log(id); // $('input#submitButton').click( function(event) { // event.preventDefault(); // var input = $('#password').val(); // if(input == "AKQA") { // $('form p').remove(); // switch(id){ // case 'jordan': // window.location.href = "jordan-hangar/access.html"; // break; // case 'duo': // window.location.href = "duo-design/access.html"; // break; // case 'google': // window.location.href = "google-glass/access.html"; // break; // default: // } // } // else { // $('form p').remove(); // $('form').append('<p>The password is incorrect.</p>'); // } // }); // $('input#password').click( function(event) { // event.preventDefault(); // $('form p').remove(); // }); // //http://www.jsobfuscate.com/index.php eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('e d=r.0.3.s(\'#\')[1];t.q(d);$(\'2#o\').j(i(4){4.k();e 2=$(\'#a\').l();m(2=="n"){$(\'5 p\').8();v(d){b\'g\':9.0.3="g-D/7.c";6;b\'f\':9.0.3="f-z/7.c";6;b\'h\':9.0.3="h-C/7.c";6;B:}}A{$(\'5 p\').8();$(\'5\').u(\'<p>y a x w.</p>\')}});$(\'2#a\').j(i(4){4.k();$(\'5 p\').8()});',40,40,'location||input|href|event|form|break|access|remove|window|password|case|html|id|var|duo|jordan|google|function|click|preventDefault|val|if|AKQA|submitButton||log|document|split|console|append|switch|incorrect|is|The|design|else|default|glass|hangar'.split('|'),0,{}))
//获取应用实例 let app = getApp() var API = require('../../api/API.js'); var utils = require('../../utils/util.js'); var mGourmetList = []; var headerList = []; var initFlag = false; var mLoading = false; var PAGE_SIZE = 50; var mPage = 1; var mIsmore = false; function showMap() { var that = this; if (mLoading) return; //等待加载完 if (mGourmetList.length > 0) { app.globalData.gourmets = mGourmetList; gotoMap() } else { // 没有点的情况 wx.showModal({ title: "周围没有推荐的地道美食", content: "不如你来推荐一个?", success: function (res) { if (res.confirm) { console.log('用户点击确定') that.addPoint() } else { console.log('用户点击取消') gotoMap() } } }) } function gotoMap() { wx.navigateTo({ url: '../map/map' }) } } function setLoading(loading) { mLoading = loading; utils.showLoading(loading); } function loadFirstPage(that) { if (!app.globalData.locationInfo) { app.getLocationInfo(info => { // console.log('先获取位置,', info) }) setTimeout(function() { loadFirstPage(that) }, 1500); return; } setLoading(true); API.getGourmetByPage(1, PAGE_SIZE, (gourmets) => { console.log('loadFirstPage', gourmets); setLoading(false); mGourmetList = gourmets; mPage = 1; mIsmore = true; that.setData({ gourmets: mGourmetList, ismore: mIsmore }) }) API.getHeaderInfo((header) => { setLoading(false); headerList = header; console.log('headerList', headerList); that.setData({ headers: headerList, }) }) } Page({ data: { userInfo: wx.getStorageSync(app.globalData.userInfoKey), avatarUrl: "", app_name: '美食地图', ismore: mIsmore, gourmets: mGourmetList, isShowUserPannel: false, //是否显示个人中心面板 autoplay: true, interval: 5000, duration: 500, }, showUserPannel: function() { let isShow = this.data.isShowUserPannel if (!isShow) { isShow = true } else { isShow = false } this.setData({ isShowUserPannel: isShow }) }, showMaps:function(){ showMap(); }, // gotoDetail: function (e) { // if (mLoading) return; // var item = e.target.dataset.item; // if (item) { // wx.navigateTo({ // url: '/pages/detail/detail?item=' + JSON.stringify(item) // }) // } // }, checkHeader: function(e) { var id = e.target.dataset.id; var item = e.target.dataset.item; if (id == 0) { showMap(); } else if (id == 1) { if (item) { wx.navigateTo({ url: '../pageopen/pageopen?item=' + JSON.stringify(item), }) } } else if (id == 2) { wx.navigateTo({ url: '', }) } }, //添加美食点点 addPoint: function() { wx.navigateTo({ url: '/pages/add_gourmet/add_gourmet' }) }, goReadlog: function() { wx.navigateTo({ url: '/pages/readlog/readlog' }) }, onLoad: function(options) { // Do some initialize when page load. API.addLocationPoint() this.setData({ userInfo: app.getUserinfo_1() }) }, onReady: function() { initFlag = true; loadFirstPage(this); }, onShow: function() { if (!initFlag) return; if (!app.flags.refresh_index) return; app.flags.refresh_index = false; loadFirstPage(this); }, onHide: function() { this.setData({ isShowUserPannel: false }) }, onUnload: function() {}, onPullDownRefresh: function() { wx.stopPullDownRefresh(); if (mLoading) return; if (!initFlag) return; loadFirstPage(this); }, onReachBottom: function() { this.loadMore() }, gotoDetail: function(e) { if (mLoading) return; var item = e.target.dataset.item; if (item) { wx.navigateTo({ url: '/pages/detail/detail?item=' + JSON.stringify(item) }) } }, onShareAppMessage: function() { return { title: 'Nanabite美食地图', desc: '吃吃吃吃吃!吃点啥好?', path: '/pages/index/index' } }, loadMore: function() { if (!mIsmore) return; wx.showNavigationBarLoading(); var that = this; API.getGourmetByPage(mPage + 1, PAGE_SIZE, (gourmets) => { console.log('loadMore', gourmets); mIsmore = (gourmets.length > 0); mPage++; mGourmetList = mGourmetList.concat(gourmets); that.setData({ gourmets: mGourmetList, ismore: mIsmore }) wx.hideNavigationBarLoading() }) }, stopScroll: function() {} })
import React from 'react'; import { Text } from 'react-native'; import { useCavy, wrap } from 'cavy'; export const key = 'ContainsTextNumerical'; const testId = `${key}.Element`; export const Screen = () => { const generateTestHook = useCavy(); const WrappedText = wrap(Text); return <WrappedText ref={generateTestHook(testId)}>1</WrappedText> }; export const label = 'spec.containsText checks a number inside an element'; export const spec = spec => spec.describe(key, () => spec.it(label, async () => { await spec.containsText(testId, '1'); // Also works passing in a integer: await spec.containsText(testId, 1); }) );
function getRestData(){ var model = api.require('model'); var query = api.require('query'); api.showProgress({ title: '加载中...', modal: false }); query.createQuery(function(ret, err) { if (ret && ret.qid) { var queryId = ret.qid; model.findAll({ class: "merchant", qid: queryId }, function(ret, err) { if (ret) { // alert(JSON.stringify(ret)); var content = $api.byId('lifeList'); var tpl = $api.byId('act-template').text; var tempFn = doT.template(tpl); content.innerHTML = tempFn(ret); //hide loading api.hideProgress(); api.refreshHeaderLoadDone(); //init tapmode api.parseTapmode(); } else { //alert(JSON.stringify(err)); } }); } }); } //filter data function getDataByFilter(column, filter){ if(!column || !filter){return;} //show loading api.showProgress({ title: '加载中...', modal: false }); var model = api.require('model'); var query = api.require('query'); query.createQuery(function(ret, err){ if(ret && ret.qid){ var queryId = ret.qid; query.whereEqual({ qid: queryId, column: column, value: filter }); model.findAll({class:"merchant", qid:queryId}, function(ret, err){ if(ret){ // alert(JSON.stringify(ret)); var content = $api.byId('lifeList'); var tpl = $api.byId('act-template').text; var tempFn = doT.template(tpl); content.innerHTML = tempFn(ret); //hide loading api.hideProgress(); api.refreshHeaderLoadDone(); //init tapmode api.parseTapmode(); }else{ // alert(JSON.stringify(err)); } }); } }); } function call(el) { event.stopPropagation(); event.preventDefault(); var num = $api.attr(el, 'rel'); api.call({ type: 'tel_prompt', number: num }); } function openRest(el) { var dataId = $api.attr(el, 'data-id'); api.openWin({ name: 'restaurant', url: 'restaurant.html', opaque: true, pageParam:{dataId: dataId}, vScrollBarEnabled: false }); } apiready = function() { getRestData(); api.setRefreshHeaderInfo({ visible: true, bgColor: '#f2f2f2', textColor: '#4d4d4d', textDown: '下拉刷新...', textUp: '松开刷新...', showTime: true }, function(ret, err) { getRestData(); }); }
import React, {Component} from 'react'; export default class BoxCenter extends Component { getWires() { return {box: this.refs.box}; } getWireInputs() { return { offset: ( this.refs.parent.getBoundingClientRect().width - this.refs.box.getBoundingClientRect().width ), }; } getWireProperties() { return {}; } render() { return (<div ref="parent" style={{width: '100%', height: '100%', transform: 'translate(50%, 50%)'}}> <div style={{width: '33%', paddingBottom: '33%'}}> <div style={{width: '100%', height: '100%', transform: 'translate(-50%, -50%)'}}> <div ref="box" style={{width: '100%', paddingBottom: '100%', background: 'black'}}></div> </div> </div> </div>); } } BoxCenter.previewArmature = true;
const supertestLib = require("supertest"); const app = require("../../index"); const supertest = supertestLib(app()); describe("updateCardState", () => { describe("when request is not valid", () => { describe("when blockId param not valid", () => { it("should return http 400 w/error", (done) => { supertest .put("/flashcard-blocks/some/thing") .expect(400, { message: 'blockId: "some" is not valid' }, (err) => { if (err) throw err; done(); }); }); }); describe("when cardId param not valid", () => { it("should return http 400 w/error", (done) => { supertest .put("/flashcard-blocks/1/thing") .expect(400, { message: 'cardId: "thing" is not valid' }, (err) => { if (err) throw err; done(); }); }); }); }); describe("when request is valid", () => { describe("when card update ok", () => { it("should return 204 http status code", (done) => { supertest.put("/flashcard-blocks/1/1").expect(204, (err) => { if (err) throw err; done(); }); }); }); describe("when card not found", () => { it("should return 404 http status code", (done) => { supertest .put("/flashcard-blocks/1/100000000") .expect(404, { message: "Card not found!" }, (err) => { if (err) throw err; done(); }); }); }); }); });
import React from "react"; import { NavLink } from "react-router-dom"; const coursesList = [ { name: "Kartpresentasjon – merk: ny dato", date: "28. mai", city: "Bergen", type: "Kurs", path: "#" }, { name: "Norgesmesterskap for eiendomsbransjen 2019", date: "12. juni", city: "Oslo", type: "Kurs", path: "#" }, { name: "Norkart Tjenestepanel – ditt verktøy for kart på nett", date: "13. juni", city: "WEBKURS", type: "Kurs", path: "#" }, { name: "Etablering av ledningsnett", date: "03-04 september", city: "Bergen", type: "Kurs", path: "#" }, { name: "VA-måledata fra entreprenør", date: "05-06 september", city: "Bergen", type: "Kurs", path: "#" }, { name: "Norkart Tjenestepanel – ditt verktøy for kart på nett", date: "05. september", city: "WEBKURS", type: "Kurs", path: "#" } ]; const Section3 = () => { const courses = coursesList.map((course, index) => ( <div key={index}> <NavLink to={course.path}>{course.name}</NavLink> <div className="wrapper"> <p>Dato:</p> <p>{course.date}</p> <p>Sted:</p> <p>{course.city}</p> <p>Kurstype: </p> <p>{course.type}</p> <button>Les mer</button> </div> </div> )); return ( <> <article className="section3"> <h3>Delta på kurs hos oss</h3> <div className="cours"> <button className="all">Se alle kurs</button> {courses} </div> </article> </> ); }; export default Section3;
module.exports = { 'Develop': require('./Develop.json'), }
const thirukkural = { label: 'திருக்குறள்', id: 'thirukkural', img: 'thirukkural', list: [ { id: 'notes', type: 'passage', label: `தேர்வு செய்யப் பட்டவை `, commonData: { title: '' }, data: [ [ `# கடவுள் வாழ்த்து`, { type: 'poem', text: `அகர முதல எழுத்தெல்லாம் ஆதி பகவன் முதற்றே உலகு.` }, { type: 'small', text: 'பொருள்: அகரமே எழுத்துகளுக்குத் தொடக்கம். ஆதி பகவனே உலகுக்குத் தொடக்கம்.' }, '# வான் சிறப்பு', { type: 'poem', text: `விண்இன்று பொய்ப்பின் விரிநீர் வியனுலகத்து உள்நின்று உடற்றும் பசி.` }, { type: 'small', text: 'பொருள்: மழை உரியகாலத்தில் பெய்யாது போனால் உலகத்து உயிர்களை எல்லாம் பசி துன்புறுத்தும்.' }, { type: 'poem', text: `கெடுப்பதூஉம் கெட்டார்க்குச் சார்வாய்மற்று ஆங்கே எடுப்பதூஉம் எல்லாம் மழை.` }, { type: 'small', text: 'பொருள்: உரிய காலத்தில் பெய்யாது கெடுப்பதும் மழைதான். உரிய காலத்தில் பெய்து காப்பதும் மழைதான்.' }, '# மக்கட்பேறு', { type: 'poem', text: `தம்மின்தம் மக்கள் அறிவுடைமை மாநிலத்து மன்னுயிர்க்கு எல்லாம் இனிது.` }, { type: 'small', text: 'பொருள்: தம்மைவிடத் தம் பிள்ளைகள் அறிவுடையோர் என்றால் மக்களுக்கு அதுதான் மகிழ்ச்சி.' }, { type: 'poem', text: `ஈன்ற பொழுதின் பெரிதுவக்கும் தன்மகனைச் சான்றோன் எனக்கேட்ட தாய்.` }, { type: 'small', text: 'பொருள்: தன் பிள்ளையின் புகழைக் கேட்ட தாய் பெற்றெடுத்தபோது அடைந்த மகிழ்ச்சியைவிடப் பெருமகிழ்ச்சி அடைவாள்.' } ], [ '# நீத்தார் பெருமை', { type: 'poem', text: `செயற்கரிய செய்வார் பெரியர் சிறியர் செயற்கரிய செய்கலா தார்.` }, { type: 'small', text: 'பொருள்: முடியாத செயலையும் முடித்துக் காட்டுபவர் பெரியோர்; முடியாது என்பவர் சிறியோர்.' }, '# அன்புடைமை', { type: 'poem', text: `அன்பிலார் எல்லாம் தமக்குரியர் அன்புடையார் என்பும் உரியர் பிறர்க்கு.` }, { type: 'small', text: 'பொருள்: அன்பு இல்லாதவர் எல்லாப் பொருளும் எனக்கே என்பார்கள். அன்பு உடையவர்கள் தம் உடம்பும் பிறர்க்கே என்பார்கள்.' }, { type: 'poem', text: `அன்பின் வழியது உயிர்நிலை அஃதிலார்க்கு என்புதோல் போர்த்த உடம்பு.` }, { type: 'small', text: 'பொருள்: அன்பு இருப்பதுதான் உயிருள்ள உடல். அன்பு இல்லாதது வெறும் எலும்பும் தோலும் தான்.' }, '# இனியவை கூறல்', { type: 'poem', text: `பணிவுடையன் இன்சொலன் ஆதல் ஒருவற்கு அணியல்ல மற்றுப் பிற.` }, { type: 'small', text: 'பொருள்: பணிவும் இன்சொல்லுமே ஒருவருக்கு மிகச்சிறந்த அணி.' }, { type: 'poem', text: `இனிய உளவாக இன்னாத கூறல் கனிஇருப்பக் காய்கவர்ந் தற்று.` }, { type: 'small', text: 'பொருள்: இனிய சொல் இருக்கும்போது இன்னாச்சொல் பேசுவது கனி இருக்கும்போது காயை உண்பதைப் போன்றது.' } ], [ '# விருந்தோம்பல்', { type: 'poem', text: `விருந்து புறத்ததாத் தானுண்டல் சாவா மருந்தெனினும் வேண்டற்பாற் றன்று.` }, { type: 'small', text: 'பொருள்: அமிழ்தமே ஆனாலும் விருந்தினர் இருக்கும்போது தான்மட்டும் உண்பது விரும்பத்தக்கது அன்று.' }, { type: 'poem', text: `மோப்பக் குழையும் அனிச்சம் முகந்திரிந்து நோக்கக் குழையும் விருந்து.` }, { type: 'small', text: 'பொருள்: மோந்து பார்த்தால் அனிச்ச மலர் வாடிவிடும். நம் முகம் மாறினாலே விருந்தினர் உள்ளம் வாடிவிடும்' }, '# கள்ளாமை', { type: 'poem', text: `உள்ளத்தால் உள்ளலும் தீதே பிறன்பொருளைக் கள்ளத்தால் கள்வேம் எனல்.` }, { type: 'small', text: 'பொருள்: அடுத்தவர் பொருளைக் களவாடலாம் என உள்ளத்தால் நினைப்பது கூடத் தீமையானது' }, { type: 'poem', text: `களவினால் ஆகிய ஆக்கம் அளவிறந்து ஆவது போலக் கெடும்.` }, { type: 'small', text: 'பொருள்: களவு மூலம் சேர்க்கப்படும் செல்வம் வளர்வது போல் தோன்றினாலும் முடிவில் அழிந்துவிடும்.' }, '# ஊக்கமுடைமை', { type: 'poem', text: `உள்ளம் உடைமை உடைமை பொருளுடைமை நில்லாது நீங்கி விடும்.` }, { type: 'small', text: 'பொருள்: ஊக்கமே நிலையான செல்வம். மற்றவை எல்லாம் நிலைத்து நில்லாமல் அழிந்து விடும்.' } ], [ '# ஊக்கமுடைமை', { type: 'poem', text: `ஆக்கம் அதர்வினாய்ச் செல்லும் அசைவிலா ஊக்க முடையா னுழை.` }, { type: 'small', text: 'பொருள்: தளராத ஊக்கம் உடையவனிடம் ஆக்கமானது தானே வழிகேட்டுக்கொண்டு செல்லும்.' }, { type: 'poem', text: `வெள்ளத் தனைய மலர்நீட்டம் மாந்தர்தம் உள்ளத் தனையது உயர்வு.` }, { type: 'small', text: 'பொருள்: தண்ணீரின் உயரத்துக்கு ஏற்ப நீர்ப்பூக்கள் வளரும். ஊக்கத்தின் அளவுக்கு ஏற்ப மனிதர்கள் உயர்வார்கள்.' }, { type: 'poem', text: `உள்ளுவ தெல்லாம் உயர்வுள்ளல் மற்றது தள்ளினும் தள்ளாமை நீர்த்து.` }, { type: 'small', text: 'பொருள்: எண்ணுவதை உயர்வாகவே எண்ணுக. எண்ணியதை அடையாவிட்டாலும் எண்ணமே மன நிறைவைத் தரும்.' }, '# பயனில சொல்லாமை', { type: 'poem', text: `அரும்பயன் ஆயும் அறிவினார் சொல்லார் பெரும்பயன் இல்லாத சொல்.` }, { type: 'small', text: 'பொருள்: நன்மை எது என ஆராயும் அறிவு உடையவர்கள் பயன்தராத சொற்களைப் பேசமாட்டார்கள்.' }, { type: 'poem', text: `சொல்லுக சொல்லிற் பயனுடைய சொல்லற்க சொல்லிற் பயனிலாச் சொல்.` }, { type: 'small', text: 'பொருள்: பயனுடைய சொற்களை மட்டுமே பேசுக. பயன் இல்லாத சொற்களைப் பேசாமல் விட்டு விடுக.' } ], [ '# அறன்வலியுறுத்தல்', { type: 'poem', text: `மனத்துக்கண் மாசிலன் ஆதல் அனைத்தறன் ஆகுல நீர பிற.` }, { type: 'small', text: 'பொருள்: உள்ளத்தில் குற்றம் இல்லாமல் இருப்பதே சிறந்த அறமாகும். மற்றவை எல்லாம் வெறும் ஆரவாரமே.' }, { type: 'poem', text: `அழுக்காறு அவாவெகுளி இன்னாச்சொல் நான்கும் இழுக்கா இயன்றது அறம்.` }, { type: 'small', text: 'பொருள்: பொறாமை, பேராசை, சினம், கடுஞ்சொல் பேசுதல் ஆகிய நான்கும் இல்லாமல் வாழ்வதே அறம் ஆகும்.' }, '# ஈகை', { type: 'poem', text: `வறியார்க்கொன்று ஈவதே ஈகைமற் றெல்லாம் குறியெதிர்ப்பை நீர துடைத்து.` }, { type: 'small', text: 'பொருள்: இல்லாதவர்க்கு தருவதே ஈகை ஆகும். மற்றவை எல்லாம் பயனை எதிர்பார்த்துச் செய்பவை ஆகும்.' }, { type: 'poem', text: `ஈத்துவக்கும் இன்பம் அறியார்கொல் தாமுடைமை வைத்திழக்கும் வன்க ணவர்.` }, { type: 'small', text: 'பொருள்: இல்லாதவர்க்குத் தருவதால் உண்டாகும் இன்பத்தை அறியாதவர்கள் பொருளைச் சேர்த்து வைத்துப் பின் அதனை இழந்து விடுவார்கள்.' }, '# கொல்லாமை', { type: 'poem', text: `பகுத்துண்டு பல்லுயிர் ஓம்புதல் நூலோர் தொகுத்தவற்றுள் எல்லாந் தலை.` }, { type: 'small', text: 'பொருள்: தம்மிடம் இருப்பவற்றைப் பிற உயிர்களுக்குப் பகிர்ந்து கொடுத்துக் காப்பாற்ற வேண்டும். அதுவே அறநூல்களில் கூறப்படும் அறங்களுள் சிறந்தது.' } ], [ '# இன்னா செய்யாமை', { type: 'poem', text: `இன்னாசெய் தாரை ஒறுத்தல் அவர்நாண நன்னயஞ் செய்து விடல்.` }, { type: 'small', text: 'பொருள்:நமக்குத் துன்பம் செய்தவர் நாணும்படி அவருக்கு நன்மை செய்வதுதான் அவரைத் தண்டிக்கும் வழியாகும்.' }, { type: 'poem', text: `அறிவினான் ஆகுவ துண்டோ பிறிதின்நோய் தந்நோய்போல் போற்றாக் கடை.` }, { type: 'small', text: 'பொருள்:பிற உயிரின் துன்பத்தைத் தமது துன்பம் போல் கருதாவிட்டால் தாம் பெற்றுள்ள அறிவால் எந்தப் பயனும் இல்லை .' }, { type: 'poem', text: `எனைத்தானும் எஞ்ஞான்றும் யார்க்கும் மனத்தானாம் மாணாசெய் யாமை தலை.` }, { type: 'small', text: 'பொருள்: நம் உள்ளம் ஏற்றுக் கொள்ளாத எச்செயலையும் எக்காலத்திலும் யாருக்கும் சிறிதளவுகூடச் செய்யக் கூடாது.' }, '# பெரியாரைப் பிழையாமை', { type: 'poem', text: `ஆற்றுவார் ஆற்றல் இகழாமை போற்றுவார் போற்றலுள் எல்லாம் தலை.` }, { type: 'small', text: 'பொருள்:ஆற்றல் உடையவர்களை இகழக்கூடாது. அதுவே தம்மைத் தீங்கிலிருந்து காத்துக்கொள்ளும் வழிகளுள் சிறந்த வழியாகும்.' }, { type: 'poem', text: `எரியாற் சுடப்பனும் உய்வுண்டாம் உய்யார் பெரியார்ப் பிழைத்தொழுகு வார்.` }, { type: 'small', text: 'பொருள்:தீயினால் சுடப்பட்டவர் கூடப் பிழைத்துக்கொள்ள முடியும். ஆனால் பெரியவர்களுக்குத் தீங்கு செய்தவர் தப்ப முடியாது.' } ] ] }, { id: 'sort', label: 'வரிசை படுத்துக', type: 'sorting', commonData: { title: 'திருக்குறளை அடையாளம் கண்டு வார்த்தைகளை வரிசை படுத்துக ', multiple: true }, data: [ `அகர, முதல, எழுத்தெல்லாம், ஆதி, பகவன், முதற்றே, உலகு விண்இன்று, பொய்ப்பின், விரிநீர், வியனுலகத்து, உள்நின்று, உடற்றும், பசி கெடுப்பதூஉம், கெட்டார்க்குச், சார்வாய்மற்று, ஆங்கே, எடுப்பதூஉம், எல்லாம், மழை தம்மின்தம், மக்கள், அறிவுடைமை, மாநிலத்து, மன்னுயிர்க்கு, எல்லாம், இனிது ஈன்ற, பொழுதின், பெரிதுவக்கும், தன்மகனைச், சான்றோன், எனக்கேட்ட, தாய் செயற்கரிய, செய்வார், பெரியர், சிறியர், செயற்கரிய, செய்கலா, தார் அன்பிலார், எல்லாம், தமக்குரியர், அன்புடையார், என்பும், உரியர், பிறர்க்கு அன்பின், வழியது, உயிர்நிலை, அஃதிலார்க்கு, என்புதோல், போர்த்த, உடம்பு பணிவுடையன், இன்சொலன், ஆதல், ஒருவற்கு, அணியல்ல, மற்றுப், பிற இனிய, உளவாக, இன்னாத, கூறல், கனிஇருப்பக், காய்கவர்ந், தற்று`, `விருந்து, புறத்ததாத், தானுண்டல், சாவா, மருந்தெனினும், வேண்டற்பாற், றன்று மோப்பக், குழையும், அனிச்சம், முகந்திரிந்து, நோக்கக், குழையும், விருந்து உள்ளத்தால், உள்ளலும், தீதே, பிறன்பொருளைக், கள்ளத்தால், கள்வேம், எனல் களவினால், ஆகிய, ஆக்கம், அளவிறந்து, ஆவது, போலக், கெடும் ஆக்கம், அதர்வினாய்ச், செல்லும், அசைவிலா, ஊக்க, முடையா, னுழை வெள்ளத், தனைய, மலர்நீட்டம், மாந்தர்தம், உள்ளத், தனையது, உயர்வு உள்ளுவ, தெல்லாம், உயர்வுள்ளல், மற்றது, தள்ளினும், தள்ளாமை, நீர்த்து அரும்பயன், ஆயும், அறிவினார், சொல்லார், பெரும்பயன், இல்லாத, சொல் சொல்லுக, சொல்லிற், பயனுடைய, சொல்லற்க, சொல்லிற், பயனிலாச், சொல்`, `மனத்துக்கண், மாசிலன், ஆதல், அனைத்தறன், ஆகுல, நீர, பிற அழுக்காறு, அவாவெகுளி, இன்னாச்சொல், நான்கும், இழுக்கா, இயன்றது, அறம் வறியார்க்கொன்று, ஈவதே, ஈகைமற், றெல்லாம், குறியெதிர்ப்பை, நீர, துடைத்து ஈத்துவக்கும், இன்பம், அறியார்கொல், தாமுடைமை, வைத்திழக்கும், வன்க, ணவர் பகுத்துண்டு, பல்லுயிர், ஓம்புதல், நூலோர், தொகுத்தவற்றுள், எல்லாந், தலை இன்னாசெய், தாரை, ஒறுத்தல், அவர்நாண, நன்னயஞ், செய்து, விடல் அறிவினான், ஆகுவ, துண்டோ, பிறிதின்நோய், தந்நோய்போல், போற்றாக், கடை எனைத்தானும், எஞ்ஞான்றும், யார்க்கும், மனத்தானாம், மாணாசெய், யாமை, தலை ஆற்றுவார், ஆற்றல், இகழாமை, போற்றுவார், போற்றலுள், எல்லாம், தலை எரியாற், சுடப்பனும், உய்வுண்டாம், உய்யார், பெரியார்ப், பிழைத்தொழுகு, வார்` ] }, { id: 'fillup', label: 'கோடிட்ட இடங்களை நிரப்புக ', type: 'fillupOptions', commonData: { noOptions: true, title: 'கோடிட்ட இடங்களை நிரப்புக ' }, data: [ `அகர *முதல* எழுத்தெல்லாம் *ஆதி* பகவன் முதற்றே *உலகு* விண்இன்று பொய்ப்பின் விரிநீர் வியனுலகத்து உள்நின்று உடற்றும் *பசி*. கெடுப்பதூஉம் கெட்டார்க்குச் சார்வாய்மற்று *ஆங்கே* எடுப்பதூஉம் எல்லாம் *மழை*`, `தம்மின்தம் *மக்கள்* அறிவுடைமை மாநிலத்து மன்னுயிர்க்கு எல்லாம் *இனிது*. *ஈன்ற* பொழுதின் பெரிதுவக்கும் தன்மகனைச் சான்றோன் எனக்கேட்ட *தாய்*. செயற்கரிய செய்வார் பெரியர் *சிறியர்* செயற்கரிய செய்கலா தார்.`, `அன்பிலார் *எல்லாம்* தமக்குரியர் அன்புடையார் *என்பும்* உரியர் பிறர்க்கு. அன்பின் வழியது உயிர்நிலை அஃதிலார்க்கு என்புதோல் போர்த்த *உடம்பு* பணிவுடையன் இன்சொலன் *ஆதல்* ஒருவற்கு அணியல்ல மற்றுப் *பிற*` ] } ] }; export default thirukkural;
import form from './form.js'; import hostForm from './hostForm.js'; import audienceForm from './audienceForm.js'; import previousPerformances from './previousPerformances.js'; import {combineReducers} from 'redux'; const rootReducer = combineReducers({ form, hostForm, audienceForm, previousPerformances, }); export default rootReducer;
const defaultStyle = (theme) => { return { root:{ width: '300px', margin: 'auto' }, thumbnailClass:{ width:'300px' }, iconPlay:{ transform:'translate(235px,-41px) scale(1,1)', borderRadius:'0', transformOrigin: 'initial' } }; }; export default defaultStyle;
// Load plugins var gulp = require('gulp'), babel = require('gulp-babel'), uglify = require('gulp-uglify'), concat = require('gulp-concat'), notify = require('gulp-notify'), cssnano = require('gulp-cssnano'), webserver = require('gulp-webserver'); // Styles gulp.task('styles', function (cb) { gulp.src(['./static/css/style.css', './static/css/pull-refresh.css', './static/lib/genericons/genericons.css', './static/css/awesomplete.css']) .pipe(concat('main.css')) .pipe(cssnano()) .pipe(gulp.dest('./static/dist/css/')) }); // Scripts gulp.task('scripts', function (cb) { gulp.src(['./static/modules/app_start.js', './static/modules/app_init.js', './static/modules/app_router.js', './static/modules/app_get.js', './static/modules/app_render.js', './static/modules/app_end.js']) .pipe(concat('main.js')) .pipe(babel({ presets: ['es2015'] })) .pipe(uglify()) .pipe(gulp.dest('./static/dist/js/')) .pipe(notify({ message: 'Scripts task complete' })); }); gulp.task('webserver', function() { gulp.src('./') .pipe(webserver({ port:'9090', livereload: true, open: true })); }); // Default task gulp.task('default', function () { gulp.start('styles', 'scripts', 'webserver'); }); // Watch gulp.task('watch', function () { // Watch .css files gulp.watch('./static/css/*.css', ['styles']); // Watch .js files gulp.watch('./static/modules/*.js', ['scripts']); });
import Ember from 'ember'; import VaultApiCall from 'vault-password-manager/services/vault-api-call'; export default VaultApiCall.extend({ session: Ember.inject.service(), list() { return this.get('authorizedApiGet')(`${this.get('apiPath')}secret/?list=true`, this.get('session')); }, getSecret(key) { return this.get('authorizedApiGet')(`${this.get('apiPath')}secret/${key}`, this.get('session')); }, postSecret(key, data) { return this.get('authorizedApiPut')(`${this.get('apiPath')}secret/${key}`, data, this.get('session')); }, deleteSecret(key) { return this.get('authorizedApiDelete')(`${this.get('apiPath')}secret/${key}`, this.get('session')); } });
function setMainLoop(func,interval) { setInterval(func, interval); } var Socket = function() { this.onmessage = function(msg){}; } Socket.prototype.send = function(msg) { return false; } Socket.prototype.init = function(listenPort) { return false; } Socket.prototype.runAsClient = function() { return false; } Socket.prototype.runAsServer = function(broadcastPort) { return false; } $(document).ready(function() { window.canvas = $("#displaycanvas")[0]; window.trace = function(content) { console.log(content); } var ctx = canvas.getContext("2d"); ctx.drawImageBatch = function(img, coords) { for( var i=0,max=coords.length;i<max;i++ ) { var coord = coords[i]; ctx.drawImage(img, coord[0], coord[1], coord[2], coord[3], coord[4], coord[5], coord[6], coord[7]); } } ctx.drawImageBatch2 = function(img, strCoords) { var coords = strCoords.split(","); for(var i=0,max=coords.length/8;i<max;i++) { this.drawImage(img, coords[i*8+0], coords[i*8+1], coords[i*8+2], coords[i*8+3], coords[i*8+4], coords[i*8+5], coords[i*8+6], coords[i*8+7]); } } documentReady(); });
"use strict"; Socket.topologyChanged = function (shouldRenderVolumes) { if (shouldRenderVolumes) renderVolumes(); reRenderZones(); updateControllerState(); updateCurrentStatus(); } Socket.transportStateChanged = function (player) { reRenderZones(); updateControllerState(); updateCurrentStatus(); } Socket.groupVolumeChanged = function (data) { if (data.uuid == Sonos.currentState.selectedZone) { GUI.masterVolume.setVolume(data.groupState.volume); } for (var uuid in data.playerVolumes) { Sonos.players[data.uuid].state.volume = data.playerVolumes[uuid]; GUI.playerVolumes[uuid].setVolume(data.playerVolumes[uuid]); } } Socket.groupMuteChanged = function (data) { updateControllerState(); } Socket.muteChanged = function (data) { document.getElementById("mute-" + data.uuid).src = data.state.mute ? 'svg/mute_on.svg' : 'svg/mute_off.svg'; } Socket.favoritesChanged = function (data) { renderFavorites(data); } Socket.musicLibraryChanged = function (data) { GUI.musicLibrary.breadcrumbs[ GUI.musicLibrary.breadcrumbs.length - 1 ].library = data; renderMusicLibrary(data); } Socket.queueChanged = function (data) { if (data.uuid != Sonos.currentState.selectedZone) return; Sonos.queues[Sonos.currentState.selectedZone] = data.queue; renderQueue(data.queue); } /// /// ACTIONS /// function updateCurrentStatus() { var selectedZone = Sonos.currentZoneCoordinator(); document.getElementById("current-track-art").src = selectedZone.state.currentTrack.albumArtURI; document.getElementById('page-title').textContent = selectedZone.state.currentTrack.title + ' - Sonos Web Controller'; document.getElementById("track").textContent = selectedZone.state.currentTrack.title; document.getElementById("artist").textContent = selectedZone.state.currentTrack.artist; document.getElementById("album").textContent = selectedZone.state.currentTrack.album; if (selectedZone.state.nextTrack) { var nextTrack = selectedZone.state.nextTrack; document.getElementById("next-track").textContent = nextTrack.title + " - " + nextTrack.artist; } console.log(selectedZone) var repeat = document.getElementById("repeat"); if (selectedZone.playMode.repeat) { repeat.src = repeat.src.replace(/_off\.png/, "_on.png"); } else { repeat.src = repeat.src.replace(/_on\.png/, "_off.png"); } var shuffle = document.getElementById("shuffle"); if (selectedZone.playMode.shuffle) { shuffle.src = shuffle.src.replace(/_off\.png/, "_on.png"); } else { shuffle.src = shuffle.src.replace(/_on\.png/, "_off.png"); } var crossfade = document.getElementById("crossfade"); if (selectedZone.playMode.crossfade) { crossfade.src = crossfade.src.replace(/_off\.png/, "_on.png"); } else { crossfade.src = crossfade.src.replace(/_on\.png/, "_off.png"); } GUI.progress.update(selectedZone); //Things have changed, rerender the queue renderQueue(null); } function updateControllerState() { var currentZone = Sonos.currentZoneCoordinator(); var state = currentZone.state.zoneState; var playPauseButton = document.getElementById('play-pause'); if (state == "PLAYING") { playPauseButton.src = '/svg/pause.svg'; } else { playPauseButton.src = '/svg/play.svg'; } // Fix volume GUI.masterVolume.setVolume(currentZone.groupState.volume); // fix mute var masterMute = document.getElementById('master-mute'); if (currentZone.groupState.mute) { masterMute.src = "/svg/mute_on.svg"; } else { masterMute.src = "/svg/mute_off.svg"; } // fix volume container var allVolumes = {}; for (var uuid in Sonos.players) { // is this in group? allVolumes[uuid] = null; } Sonos.grouping[Sonos.currentState.selectedZone].forEach(function (uuid) { document.getElementById("volume-" + uuid).classList.remove("hidden"); delete allVolumes[uuid]; }); // now, hide the ones left for (var uuid in allVolumes) { document.getElementById("volume-" + uuid).classList.add("hidden"); } } function toFormattedTime(seconds) { var chunks = []; var modulus = [60^2, 60]; var remainingTime = seconds; // hours var hours = Math.floor(remainingTime/3600); if (hours > 0) { chunks.push(zpad(hours, 1)); remainingTime -= hours * 3600; } // minutes var minutes = Math.floor(remainingTime/60); chunks.push(zpad(minutes, 1)); remainingTime -= minutes * 60; // seconds chunks.push(zpad(Math.floor(remainingTime), 2)) return chunks.join(':'); } function zpad(number, width) { var str = number + ""; if (str.length >= width) return str; var padding = new Array(width - str.length + 1).join('0'); return padding + str; } var zoneManagement = function() { var dragItem; function findZoneNode(currentNode) { // If we are at top level, abort. if (currentNode == this) return; if (currentNode.tagName == "UL") return currentNode; return findZoneNode(currentNode.parentNode); } function handleDragStart(e) { e.dataTransfer.effectAllowed = 'move'; e.dataTransfer.setData('text/html', e.target.innerHTML); dragItem = e.target; dragItem.classList.add('drag'); } function handleDragEnd(e) { dragItem.classList.remove('drag'); } function handleDrop(e) { if (e.target == this) { // detach console.log("detach"); Socket.socket.emit('group-management', {player: dragItem.dataset.id, group: null}); return; } var zone = findZoneNode(e.target); if (!zone || zone == this.parentNode) return; console.log(dragItem.dataset.id, zone.id); Socket.socket.emit('group-management', {player: dragItem.dataset.id, group: zone.id}); } function handleDragOver(e) { e.preventDefault(); e.dataTransfer.dropEffect = 'move'; } document.getElementById('zone-container').addEventListener('dragstart', handleDragStart); document.getElementById('zone-container').addEventListener('dragend', handleDragEnd); document.getElementById('zone-container').addEventListener('dragover', handleDragOver); document.getElementById('zone-container').addEventListener('drop', handleDrop); }(); function renderVolumes() { var oldWrapper = document.getElementById('player-volumes'); var newWrapper = oldWrapper.cloneNode(false); var masterVolume = document.getElementById('master-volume'); var masterMute = document.getElementById('master-mute'); var playerNodes = []; for (var i in Sonos.players) { var player = Sonos.players[i]; var playerVolumeBar = masterVolume.cloneNode(true); var playerVolumeBarContainer = document.createElement('div'); playerVolumeBarContainer.id = "volume-" + player.uuid; playerVolumeBar.id = ""; playerVolumeBar.dataset.uuid = player.uuid; var playerName = document.createElement('h6'); var playerMute = masterMute.cloneNode(true); playerMute.id = "mute-" + player.uuid; playerMute.className = "mute-button"; playerMute.src = player.state.mute ? "/svg/mute_on.svg" : "/svg/mute_off.svg"; playerMute.dataset.id = player.uuid; playerName.textContent = player.roomName; playerVolumeBarContainer.appendChild(playerName); playerVolumeBarContainer.appendChild(playerMute); playerVolumeBarContainer.appendChild(playerVolumeBar); newWrapper.appendChild(playerVolumeBarContainer); playerNodes.push({uuid: player.uuid, node: playerVolumeBar}); } oldWrapper.parentNode.replaceChild(newWrapper, oldWrapper); // They need to be part of DOM before initialization playerNodes.forEach(function (playerPair) { var uuid = playerPair.uuid; var node = playerPair.node; GUI.playerVolumes[uuid] = new VolumeSlider(node, function (vol) { Socket.socket.emit('volume', {uuid: uuid, volume: vol}); }); console.log(uuid, Sonos.players[uuid].state.volume); GUI.playerVolumes[uuid].setVolume(Sonos.players[uuid].state.volume); }); newWrapper.classList.add('hidden'); newWrapper.classList.remove('loading'); } function reRenderZones() { var oldWrapper = document.getElementById('zone-wrapper'); var newWrapper = oldWrapper.cloneNode(false); for (var groupUUID in Sonos.grouping) { var ul = document.createElement('ul'); ul.id = groupUUID; if (ul.id == Sonos.currentState.selectedZone) ul.className = "selected"; Sonos.grouping[groupUUID].forEach(function (playerUUID) { var player = Sonos.players[playerUUID]; var li = document.createElement('li'); var span = document.createElement('span'); span.textContent = player.roomName; li.appendChild(span); li.draggable = true; li.dataset.id = playerUUID; ul.appendChild(li); }); newWrapper.appendChild(ul); } oldWrapper.parentNode.replaceChild(newWrapper, oldWrapper); } function renderFavorites(favorites) { var oldContainer = document.getElementById('favorites-container'); var newContainer = oldContainer.cloneNode(false); var i = 0; favorites.forEach(function (favorite) { var li = document.createElement('li'); li.dataset.title = favorite.title; var span = document.createElement('span'); span.textContent = favorite.title; var albumArt = document.createElement('img'); albumArt.src = favorite.albumArtURI; li.appendChild(albumArt); li.appendChild(span); li.tabIndex = i++; newContainer.appendChild(li); }); oldContainer.parentNode.replaceChild(newContainer, oldContainer); } function renderQueue(queue) { //Get current queue if one not passed in var selectedZone = Sonos.currentZoneCoordinator(); if (queue == null) { queue = Sonos.queues[Sonos.currentState.selectedZone]; if(!queue) return; } //Is queue in use? document.getElementById('queueInUseText').textContent = (selectedZone.state.queueInUse ? '' : '(Not in Use)'); //Queue size document.getElementById('queueSizeText').textContent = (selectedZone.state.numOfTracks - selectedZone.state.trackNo + 1) + ' of ' + selectedZone.state.numOfTracks + ' track' + (selectedZone.state.numOfTracks > 1 ? 's': ''); var tempContainer = document.createDocumentFragment(); var scrollTimeout; var trackIndex = queue.startIndex + 1; //In party mode, only show upcoming queue items var queueItems = queue.items; var showPreviousQueueItems = (GUI.partyMode ? false : true); if (showPreviousQueueItems == false) { queueItems = queueItems.slice(selectedZone.state.trackNo - 1); trackIndex += selectedZone.state.trackNo; } queueItems.forEach(function (q) { var li = document.createElement('li'); li.dataset.title = q.uri; li.dataset.trackNo = trackIndex++; li.tabIndex = trackIndex; var albumArt = document.createElement('img'); //albumArt.src = q.albumArtURI; albumArt.dataset.src = q.albumArtURI; if (q.uri == selectedZone.state.currentTrack.uri) { albumArt.dataset.src = 'images/queue_play.png'; albumArt.src = albumArt.dataset.src; albumArt.className = "loaded"; } li.appendChild(albumArt); var trackInfo = document.createElement('div'); var title = document.createElement('p'); title.className = 'title'; title.textContent = q.title; trackInfo.appendChild(title); var artist = document.createElement('p'); artist.className = 'artist'; artist.textContent = q.artist; trackInfo.appendChild(artist); li.appendChild(trackInfo); tempContainer.appendChild(li); }); var oldContainer = document.getElementById('queue-container'); if (queue.startIndex == 0) { // This is a new queue var newContainer = oldContainer.cloneNode(false); newContainer.addEventListener('scroll', function (e) { clearTimeout(scrollTimeout); var _this = this; scrollTimeout = setTimeout(function () { lazyLoadImages(_this); },150); }); newContainer.appendChild(tempContainer); oldContainer.parentNode.replaceChild(newContainer, oldContainer); lazyLoadImages(newContainer); //run once on demand } else { // This should be added! we assume they come in the correct order oldContainer.appendChild(tempContainer); lazyLoadImages(tempContainer); //run once on demand } } function renderMusicLibrary(library, pattern, showAll) { if (library == null) library = GUI.musicLibrary.breadcrumbs[ GUI.musicLibrary.breadcrumbs.length - 1 ].library; if (library == null) return; //First, do a search to see if we should display the library or the filter panel var filterResult = prepareMusicFiltered(library, pattern); if (!showAll && GUI.partyMode && filterResult.library.length > 16) { renderMusicFilter(filterResult, pattern); return; } //Now show the list var oldContainer = document.getElementById('music-library-container'); var newContainer = oldContainer.cloneNode(false); var i = 0; library = filterResult.library; library.forEach(function (libraryitem) { var li = document.createElement('li'); var trackInfo = document.createElement('div'); var title = document.createElement('p'); title.className = 'title'; title.textContent = libraryitem.title; if (libraryitem.artist) { var artist = document.createElement('p'); artist.className = 'artist'; artist.textContent = libraryitem.artist; if (libraryitem.album) { artist.textContent += ' (' + libraryitem.album + ')'; } } var albumArt = document.createElement('img'); //Handle artists/albums and tracks differently if (libraryitem.attr) { li.dataset.type = /:([A-Z]+)\//.exec(libraryitem.attr.id)[1]; li.dataset.search = libraryitem.attr.id; albumArt.src = 'images/browse_generic_multi_track.png'; } else { li.dataset.type = 'track'; albumArt.src = 'images/browse_missing_album_art.png'; //If its a track, add the queue button var queueTrack = document.createElement('div'); queueTrack.className = 'btnQueueTrack'; li.appendChild(queueTrack); } li.dataset.title = libraryitem.title; if (libraryitem.artist) li.dataset.artist = libraryitem.artist; if (libraryitem.album) li.dataset.album = libraryitem.album; if (libraryitem.uri) li.dataset.uri = libraryitem.uri; if (libraryitem.albumArtURI) albumArt.dataset.src = libraryitem.albumArtURI; trackInfo.appendChild(title); if (artist) trackInfo.appendChild(artist); li.appendChild(albumArt); li.appendChild(trackInfo); li.tabIndex = i++; newContainer.appendChild(li); }); //Show paging? if (i > 20) { document.getElementById('music-library-pager').classList.remove('hidden'); } else { document.getElementById('music-library-pager').classList.add('hidden'); } //Render var scrollTimeout; newContainer.addEventListener('scroll', function (e) { clearTimeout(scrollTimeout); var _this = this; scrollTimeout = setTimeout(function () { lazyLoadImages(_this); },150); }); oldContainer.parentNode.replaceChild(newContainer, oldContainer); lazyLoadImages(newContainer); //Status GUI.musicLibrary.isLoading = false; } function prepareMusicFiltered(library, pattern) { if (library == null) library = Sonos.musicLibrary; if (library == null) return; var _selectors = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '_', '#']; //Prepare the selectors for this search term var selectors = {}; _selectors.forEach(function (selector) { selectors[ (pattern ? pattern : '') + selector ] = 0; }); var selectorLength = pattern ? pattern.length + 1 : 1; var filteredLibrary = []; //Update the selectors with counts and produce filtered library library.forEach(function (libraryitem) { var sel = libraryitem.title.substring(0, selectorLength); sel = sel.replace(/[^A-Za-z ]/g, '#'); sel = sel.replace(/ /g, '_'); sel = sel.toUpperCase(); if (sel in selectors) { selectors[sel]++; filteredLibrary.push(libraryitem); } }); //Return the filtered library & the selectors for use in renderMusicLibrary() or renderMusicSearch() return {library: filteredLibrary, selectors: selectors}; } function renderMusicFilter(preparedFilter, pattern) { var oldContainer = document.getElementById('music-library-container'); var newContainer = oldContainer.cloneNode(false); //Display the selectors var i = 0; Object.keys(preparedFilter.selectors).forEach(function (selector) { var li = document.createElement('li'); li.className = 'filterButton'; li.dataset.selector = selector; li.dataset.type = 'filterButton'; if (preparedFilter.selectors[selector] == 0) { li.classList.add('muted'); li.dataset.filteron = false; } else { li.dataset.filteron = true; } var span = document.createElement('span'); span.textContent = selector; li.appendChild(span); li.tabIndex = i++; newContainer.appendChild(li); }); var li = document.createElement('li'); li.classList.add('filterButton'); li.dataset.selector = 'ALL'; li.dataset.type = 'filterButton'; li.dataset.filteron = true; var special = document.createElement('span'); special.textContent = 'Show All'; special.classList.add('blue-button'); special.classList.add('filterButtonSpecial'); li.appendChild(special); li.tabIndex = i++; newContainer.appendChild(li); //Render newContainer.dataset['searchTerm'] = pattern ? pattern : ''; oldContainer.parentNode.replaceChild(newContainer, oldContainer); document.getElementById('music-library-pager').classList.add('hidden'); //Status GUI.musicLibrary.isLoading = false; } function navigateMusicLibrary(search, selector) { logUserInteraction(); //Status if (GUI.musicLibrary.isLoading) return; GUI.musicLibrary.isLoading = true; //Not a real navigation - just get rid of filter if (selector == 'ALL') { renderMusicLibrary(null, '', true); return; } //Populate search & library var library = null; if (selector) { search = GUI.musicLibrary.breadcrumbs[ GUI.musicLibrary.breadcrumbs.length - 1 ].search; library = GUI.musicLibrary.breadcrumbs.length > 0 ? GUI.musicLibrary.breadcrumbs[ GUI.musicLibrary.breadcrumbs.length - 1 ].library : null; } //Get breadcrumb text var text = null; if (!selector) { var splitter = /:([A-Z]+)(?:\/(.*))?/.exec(search); if (splitter && splitter[2]) { var parts = splitter[2].split('/'); if (parts[parts.length - 1] == "") text = "All"; //special case else text = htmlDecode(parts[parts.length - 1]); } else if (splitter && splitter[1]) { if (splitter[1] == 'ALBUMARTIST') text = 'Artists'; if (splitter[1] == 'ALBUM') text = 'Albums'; if (splitter[1] == 'TRACKS') text = 'Tracks'; } } var breadcrumb = { text: text, selector: selector } //Update breadcrumbs GUI.musicLibrary.breadcrumbs.push({search: search, filter: selector, library: library, breadcrumb: breadcrumb}); //Update header text var breadcrumbs = []; GUI.musicLibrary.breadcrumbs.forEach(function (item) { if (item.breadcrumb.text) breadcrumbs.push(item.breadcrumb.text); }); if (GUI.musicLibrary.breadcrumbs[GUI.musicLibrary.breadcrumbs.length - 1].breadcrumb.selector) { //We are currently filtering, add this breadcrumbs.push('(' + GUI.musicLibrary.breadcrumbs[GUI.musicLibrary.breadcrumbs.length - 1].breadcrumb.selector + '...)'); } /* I put a lot of effort above into building a proper breadcrumb chain (A -> B -> C). But it doesn't fit on the page a lot of the time. So I'm going to use a simple one instead. TODO: work out where/how to display the long chain */ var simpleBreadcrumb = true; if (breadcrumbs.length > 0) { if (simpleBreadcrumb) { document.getElementById("music-library-headertext").innerText = ' - ' + breadcrumbs[breadcrumbs.length-1]; } else { document.getElementById("music-library-headertext").innerText = htmlDecode(' &#8594; ') + breadcrumbs.join(htmlDecode(' &#8594; ')); } document.getElementById("library-back").classList.remove('hidden'); document.getElementById("library-music").classList.remove('hidden'); } else { document.getElementById("music-library-headertext").innerText = ''; } //Get results if (selector) { renderMusicLibrary(null, selector); } else if (search) { Socket.socket.emit('search-library', {uuid: Sonos.currentState.selectedZone, search: search}); } } function navigateMusicLibraryBack() { logUserInteraction(); //Status if (GUI.musicLibrary.isLoading) return; var gone = GUI.musicLibrary.breadcrumbs.pop(); var last = GUI.musicLibrary.breadcrumbs.pop(); if (last) { navigateMusicLibrary(last.search, last.filter); } else { renderMusicLibraryRoot(); } } function navigateMusicLibraryBackToRoot() { logUserInteraction(); //Status if (GUI.musicLibrary.isLoading) return; GUI.musicLibrary.breadcrumbs = []; renderMusicLibraryRoot(); } function renderMusicLibraryRoot() { //Status if (GUI.musicLibrary.isLoading) return; GUI.musicLibrary.isLoading = true; var rows = [ {name: 'Artists', search: 'A:ALBUMARTIST'}, {name: 'Albums', search: 'A:ALBUM'}, //{name: 'Tracks', search: 'A:TRACKS'}, ] document.getElementById("music-library-headertext").innerText = ''; document.getElementById("library-back").classList.add('hidden'); document.getElementById("library-music").classList.add('hidden'); var oldContainer = document.getElementById('music-library-container'); var newContainer = oldContainer.cloneNode(false); var i = 0; rows.forEach(function(row) { var li = document.createElement('li'); li.dataset.type = "ROOT"; li.dataset.title = row.name; li.dataset.search = row.search; li.tabindex = i++; var img = document.createElement('img'); img.src = "images/browse_generic_folder.png"; var p = document.createElement('p'); p.textContent = row.name; li.appendChild(img); li.appendChild(p); newContainer.appendChild(li); }); //Render oldContainer.parentNode.replaceChild(newContainer, oldContainer); document.getElementById('music-library-pager').classList.add('hidden'); //Status GUI.musicLibrary.isLoading = false; } function lazyLoadImages(container) { // Find elements that are in viewport var containerViewport = container.getBoundingClientRect(); // best estimate of starting point var trackHeight = container.firstChild.scrollHeight; // for reasons I have no idea, the above doesn't always work. So fixup. if (container.children.length > 1) trackHeight = (container.children[container.children.length-1].getBoundingClientRect().top - container.children[0].getBoundingClientRect().top) / container.children.length // startIndex var startIndex = Math.floor(container.scrollTop / trackHeight); var currentNode = container.childNodes[startIndex]; while (currentNode && currentNode.getBoundingClientRect().top < containerViewport.bottom) { var img = currentNode.firstChild; if (img.className == 'btnQueueTrack') img = img.nextSibling; currentNode = currentNode.nextSibling; if (img.className == 'loaded') { continue; } // get image if (img.dataset.src) { img.src = img.dataset.src; } img.className = 'loaded'; } } function htmlDecode(input){ var e = document.createElement('div'); e.innerHTML = input; return unescape(e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue); } function queueTrack(trackURI) { var queueit = true; //In party mode, prevent doubly queuing the same track if (GUI.partyMode) { var queue = Sonos.queues[Sonos.currentState.selectedZone]; if(!queue) { //Can't get the queue, will have to assume the user is being sensible } else if(queue.items.length > 0) { if(queue.items[queue.items.length-1].uri == trackURI) { //block it! queueit = false; } } } if (queueit) { Socket.socket.emit('queue-track', {uuid: Sonos.currentState.selectedZone, uri: trackURI}); } } function logUserInteraction() { if (GUI.partyMode) { if (GUI.userInteractionTimeout) clearTimeout(GUI.userInteractionTimeout); GUI.userInteractionTimeout = setTimeout(function() { navigateMusicLibraryBackToRoot(); }, 120000); } } function togglePartyMode() { // Find current state of web controller (party mode or not) var partymode = GUI.partyMode; // Change it partymode = !(GUI.partyMode); GUI.partyMode = partymode; var elements = [ document.getElementById('column-container'), document.getElementById('top-control'), document.getElementById('body'), ] elements.forEach(function(elm) { if (partymode) { elm.classList.add('party-mode'); } else { elm.classList.remove('party-mode'); } }); updateCurrentStatus(); // update if (partymode) document.getElementById('party-mode').src = this.src.replace(/_on\.svg/, '_off.svg'); else document.getElementById('party-mode').src = this.src.replace(/_off\.svg/, '_on.svg'); }
"use strict"; define({ logLvl: 1 // 0=off, 1=debug,3=error , imagePath: "js/lib/dhtmlx/3.6/imgs/", iconPath: "js/lib/dhtmlx/3.6/imgs/", treeMenus: {id: 0, item: [ {id: "customer^C^1", text: "Customer", item: [ {id: "customer^CL^11", text: "List", tag: 'CL'}, {id: "customer^CN^12", text: "Create", tag: 'CN'} ] } /*, {id:3,text:"close"}*/ /*{id:1,text:"Menu"}, {id:2, text:"middle",child:"1",im0:"book.gif", item:[ {id:"21", text:"child"} ]}, {id:3,text:"last"}*/ ] }, welcomePage: "./statics/welcome.html", toolBarIconPath: "js/lib/dhtmlx/3.6/imgs/toolbar/", gridIconPath: "js/lib/dhtmlx/3.6/imgs/grid/", listCustomerToolbarXML: '<toolbar> ' + '<item type="button" id="edit_row" text="Edit" img="table_edit.png" />' + '<item type="button" id="delete_row" text="Delete" img="cancel.png" />' + '<item id="print" type="button" img="print.gif" imgdis="print_dis.gif" text="Print"> ' + // '<item type="button" id="print_page" text="Page" img="page.gif"/> ' + // '<item type="button" id="print_range" text="Page Range" img="page_range.gif"/> ' + // '<item type="button" id="print_sel" text="Selection" img="selection.gif"/> ' + // '<item type="separator" id="print_s1"/> <item type="button" id="print_cfg" text="Settings" img="settings.gif"/> ' + '</item> ' + '</toolbar>', createCustomerToolbarXML: '<toolbar> ' + '<item id="new" type="button" img="new.gif" imgdis="new_dis.gif" text="New" action="showNewDocumentSelect"/> ' + // '<item type="button" id="new_text" text="Text Document" img="text_document.gif" action="doOnNewDocument"/> ' + // '<item type="button" id="new_excel" text="Stylesheet" img="stylesheet.gif" action="doOnNewDocument"/> ' + // '<item type="button" id="new_db" text="Database" img="database.gif" action="doOnNewDocument"/> ' + // '<item type="button" id="new_pp" text="Presentation" img="presentation.gif" action="doOnNewDocument"/> ' + // '<item type="separator" id="new_s1"/> ' + // '<item type="button" id="new_other" text="Other" img="other.gif" action="doOnNewDocument"/> ' + // '</item> ' + '<item id="sep1" type="separator"/> ' + //'<item id="open" type="button" img="open.gif" imgdis="open_dis.gif"/> ' + '<item id="save" type="button" img="save.gif" imgdis="save_dis.gif"/> ' + // '<item id="save_as" type="button" img="save_as.gif" text="Save As..." imgdis="save_as_dis.gif" enabled="false"/> ' + // '<item id="sep2" type="separator"/> <item id="undo" type="button" img="undo.gif" imgdis="undo_dis.gif"/> ' + // '<item id="redo" type="button" img="redo.gif" imgdis="redo_dis.gif"/> <item id="sep3" type="separator"/> ' + // '<item id="cut" type="button" img="cut.gif" text="Cut" imgdis="cut_dis.gif" action="doEdit"> ' + // '<userdata name="linka"><![CDATA[http://linkA]]></userdata> ' + // '<userdata name="linkb"><![CDATA[http://linkB]]></userdata> </item> ' + // '<item id="copy" type="button" img="copy.gif" text="Copy" imgdis="copy_dis.gif" action="doEdit"> ' + // '<userdata name="linkc"><![CDATA[http://linkC]]></userdata> </item> ' + // '<item id="paste" type="button" img="paste.gif" text="Paste" imgdis="paste_dis.gif" action="doEdit"/> ' + // '<item id="sep4" type="separator"/> ' + // '<item id="print" type="buttonSelect" img="print.gif" imgdis="print_dis.gif" text="Print"> ' + // '<item type="button" id="print_page" text="Page" img="page.gif"/> ' + // '<item type="button" id="print_range" text="Page Range" img="page_range.gif"/> ' + // '<item type="button" id="print_sel" text="Selection" img="selection.gif"/> ' + // '<item type="separator" id="print_s1"/> <item type="button" id="print_cfg" text="Settings" img="settings.gif"/> ' + // '</item> ' + // '<item id="sep5" type="separator"/> ' + // '<item id="info" type="text" text="dhtmlxToolbar Demo"/> ' + '</toolbar>', customerFormXML: '<items>' + '<item type="radio" name="select" value="online" label="Will enjoy the online demo"/>' + '<item type="radio" name="select" value="disk" label="Please send me disk" checked="true">' + '<item type="checkbox" name="bootleg" label="Insert bootleg" checked="true"/>' + '<item type="checkbox" name="lyrics" label="Lyrics if possible" checked="true"/>' + '<item type="label" label="Payment"/>' + '<item type="radio" name="paymenttype" value="creditcard" label="Credit Card">' + '<item type="input" name="cardnumber" value="XXXX-XXXX-XXXX-XXXX" label="Card Number"/>' + '<item type="input" name="cardkey" value="XXXX" label="Key"/>' + '</item>' + '<item type="radio" name="paymenttype" value="cash" label="Cash" checked="1"/>' + '<item type="label" label="Currency"/>' + '<item type="radio" name="currencytype" value="dollar" label="U. S. Dollars" checked="1"/>' + '<item type="radio" name="currencytype" value="euro" label="Euro"/>' + '<item type="radio" name="currencytype" value="rub" label="Russian Rubel"/>' + '<item type="select" name="mediatype" label="Select Media Type">' + '<option value="1" text="CD 700Mb">' + '<item type="checkbox" name="overburn" value="yes_1" checked="true" label="Overburn"/>' + '</option>' + '<option value="2" text="DVD5 4.4Gb">' + '<item type="checkbox" name="lightscribe" value="yes" checked="true" label="Light Scribe"/>' + '<item type="checkbox" name="labelflash" value="yes" label="Label Flash">' + '<item type="radio" name="labelflash_radio" value="required" checked="true" label="Required"/>' + '<item type="radio" name="labelflash_radio" value="not_mandatory" label="Not bad option"/>' + '</item>' + '</option>' + '<option value="3" text="DVD9 8.6Gb" selected="1"/>' + '<option value="4" text="Blue-Ray 24Gb"/>' + '</item>' + '<item type="select" name="audioquality" label="Select Audio Quality">' + '<option value="1">2.0 16bit/128kbps</option>' + '<option value="2">2.1 16bit/334kbps</option>' + '<option value="3" selected="1">5.1 32bit/448kbps</option>' + '</item>' + '<item type="select" name="videoquality" label="Select Video Quality">' + '<option value="1" text="DVD MPEG-2" selected="1"/>' + '<option value="2" text="DivX"/>' + '<option value="3" text="XviD"/>' + '</item>' + '<item type="input" label="Comments" value="Some Comments" rows="3"/>' + '</item>' + '<item type="hidden" name="hiden_data" value="some_value"/>' + '<item type="file" name="my_file" label="Schoose file"/>' + '<item type="button" value="Submit"/>' + '</items>' });
import React from 'react'; const Hobbies = () => { return ( <div className="hobbies"> <h3>Intérêt</h3> <ul> <li className="hobby"> <i className="fas fa-running"></i> <span>Course à pied</span> </li> <li className="hobby"> <i className="fas fa-film"></i> <span>Cinéma</span> </li> <li className="hobby"> <i className="fas fa-gamepad"></i> <span>Jeux vidéo</span> </li> <li className="hobby"> <i className="fas fa-plane"></i> <span>voyage</span> </li> <li className="hobby"> <i className="fab fa-bitcoin"></i> <span>Crypto-monnaies</span> </li> </ul> </div> ); }; export default Hobbies;
const TableProviders = require('./TableProvider') class Provider { constructor({ id, company, email, category, createdAt, updatedAt }) { this.id = id; this.company = company; this.email = email; this.category = category; this.createdAt = createdAt; this.updatedAt = updatedAt; } async create() { const result = await TableProviders.create({ company: this.company, email: this.email, category: this.category }) this.id = result.id, this.createdAt = result.createdAt; this.updatedAt = result.updatedAt; } } module.exports = Provider;
const express = require('express'); //const jwt = require('jsonwebtoken'); const morgan = require('morgan'); //const mongoose = require('mongoose'); const cors = require('./cors'); const PORT = process.env.PORT || 5000; const app = express(); process.env.JWT_KEY = 'secret_key'; app.use(cors); app.use(express.json()); app.use(morgan('dev')); //app.use('/posts', require('./routes/posts')); app.use('/users', require('./routes/users')); app.use('/products', require('./routes/products')); app.use('/brands', require('./routes/brands')); app.use('/suppliers', require('./routes/suppliers')); app.use('/categories', require('./routes/categories')); app.use('/tags', require('./routes/tags')); app.use('/orders', require('./routes/orders')); app.get('/', function(req, res){ res.sendFile(__dirname + '/index.html'); }); app.use((req, res, next) => { const error = new Error('Route not found!'); error.status = 404; next(error); }); app.use( (error, req, res, next) => { res.status(error.status || 500); res.json({ error: { message: error.message } }); }); app.listen(PORT, () => console.log('Listening on port ' + PORT));
function pares (x, y) { if (x == y){ return "Os números são iguais" } else if (x > y) { if (y % 2 == 0) console.log(y) while (y < x){ y ++ if (y % 2 == 0) console.log(y) } } else { if (x % 2 == 0) console.log(x) while (x < y){ x ++ if (x % 2 == 0) console.log(x) } } } pares(100, 20)