Python Labs
-
Write a countdown timer that counts for 120 seconds (ticks every second), printing the remaining seconds to wait in each tick
-
Change your countdown timer to show remaining time like a watch, i.e.: 2:00 1:59 1:58 ... 1:20
Python Labs
Write a countdown timer that counts for 120 seconds (ticks every second), printing the remaining seconds to wait in each tick
Change your countdown timer to show remaining time like a watch, i.e.: 2:00 1:59 1:58 ... 1:20
(defn power | |
[serial x y] | |
(let [ | |
rack-id (+ x 10) | |
] | |
(- | |
(Math/floor |
(ns aoc2018.day5 | |
(:require [clojure.string :as s])) | |
(def letters (map char (concat (range 97 123)))) | |
(def reactions | |
(re-pattern | |
(s/join "|" | |
(for [letter letters] | |
(str |
(ns aoc2018.day4 | |
(:require [clojure.math.combinatorics :as combo])) | |
(defn add-guard-sleep-time | |
[guards-map current-guard last-sleep-time line] | |
(let [ | |
wake-up-time (first (drop 1 (re-find #"\d+-\d+-\d+ \d+:(\d+)" line))) | |
nwake-up-time (Integer/parseInt wake-up-time) | |
nsleep-time (Integer/parseInt last-sleep-time)] |
rails new feeder --webpack=react --skip-turbolinks | |
--- Setup | |
1. Install devise and create a user model | |
* rails generate devise:install | |
* rails generate devise User | |
2. Create a Post model: | |
./bin/rails g scaffold post user:references text:text color:string |
qt.qpa.cocoa.screens: Adding QCocoaScreen(0x7f9f26d67de0, index=0, native=<NSScreen: 0x7f9f26d1fbe0>, geometry=QRect(0,0 1440x900), dpr=1, name="Color LCD") | |
Unable to load translation for locale "en_IL" , use en_US by default | |
exeCount set to: 155 | |
qt.scenegraph.general: threaded render loop | |
qt.scenegraph.general: Using sg animation driver | |
qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms | |
qt.quick.hover.trace: QQuickMultiPointTouchArea(0x7f9f29417090, parent=0x0, geometry=0,0 0x0) false -> true | |
qt.quick.hover.trace: Loading_QMLTYPE_11(0x7f9f29416d50, parent=0x0, geometry=0,0 0x0, z=10001) false -> true | |
qt.quick.hover.trace: QQuickRootItem(0x7f9f2954aab0, parent=0x0, geometry=0,0 0x0) false -> true | |
qt.quick.focus: QQuickWindowPrivate::setFocusInScope(): |
const f = (x) => x * 2; | |
const g = (x) => ( x * 2 ); | |
const i = (x) => { return x * 2 }; | |
const j = x => x * 2; | |
(state + props) => DOM | |
class TimeConverter extends React.Component { |
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
export default class DiscussionBox extends React.Component { | |
static propTypes = { | |
discourseUrl: PropTypes.string.isRequired, | |
discourseEmbedUrl: PropTypes.string.isRequired, | |
}; |
defmodule Day24 do | |
def strength(bridge) do | |
bridge | |
|> Enum.reduce(0, fn { p1, p2 }, acc -> acc + p1 + p2 end) | |
end | |
def find_max_bridge(start, []) do | |
{ start, strength(start) } | |
end |