\(\newcommand{\A}{\mat{A}}\)
\(\newcommand{\B}{\mat{B}}\)
\(\newcommand{\C}{\mat{C}}\)
\(\newcommand{\D}{\mat{D}}\)
\(\newcommand{\E}{\mat{E}}\)
\(\newcommand{\F}{\mat{F}}\)
\(\newcommand{\G}{\mat{G}}\)
\(\newcommand{\H}{\mat{H}}\)
\(\newcommand{\I}{\mat{I}}\)
\(\newcommand{\K}{\mat{K}}\)
\(\newcommand{\L}{\mat{L}}\)
\(\newcommand{\M}{\mat{M}}\)
\(\newcommand{\N}{\mat{N}}\)
\(\newcommand{\One}{\mathbf{1}}\)
\(\newcommand{\P}{\mat{P}}\)
\(\newcommand{\Q}{\mat{Q}}\)
\(\newcommand{\Rot}{\mat{R}}\)
\(\newcommand{\R}{\mathbb{R}}\)
\(\newcommand{\S}{\mathcal{S}}\)
\(\newcommand{\T}{\mat{T}}\)
\(\newcommand{\U}{\mat{U}}\)
\(\newcommand{\V}{\mat{V}}\)
\(\newcommand{\W}{\mat{W}}\)
\(\newcommand{\X}{\mat{X}}\)
\(\newcommand{\Y}{\mat{Y}}\)
\(\newcommand{\argmax}{\mathop{\text{argmax}}}\)
\(\newcommand{\argmin}{\mathop{\text{argmin}}}\)
\(\newcommand{\c}{\vec{c}}\)
\(\newcommand{\d}{\vec{d}}\)
\(\newcommand{\e}{\vec{e}}\)
\(\newcommand{\f}{\vec{f}}\)
\(\newcommand{\g}{\vec{g}}\)
\(\newcommand{\mat}[1]{\mathbf{#1}}\)
\(\newcommand{\min}{\mathop{\text{min}}}\)
\(\newcommand{\n}{\vec{n}}\)
\(\newcommand{\p}{\vec{p}}\)
\(\newcommand{\q}{\vec{q}}\)
\(\newcommand{\r}{\vec{r}}\)
\(\newcommand{\transpose}{{\mathsf T}}\)
\(\newcommand{\tr}[1]{\mathop{\text{tr}}{\left(#1\right)}}\)
\(\newcommand{\t}{\vec{t}}\)
\(\newcommand{\u}{\vec{u}}\)
\(\newcommand{\vec}[1]{\mathbf{#1}}\)
\(\newcommand{\x}{\vec{x}}\)
\(\newcommand{\y}{\vec{y}}\)
\(\newcommand{\z}{\vec{z}}\)
\(\renewcommand{\v}{\vec{v}}\)
Computer Graphics – Shader Pipeline
To get started: Clone this repository and all its submodule dependencies using:
git clone --recursive https://github.com/alecjacobson/computer-graphics-shader-pipeline.git
Do not fork: Clicking “Fork” will create a public repository. If you’d like to use GitHub while you work on your assignment, then mirror this repo as a new private repository: https://stackoverflow.com/questions/10065526/github-how-to-make-a-fork-of-public-repository-private
Background
Review chapters 6, 7 and sections 8.1–8.2 of Fundamentals of Computer Graphics (4th Edition).
Read Sections 11.4–11.5 and Chapter 17 of Fundamentals of Computer Graphics (4th Edition).
In this assignment, we will use the “real-time rendering” shader pipeline and
procedural rendering to create interesting pictures.
GLSL
Your work will be implemented using the OpenGL shading language
(glsl). In many ways,
glsl code looks like C++ code. However, there are many builtin linear algebra
types (e.g., vec3
is a 3D-vector type) and geometric functions (e.g.,
dot(a,b)
computes the dot product
between vectors a
and b
. Since vectors are often used to represent spatial
coordinates or colors. We can index the coordinates of a vector (vec3 a
)
using a.r
, a.g
, a.b
or a.x
, a.y
, a.z
. When working with perspective
projection
it’s often useful to employ 4D homogeneous
coordinates vectors:
vec4
in glsl. Glsl has many builtin ways to work with differently sized
vectors and matrices. For example, if we have vec4 h
then we can write vec3 p
= h.xyz;
to grab the first three coordinates. Similarly, we could write: vec4
h = vec4(p,1.0)
to convert a 3D Cartesian point to a 4D homogeneous point.
Fortunately, there are many online resources and googling a glsl-related
question often returns helpful answers.
On the CPU side
The shaders you write in this assignment will run on the
GPU. Let’s breifly
describe what’s happening on the
CPU side.
A pseudo-code version of main.cpp
might look like:
main()
initialize window
copy mesh vertex positions V and face indices F to GPU
while window is open
if shaders have not been compiled or files have changed
compile shaders and send to GPU
send "uniform" data to GPU
set all pixels to background color
tell GPU to draw mesh
sleep a few milliseconds
Window
Creating a window is clearly something that will depend on the operating system
(e.g., Mac OS X, Linux, Windows). This assignment, like many small scale
graphics programs or games, uses an open source windowing toolkit called
glfw. It works on all major operating
systems. Once the window is open we have access to its contents as an RGB image.
The job of our programs are to fill in all the pixels of this image with colors.
The windowing toolkit also handles interactions with the mouse and keyboard as
well as window resizing.
Shader compilation
Unlike your C++ code, shaders are compiled at runtime. This has a nice
advantage that you can change your shaders without restarting the main program.
So long as the change is noticed and the shaders are recompiled, the rendering
will be immediately updated.
Compilation errors (usually syntax errors) will be output from the main program
and the window will turn black (background color). For example, if your
fragment shader contained:
#version 410 core
in vec3 pos_fs_in;
out vec3 color;
void main()
{
color = pos_fs_in.x;
}
You would see an error printed to the screen:
ERROR: failed to compile fragment shader
ERROR: 0:6: Incompatible types (vec3 and float) in assignment (and no available implicit conversion)
ERROR: One or more attached shaders not successfully compiled
ERROR: Failed to link shader program
If you change this file, the main program should immediately notice the change
before drawing the next frame. If successful there will be no error message and
the screen may now draw something interesting.
Data on the GPU
From the perspective of the shader pipeline, data on the GPU is separated into
different types. For example, when we send the mesh vertex positions to the GPU
we’re associating one 3D position per vertex. This data is considered an
“attribute” of each vertex. Each vertex invokes a single execution of the vertex
shader and its corresponding position is given as the in vec3 pos_vs_in;
variable. The output of the vertex shader will be “varying” depending on the
input and computation conducted. Your program is responsible for setting this
output value in out vec3 pos_cs_in
. This variable is named ending with
_cs_in
because it will in turn be used as input to the next shader in the
pipeline tessellation control shader.
Small amounts of data that is constant and independent of the particular
vertex/tessellation patch/fragment being processed is labeled as “uniform” data.
The prototypical example of this is the perspective projection matrix: uniform
mat4 proj
. Uniform data is usually changed once per draw frame (e.g., uniform
float time_since_start
is updated with the number of seconds since the start of
the program) or once per “object” (e.g., uniform bool is_moon;
is set based on
whether we’re drawing the first or second object in our scene).
Large amounts of data that may be randomly accessed by shaders is stored in
“texture” memory (e.g., color texture images). This data must be accessed by
sampling specific pixel values based on a given 2D locations (e.g., the U.V.
mapping of a fragment).
Tessellation Control Shader
The tessellation control shader determines how to subdivide each input “patch”
(i.e., triangle). Unlike the subdivision we saw with subdivision
surfaces, the subdivision is
determined independently for each triangle and not called recursively.
The exact pattern of the resulting triangulation is left largely to
implementation. As the shader programmer, you have control over:
- the number of new edges each input each should split into
(
gl_TessLevelOuter[1] = 5
means the edge across from vertex 1
(i.e., the
edge between vertices 0
and 2
) should be split into 5 edges); and
- the number of edges to place toward the center of the patch
(
gl_TessLevelInner[0] = 5
would be a good choice if
gl_TessLevelOuter[...] = 5
and a regular tessellation was desired).
Unlike the vertex or fragment shader, the tessellation control shader has access
to attribute information at all of the vertices of a triangle. The main
responsibility of this shader is setting the gl_TessLevelOuter
and
gl_TessLevelInner
variables.
Question: If the amount of subdivision along each edge is determined
independently for each triangle, how can we make sure neighboring triangles
subdivide their shared edge the same amount?
Hint: ✌
Tessellation Evaluation Shader
The tessellation evaluation shader takes the result of the tessellation that
the tessellation control shader has specified. This shader is called once for
every vertex output during tessellation (including original corners). It has
access to the attribute information of the original corners (e.g., in our code
in vec3 pos_es_in[]
) and a special variable gl_TessCoord
containing the
barycentric
coordinates of the
current vertex. Using this information, it is possible to interpolate
information stored at the original corners onto the current vertex: for example,
the 3D position. Like the vertex and tessellation control shader, this shader
can change the 3D position of a vertex. This is the last opportunity to do
that, since the fragment shader cannot.
How come I can’t use #include
?
Our glsl shader programs are not compiled from files. Instead the
CPU-side program must read the file contents into memory as strings and provide
the raw strings to the shader compiler. Unfortunately, this means there is no
#include
preprocessor directive and sharing code across different shaders is a
burden.
In this assignment, we will use a .json
file to collect the different files
whose contents are concatenated to form the input string to be compiled
for each shader. For example, in data/test-01.json
you’ll see:
{
"vertex": [ "../src/version410.glsl","../src/pass-through.vs"],
"tess_control": [ "../src/version410.glsl","../src/pass-through.tcs"],
"tess_evaluation": [ "../src/version410.glsl","../src/pass-through.tes"],
"fragment": [ "../src/version410.glsl","../src/pass-through.fs"]
}
This indicates that the string for the vertex shader is the concatenation of two
(2) files ../src/version410.glsl
and then "../src/pass-through.vs"
.
Similarly, for each of the other shaders.
Shader debugging
Debugging shader programs must be done visually. Since we only see the result of
all computation, we can use the shader pipeline’s ability to set screen colors
to debug all computation simultaneously. For example, when debugging the
fragment shader we can check all values at once by setting the pixel color to a
value we expect (or don’t expect) depending on the computation. A few useful
commands come in handy:
color = 0.5+0.5*n;
will set the color based on the normal.
color = vec3(0.5,0.5,0)+vec3(0.5,0.5,0)*view_pos_fs_in.xyz
will set the color based on the 2D position.
color = (1+(view_pos_fs_in.z - -3)/5)*vec3(1,1,1);
will set the color based on
the distance to the camera in the z-direction.
color = vec3(float(is_moon),1,0);
will set the color to yellow or green based
on a boolean value (in this case is_moon
).
Bump and normal maps
A bump map is a mapping from a surface point to a displacement along the
normal direction. A normal map is a mapping from a surface point to a unit
normal vector. In a mathematical sense, a normal map is non-sense. A point on a
surface has a specific normal completely determined by its local geometry. The
normal is the direction that goes in the most outward direction from the
surface. That is, the normal is perpendicular to the surface.
Normal mapping is useful in computer graphics because we can drape the
appearance of a complex surface on top a low resolution and simple one. To
create a consistent and believable looking normal map, we can first generate a
plausible bump map. Each point \(\mathbf{p}∈ \mathbb{R}³\) on the surface is moved to a new
position \(\mathbf{\tilde{p}} ∈ \mathbb{R}³\):
\[
\mathbf{\tilde{p}}(\mathbf{p}) := \mathbf{p} + h(\mathbf{p}) \ \mathbf{\hat{n}}(\mathbf{p}) ,
\]
where \(h : \mathbb{R}³ → \mathbb{R}\) is the bump height amount function (could
be negative) and \(\mathbf{\hat{n}}(\mathbf{p}) : \mathbb{R}³ → \mathbb{R}³\) is the
mathematically correct normal at \(\mathbf{p}\).
If our bump height \(h\) is a smooth function over the surface, we can compute the
perceived normal vector \(\mathbf{\tilde{n}}\) by taking a small finite
difference of the 3D position:
\[
\mathbf{\tilde{n}} = \frac{∂\ \mathbf{p}}{∂\ \mathbf{T}} ×
\frac{∂\ \mathbf{p}}{∂\ \mathbf{B}} ≈
\left(\frac{\mathbf{\tilde{p}(\mathbf{p} + ε \mathbf{T}})-\mathbf{\tilde{p}}(\mathbf{p})}{ε}\right) ×
\left(\frac{\mathbf{\tilde{p}(\mathbf{p} + ε \mathbf{B}})-\mathbf{\tilde{p}}(\mathbf{p})}{ε}\right)
\]
where \(\mathbf{T},\mathbf{B}∈ \mathbb{R}³\) are orthogonal tangent and
bi-tangent vectors in the tangent
plane at \(\mathbf{p}\) and \(ε\) is a small number (e.g., 0.0001
). By abuse of
notation, we’ll make sure that this approximate perceived normal is unit length
by dividing by its length:
\[
\mathbf{\tilde{n}} ←
\frac{\mathbf{\tilde{n}}}{‖\mathbf{\tilde{n}}‖}.
\]
Question: Can we always recover some orthogonal tangent vectors \(\mathbf{T}\) and \(\mathbf{B}\) from
the unit normal
\(\mathbf{n}\) ?
Hint: ☝
Tasks
There are no header files.
Accordingly, this assignment is organized a bit differently. The src/
directory contains glsl files whose contents should be completed or replaced.
Some of the functions have an element of creative freedom (e.g.,
src/bump_position.glsl
), while others are have a well-defined specification
(e.g., src/identity.glsl
).
Since glsl does not support #include
, the comments may hint that a previously
defined function can/should/must be used by writing // expects: ...
.
You may check the corresponding .json
example file to see specifically which
glsl files are loaded (and in which order) for each test program.
Unless otherwise noted, do not declare new functions.
White list
Black list
noise1
noise2
noise3
noise4
This assignment works best if you implement the following tasks in order.
Before editing anything be sure that your opengl and shader setup is correct. If you run ./shaderpipeline ../data/test-01.json
you should see this
image:
src/identity.glsl
src/translate.glsl
src/rotate_about_y.glsl
src/model.glsl
src/model_view_projection.vs
src/blue_and_gray.fs
With these implemented you should now be able to run ./shaderpipeline
../data/test-02.json
and see an animation of a gray moon orbiting around a blue
planet:
If you press L
this should switch to a wireframe rendering:
src/5.tcs
Running ./shaderpipeline ../data/test-03.json
and pressing L
should produce an
animation of a gray moon orbiting around a blue planet in wireframe with more
triangles:
snap_to_sphere.tes
Move your model-view-projection operations from the vertex shader (e.g.,
model_view_projection.vs
) to the tessellation evaluation shader. In addition,
snap the vertices of each shape to the unit sphere before applying these
transformations. This gives your shapes a round appearance if you run
./shaderpipeline ../data/test-04.json
:
blinn_phong.glsl
lit.fs
Running ./shaderpipeline ../data/test-05.json
adds light to the scene and we
see a smooth appearance with specular highlights:
random_direction.glsl
smooth_step.glsl
perlin_noise.glsl
procedural_color.glsl
Be creative! Your procedural colored shape does not need to look like marble
specifically and does not need to match the example. Mix and match different
noise frequencies and use function
composition to create an
interesting, complex pattern.
Running ./shaderpipeline ../data/test-06.json
adds a procedural color to the
objects. The color should not change based on the view or model
transformation. For example, this animation attempts to recreate a
marble texture:
improved_smooth_step.glsl
improved_perlin_noise.glsl
bump_height.glsl
bump_position.glsl
tangent.glsl
bump.fs
Be creative! Your bumpy shape does not need to match the example.
Running ./shaderpipeline ../data/test-07.json
adds a normal
map determined by differentiating
a procedural bump map. The color
should not change based on the view or model transformation. For example,
this animation attempts to recreate the (very) bumpy appearance of planets and
moons:
For this file, you may declare new functions: declare them directly at the
top of bump.fs
; do not modify the .json files.
planet.fs
For this file, you may declare new functions: declare them directly at the
top of planet.fs
; do not modify the .json files.
Be creative! Your planets do not need to look like the earth/moon and do not
need to look like the example planets.
Hint: Sprinkle noise on everything: diffuse color, specular color,
normals, specular exponents, color over time.
Running ./shaderpipeline ../data/test-08.json
should display a creative planet
scene. For example:


The Extract Method refactoring lets you extract one or many expressions into a new private method. The refactoring takes care of passing all necessary parameters to the method and returns all values that are needed.
To invoke the refactoring, a selection inside of a method has to be made. The refactoring wizard will then ask for a new name and show a preview of the changes:
Compared to Eclipse's Extract Method for Java, the Scala version currently lacks many features – for example, one cannot reorder the parameters, nor rename them. Allowing the user to choose where the extracted method should be placed also has not been implemented yet, and the visibility of the extracted method is always set to private.


{% extends "base.html" %} {% block content %} {% if shows %}
We aren't currently reviewing videos for any shows at the moment. Thank you for volunteering, and we hope you'll be here for the next converence.


Alexandre Bergeron
Backend Developer @ Wajam
@AlexBergeron2
Montreal Python 43 - Artistic Baboon
February 10, 2014
Values and variables - strong focus on immutability
// Mutable
var mutableVariable = "Test" // Type String infered
mutableVariable = "SomethingElse"
// Immutable
val immutableValue = 42 // Type Int infered
//immutableValue = 0 // error: reassignment to val
// We've got Java Arays - we just don't use them a lot
val someArray = Array("Hello", "World")
someArray(1) = "Scala" // They're mutable
println(someAray.mkString(" "))
Control statements
val meetup = "Montreal Python"
if (meetup.contains("Python")) {
println("You can see me")
} else {
// Dead code here
}
// if can also return a value, or be a one-liner
val foo = if (presenterRunningOutOfImagination) bar else baz
try {
// Something that might throw an exception
} catch {
case e => // Handle that exception
}
More control statements
// Scala also has while and do...while loops
// But they're seen as bad practice and used mostly for optimizations
while (someCondition) {
executeSomeOtherTasks()
}
for (i <- 1 to 5) println(i)
// Syntactic sugar for
(1 to 5).foreach(i => println(i))
Function declaration
// Our first function
def multiply(x: Int, y: Int): Int = x * y
multiply(2, 3)
// Unit-returning function
def show(i: Int): Unit = {
println("show(" + i + ")")
}
// Or, as an anonymous function
def anon = (x: Int, y, Int) => x * y // Type Infered
anon(2, 3)
// Functions can take functions as a parameter
def applyOperation(value: Int, oper: Int => Int): Int = oper(value)
Object-oriented - class, object, extends
abstract class Foo {
def a: String
}
// Classes can only inherit from one other class
class Bar extends Foo {
def a = "Bar"
}
// Singleton objects - can behave like a class
object Baz extends Foo {
def a = "Baz"
}
println(baz.a)
// Companion objects can also be created for existing classes
Python
# Lists - Ordered, duplicates allowed
a_list = [1, 2, 3, 4]
# Tuples - Ordered, fixed
a_tuple = (1, 2, 3)
a, b, c = a_tuple
# Sets - Unordered, duplicates not allowed
a_set = {1, 2, 3, 3} # {1, 2, 3}
# Dicts - Binds keys to values
a_dict = {"one": 1, "two": 2}
Scala
// Collections are immutable by default
// Mutable versions available
// Seqs - Ordered, duplicates allowed
val seq = Seq(1, 2, 3, 4)
val list = List(1, 2, 3, 4) // 1 :: 2 :: 3 :: 4 :: Nil
// Tuples - Ordered, fixed
val tuple = (1, 2, 3)
val (a, b, c) = tuple
// Sets - Unordered, duplicates not allowed
val set = Set(1, 2, 3, 3) // Set(1, 2, 3)
// Map - Binds keys to values
val map = Map("one" -> 1, "two" -> 2)
Python
[x * x for x in range(1, 4)]
# [1, 4, 9]
[x for x in range(1, 10) if x % 3 == 0]
# [3, 6, 9]
[(x, y) for x in range(1,5) for y in range(x, 5) if x + y == 5]
# [(1, 4), (2, 3)]
Scala
for (x <- 1 to 3) yield x * x
// Vector(1, 4, 9)
for (x <- 1 to 10 if x % 3 == 0) yield x
// Vector(3, 6, 9)
for {
x <- 1 until 5
y <- x until 5
if x + y == 5
} yield (x, y)
// Vector((1,4), (2,3))
Python
map(lambda x: x * x, range(1, 4))
# [1, 4, 9]
filter(lambda x: x % 3 == 0, range(1,10))
# [3, 6, 9]
from itertools import combinations
def sum_is_five(tuple):
x, y = tuple
return x < y and x + y == 5
filter(sum_is_five, combinations(range(1, 5), 2))
# [(1, 4), (2, 3)]
Scala
(1 to 3).map(x => x * x)
// Vector(1, 4, 9)
(1 to 10).filter(_ % 3 == 0) // Implicit parameter
// Vector(3, 6, 9)
(1 until 5).combinations(2).filter(_.sum == 5).toList
// List(Vector(1, 4), Vector(2, 3))
// Or, closer to what the for-comprehension executes
def sumIsFive(t: (Int, Int)) = {
val (x, y) = t
x + y == 5
}
(1 to 5).flatMap(x => (x to 5).map((x, _))).filter(sumIsFive)
// Vector((1,4), (2,3))
Pattern matching
// Looks like switch from Java
def sign(n: Int) = n match {
case 0 => "zero"
// Supports guards
case n if < 0 => "negative"
case _ => "positive
}
Pattern matching
// Gets even better with extractors
// Like when pattern matching with lists
def sum(lst: List[Int]): Int = lst match {
case head :: tail => head + sum(tail)
case Nil => 0
}
Option - Avoiding nulls
// Option[A] type has two possible values
// Some(value: A)
// None
// This allows to avoid nulls and NullPointerException
def greet(name: Option[String]): Unit = {
println("Hello " + name.getOrElse("world"))
}
greet(Some("Python"))
greet(None)
Option - Avoiding nulls
// Option also fits into pattern matching
def respond(result: Option[String]): Unit = result match {
case Some(r) => println("Response sent: " + r)
case None => println("No response sent")
}
Try - Avoiding calls to try
// Like Option, Try[A] has two possible values
// Success(value: A)
// Failure(t: Throwable)
// And it can be used with pattern matching
Try(4 / 2) // Success(2)
Try(1 / 0) // Failure(java.lang.ArithmeticException: / by zero)
case class - Easy way to create class that integrates with Pattern Matching
case class Person(name: String, city: String, job: Option[String])
// Every parameters in that constructor is now an immutable field
def makeStringForPerson(p: Person) = {
println(p.name + " - " p.job,getOrElse("unemployed") + " in " + p.city)
}
// You can also easily clone a case class
def moveTo(p: Person, c: String) = p.copy(city = c)
// As you'll see, you can also have case objects
Traits - Allows to inherit from multiple traits with implementations
trait A {
def toImplement(): Int
}
trait B {
val value = 42
def implemented() = value
}
class C extends A with B {
def toImplement() = implemented()
}
Traits - Allows to inherit from multiple traits with implementations
// sealed = you can't implement this trait outside of this file
// The + in front of means it's covariant.
sealed trait Option[+A] {
def getOrElse(value: A) = this match {
case Some(v) => v
case None => value
}
}
case class Some[+A](value: A) extends Option[A]
case object None extends Option[Nothing] // Nothing = Bottom type
Made with reveal.js


Home
Get Updates
UK History
Contact Us
Home | Sign Up | History | Contact
Please leave any comments, complaints, or compliments. We'd love to hear from you!


The Harvester:
The harvester provides a email address, virtual hosts, different domains, shodan results for the domain. Provides really good results, especially if you combine with shodan results as it may provide server versions and what's OS is running on the IP address.
Usage: theharvester options
-d: Domain to search or company name
-b: data source: google, googleCSE, bing, bingapi, pgp
linkedin, google-profiles, people123, jigsaw,
twitter, googleplus, all
-v: Verify host name via dns resolution and search for virtual hosts
-f: Save the results into an HTML and XML file
-c: Perform a DNS brute force for the domain name
-t: Perform a DNS TLD expansion discovery
-e: Use this DNS server
-h: use SHODAN database to query discovered hosts
TODO: Combine these results with recon-ng and DNS Dumpsters and create one csv with all results.


VisualFactory's built in intelligence and innovative configurator make producing high variety, complex assemblies extremely simple and cost effective.
VisualFactory is a single point of contact for all manufacturing knowledge & intelligence, eliminating the need for multiple document based systems.
VisualFactory automates and coordinates the manufacturing intelligence needed to optimize operations. This provides the information you need to know, when you need to know it.


The User Menu component can be used on a webpage to provide visual login and logout buttons. If logged out, the component displays a single button enabling the user to login. If logged in, the component provides an avatar button, displaying a flyout where a logout button is featured.
This component uses content projection inside its tag, meaning whatever html is included
between the aui-user-menu
tag will be inserted in the flyout section. The logout button is displayed
by default but can be disabled if you wish to implement your custom logout button.
Two output events may be used to hook to login or logout functionality to the interface:
login$
logout$
You are responsible for providing login and logout callback functionality, this component only provides visuals.


BTS' Grammy Awards outfit to be displayed at 'The GRAMMY Museum'
by jennywillThe outfit that BTS wore to the Grammys will be displayed at the museum.
The GRAMMY Museum will hold their 'Grammy Award Red Carpet' exhibition starting on the 20th, and one of the outfits on display will be the suits that BTS wore in the beginning of the year to attend the '61st GRAMMY Awards'. The exhibition will be on display from the 20th to next Spring.
Congratulations to BTS.


January 19, 2019
Created By:
For Eclipse it is much simpler to include the needed libraries
|
Libraries |
name |
link |
|
Lwjgl_util.jar |
Lwjgl util |
Same as main and is located inside the zip file |
|
Slick – util.jar library only |
Slick texturing |
http://slick.ninjacave.com/slick-util/ |
|
Lwgl.jar |
Lwjgl main |
https://sourceforge.net/projects/java-game-lib/files/Official%20Releases/LWJGL%202.9.3/lwjgl-2.9.3.zip/download |
All these files are included in the lib folder in the project source
· All natives are included for the project in the lib/natives folder
If you import this project or clone it from the Github repository the natives and all ref libs will be in place for you, or if you clone it, and then import the project from the .zip file.
The game is mostly based on the ever popular game Bloons Tower Defense created by Ninja Kiwi
The game reflects some of the concepts presented by its predecessor in which it has:
· Place able towers which have different strengths and abilities.
· A system in which you may create your own map and paths for the balloons to travel on.
o There are some know issues that may affect the gameplay experience (listed later in this document).
· A loading screen (Its just there for help with future development, more on this later)
· Ability to create custom towers (for now it is only possible through editing the source).
· Different balloon types with different heath and speeds.
· Though my expectations were merely reached through some of the implementation of concepts that produced high end game design (i.e. multi-threading though I could not find a place to use this at, more on this later).
· Some computers may not be able to handle the calculations required in this game if there is a medium amount of load on the system, caused by background tasks like Chrome and Photoshop.
· Sometimes the towers will glitch and not shoot the balloons
In the following table, I have listed all the changes I have made to the project since the initial outline
i. Balloon.java
ii. BalloonBlue.java
iii. BalloonRed.java
iv. Dart.java
v. DartLazer.java
vi. DartNinjaStar.java
vii. DartNormal.java
viii. DartType.java
ix. Entity.java
x. Explosion.java
xi. Floor.java
xii. FloorGrid.java
xiii. FloorType.java
xiv. Game.java
xv. HighScore.java
xvi. Instructions.java
xvii. Leaderboard.java
xviii. LevelEditor.java
xix. MainMenu.java
xx. MakeFrame.java
xxi. MonkeyTower.java
xxii. MonkeyTowerDartMonkey.java
xxiii. MonkeyTowerIceMonkey.java
xxiv. MonkeyTowerNinjaMonkey.java
xxv. MonkeyTowerSuperMonkey.java
xxvi. MonkeyTowerType.java
xxvii. Player.java
xxviii. Round.java
xxix. RoundManager.java
xxx. SplashScreenLoading.java
xxxi. StartGame.java
xxxii. TestScreen.java
xxxiii. TurningPoint.java
i. Informal.java
ii. Error.java
i. DrawInFrame.java
ii. ImageTools.java
iii. LevelToolKit.java
iv. Sprite.java
v. StateManager.java
vi. Timer.java
i. Button.java
ii. Image.java
iii. Label.java
iv. ProgressBar.java
v. Slider.java
vi. UserInterFace.java
i. Make place able towers
ii. Make a level editor
iii. An algorithm to traverse a path
iv. Basic framework for user interface and game mechanics
i. Leader boards and user saving
ii. Select map screen
iii. Select difficulty/game mode screen
CLASS METHOD DOCUMENTATION
Description:
This class is the super object of all other balloon classes (BalloonRed etc).
It controls most of the tasks needed to perform for the balloon to render on to the screen and is the heart of the balloon framework. Like movement and health, hits and drawing and most importantly rewarding the player money if the balloon is in fact popped.
· other.DrawInFrame.DrawQuadWithTexture
· other.DrawInFrame.GRID_SQUARE_SIZE
· other.DrawInFrame.HEIGHT
· other.DrawInFrame.LoadTexture
· other.DrawInFrame.WIDTH
· other.Timer.Delta
· java.util.ArrayList
· org.newdawn.slick.opengl.Texture
· Entity (Interface)
Variables:
· private static final int MONEY_FOR_KILL = 10;
· private int width, height, moneyReward, currentTurnPoint;
· private float speed, x, y, health, startingHealth, hiddenHealth;
· private Texture instanceTexture;
· public BalloonType type;
· private Floor startingFloorObject;
· private boolean first, alive;
· private FloorGrid grid;
· private boolean calledChangeMoney = false;
· private ArrayList<TurningPoint> turnigPoints;
· private int[] directions; // this contains the x and y momentum
Balloon(int, int, FloorGrid, BalloonType)
Description:
constructor a balloon object is created with the following as parameters int
floorX, int floorY, FloorGrid grid, BalloonType type
the balloon is spawned on the floorX and floorY coordinates and the default
values provided by the type specified
Balloon(Texture, Floor, FloorGrid, int, int, float, float)
Description:
constructor a balloon object is created with the following as parameters
Texture instanceTexture, Floor startingFloorObject, FloorGrid grid, int
width, int height, float speed, float health
the balloon is created with a texture and spawned on the startingFloorObject
with a width and height and speed and health
tick()
Description:
tick is called every loop of the main game loop to update the current factors
of the balloons position and checks if the balloon is alive and gets the next
turning point and moves the balloon depending on the speed and the directions
array
isTurningPointReached()
Description:
returns true if the turning point has been reached
endReached()
Description:
This pops the balloon if it makes it through the entire way without beeing
poped and subtracts a life from the player
damage(int)
Description:
damages the balloon object and requires a damage parameter to subtract from
the health if the health is 0 or less then added the specified amount of
money to the player object
findDirection(Floor)
Description:
findDirection returns a int array which contains two values represent if the
balloon should move in either axis
post: returns a direction array that contains values either 1, 2, 0, -1
representing movement if the value is 1 then the balloon moves by
mulltiplieing the speed and delta by 1 otherwise it returns 2 if the end is
reached and 0 if the movement is not required in either the x or y axis also
it is -1 one if it is going backwards or against the axis in this case if it
is -1 on the 1st index then it is going up on the y axis
fillTurningPointArrayList()
Description:
Fills the array list of turning point objects containing all directional
object for maneuvering the balloon object it loops through util it finds the
end of the path using a basic guess and check algorithm path finding
algorithm,
post: the turning point list is filled with all the turning points discovered
in the map
findTurningPoint(Floor, int[])
Description:
Returns an object representing the current turning point by looping through
all possibilites of the checkpoint's location up, down, left, right from the
current location starting floor is the object currently on.
In summary this algorithm is more complicated to explain then to make it
Basically checks if there is a turning point in the direction the balloon is
Going by looking at the dir array passed as a parameter and then sets found
To true if the turning point is found. For example if the x axis movement is
0 and the y axis is 1 then this algorithm checks the floor down 1 times the
Counter so the first one is just 1 down and the next loop the counter is 2
And so it checks the 2nd floor down and if it is a turning point then found
Is set to true and the loop is broken I found some tutorial talking about
This and provided some pseudo code but I couldn't find it again so I am sorry
I can't reference it here
draw()
Draws the object on the screen represented by the texture on the screen using
a static method from DrawInFrame
kill()
sets alive to false so that the balloon is considered dead and is removed
from the round
reduceHiddenHealth(float)
reduces the health of the balloon and requires a amount to do by so.
isAlive()
returns the isAlive variable
This class is the super class. Controls movement of projectiles shot from towers
·
Entity (Interface)
Variables:
methodname
Description:


Primerion Chambers offer the best legal services which you can always rely on, We are dedicated to giving our clients the best of our legal services and ensuring their happiness.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Arcu nec ac faucibus elementum placerat. Dolor varius cursus fermentum donec. Amet leo ac pellentesque adipiscing adipiscing cras dignissim. Condimentum nisl sit a egestas nisl nibh vulputate eget bibendum. Turpis lorem condimentum ligula nibh cum vitae augue. Tincidunt hendrerit mattis posuere nisl scelerisque mattis vitae. Tristique velit magna volutpat fermentum lorem leo aenean. Sit malesuada blandit mauris elit, porttitor pulvinar nullam turpis molestie. Et turpis ultrices etiam vulputate ut. Pharetra, morbi vitae viverra turpis. Sem.
We are team of professional, intellectual and creative experts in the law field. we started up in 1998 with our first case on criminal law which we gained points from, on winning the case Before the end of the year 1998, we had already won about 50 cases in our region and our spread became rapid.
In 1999, we opened up a new branch in Kaduna with cases rolling in. we covered cases as such family law, corporate law, business law and divorce law. In 2000, we opened up a new branch in Kaduna with cases rolling in. we covered cases as such family law, corporate law, business law and divorce law. In 1999, we opened up a new branch in Kaduna with cases rolling in. we covered cases as such family law, corporate law, business law and divorce law. In 2000, we opened up a new branch in Kaduna with cases rolling in. we covered cases as such family law, corporate law, business law and divorce law.
We are dedicated and passionate in giving our clients the best and reliable legal services. We are dedicated and passionate in giving our clients the best and reliable legal services. We are dedicated and passionate in giving our clients the best and reliable legal services. We are dedicated and passionate in giving our clients the best and reliable legal services. at all times. Passion is key to our victory.
We won our first case
We opened our new office
We opened a new branch
Attorney’s openinig
Best law firm of the year
Corperate Law 80%
Human Rights Law 80%
Property Law 80%
Litigation Law 80%
To get our daily updates and connected to our great minds and professionals, subscribe to our newsletter
© CodeLyne 2020. All Rights Reserved.


It's Friday night, you've just finished a long work week and you're finally kicked back on your couch with beer in hand and pizza ordered - you can't wait to turn on your favorite show, when to all avail you realize you CAN'T FIND IT! We know your frustration and we are here to help.

Popular Television searches:


Happiness (8/10)
12th June 1999: Cineworld, Bristol
Major plot points revealed.
Happiness, written and directed by Todd Solondz, won the International Critics' Prize at Cannes last year. It is an extremely frank and disturbing look at the emotional horror stories that exist under the surface of the lives of several apparently everyday American suburbanites. The characters' lives intersect in various ways, as if to suggest that the film has not just chosen a few freaks to examine, but that the awfulness of what goes on in the film is quite normal.
The interweaving stories show the ways in which the characters seek happiness and uniformly fail.  It is this aspect of the film that is truly shocking. The son, embarrassed and confused about his stirring sexuality, goes to his father for advice. The father's calm but frank comments can be seen either as a model of open and supportive parenting, or as an attempt at a gross seduction. The scenes in which the father plots his assaults are uncomfortable enough to watch, but the scene in which he admits to his son what he has done, and describes it with brutal candour, is almost unbearable.  It is this that has provoked some to call the film morally repugnant.
The other story lines are hardly light-hearted, and there is a rape and murder thrown in for good measure, but there is nevertheless a strange humour, fuelled by embarrassment, running through much of the film. The cast is uniformly excellent, although Dylan Baker deserves special mention for his portrayal of the paedophile father.
I was not looking forward to seeing Happiness, but felt it was a film I had to see. I can't say I enjoyed it very much, but it is as emotionally involving and challenging as cinema can get.
--
Gary Jones
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


[viewBag] title = "second" url = "/second" layout = "main" is_hidden = 0 navigation_hidden = 0 meta_title = "Second page" meta_description = "Second page" ==
Here is the second page


--- layout: post title: An Introduction and Thoughts on Developing iOS Applications with MonoTouch date: '2012-07-25T14:48:00.001+01:00' author: solrevdev tags: modified_time: '2012-07-25T14:48:28.153+01:00' blogger_id: tag:blogger.com,1999:blog-31446756.post-2628274212682783673 blogger_orig_url: http://www.solrevdev.com/2012/07/an-introduction-and-thoughts-on.html ---
mono and monotouch are simply brilliant bits of kit.


GDQ - Playing games for fun and charity
In a nutshell, speedrunning is trying to finish a game as fast as possible. There’s different set of rules for each game (called categories), but it always boils down to how fast a game can be finished.
Video games mean different things for different people. For some they are their day-to-day source of entertainment or it’s their competitive nature that speaks to them, while for others it may be childhood nostalgia. Whatever reason that may be, GDQ, the seven day speedrunning marathon raises incredible amounts of money for charity each year, and it only keeps on growing.
Games are serious business
Over seven years ago Games Done Quick was inaugurated. Who would have thought that something seemingly so niche would become such a huge event in such a short time? So far, GDQ has managed to raise over 12 Million USD for different charities. It is refreshing to see gamers, which are often cast under a negative light in the media, coming together for such a noble cause, as well as seeing such a diverse and inclusive community built around video games.
The next GDQ event will be happening very soon, from Jan 7th until Jan 14th 2018, the schedule is available here.
Why I love speedrunning
I’ve always been a gamer, in fact, my earliest memories of computers are of games such as Prince of Persia and Gorillas. Even from an early age I was always mesmerized by video games, some times because of the graphics and music and some other times by the storytelling and the atmosphere they manage to create.
I’ve always found it fascinating how some incredibly dedicated people with patience and determination can manage to not only beat some incredibly tough games, but do so in such a short amount of time. I don’t think anyone can deny the amount of skill that is required to pull off some frame and pixel perfect tricks in Super Mario bros. or categories such as Reverse Boss Order in Super Metroid or even blindfolded runs of games such as Mike Tyson’s Punch-Out!!.
Anyone who plays or played video games can appreciate the sheer amount of skill required to speedrun them. I am personally amazed at the talent speedrunners showcase each year after year, and how they do so live with thousands of people watching. Every year, Runners keep coming up with new way to shave seconds off the timer, often managing to do things which were deemed impossible.
As a software developer, I also enjoy speedrunning at a technical level. Often, glitches games are abused to finish games faster (for example by breaking a random number generator). These are interesting achievements as they give us a glimpse of how some games are implemented, where their programmers went wrong, or even expose some smart tricks they use so they can run on limited hardware. Whatever the cause may be, it is always fun to see what software is like under the hood.
A magnificent, albeit extreme example of this is how for the Tool Assisted Speedrun (TAS) block of AGDQ in 2016 a simple version of Mario Maker was re-created by exploiting glitches on Super Mario World. This cool Arstechnica article goes into some detail on how it was achieved.
For years to come
There’s no doubt that GDQ is an extremely positive event. It does not really matter why people decide to watch it, if it’s the competitive nature of the event, the glitches, or simply the nostalgia, or why people decide to donate; what matters is that GDQ is helping make the world a better place for everybody.


Exhausted Geographies is a radical engagement with the politics of representation and map-making in order to explore and produce new ways of seeing and imagining cities in the global south. This publication is a collection of 7 maps, each coupled with an essay, contributed by artists, architects, historians, urban planners, geographers and anthropologists working on/in Karachi. It is a coming together of different situated and localized knowledges to enable an exchange of ideas and methodologies beyond the borders of the academy and the art world. Using artistic and interdisciplinary research methods, the contributors subvert mapmaking into an open and critical medium to produce visual representations of space, temporality, politics and human relationships.
Exhausted Geographies mobilises a crucial, cross-disciplinary political imaginary to rethink current representations of Karachi and includes a wide range of topics that provide new insights into the social, spatial and discursive fabric of the city.
Borrowing the terminology of Irit Rogoff, this project takes as its starting point a moment of exhaustion from representations of and discourses around a city whose histories and geographies have collapsed into clichés. Rather than offering representations of the city as a single, fixed, knowable whole, this project is an assemblage of experimentations in ways of seeing, rendering, understanding and inhabiting the innumerable parallel realities of the city of Karachi. The city, too, is read as an assemblage, an open multiplicity of relations, encounters, movements – experienced and viewed in multiple scales, dimensions and perspectives.
The contributions range from the politics of development/displacement, missing persons and state-enforced disappearances, cartographic silences of local knowledge productions, eighteenth-century narrative geographies of Sindh, colonial reordering of the city, community mapping and regularisation politics, visual architectures of desire and longing, spatial memories and embodied subjectivities.


|
SounDroid
2.0
The Android part of the project for controlling desktop's sound volume from an Android application
|
Network connector. More...
Inherited by com.soundroid.net.bluetooth.BluetoothConnector, and com.soundroid.net.wifi.WifiConnector.
Data Structures | |
| enum | ConnectionTypes |
| Connection types, e.g. More... | |
Public Member Functions | |
| boolean | isConnectedToNet (final Context context) |
| Return connection to a network. More... | |
| void | connect (final String addr, final String port) throws IOException |
| Connect to the given address and port. More... | |
| boolean | isAddrReachable (final String addr) |
| Check availability of the given address. More... | |
| String | getCurVol () |
| Get current volume of the remote soundroid daemon. More... | |
| boolean | sendMuteState (final boolean mute) |
| Send the state of mute to the remote soundroid daemon. More... | |
| void | closeConnection () |
| Close the connection to a network. More... | |
| boolean | sendChgVol (final int vol) |
| Send changing volume to the soundroid daemon. More... | |
| boolean | isConnectedToDaemon () |
| Check the connection to the soundroid daemon. More... | |
| boolean | handShake () |
| Make hand shake with the soundroid daemon. More... | |
| boolean | isMuted () |
| Is the remote soundroid daemon muted. More... | |
Data Fields | |
| String | HELLO = "hello" |
| String constant 'hello'. More... | |
Network connector.
Definition at line 41 of file NetConnector.java.
| void com.soundroid.net.NetConnector.closeConnection | ( | ) |
Close the connection to a network.
Implemented in com.soundroid.net.bluetooth.BluetoothConnector, and com.soundroid.net.wifi.WifiConnector.
| void com.soundroid.net.NetConnector.connect | ( | final String | addr, |
| final String | port | ||
| ) | throws IOException |
Connect to the given address and port.
| addr | The address for connection |
| port | The port for connection |
| IOException |
Implemented in com.soundroid.net.wifi.WifiConnector.
| String com.soundroid.net.NetConnector.getCurVol | ( | ) |
Get current volume of the remote soundroid daemon.
Implemented in com.soundroid.net.bluetooth.BluetoothConnector, and com.soundroid.net.wifi.WifiConnector.
| boolean com.soundroid.net.NetConnector.handShake | ( | ) |
Make hand shake with the soundroid daemon.
Implemented in com.soundroid.net.wifi.WifiConnector, and com.soundroid.net.bluetooth.BluetoothConnector.
| boolean com.soundroid.net.NetConnector.isAddrReachable | ( | final String | addr | ) |
Check availability of the given address.
| addr | The address string |
Implemented in com.soundroid.net.wifi.WifiConnector.
Referenced by com.soundroid.ui.wifi.WiFiConnectingActivity.getConnection().
| boolean com.soundroid.net.NetConnector.isConnectedToDaemon | ( | ) |
Check the connection to the soundroid daemon.
Implemented in com.soundroid.net.wifi.WifiConnector, and com.soundroid.net.bluetooth.BluetoothConnector.
Referenced by com.soundroid.ui.bluetooth.BluetoothUI.reInitConnector(), com.soundroid.ui.bluetooth.BluetoothUI.setVolumeUI(), and com.soundroid.ui.wifi.WifiUI.setVolumeUI().
| boolean com.soundroid.net.NetConnector.isConnectedToNet | ( | final Context | context | ) |
Return connection to a network.
| context | The application's context |
Implemented in com.soundroid.net.bluetooth.BluetoothConnector, and com.soundroid.net.wifi.WifiConnector.
Referenced by com.soundroid.ui.DistanceVolumeActivity.isConnectedToNetAfterDialog().
| boolean com.soundroid.net.NetConnector.isMuted | ( | ) |
Is the remote soundroid daemon muted.
Implemented in com.soundroid.net.wifi.WifiConnector, and com.soundroid.net.bluetooth.BluetoothConnector.
Referenced by com.soundroid.ui.UI.setVolumeUiElements().
| boolean com.soundroid.net.NetConnector.sendChgVol | ( | final int | vol | ) |
Send changing volume to the soundroid daemon.
| vol | The new volume value |
Implemented in com.soundroid.net.wifi.WifiConnector.
Referenced by com.soundroid.ui.UI.getOnSeekBarChangeListener().
| boolean com.soundroid.net.NetConnector.sendMuteState | ( | final boolean | mute | ) |
Send the state of mute to the remote soundroid daemon.
| mute | The state of mute: true - to mute, false - to unmute |
Implemented in com.soundroid.net.bluetooth.BluetoothConnector, and com.soundroid.net.wifi.WifiConnector.
Referenced by com.soundroid.ui.UI.MuteButton.getMuteButtOnClickListener().
| String com.soundroid.net.NetConnector.HELLO = "hello" |
String constant 'hello'.
Definition at line 42 of file NetConnector.java.
Referenced by com.soundroid.net.bluetooth.BluetoothConnector.handShake(), and com.soundroid.net.wifi.WifiConnector.handShake().


Serperbuy is a Unofficial third party tool not related to Superb AI, inc.
This extension is applied to SuperbAI Suite v1.9.9 and eariler (Legacy tools)
If you want to get the New Serperbuy for "SuperbAI Suite v1.10.0 and later", click here(link will be added)
CrossHair
- A Hide/Show
- X Change Color(Black/White)
- V B Change Width Thinner/Thicker
Brightness/Contrast
Performance may be degraded when you adjust brightness & contrast. It can fixed by Reset.
- ; ' Change Brightness Lower / Higher
- Ctrl + ; Ctrl + ' Change Contrast Lower / Higher
- Ctrl + Alt + ; Reset
- Ctrl + Alt + ' Activate / Deactivate
Fix Cabinet Height
- Ctrl + [Activate / Deactivate
- Ctrl + ]Save current Cabinet Height


Brush Size: How big do you want the stroke to be?
Brush Color: What color do you want to draw in?
Brush Type: What shape would you like the brush to be?
rectangle
circle
Tips, tricks and documentation!


Send A Cat
Know someone that needs a pick me up? Well then, send them a cat. Straight to their phone.
Currently this only works for numbers in North America.
{% extends "layout.html" %} {% block content %} {% with messages = get_flashed_messages() %} {% if messages %}
Know someone that needs a pick me up? Well then, send them a cat. Straight to their phone.
Currently this only works for numbers in North America.
Why is there a max on cats that can be sent you ask? Well, Twilio costs money, and 100 cats a day seems like 'nuff cats.
This wee app was made by NL. Cats are pulled from the twitter-verse and delivered via Twilio.


Delivery Route Optimization with Python
The Google Maps Platform offers a number of APIs to get maps, routes, and places information. In this example, I will demonstrate how to get coordinates of an address using the Geocoding API.
Distance Matrix
n2/2
Problem Statement¶
A team needs to make deliveries to a set of addresses in a semi-optimized manner. The inputs are a [list of addresses to deliver to] and the number of drivers available. Our goal is to print a list of delivery addresses for each driver in an automated way so that if the address list or number of drivers available changes we can quickly re-generate the list.
In this analysis we minimize the average time traveled by each driver while keeping the number of stops per driver roughly equal.
Inputs:
# 1. Enter the number of driveres:
n_drivers = 12
# 2. Enter the distance calculation method. Options
# - COORDINATES: Uses simple distance between lat/lng coordinates. Less accurate but quick.
# - GOOGLE: Uses the Google Distance Matrix API (more accurate but ~20 min for
# 100 stops + fees).
DISTANCE_METHOD='COORDINATES'
%matplotlib inline
import math
import numpy as np
import pandas as pd
import random
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['figure.dpi'] = 150
plt.style.use('seaborn-ticks')
%load_ext watermark
%watermark -iv
# Google Maps API authentication
file = open('GoogleMapsAPIKey.txt', 'r')
apiKey = file.read()
1. Load Data¶
We load the data required, which is a list of addresses needing deliveries. This list includes latitude and longitude of each address. Use this script ADD to get the latitude and longitude if you don't already have them.
Note that the first address in the list needs to be the home base where deliveries originate.
df = pd.read_excel('Meal Deliveries (coordinates).xlsx')
3. Clustering¶
We use the sklearn kmeans algorithm to cluster the locations into a group for each driver. Note that this does not gurantee an equal number of locations in each cluster, and may produce clusters with only one outlier locaiton. It may be necessary to manually adjust the number of clusters to arrive at an appropriate route for each driver.
X = df.as_matrix(columns=['lat','lng'])
X
# plt.scatter(X[:, 0], X[:, 1])
plt.scatter(df['lng'], df['lat'])
# # create distance matrix (from coordinates)
# D = np.zeros(shape=(df.shape[0],df.shape[0]))
# for row in range(df.shape[0]):
# origin = df.loc[df.index[row],'Address']
# orig_lat = df.loc[df.index[row],'lat']
# orig_lng = df.loc[df.index[row],'lng']
# for col in range(df.shape[0]):
# destination = df.loc[df.index[col],'Address']
# dest_lat = df.loc[df.index[col],'lat']
# dest_lng = df.loc[df.index[col],'lng']
# if origin!=destination:
# distance = math.sqrt((dest_lat-orig_lat)**2 + (dest_lng-orig_lng)**2) * 1000
# D[row,col] = distance
# D
def get_drive_time(apiKey, origin, destination):
"""
Returns the driving time between using the Google Maps Distance Matrix API.
API: https://developers.google.com/maps/documentation/distance-matrix/start
# INPUT -------------------------------------------------------------------
apiKey [str]
origin [str]
destination [str]
# RETURN ------------------------------------------------------------------
drive_tim [float] (minutes)
"""
import requests
url = ('https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins={}&destinations={}&key={}'
.format(origin.replace(' ','+'),
destination.replace(' ','+'),
apiKey
)
)
try:
response = requests.get(url)
resp_json_payload = response.json()
drive_time = resp_json_payload['rows'][0]['elements'][0]['duration']['value']/60
except:
print('ERROR: {}, {}'.format(origin, destination))
drive_time = 0
return drive_time
# test...
# origin = '3272 Ainwick Road, Columbus, OH'
# destination = '375 N Front St. Columbus, OH'
# drive_time = get_drive_time(apiKey, origin, destination)
# print(drive_time)
# create distance matrix (from Google Distance Matrix API)
# https://developers.google.com/maps/documentation/distance-matrix/start
D = np.zeros(shape=(df.shape[0],df.shape[0]))
for row in range(df.shape[0]):
origin = df.loc[df.index[row],'Address']
orig_lat = df.loc[df.index[row],'lat']
orig_lng = df.loc[df.index[row],'lng']
for col in range(df.shape[0]):
destination = df.loc[df.index[col],'Address']
dest_lat = df.loc[df.index[col],'lat']
dest_lng = df.loc[df.index[col],'lng']
if origin!=destination:
if DISTANCE_METHOD=='GOOGLE':
distance = get_drive_time(apiKey, origin, destination)
elif DISTANCE_METHOD=='COORDINATES':
distance = math.sqrt((dest_lat-orig_lat)**2 + (dest_lng-orig_lng)**2) * 1000
D[row,col] = distance
D
# locs = [0,24]
# origin = df.loc[df.index[locs[0]],'Address']
# destination = df.loc[df.index[locs[1]],'Address']
# dist = D[locs[0],locs[1]]
# print('Distance between:\n{}\n{}\n{}'.format(origin,destination,dist))
def get_driver_distance(locations):
# location 0 is home base, so prepend and append list
locations.insert(0, 0)
locations.append(0)
driver_distance = 0
for i in range(len(locations)-1):
distance = D[locations[i],locations[i+1]]
driver_distance += distance
return driver_distance
def switch_two(all_locs):
i = random.sample(range(1,len(all_locs)), 2)
# print(i)
all_locs_new = all_locs[:]
all_locs_new[i[0]] = all_locs[i[1]]
all_locs_new[i[1]] = all_locs[i[0]]
return all_locs_new
def divide_list(my_list, n_result):
avg = len(my_list) / float(n_result)
my_list_divided = []
last = 0.0
while last < len(my_list):
my_list_divided.append(my_list[int(last):int(last + avg)])
last += avg
return my_list_divided
def get_total_distance(driver_routes):
total_distance = 0
driver_distances = []
for i in range(len(driver_routes)):
driver_distance = get_driver_distance(driver_routes[i])
driver_distances.append(driver_distance)
total_distance+=driver_distance
return total_distance, driver_distances
def get_avg_distance(driver_routes):
driver_distances = []
for i in range(len(driver_routes)):
driver_distance = get_driver_distance(driver_routes[i])
driver_distances.append(driver_distance)
avg_distance = np.mean(driver_distances)
return avg_distance, driver_distances
all_locs = list(range(df.shape[0]))[1:]
driver_routes = divide_list(my_list=all_locs, n_result=n_drivers)
avg_difference, driver_distances = get_avg_distance(driver_routes)
print(avg_difference)
distances = []
for i in range(10000):
# all_locs_new = all_locs[:]
all_locs_new = switch_two(all_locs)
driver_routes_new = divide_list(my_list=all_locs_new, n_result=n_drivers)
avg_difference_new, driver_distances = get_avg_distance(driver_routes_new)
if avg_difference_new < avg_difference:
all_locs = all_locs_new[:]
avg_difference = avg_difference_new
distances.append(avg_difference)
else:
distances.append(avg_difference)
plt.plot(range(len(distances)),distances)
plt.ylabel('Cost Function (Average Distance)')
plt.xlabel('# Iterations')
driver_routes_new
driver_distances
sum(driver_distances)
np.std(driver_distances)
print(max(driver_distances)-min(driver_distances))
Print Driver Lists¶
# write driver-stop to dataframe
df['Driver-Stop'] = ''
for driver in range(len(driver_routes_new)):
for stop in range(len(driver_routes_new[driver])):
row = driver_routes_new[driver][stop]
if row>0:
if driver+1<10:
df.loc[df.index[row],'Driver-Stop'] = '0{}-{}'.format(driver+1,stop)
else:
df.loc[df.index[row],'Driver-Stop'] = '{}-{}'.format(driver+1,stop)
# save Excel
cols = ['Driver-Stop','Qty','Address','Apt','Last Name','First Name','Phone',
'Note1','Note2', 'Note3', 'Confirmed']
df = df[cols].sort_values('Driver-Stop')
writer = pd.ExcelWriter('Delivery List.xlsx')
df.to_excel(writer, sheet_name='Deliveries', index=False)
writer.save()
print('Done.')
# # creat google maps URL for each driver
# df['Driver-Stop'] = ''
# for driver in range(len(driver_routes_new)):
# print('\n\nDRIVER {}'.format(driver+1))
# addresses = []
# for stop in range(len(driver_routes_new[driver])):
# row = driver_routes_new[driver][stop]
# address = df.loc[df.index[row],'Address']
# apt = df.loc[df.index[row],'Apt']
# qty = df.loc[df.index[row],'Qty']
# addresses.append(address)
# if row>0:
# if driver+1<n_drivers+1:
# if pd.isnull(apt):
# print('\tQty {}: {}'.format(qty,address))
# else:
# print('\tQty {}: {} (#{})'.format(qty,address,apt))
# url = 'https://www.google.com/maps/dir'
# for item in addresses:
# url_add = '/{}'.format(item.replace(' ','+'))
# url = url+url_add
# print('Directions: '+url)
# create summary for each driver
df['Name'] = df['First Name']+' '+df['Last Name']
df['Note1'] = df['Note1'].fillna('')
df['Phone'] = df['Phone'].fillna(' ')
file = open('Delivery List.txt', 'w')
file.write('Driver Summary')
df['Driver-Stop'] = ''
for driver in range(len(driver_routes_new)):
file.write('\n\nDRIVER {}'.format(driver+1))
addresses = []
for stop in range(len(driver_routes_new[driver])):
row = driver_routes_new[driver][stop]
address = df.loc[df.index[row],'Address']
apt = df.loc[df.index[row],'Apt']
qty = df.loc[df.index[row],'Qty']
phone = df.loc[df.index[row],'Phone']
name = df.loc[df.index[row],'Name']
note = df.loc[df.index[row],'Note1']
addresses.append(address)
if row>0:
if driver+1<n_drivers+1:
if pd.isnull(apt):
file.write('\n - Qty {}: {}'.format(qty,address))
# file.write('\n({}) {:<14}{:<25}{}\t{}'.format(qty,phone,name,address,note))
else:
file.write('\n - Qty {}: {} (#{})'.format(qty,address,apt))
# file.write('\n({}) {:<14}{:<25}{} (#{})\t{}'.format(qty,phone,name,address,apt,note))
url = 'https://www.google.com/maps/dir'
for item in addresses:
url_add = '/{}'.format(item.replace(' ','+'))
url = url+url_add
file.write('\nDirections: {}'.format(url))
file.close()
print('Done.')
- You can view the original code and files.
Versions:
Python 3.6.3
numpy 1.14.2
pandas 0.23.4
matplotlib 3.0.0


SITE_NAME can monitor your cron jobs and notify you when they don't run at
expected times. Assuming curl
or wget
is available, you will not need to install
any new software on your servers.
The principle of operation is simple: your cron job sends an HTTP request ("ping") to SITE_NAME every time it completes. When SITE_NAME does not receive the HTTP request at the expected time, it notifies you. This monitoring technique, sometimes called "heartbeat monitoring", is a type of dead man's switch. It can detect various failure modes:
Let's take a look at an example cron job:
# run backup.sh at 06:08 every day
8 6 * * * /home/me/backup.sh
To monitor it, first create a new Check in your SITE_NAME account:
After creating the check, copy the generated ping URL , and update the job's definition:
# run backup.sh, then send a success signal to SITE_NAME
8 6 * * * /home/me/backup.sh && curl -fsS -m 10 --retry 5 -o /dev/null PING_URL
The extra curl call lets SITE_NAME know the cron job has run successfully. SITE_NAME keeps track of the received pings and notifies you as soon as a ping does not arrive on time.
Note: you can alternatively add the extra curl
call as a final line inside the
/home/me/backup.sh
script, to keep the cron job's definition clean and short.
You can use an HTTP client other than curl to send the HTTP request.
The extra options in the above example tell curl to retry failed HTTP requests, limit the maximum execution time, and silence output unless there is an error. Feel free to adjust the curl options to suit your needs.
/home/me/backup.sh
exits with an exit code 0.Grace Time is the amount of extra time to wait when a cron job is running late before declaring it as down. Set Grace Time to be above the expected duration of your cron job.
For example, let's say the cron job starts at 14:00 every day, and takes between 15 and 25 minutes to complete. The grace time is set to 30 minutes. In this scenario, SITE_NAME will expect a ping to arrive at 14:00, but will not send any alerts yet. If there is no ping by 14:30, it will declare the job failed and send alerts.
SITE_NAME has integrations to deliver notifications over different channels: email, webhooks, SMS, chat messages, incident management systems, and more. You can and should set up multiple ways to get notified about job failures:
Additionally, to make sure no issues "slip through the cracks", in the Account Settings › Email Reports page you can configure SITE_NAME to send repeated email notifications every hour or every day as long as any of the jobs is down:
Classic cron implementations have a built-in method of notifying about cron job failures, the MAILTO variable:
<EMAIL_ADDRESS>8 6 * * * /home/me/backup.sh
So why not just use that? There are several drawbacks:
If your cron job consistently pings SITE_NAME an hour early or an hour late, the likely cause is a timezone mismatch: your machine may be using a timezone different from what you have configured on SITE_NAME.
On modern GNU/Linux systems, you can look up the time zone using the
timedatectl status
command and looking for "Time zone" in its output:
$ timedatectl status
Local time: C 2020-01-23 12:35:50 EET
Universal time: C 2020-01-23 10:35:50 UTC
RTC time: C 2020-01-23 10:35:50
Time zone: Europe/Riga (EET, +0200)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
journalctl
On a systemd-based system, you can use the journalctl
utility to see system logs,
including logs from the cron daemon.
To see live logs:
journalctl -f
To see the logs from e.g. the last hour, and only from the cron daemon:
journalctl --since "1 hour ago" -t CRON


Infantino-led FIFA powerful delegation arrives in Madagascar to start African tour
Gianni Infantino has led a powerful FIFA delegation including General Secretary Fatma Samoura to Antananarivo, Madagascar to meet CAF President Ahmad Ahmad and the Madagascar Football Association at the start of his visit to several African member associations.
Samoura, who is also the FIFA Delegate-General for Africa, Deputy Secretary-General Matthias and Senior Member of Association of Member Associations Veron Musengo-Umba were part of the historic tour delegation to boost activities of African FAs.
Former Executive Director of FIFA and FIFA Foundation Youri Djorkaeff , legendary player and Special Advisor to CAF President Samuel Eto'o are all part of the delegation.
Madagascar is one of four African countries that Infantino and Ahmad will visit. They will also go to Malawi, Mozambique and Congo Brazzaville.
In Antananarivo, FIFA president will meet with President of the Republic of Madagascar Andre Rajoelina, as well as meetings with the Chairman of the FMCT Committee and members of the Executive Committee of the FFA.
In Mahajunga, the FIFA delegation will visit the offices of the Confederation of African Football (CAF) there, where there will be a meeting of the FIFA Committee of Federations.
"We are delighted to receive the president of the International Football Association (FIFA) on the continent of Africa, where he feels like in his own country," said CAF President Ahmed Ahmed.
"Football enthusiasts in Madagascar and the general public warmly welcome President Infantino," he said.
Infantiono, who has an African wife, reechoed these sentiments that he feels at home on the continent where he enjoys a lot of support.
“I am delighted to be back in Africa, where I feel at home,” said Infantino.
“We are delighted to be here and to start our African tour in your country. We intend to do great things for African football, to restore the hope of many, and bring smiles to the faces of millions."


{% extends "skeleton/_body.html" %} {%hyde title: "Managing Instances" created: 2011-04-25 modified: 2011-04-25 %} {% block content_body %} {% markdown %} Instance in Cast represents a single instance of your application. Currently each instance is associated with a single service, but in the future this will change and you will be able to associate multiple services with your instance. For the rest of this tutorial we will assume the following setup: Application name: `Node Chat` Bundle identifier: `node_chat` Uploaded bundle version: `1.0.0` Instance name: `node_chat-0` 1. [Upgrading an instance](#upgrading_instance)


LengthReturns the number of characters in field, including all spaces, numbers, and special characters.field - any text, number, date, time, timestamp, or container field, or any text expression or numeric expressionThis function returns the number of characters in a specified field. For a container field, Length returns the size of the original file in bytes.Length(“John”) returns 4.Length(Description) returns 12 when the value in Description is Modem for PC.Length(“M1” & Left(Product;5)) returns 7, when the Product field contains Canvas Backpack.


protected fun publishInterest(selectable: Selectable): Unit
Overrides SelectorManagerSupport.publishInterest


Vacation preferences
Enter vacation preferences as:
(or look at)
Open
Start typing and select your name from the list.
Save
Close


class Run
Schema Information¶ ↑
Table name: runs
id :integer not null, primary key run_date :date distance :float route_name :string(255) notes :text run_time :integer user_id :integer
Public Class Methods
all_time_per_mile_pace(runs)
click to toggle source
# File app/models/run.rb, line 51 def self.all_time_per_mile_pace(runs) run_time = total_time(runs) distance = total_distance(runs) if distance > 0 && run_time > 0 run_time / distance else 0 end end
total_distance(runs)
click to toggle source
# File app/models/run.rb, line 42 def self.total_distance(runs) distances = runs.all.pluck(:distance) if distances.length > 0 distances.reduce(:+).round(2) else 0 end end
total_time(runs)
click to toggle source
# File app/models/run.rb, line 37 def self.total_time(runs) run_times = runs.all.pluck(:run_time) run_times.reduce(:+) end
Public Instance Methods
init_data()
click to toggle source
# File app/models/run.rb, line 61 def init_data self.run_date ||= Date.today self.distance ||= 0 self.run_time ||= 0.0 end
per_mile_pace()
click to toggle source
# File app/models/run.rb, line 29 def per_mile_pace if run_time == 0.0 || distance == 0 "0:00/mile" else run_time / distance end end


Entfernung zur Sonne:
4.498.000.000 km
Bahngeschwindigkeit:
5,43 km/s
Temperatur:
-201 °C
Dichte:
1,64 g/cm³
"Over the mountains,
And over the waves,
Over the fountains,
And under the graves;
Over the floods that are deepest,
Which do Neptune obey; Over the rocks that are steepest,
Love will find out the way."
— "Love will find out the Way", Altertümliches englisches Gedicht


Class Lexer
public
|
|
public
mixed
|
protected
|
$configure
$configure |
|
protected
array
|
$data
|
#
[
// if
LexerConst::T_IF => Extension\TIF\TIF::class,
LexerConst::T_ELSEIF => Extension\TIF\TELSEIF::class,
LexerConst::T_ELSE => Extension\TIF\TELSE::class,
LexerConst::T_END_IF => Extension\TIF\TEndIF::class,
// for
LexerConst::T_FOR => Extension\TFor\TFor::class,
LexerConst::T_END_FOR => Extension\TFor\TEndFor::class,
// while
LexerConst::T_WHILE => Extension\TWhile\TWhile::class,
LexerConst::T_END_WHILE => Extension\TWhile\TEndWhile::class,
// foreach
LexerConst::T_FOREACH => Extension\TForeach\TForeach::class,
LexerConst::T_FOREACH_ELSE => Extension\TForeach\TElseForeach::class,
LexerConst::T_END_FOREACH => Extension\TForeach\TEndForeach::class,
// operators
LexerConst::T_CONTINUE => Extension\TSimple\TContinue::class,
LexerConst::T_BREAK => Extension\TSimple\TBreak::class,
// PHP
LexerConst::T_PHP => Extension\TPHP\TPHP::class,
LexerConst::T_END_PHP => Extension\TPHP\TEndPHP::class,
// ASSIGN
LexerConst::T_ASSIGN => Extension\TSimple\TAssign::class,
// variable
LexerConst::T_VARIABLE => Extension\TSimple\TVariable::class,
// include
LexerConst::T_INCLUDE => Extension\TSimple\TInclude::class,
// extends
LexerConst::T_EXTENDS => Extension\TSimple\TExtends::class,
// partial
LexerConst::T_PARTIAL => Extension\TSimple\TPartial::class,
// block
LexerConst::T_BLOCK_START => Extension\TBlock\TBlockStart::class,
LexerConst::T_BLOCK_END => Extension\TBlock\TEndBlock::class,
// try|catch|finally
LexerConst::T_TRY => Extension\TTry\TTry::class,
LexerConst::T_CATCH => Extension\TTry\TCatch::class,
LexerConst::T_FINALLY => Extension\TTry\TFinally::class,
LexerConst::T_END_TRY => Extension\TTry\TEndTry::class,
]
|