Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
# Demo application showing how once can combine the python | |
# threading module with GObject signals to make a simple thread | |
# manager class which can be used to stop horrible blocking GUIs. | |
# | |
# (c) 2008, John Stowers <john.stowers@gmail.com> | |
# | |
# This program serves as an example, and can be freely used, copied, derived | |
# and redistributed by anyone. No warranty is implied or given. | |
import gtk | |
import gobject |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
Partial evaluation means to fix some variables in the given code before execution. With a traditional implementation of a compiler or an interpreter, all variables are replaced with its value on each evaluation of that variable. This is because a variable can change at any timing. This is, however, not always true in actual applications. Almost all of large applications has setting variables and data
/** | |
* Convert From/To Binary/Decimal/Hexadecimal in JavaScript | |
* https://gist.github.com/faisalman | |
* | |
* Copyright 2012-2015, Faisalman <fyzlman@gmail.com> | |
* Licensed under The MIT License | |
* http://www.opensource.org/licenses/mit-license | |
*/ | |
(function(){ |
<html> | |
<head> | |
<script src="out/goog/base.js" type="text/javascript"></script> | |
<script src="hello_world.js" type="text/javascript"></script> | |
<script type="text/javascript">goog.require("hello_world.core");</script> | |
</head> | |
<body> | |
</body> | |
<script type="text/javascript">hello_world.core.run()</script> | |
</html> |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
This is a study of interpersonal closeness, and your task, which we think will be quite enjoyable, is simply to get close to your partner. We believe that the best way for you to get close to your partner is for you to share with them and for them to share with you. Of course, when we advise you about getting close to your partner, we are giving advice regarding your behavior in this demonstration only, we are not advising you about your behavior outside of this demonstration.
In order to help you get close we've arranged for the two of you to engage in a kind of sharing game. You're sharing time will be for about one hour, after which time we ask you to fill out a questionnaire concerning your experience of getting close to your partner.
You have been given three sets of slips. Each slip has a question or a task written on it. As soon as you both finish reading these instructions, you should
# Get a server, somehow. Mine runs CentOS 7 | |
# All commands to be run as root, so either sudo su, or add sudo to each one | |
# Install Docker | |
yum install docker | |
# This nginx proxy listens to the main Docker socket for containers starting | |
# and stopping. It then reads the VIRTUAL_HOST environment variable for that | |
# container and creates a proxy route for each one. Containers without a | |
# VIRTUAL_HOST environment variable will be ignored. This fork also allows |