This is Words and Buttons Online — a collection of interactive #tutorials, #demos, and #quizzes about #mathematics, #algorithms and #programming.
We don't have many tools for metaprogramming in C. We don't have templates or constexprs C++ has; we don't have mixins like in D; and we certainly don't have homoiconicity of Lisp and Julia. All we have in C is the preprocessor that supports macros. And we don't even have recursive macros neither as in macros that recurrently call themselves, nor as in macros that define macros. Apparently, you can't implement something as awesome as a compile time compiler with this.
Yet with preprocessor macros only you can still explain your compiler what do you want, and the compiler, being sophisticated machine, will use this knowledge to generate better code. You can make it compute rather elaborate things statically, and more importantly you can make it generate zero-overhead code to win quite a lot in performance.
I'll show you a pair of tricks that will turn a crude and inefficient algorithm for solving small linear systems into something that can outrun LAPACK.
Function inlining is the basics of compiler optimization. When the body of a function is small and the arguments are numerous it makes perfect sense to build the body into the code directly without arranging the conventional data configuring and jumping there and back in the memory. However, there are things that effectively prevent function inlining and one of them is the recursion.
Indeed, when a function calls itself simply building its body into its body will not work. You can force GCC to do that, but it will only eat up all the memory and crash.
The trick is to promise a compiler that the recursion will soon end. You have to unroll a recursive call into a finite number of specific function calls. And you can do this with macros.
Yes, the compiler would have to generate extra code on the first steps of compilation, but it will eventually eliminate the dead calls once the variables are proven to be constant during the runtime. GCC is very good in doing this. In fact, you don't even have to help it with const modifiers. If it can, it will minimize the runtime computation to the very possible extend.
In this example we will make it compute a quasi-recursive factorial function statically. Please press the “next step” button to see how the preprocessor and the compiler work together.
|
Of course, this hack has its limits. For instance, when you have to do several calls from a quasi-recursive function, the compiler would have to build not a list of bodies, but a whole tree. This slows down compilation enormously. It takes noticeable time to compile 4-depth 4-branches quasi-recursion on a modern desktop. 6-depth 6-branches might turn it catatonic.
Compilers are usually good in unrolling loops. In fact, they are usually better than us, regular people. The good side of the loop unrolling is that it removes the overhead on index counting and comparison. The bad side is larger code. Sometimes we would win more from a small loop running completely in the instruction cache than from a huge unrolled loop that has to be read from uncached memory. Usually, compilers can balance these things for a specific processor architecture better than people with assemblers.
Sometimes however we know better than the compiler. We know that even if the loop is not quite short, and even if it has inner loops it should still be eligible for unrolling because it will shrink after the dead code elimination. Here is the trick that will leave no options to the C compiler.
This is a bubble sort conducted in compile time. Once again, please use the “next step” button to see how it goes.
|
Technically, one can do the very same hack with the inlined pseudo-recursion from before. But this compiles faster and it has shown itself easier to debug.
LAPACK is known to be a rather effective library for solving linear algebra problems. I'm going to measure how it performs on 1M small linear systems, and compare it to the brute Cramer's rule solution done with loops and recursive functions first, and with metaprogramming tricks to remove overhead then.
That's exactly what I want to measure:
#include "stdio.h" void dgesv_( int* n, int* nrhs, double* a, int* lda, int* ipiv, double* b, int* ldb, int* info ); #define N 5 #define NRHS 1 #define LDA N #define LDB N int main() { double sum_x[5] = {0., 0., 0., 0., 0.}; for(int i = 0; i < 1000000; ++i) { int n = N, nrhs = NRHS, lda = LDA, ldb = LDB, info; int ipiv[N]; double a[LDA*N] = { 6.80, -2.11, 5.66, 5.97, 8.23, -6.05, -3.30, 5.36, -4.44, 1.08, -0.45, 2.58, -2.70, 0.27, 9.04, 8.32, 2.71, 4.35, -7.17, 2.14, -9.67, -5.14, -7.26, 6.08, -6.87 }; double b[LDB*NRHS] = { 4.02, 6.19, -8.22, -7.57, -3.03, }; dgesv_( &n, &nrhs, a, &lda, ipiv, b, &ldb, &info ); for(int j = 0; j < 5; ++j){ sum_x[j] += b[j]; } } printf("%f, %f, %f, %f, %f\n", sum_x[0], sum_x[1], sum_x[2], sum_x[3], sum_x[4]); } |
I know this is not a perfect benchmark, for the very least it doesn't account for branch mis-prediction. But I'm ok with this. The metaprogrammed version I am going to compare it to simply has no branches to mis-predict.
But first, the version with all the overheads:
#include "stdio.h" double aijn(double* a, double* b, int i, int j, int n, int m){ return (n == m) ? a[i*m+j] : aijn(a, b, i, j, n+1, m) * aijn(a, b, n, n, n+1, m) - aijn(a, b, i, n, n+1, m) * aijn(a, b, n, j, n+1, m); } double bin(double* a, double* b, int i, int n, int m){ return (n == m) ? b[i] : aijn(a, b, n, n, n+1, m) * bin(a, b, i, n+1, m) - aijn(a, b, i, n, n+1, m) * bin(a, b, n, n+1, m); } void solve_xi(double* a, double* b, double* x, int i, int m){ double d = bin(a, b, i, i+1, m); for(int j = 0; j < i; ++j) d-=aijn(a, b, i, j, i+1, m)*x[j]; x[i] = d / aijn(a, b, i, i, i+1, m); } void runtime_solve(double* a, double * b, double* x, int m){ for(int k = 0; k < m; ++k) solve_xi(a, b, x, k, m); } int main() { double sum_x[5] = {0., 0., 0., 0., 0.}; for(int i = 0; i < 1000000; ++i) { double a[5*5] = { 6.80, -6.05, -0.45, 8.32, -9.67, -2.11, -3.30, 2.58, 2.71, -5.14, 5.66, 5.36, -2.70, 4.35, -7.26, 5.97, -4.44, 0.27, -7.17, 6.08, 8.23, 1.08, 9.04, 2.14, -6.87 }; double b[5] = { 4.02, 6.19, -8.22, -7.57, -3.03, }; double x[5]; runtime_solve(a, b, x, sizeof(x) / sizeof(x[0])); for(int j = 0; j < 5; ++j){ sum_x[j] += x[j]; } } printf("%f, %f, %f, %f, %f\n", sum_x[0], sum_x[1], sum_x[2], sum_x[3], sum_x[4]); } |
It has a loop, a nested loop and a pair of recursive functions. Nothing we can't linearize with macros. The version with metaprogramming tricks looks like this:
// from static_recursion.h #define RECURSIVE_4_CALLS(PREFIX, CHUNK1, CHUNK2, CHUNK3, CHUNK4, SUFFIX, END_SUFFIX) \ inline PREFIX##_4 END_SUFFIX \ inline PREFIX##_3 CHUNK1##_4 CHUNK2##_4 CHUNK3##_4 CHUNK4##_4 SUFFIX \ inline PREFIX##_2 CHUNK1##_3 CHUNK2##_3 CHUNK3##_3 CHUNK4##_3 SUFFIX \ inline PREFIX##_1 CHUNK1##_2 CHUNK2##_2 CHUNK3##_2 CHUNK4##_2 SUFFIX \ inline PREFIX##_0 CHUNK1##_1 CHUNK2##_1 CHUNK3##_1 CHUNK4##_1 SUFFIX |
// from static_loops.h #define LOOP_TO_0(ID, N, BODY) {int ID; switch(N){\ case 7: ID=7;{BODY};\ case 6: ID=6;{BODY};\ case 5: ID=5;{BODY};\ case 4: ID=4;{BODY};\ case 3: ID=3;{BODY};\ case 2: ID=2;{BODY};\ case 1: ID=1;{BODY};\ case 0: ID=0;{BODY};\ }} #define LOOP_TO(ID, START, END, BODY) \ LOOP_TO_0(ID, (END)-(START), ID=(END)-ID; BODY) #define LOOP_DOWNTO(ID, START, END, BODY) \ LOOP_TO_0(ID, (START)-(END), ID=(END)+ID; BODY) |
// from static_linear_solver.h RECURSIVE_4_CALLS(double aijn, (double* a, double* b, int i, int j, int n, int m){ return (n == m) ? a[i*m+j] : aijn, (a, b, i, j, n+1, m) * aijn, (a, b, n, n, n+1, m) - aijn, (a, b, i, n, n+1, m) * aijn, (a, b, n, j, n+1, m); }, (double* a, double* b, int i, int j, int n, int m){return a[i*m+j];}) RECURSIVE_4_CALLS(double bin, (double* a, double* b, int i, int n, int m){ return (n == m) ? b[i] : aijn, (a, b, n, n, n+1, m) * bin, (a, b, i, n+1, m) - aijn, (a, b, i, n, n+1, m) * bin, (a, b, n, n+1, m); }, (double* a, double* b, int i, int n, int m){return b[i];}) #define SOLVE_X(A, B, X, I, M) \ double d = bin_0(A, B, I, (I+1), M); \ LOOP_TO(j, 0, (I)-1, d-=aijn_0(A, B, I, j, (I+1), M)*X[j];); \ X[I] = d / aijn_0(A, B, I, I, (I+1), M); #define STATIC_SOLVE(A, B, X) \ int m = sizeof(X) / sizeof(X[0]); \ LOOP_TO(k, 0, m-1, SOLVE_X(A, B, X, k, m);); |
// and the benchmark itself #include "stdio.h" #include "static_linear_solver.h" int main() { double sum_x[5] = {0., 0., 0., 0., 0.}; for(int i = 0; i < 1000000; ++i) { volatile double v_a[5*5] = { 6.80, -6.05, -0.45, 8.32, -9.67, -2.11, -3.30, 2.58, 2.71, -5.14, 5.66, 5.36, -2.70, 4.35, -7.26, 5.97, -4.44, 0.27, -7.17, 6.08, 8.23, 1.08, 9.04, 2.14, -6.87 }; double a[5*5] = { v_a[0+0], v_a[0+1], v_a[0+2], v_a[0+3], v_a[0+4], v_a[5+0], v_a[5+1], v_a[5+2], v_a[5+3], v_a[5+4], v_a[10+0], v_a[10+1], v_a[10+2], v_a[10+3], v_a[10+4], v_a[15+0], v_a[15+1], v_a[15+2], v_a[15+3], v_a[15+4], v_a[20+0], v_a[20+1], v_a[20+2], v_a[20+3], v_a[20+4], }; volatile double v_b[5] = { 4.02, 6.19, -8.22, -7.57, -3.03, }; double b[5] = { v_b[0], v_b[1], v_b[2], v_b[3], v_b[4], }; double x[5]; STATIC_SOLVE(a, b, x); for(int j = 0; j < 5; ++j){ sum_x[j] += x[j]; } } printf("%f, %f, %f, %f, %f\n", sum_x[0], sum_x[1], sum_x[2], sum_x[3], sum_x[4]); } |
Note that the input arrays start as volatile but then get copied to the non-modified arrays used as the STATIC_SOLVE's input. The thing is, if we don't do that, the whole thing gets solved statically for 0 runtime cost. That's not all I want to measure. I want my compiler to build a code that would work on arbitrary data, that's why the input data should be volatile.
On the other hand, having volatile as function argument inside the macros would kill the optimization for constant data, and I want static and semi-static solutions measured as well.
We can have both static and runtime solution with explicit copying. This way a single macros fits every possible configuration of constant and volatile data. In this regard it makes sense to measure not only LAPACK and metaprogrammed solution, but several other things as well. Here are the measurements.
Of course, these measurements are not at all precise but I think they still work since the numbers are so distinct.
You can trick the compiler into doing things it wouldn't normally do, and benefit from this performance-wise. Technically, you can even do this without macros, but macros make it easier.
Apart from the tricks themselves there are also some things worth mentioning.
All the measurements conducted on Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz, the code is compiled with g++ 5.4.0 -std=c++11 -O2. The source code for the benchmark is available on Github.
| Index #programming #demos | ← there's more. |
+
So You Think You Know C (free book) + Geometry for Programmers (paid book) + Github & RSS |


Philippine army says it has killed militant behind suicide attacks
MANILA: Philippine soldiers have killed a militant who had helped a local group linked to Islamic State to stage suicide bombings in the southern province of Sulu, the military said on Saturday (Nov 23).
The body of Talha Jumsah, also known as Abu Talha, was recovered after a clash with Filipino troops on Friday morning in the town of Patikul, military officials said.
They said Abu Talha had been trained in bomb-making by Islamic State and had instructed the Islamist militant Abu Sayyaf Group (ASG) in setting up suicide attacks. He had also served as "finance conduit and liaison" between foreign and local jihadists.
"The death of Abu Talha will surely cause demoralisation in the ASG ranks in Sulu," said Army Brigadier General Antonio Nafarrete.
Major General Corleto Vinluan Jr, the commander of military forces in Sulu, urged remaining ASG members to "surrender and live a normal life instead of being hunted down as fleeing criminals".
Early this month, the army said soldiers had foiled what they called an attempted suicide bombing in an urban area in Jolo municipality in Sulu, the latest in a series of attacks blamed on Abu Sayyaf.
There have been four suicide bombings in Sulu, Abu Sayyaf's stronghold, in the past 16 months, despite intensified army operations and a vow by Philippine President Rodrigo Duterte to wipe the group out.
The twin bombing of a church in January killed 21 people, a van bomb at a checkpoint in July 2018 killed 11, a suicide attack by two youths killed eight in June, and in September a woman carrying a bomb near an army detachment detonated it prematurely.
The attackers included Indonesians, a Moroccan and Filipinos.


OnMouseMove is a deferred connection, _Widget only call dojo.connect() (dojoAttachEvent) to connect the onmousemove event on the focusNode to the widget method if needed.
Mousing over the three buttons below should call the user-defined mouse-move handlers. The "both" button has two handlers, and they should both be called.


Sign In
Don't have an account?
Sign up
Rachael Lau
My Project
Explore Mentors
My Profile
Chat
Welcome to YouGo!
Start a project
then
find a mentor!
Refer to our
FAQ
if you need help.


Toyota Vellfire Spotted At Dealership Ahead Of Launch, Expected Price Rs. 79 Lakh
by Team GaadiWaadiThe bigger sibling of the hot-selling Toyota Innova Crysta measures 4,935 mm in length, 1,850 mm in width and 1,950 mm in height.
Toyota Kirloskar Motor (TKM), the Indian subsidiary of the Japanese auto giant, is close to launching a high-end MPV that will rival the recently launched Mercedes V-Class. Dubbed Toyota Vellfire, the new model was recently spotted testing on the public roads of the country, thereby hinting that the launch of the new model will take place sooner than later.
The new MPV has already been showcased to private gatherings to gauge the public response and the latest sighting hints at an imminent launch. The Toyota Vellfire will come to us via CBU route and will become the most expensive MPV in its carmaker’s lineup.
The new model will be available with Toyota’s ‘Executive Lounge’ package, which will bring in bits like electric tailgate and sliding doors, dual sunroofs, three-zone automatic climate control, mood lighting and individual tray tables. The second row of seats will include two large- sofa-like captain chairs that will have power adjustments for the desired seating posture.
Going by the latest spy images of the Toyota Vellfire, the new MPV will be sold with a 7.0-inch touchscreen infotainment system that will likely offer Android Auto and Apple SmartPlay connectivity. Furthermore, the new new MPV will even offer two 10.2-inch screens for the rear passengers.
In all likelihood, the Toyota Vellfire will be sold in India with a petrol-electric hybrid powertrain unit that will comprise a 2.5-litre petrol engine that will come mated with an electric motor.
The power source will be paired with a CVT for seamless performance. The two power-sources will be capable of producing a maximum power of 197 PS. This is the same powertrain that propels the Lexus NX 400h.
In the Indian market, the Toyota Vellfire will lock horns with the likes of Mercedes V-Class. The new model will be launched around the Auto Expo 2020 at an expected price of Rs. 79 Lakhs. Some previous reports indicate that the unofficial bookings of the new model have already commenced at select dealerships.


from typing import *
from collections import defaultdict
import logging
import velocyto as vcy
[docs]class Interval:
""" Holds an exon/intron interval read from the interval file """
# Since many of this object are instanciated, implementing slots make it more efficient
__slots__ = ['start', 'end', 'gene', "ivlidx", "ivltype", "is_sure_exon", "is_maybe_exon", "is_sure_intron", "is_sure_valid_intron", "is_last3prime"]
def __init__(self, start: str, end: str, gene: vcy.Gene, ivlidx: int, ivltype: str, is_last3prime: bool) -> None:
self.start, self.end, self.gene, self.ivlidx, self.ivltype = int(start), int(end), gene, ivlidx, ivltype
self.is_last3prime = is_last3prime
self.is_maybe_exon = ivltype in ('Eei', 'E-i')
self.is_sure_exon = ivltype in ('E--', 'Ee-')
self.is_sure_intron = ivltype in ('I--', 'I-i')
self.is_sure_valid_intron = self.is_sure_intron # NOTE This is just initialized and it will be adjusted later based on junction analysis
[docs] def add_read_inside(self) -> None:
self.gene.ivlinside_read_counts[self.ivlidx] += 1
[docs] def add_read_spanning5end(self) -> None:
self.gene.ivljunction5_read_counts[self.ivlidx] += 1
[docs] def add_read_spanning3end(self) -> None:
self.gene.ivljunction3_read_counts[self.ivlidx] += 1
[docs] def ends_upstream_of(self, read: vcy.Read) -> bool:
"""The following situation happens
Read
*|||segment|||-?-||segment|||????????
???????|||||Ivl|||||||||*
"""
return self.end < read.pos
[docs] def starts_upstream_of(self, segment: Tuple[int, int]) -> bool:
"""The following situation happens
*||||||segment|||||????????
*|||||||||||||Ivl||||||||||????????????
"""
return self.start < segment[-1]
[docs] def contains(self, segment: Tuple[int]) -> bool:
"""The following situation happens
*||||||segment|||||*
*|||||||||||||Ivl||||||||||||||||*
"""
return (segment[0] >= self.start) and (segment[-1] <= self.end)
[docs] def start_overlaps_with_part_of(self, segment: Tuple[int, int], minimum_flanking: int=vcy.MIN_FLANK) -> bool:
"""The following situation happens
*---|||segment||---*
*|||||||||||||Ivl||||||||||||||||*
where `---` idicates the minimum flanking
"""
return (segment[0] + minimum_flanking < self.start) and (segment[-1] - minimum_flanking > self.start)
[docs] def end_overlaps_with_part_of(self, segment: Tuple[int, int], minimum_flanking: int=vcy.MIN_FLANK) -> bool:
"""The following situation happens
*---|||segment||---*
*|||||||||||||Ivl||||||||||||||||*
where `---` idicates the minimum flanking
"""
return (segment[0] + minimum_flanking < self.end) and (segment[-1] - minimum_flanking > self.end)
def __lt__(self, other: Any) -> bool:
assert type(other) == Interval, "Comparison can be only between two intervals"
if self.start == other.start:
return self.end < other.end
return self.start < other.start
def __gt__(self, other: Any) -> bool:
assert type(other) == Interval, "Comparison can be only between two intervals"
if self.start == other.start:
return self.end > other.end
return self.start > other.start
[docs]class IntervalsIndex:
""" Search help class used to find the intervals that a read is spanning """
def __init__(self, ivls: List[Interval]) -> None:
self.ivls = ivls
self.ivls.sort() # NOTE: maybe I am sorting twice check what I do upon creation
self.iidx = 0 # index of the current interval
self.maxiidx = len(ivls) - 1
@ property
def last_interval_not_reached(self) -> bool:
return self.iidx < self.maxiidx
[docs] def has_ivls_enclosing(self, read: vcy.Read) -> bool:
"""Finds out if there are intervals that are fully containing all the read segments
Args
----
read: vcy.Read
the read object to be analyzed
Returns
-------
respones: bool
if one has been found
"""
if len(self.ivls) == 0:
return False
ivl = self.ivls[self.iidx] # current interval
# Move forward until we find the position we will never search left of again (because the reads are ordered)
while self.last_interval_not_reached and ivl.ends_upstream_of(read):
# move to the next interval
self.iidx += 1
ivl = self.ivls[self.iidx]
for segment in read.segments:
segment_matchtype = 0
# Local search for each segment move a little forward (this just moves a coupple of intervals)
i = self.iidx
while i < self.maxiidx and ivl.starts_upstream_of(segment):
matchtype = 0 # No match
if ivl.contains(segment):
matchtype = vcy.MATCH_INSIDE
if ivl.start_overlaps_with_part_of(segment): # NOTE: should this be elif or it makes sense to allow both?
matchtype |= vcy.MATCH_OVER5END
if ivl.end_overlaps_with_part_of(segment): # NOTE: should this be elif or it makes sense to allow both?
matchtype |= vcy.MATCH_OVER3END
segment_matchtype |= matchtype
# move to the next interval
i += 1
ivl = self.ivls[i]
# If one of the segments does not match inside a repeat we return false
if segment_matchtype ^ vcy.MATCH_INSIDE:
return False
# If I arrive at this point of the code all the segment matched inside
return True
[docs] def find_overlapping_ivls(self, read: vcy.Read) -> Tuple[set, Dict[Any, int]]:
"""Finds the overlap between Read and intervals
Args
----
read: vcy.Read
the read object to be analyzed
Returns
-------
matchgenes: set
the genes that the read is overlapping with
matchivls: dict: {vcy.Interval: int}
A dictionary with keys the intervals that the read is overlapping with and values the kind of overlapping
it is one of vcy.MATCH_INSIDE (1), vcy.MATCH_OVER5END (2), vcy.MATCH_OVER3END (4)
"""
matchgenes = set() # type: set
matchivls = defaultdict(int) # type: Dict[Any, int]
if len(self.ivls) == 0:
# logging.warn("IntervalsIndex %s contains no intervals" % self)
return matchgenes, matchivls
ivl = self.ivls[self.iidx] # current interval
# Move forward until we find the position we will never search left of again (because the reads are ordered)
while self.last_interval_not_reached and ivl.ends_upstream_of(read):
# move to the next interval
self.iidx += 1
ivl = self.ivls[self.iidx]
# Loop trough the mapping segments of a read (e.g. just one of an internal exon, generally 2 for a splice or intron)
for segment in read.segments:
# Local search for each segment move a little forward (this just moves a coupple of intervals)
i = self.iidx
while i < self.maxiidx and ivl.starts_upstream_of(segment):
matchtype = 0 # No match
if ivl.contains(segment):
matchtype = vcy.MATCH_INSIDE
if ivl.start_overlaps_with_part_of(segment): # NOTE: should this be elif or it makes sense to allow both?
matchtype |= vcy.MATCH_OVER5END
if ivl.end_overlaps_with_part_of(segment): # NOTE: should this be elif or it makes sense to allow both?
matchtype |= vcy.MATCH_OVER3END
if matchtype:
# if there is a segment matching add it to the set of genes
matchgenes.add(ivl.gene)
# and add the match type to the set of genes
matchivls[ivl] |= matchtype
# move to the next interval
i += 1
ivl = self.ivls[i]
return matchgenes, matchivls


public class MyLocationOverlay extends Overlay implements android.hardware.SensorListener, android.location.LocationListener, Overlay.Snappable
Overlay
for drawing the user's current location (and
accuracy) on the map, and/or a compass-rose inset. Subclases can
override dispatchTap()
to handle taps on the current
location.
You will want to call enableMyLocation()
and/or enableCompass()
, probably from your Activity's Activity.onResume()
method, to enable the features of
this overlay. Remember to call the corresponding disableMyLocation()
and/or disableCompass()
in your Activity's
Activity.onPause()
method to turn off updates
when in the background.
Optionally, the constructor can also take a MapController
and use it to keep the "my location" dot visible by panning the map
when it would go offscreen, and a View
to View.postInvalidate()
when location or orientation is changed.
Runnables can be provided in runOnFirstFix(java.lang.Runnable)
to be run as
soon as we have a fix. (For example, this could center the map and
zoom in to show the location.)
Overlay.Snappable
SHADOW_X_SKEW, SHADOW_Y_SCALE
| Constructor and Description |
|---|
MyLocationOverlay(android.content.Context context,
MapView mapView)
Construct a new MyLocationOverlay.
|
| Modifier and Type | Method and Description |
|---|---|
void |
disableCompass()
Disable updates from the compass sensor.
|
void |
disableMyLocation()
Stops location updates.
|
protected boolean |
dispatchTap()
Handle a tap on the "my location" point.
|
boolean |
draw(android.graphics.Canvas canvas,
MapView mapView,
boolean shadow,
long when)
Draw method.
|
protected void |
drawCompass(android.graphics.Canvas canvas,
float bearing)
Draw the compass inset.
|
protected void |
drawMyLocation(android.graphics.Canvas canvas,
MapView mapView,
android.location.Location lastFix,
GeoPoint myLocation,
long when)
Draw the "my location" dot.
|
boolean |
enableCompass()
Enable updates from the compass sensor.
|
boolean |
enableMyLocation()
Attempts to enable MyLocation, registering for updates from
LocationManager.GPS_PROVIDER and LocationManager.NETWORK_PROVIDER . |
android.location.Location |
getLastFix()
Returns a Location corresponding to the most-recently-set user location.
|
GeoPoint |
getMyLocation()
Returns a GeoPoint corresponding to the most-recently-set user location.
|
float |
getOrientation()
Returns the most-recently-set compass bearing.
|
boolean |
isCompassEnabled()
Checks whether the compass widget is displayed.
|
boolean |
isMyLocationEnabled()
Checks whether location awareness is enabled (via GPS or network).
|
void |
onAccuracyChanged(int sensor,
int accuracy) |
void |
onLocationChanged(android.location.Location location)
Listener to get location updates from LocationManagerService.
|
void |
onProviderDisabled(java.lang.String provider) |
void |
onProviderEnabled(java.lang.String provider) |
void |
onSensorChanged(int sensor,
float[] values)
Called by the SensorManager when the compass value changes.
|
boolean |
onSnapToItem(int x,
int y,
android.graphics.Point snapPoint,
MapView mapView)
Checks to see if the given x and y are close enough to an item
resulting in snapping the current action (e.g.
|
void |
onStatusChanged(java.lang.String provider,
int status,
android.os.Bundle extras) |
boolean |
onTap(GeoPoint p,
MapView map)
Checks whether the location of the tap is close enough to the
current location (if it's known).
|
boolean |
runOnFirstFix(java.lang.Runnable runnable)
Queues a runnable to be executed as soon as we have a location
fix.
|
draw, drawAt, onKeyDown, onKeyUp, onTouchEvent, onTrackballEvent
public MyLocationOverlay(android.content.Context context, MapView mapView)
context
- A context to be used for accessing system services.mapView
- The MapView on which the location is to be overlayed.java.lang.IllegalArgumentException
- if mapView is null.public boolean enableCompass()
public void disableCompass()
public boolean isCompassEnabled()
public boolean enableMyLocation()
LocationManager.GPS_PROVIDER
and LocationManager.NETWORK_PROVIDER
.public void disableMyLocation()
It is safe to call this method even if location updates are currently disabled.
public void onSensorChanged(int sensor, float[] values)
onSensorChanged
in interface android.hardware.SensorListener
public void onLocationChanged(android.location.Location location)
onLocationChanged
in interface android.location.LocationListener
public void onStatusChanged(java.lang.String provider, int status, android.os.Bundle extras)
onStatusChanged
in interface android.location.LocationListener
public void onProviderEnabled(java.lang.String provider)
onProviderEnabled
in interface android.location.LocationListener
public void onProviderDisabled(java.lang.String provider)
onProviderDisabled
in interface android.location.LocationListener
public boolean onSnapToItem(int x, int y, android.graphics.Point snapPoint, MapView mapView)
Overlay.Snappable
onSnapToItem
in interface Overlay.Snappable
x
- The x in screen coordinates.y
- The y in screen coordinates.snapPoint
- To be filled with the the interesting point (in
screen coordinates) that is closest to the given x and y. Can
be untouched if not snapping.mapView
- The MapView that is requesting the snap. Use
MapView.getProjection()
to convert between on-screen
pixels and latitude/longitude pairs.public boolean onTap(GeoPoint p, MapView map)
dispatchTap()
; otherwise returns false.
Handle a "tap" event. This can be either a touchscreen tap
anywhere on the map, or a trackball click on the center of the
map. By default does nothing and returns false.protected boolean dispatchTap()
public boolean draw(android.graphics.Canvas canvas, MapView mapView, boolean shadow, long when)
drawMyLocation(android.graphics.Canvas, com.google.android.maps.MapView, android.location.Location, com.google.android.maps.GeoPoint, long)
if we
have a location fix, and then to drawCompass(android.graphics.Canvas, float)
if we
have a compass reading. We return false since we don't require
an immediate redraw; however, a delayed invalidate may be posted
on the viewToInvalidate passed to this class's constructor in
order to trigger the next phase in the animation of the blue location
dot.draw
in class Overlay
canvas
- The Canvas upon which to draw. Note that this
may already have a transformation applied, so be sure to leave
it the way you found it.mapView
- the MapView that requested the draw. Use MapView.getProjection()
to convert between on-screen pixels and
latitude/longitude pairs.shadow
- If true, draw the shadow layer. If false, draw the
overlay contents.when
- The timestamp of the draw.protected void drawMyLocation(android.graphics.Canvas canvas, MapView mapView, android.location.Location lastFix, GeoPoint myLocation, long when)
MapController
in our constructor, we'll scroll
to recenter the new reading.canvas
- the Canvas to draw to.mapView
- the mapView calling the draw.lastFix
- the last location fix we received.myLocation
- the coordinates of the last fix, extracted
into handy GeoPoint
form.when
- the drawing time, in millisecondsprotected void drawCompass(android.graphics.Canvas canvas, float bearing)
canvas
- The Canvas to draw to.bearing
- The estimated bearing of the phone, in degrees east of north.public GeoPoint getMyLocation()
public android.location.Location getLastFix()
public float getOrientation()
public boolean isMyLocationEnabled()
public boolean runOnFirstFix(java.lang.Runnable runnable)
public void onAccuracyChanged(int sensor, int accuracy)
onAccuracyChanged
in interface android.hardware.SensorListener


Used: Html, CSS, Bootstrap, Zepl, Excel, Python, Pandas, Machine Learning, Plotly, Natural Language Toolkit, Vectorizing, Naive Bayes
We used categorization model to create our prediction, after contemplation and trial and error we recieved about 40% predictive accuracy for the 70s, 80s, 2000s whereas the 60s and 2010s had a 85% predictive accuracy.
Stemming word bag, cleaner data set, less stop words, Genres could have created a more accurate prediction.
"I don't discriminate by the decade of the music but the creativity of the song."
"Give me some 90s Gangsta Rap"
"My Favorite decade is the 80s!"


Best Home Cooks Recipe Finder!
Are you a home cook tired of wasting time looking through the pantry, freezer and having no idea what recipe to cook with what you have, or wanting to know what would it take to prepare some new recipe, you came to the right place! Discover recipes by searching by Ingredient, Cuisine or Meal name and get it done!
Sign Up now !


Frugal Search
问题描述 :
For this problem you will write a search engine that takes a query, searches a collection of words, and finds the lexicographically smallest word that matches the query (i.e., the matching word that would appear first in an English dictionary). A query is a sequence of one or more terms separated by single vertical bars ("|"). A term is one or more letters followed by zero or more signed letters. A signed letter is either +s ("positive" s) or -s ("negative" s), where s is a single letter. All letters are lowercase, and no letter will appear more than once within a term. A query will not contain spaces. A term matches a word if the word contains at least one of the unsigned letters, all of the positive letters, and none of the negative letters; a query matches a word if at least one of its terms matches the word.
输入:
The input consists of one or more test cases followed by a line containing only "#" that signals the end of the input. Each test case consists of 1�100 words, each on a line by itself, followed by a line containing only "*" that marks the end of the word list, followed by one or more queries, each on a line by itself, followed by a line containing only "**" that marks the end of the test case. Each word will consist of 1�20 lowercase letters. All words within a test case will be unique. Each query will be as defined above and will be 1�79 characters long.
输出:
The input consists of one or more test cases followed by a line containing only "#" that signals the end of the input. Each test case consists of 1�100 words, each on a line by itself, followed by a line containing only "*" that marks the end of the word list, followed by one or more queries, each on a line by itself, followed by a line containing only "**" that marks the end of the test case. Each word will consist of 1�20 lowercase letters. All words within a test case will be unique. Each query will be as defined above and will be 1�79 characters long.
样例输入:
elk cow bat * ea acm+e nm+o|jk+l ** debian slackware gentoo ubuntu suse fedora mepis * yts cab-e+n r-e|zjq|i+t|vs-p+e-u-c ** #
样例输出:
bat NONE elk $ gentoo ubuntu NONE $
#include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <ctime> #include <iostream> #include <string> #include <vector> #include <map> #include <set> #include <algorithm> using namespace std; #define pub(x) push_back(x) #define x first #define y second #define MP make_pair typedef long long ll; typedef long double real; struct word { string t; int s[30]; void make() { memset(s, 0, sizeof s); for (size_t i = 0; i < t.size(); ++i) s[t[i]-'a']++; } } dic[121]; char s[100]; int b[80][30]; bool cmp(const word &a, const word &b) { return a.t < b.t; } bool match(int *s, int k) { bool us = false, un =false; for (int i = 0; i < 26; ++i) { if (b[k][i] == 1 && s[i] == 0) return false; if (b[k][i] == 2 && s[i] > 0) return false; if (b[k][i] == 3 && s[i] > 0) us = true; if (b[k][i] == 3) un = true; } //printf("%d\n", k); if (!un) return true; return us; } int main() { while (1) { gets(s); if (s[0] == '#') break; int m = 0; while (s[0] != '*') { dic[++m].t = s; dic[m].make(); gets(s); } sort(dic + 1, dic + 1 + m, cmp); for (int i = 1; i <= m; ++i) dic[i].make(); //for (int i = 1; i <= m; ++i){puts(dic[i].t.c_str());} puts("----"); //printf("%d\n", dic[1].s[0]); memset(b, 0, sizeof b); while (1) { gets(s); if (s[0] == '*') break; memset(b, 0, sizeof b); int k = 1; for (int i = 0; s[i]; ++i) if ('a' <= s[i] && s[i] <= 'z') { if (i > 0 && s[i - 1] == '+') b[k][s[i] - 'a'] = 1; else if (i > 0 && s[i - 1] == '-') b[k][s[i] - 'a'] = 2; else b[k][s[i] - 'a'] = 3; } else if (s[i] == '|') ++k; //printf("%s %d %d\n", s, b[1]['e' - 'a'] , b[1]['a' - 'a']); int ans = -1; for (int i = 1; i <= m; ++i) { for (int j = 1; j <= k; ++j) if (match(dic[i].s, j)) {ans = i; break;} if (ans >= 0) break; } if (ans == -1) puts("NONE"); else puts(dic[ans].t.c_str()); } puts("$"); } return 0; }
(adsbygoogle = window.adsbygoogle || []).push({});
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
怎么不能下载有那个大师告诉一声怎么回事
这是什么编译器啊，不通过
#include <cstdio>
int main() {
//answer must be odd
int n, u, d;
while(scanf("%d%d%d",&n,&u,&d)==3 && n>0) {
if(n<=u) { puts("1"); continue; }
n-=u; u-=d; n+=u-1; n/=u;
n<<=1, ++n;
printf("%dn",n);
}
return 0;
}
图像处理那题解题报告在哪儿呢？
秒！~
不错，再多来的CF上面的题
Good task for the group. Hold it up for every yeara??s winner. This is a excellent oppotunity for a lot more enhancement. Indeed, obtaining far better and much better is constantly the crucial. Just like my pal suggests on the truth about ab muscles, he just keeps obtaining much better.
这个问题其实还可以找循环节。参照欧拉定理（也就是费马定理的推广）,a^(phi(m)) mod m = 1
http://zh.wikipedia.org/wiki/%E6%AC%A7%E6%8B%89%E5%AE%9A%E7%90%86_(%E6%95%B0%E8%AE%BA)
所以先算b mod phi(10)，这个部分都是可以约掉的。基本上O(1)的时间就出解了。当然，这也是因为这个问题模数太小的原因。
第一个数表示数列的个数，5表示之后有5个数
思考人生吗
第二个程序编译都通不过， int L[m+1][n+1];这样定义出错，应该换成具体的数字ac
为什么暴力求解方法循环到sqrt(n) 就可以了呢
说的就是无向图啊，有向图的算法也是类似的
对，还是这种实现比较好理解。虽然效率有点低


| Scroll step size | px | |
| % | ||
|
Excluded URLs
e.g. http*://mail.google.com/*
This will disable Vimium on Gmail. Enter one URL per line. |
||
| Advanced options » | ||
| Key mappings |
Enter commands to remap your keys. Available commands:
map j scrollDown
Show available commands.
unmap j unmapAll " this is a comment # this is also a comment |
|
| Characters used for link hints |
The characters placed next to each link after typing "F" to enter link hinting mode.
|
|
| CSS for link hints |
The CSS used to style the characters next to each link hint.
Note: these styles are used in addition to and take precedence over Vimium's default styles. |


Center of the Page
Just under header 1
Top left of the page
Bottom right of the page
Center left of the page


PairDE Instructor
Home
Create New Assignment
Assignment: {{name}}
Due: {{due}}
Files:
{% for n in files %}
{{n}}
{% endfor %}
Partners:
{% for n in partners %}
{{n}}
{% endfor %}


Wait: we are still in developing.
This index.html page is a placeholder with the Javascript, CSS, font and favicon. It's just waiting for you to add some content! If you need some help hit up:


Institute
Telkom of Technology
Home
Abouts
Research
People
Comment
Course
Link 1
Link 2
Link 3
University Life
Link 1
Link 2
Link 3
Research
Link 1
Link 2
Link 3
Global
Link 1
Link 2
Link 3
Seminars and Events


Fill in all of the information below to update the title info, citation section, and footer.
Document Name: (Example "Test Plan")
Version: (Example "1.0")
Date:
Stage: Working Draft Committee Specification Draft Committee Specification Committee Note Draft Committee Note
Revision #: (Example "01")
Populate From Document
Update Document


|
| | MenuBar () |
| | Default constructor. More...
|
| |
| bool | load (const std::string &configFileFilename) |
| | Loads the widget. More...
|
| |
| const std::string & | getLoadedConfigFile () const |
| | Returns the filename of the config file that was used to load the widget. More...
|
| |
| virtual void | setSize (float width, float height) |
| | Changes the size of the menu bar. More...
|
| |
| virtual sf::Vector2f | getSize () const |
| | Returns the size of the menu bar. More...
|
| |
| void | addMenu (const sf::String &text) |
| | Adds a new menu. More...
|
| |
| bool | addMenuItem (const sf::String &menu, const sf::String &text) |
| | Adds a new menu item. More...
|
| |
| bool | removeMenu (const sf::String &menu) |
| | Removes a menu. More...
|
| |
| void | removeAllMenus () |
| | Removes all menus. More...
|
| |
| bool | removeMenuItem (const sf::String &menu, const sf::String &menuItem) |
| | Removes a menu item. More...
|
| |
| void | changeColors (const sf::Color &backgroundColor=sf::Color::White, const sf::Color &textColor=sf::Color::Black, const sf::Color &selectedBackgroundColor=sf::Color(50, 100, 200), const sf::Color &selectedTextColor=sf::Color::White) |
| | Changes the colors used in the menu bar. More...
|
| |
| void | setBackgroundColor (const sf::Color &backgroundColor) |
| | Set the background color that will be used inside the menu bar. More...
|
| |
| void | setTextColor (const sf::Color &textColor) |
| | Set the text color that will be used inside the menu bar. More...
|
| |
| void | setSelectedBackgroundColor (const sf::Color &selectedBackgroundColor) |
| | Set the background color of the selected text that will be used inside the menu bar. More...
|
| |
| void | setSelectedTextColor (const sf::Color &selectedTextColor) |
| | Set the text color of the selected text that will be used inside the menu bar. More...
|
| |
| const sf::Color & | getBackgroundColor () const |
| | Get the background color that is currently being used inside the menu bar. More...
|
| |
| const sf::Color & | getTextColor () const |
| | Get the text color that is currently being used inside the menu bar. More...
|
| |
| const sf::Color & | getSelectedBackgroundColor () const |
| | Get the background color of the selected text that is currently being used inside the menu bar. More...
|
| |
| const sf::Color & | getSelectedTextColor () const |
| | Get the text color of the selected text that is currently being used inside the menu bar. More...
|
| |
| void | setTextFont (const sf::Font &font) |
| | Changes the font used in the menu bar. More...
|
| |
| const sf::Font * | getTextFont () const |
| | Returns the font that is used in the menu bar. More...
|
| |
| void | setTextSize (unsigned int size) |
| | Changes the character size of the text. More...
|
| |
| unsigned int | getTextSize () const |
| | Returns the character size of the text. More...
|
| |
| void | setDistanceToSide (unsigned int distanceToSide) |
| | Changes the distance between the text and the side of the menu item. More...
|
| |
| unsigned int | getDistanceToSide () const |
| | Returns the distance between the text and the side of the menu item. More...
|
| |
| void | setMinimumSubMenuWidth (unsigned int minimumWidth) |
| | Changes the minimum width of the submenus. More...
|
| |
| unsigned int | getMinimumSubMenuWidth () const |
| | Returns the distance between the text and the side of the menu item. More...
|
| |
| | Widget () |
| | Default constructor. More...
|
| |
| | Widget (const Widget ©) |
| | Copy constructor. More...
|
| |
| virtual | ~Widget () |
| | Destructor. More...
|
| |
| Widget & | operator= (const Widget &right) |
| | Overload of assignment operator. More...
|
| |
| virtual sf::Vector2f | getAbsolutePosition () const |
| | Get the absolute position of the widget on the screen. More...
|
| |
| virtual void | show () |
| | Shows the widget. More...
|
| |
| virtual void | hide () |
| | Hides the widget. More...
|
| |
| bool | isVisible () const |
| | Returns true when the widget is visible. More...
|
| |
| virtual void | enable () |
| | Enables the widget. More...
|
| |
| virtual void | disable () |
| | Disables the widget. More...
|
| |
| bool | isEnabled () const |
| | Returns true when the widget is enabled. More...
|
| |
| bool | isDisabled () const |
| | Returns true when the widget is disabled. More...
|
| |
| bool | isLoaded () const |
| | Returns true when the widget is loaded successfully. More...
|
| |
| virtual void | focus () |
| | Focus the widget. More...
|
| |
| virtual void | unfocus () |
| | Unfocus the widget. More...
|
| |
| bool | isFocused () const |
| | Returns true when the widget is focused and false otherwise. More...
|
| |
| WidgetTypes | getWidgetType () const |
| | Returns the type of the widget. More...
|
| |
| Container * | getParent () const |
| | Returns a pointer to the parent widget. More...
|
| |
| virtual void | setTransparency (unsigned char transparency) |
| | Changes the transparency of the widget. More...
|
| |
| unsigned char | getTransparency () const |
| | Returns the transparency of the widget. More...
|
| |
| virtual void | moveToFront () |
| | Places the widget before all other widgets. More...
|
| |
| virtual void | moveToBack () |
| | Places the widget behind all other widgets. More...
|
| |
| void | setCallbackId (unsigned int callbackId) |
| | Changes the callback id of the widget. More...
|
| |
| unsigned int | getCallbackId () |
| | Returns the callback id of the widget. More...
|
| |
| | Transformable () |
| | Default constructor. More...
|
| |
| virtual | ~Transformable () |
| | Destructor. More...
|
| |
| virtual void | setPosition (float x, float y) |
| | Set the position of the widget. More...
|
| |
| void | setPosition (const sf::Vector2f &position) |
| | set the position of the widget More...
|
| |
| const sf::Vector2f & | getPosition () const |
| | get the position of the widget More...
|
| |
| void | move (float offsetX, float offsetY) |
| | Move the widget by a given offset. More...
|
| |
| void | move (const sf::Vector2f &offset) |
| | Move the widget by a given offset. More...
|
| |
| virtual sf::Vector2f | getFullSize () const |
| | Returns the entire size that the widget is using. More...
|
| |
| void | scale (float factorX, float factorY) |
| | Scale the widget. More...
|
| |
| void | scale (const sf::Vector2f &factors) |
| | Scale the widget. More...
|
| |
| void | bindCallback (std::function< void()> func, unsigned int trigger) |
| | Bind a function to one or more specific callback trigger(s). More...
|
| |
| template<typename T > |
| void | bindCallback (void(T::*func)(), T *const classPtr, unsigned int trigger) |
| | Bind a function to one or more specific callback trigger(s). More...
|
| |
| void | bindCallbackEx (std::function< void(const Callback &)> func, unsigned int trigger) |
| | Bind a function to one or more specific callback trigger(s). More...
|
| |
| template<typename T > |
| void | bindCallbackEx (void(T::*func)(const Callback &), T *const classPtr, unsigned int trigger) |
| | Bind a function to one or more specific callback trigger(s). More...
|
| |
| void | bindCallback (unsigned int trigger) |
| | Bind one or more specific callback trigger(s) to the parent widget. More...
|
| |
| void | unbindCallback (unsigned int trigger) |
| | Unbind all callback function bound to the given trigger. More...
|
| |
| void | unbindAllCallback () |
| | Unbind all callback functions bound to any callback. More...
|
| |


This section configures the 'RTCOMM' Layer and Message Logging. Typically, this would be done automatically via the application developer
initializing the code. All that happens here is the connection to the MQ server.
Initialize the Client Service and the RTCOMM Layer


Put this page on your server and try donkeyGallery.See our example galleries and try to configure your own.


--- layout: post title: Cellular Automatas published: true image: /img/Rule_120_Orange_Blue.png excerpt: Cellular automatas are simple discrete simulations which turn up unusually frequently in the real world. The concept was thought up in the 1940's by Stanislaw Ulam and John von Neumann but was popularized much later after computers became widespread. ---
Cellular automatas are simple discrete simulations which turn up unusually frequently in the real world. The concept was thought up in the 1940's by Stanislaw Ulam and John von Neumann but was popularized much later after computers became widespread. These days cellular automatas appear as Ising models in physics as well as naturally in the patterns in some seashells, they can also be used simply to make some elegent patterns.
A cellular automatas consists of two simple parts
Let's look at a simple example. See the grid below, it consists of 30 cells in a row each coloured either white or red. We are going to apply a simple update rule called majority. For each cell we will look at the colour of itself and its 2 immediate neighbours. Then its new colour will be whichever colour is the most common. For example if the grid looked like red white red, the middle cell would become red and there are 2 reds and only 1 white among itself and it 2 neighbours.
The step button advances the automata one step, updating every cell as described above. The randomize button gives each cell a random colour. Observe that in this case, after a couple of steps the automata freezes. Is there anything you notice about frozen states? How could you work out if you've reached the frozen stage without pressing the step button?
Another possible simple update rule would be to simply take on the colour of the cell to your right. What do you think this would look like? Click the button labelled Change Update Rule to find out.
In general, these sort of automata are usually displayed on a two dimensional grid where each step corresponds to moving down one level and the colours are usually white and black. Using the above automatas as examples we would get the following figures:
So far these automata have not produced anything particularly interesting but we at least can generate some nice looking patterns with our left moving rule. Things will get much more interesting though when we start to play around with less human update rules. To make things a little more mathematical, as opposed to thinking of our cells as having one of 2 colours, we can think of assigning to each cell either a 0 or a 1. With this in mind, our previous 2 update rules can be expressed as:
| Update Rule | 111 | 110 | 101 | 100 | 011 | 010 | 001 | 000 |
|---|---|---|---|---|---|---|---|---|
| Majority | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 |
| Left Mover | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
Reading the rows left to right, the majority update rule corresponds to the string 11101000 which in binary translates to 232. Similarly the left mover update rule gives 101010102 = 17010. Hence every possible update rule of this form will correspond to an integer between 0 and 255 (111111112). This gives us an easy way to generate new update rules, all we need to do is pick a number between 0 and 255 and then convert it to binary. For example lets look at the update rule 30. As 30 = 16 + 8 + 4 + 2, we see 3010 = 000111102 and so the update rule will be:
| Update Rule | 111 | 110 | 101 | 100 | 011 | 010 | 001 | 000 |
|---|---|---|---|---|---|---|---|---|
| 30 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 |
Let's have a look at what this gives us:
As you can see we are getting a much more intricate pattern. Let's see what happens if we shrink down the size of all our cells so we can get a better look at the larger structures.
Somewhat surprisingly we end up with an image that looks somewhat but not completely random and has a collection of interesting features such as the appearance of triangles. This is known as emergent behaviour as it was not at all clear from looking at the update rule that this would appear and this is a common feature of cellular automata.
This concept of emergence turns up throughout science in places where simple building blocks lead to highly complicated systems. For example, going from particle physics describing the interactions of elementary particles to trying to explain how molecules work in chemistry or cells in biology.
I'll leave you with a little gadget to let you try out some update rules by yourself. You can also pick what colours you want to display. It's currently set on rule 73, which gives something that looks a lot like a Persian rug. Some other rules I've found which give interesting patterns are 82, 86, 93, 107, 110, and 120 and there are many more so please try some numbers out more yourself and let me know if you find any patterns you particularly like.


--- author: Jesse categories: app date: '2011-05-04 23:19:49' permalink: /2011/05/04/phonegap-alytics/ slug: phonegap-alytics status: publish title: PhoneGap-alytics type: post format: html categories: - Plugins ---
Do you want to gain marketing intelligence and information on how users interact with your PhoneGap app? You need this plugin!
Over the last couple weeks, Joe aka @infil00p and I have been working on some exciting new plugins. We wanted to provide a simple way for PhoneGap developers to get analytics data on the usage of their apps. Instead of doing something silly [edit: removed prickish link], like trying to write our own analytics engine, we integrated with Google's best in class offering.
Yes, you could, in fact, if you are targeting BlackBerry, Palm or other devices, you will need to do this. For iOS and Android though, this plugin allows analytics data to be stored when the application is running without a network connection, and updated when a network becomes available. You could even track the fact that the network is unavailable, so you can compare metrics of offline vs online usage.
Google already provides code for Android and iOS, so we really just needed to make a mapping from the JS side to the native side. Phonegap's pluggable architecture made this simple, as this is exactly what it was built to do. We simply reviewed the Google SDK functionality and mirrored this in JS.
Google's GANTracker class provides the bulk of the functionality and exposes the following methods:
given a web-entity-id, start tracking engine.
the engine will periodically send analytics data to the server.
the engine will cache data if there is no network connection, and update the server when it can.
parameters for category, action, label, value
when something happens in your app, and you want to keep track of it, you can call trackEvent
google has an in-depth guide to using custom events here
pageViews mean something different in an application, they may reflect actual pages, or perhaps different views within your app.
The choice of what you send for pageUri is up to you. It can be any string value, for example /application/launch or app/settings.
To setup Android, you will need to follow Google's instructions in the docs. For iOS, I have packaged the lib and header, so you can simply add everything in the iOS folder of the repo.
From finder, place the plugin js file in your www folder, and include it in the page. After receiving the deviceready event in your app, start the tracker. Note that I create a local alias, so I don't need to type window.plugins.googleAnalyticsPlugin everywhere, and code can be more readable. This gist demonstrates the initialization, and shows how to track the fact that your app was launched, as well as showing an example trackEvent for tracking playback of a movie.
You can get the code here: https://github.com/purplecabbage/phonegap-plugins/tree/CoreDump/GoogleAnalytics
More in depth info on Google Analytics for Mobile can be found here: Google SDK Docs http://code.google.com/mobile/analytics/docs/
... and lots more info on how to use events so that you can track meaningful information on usage. http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html
Plugin work in general is ongoing. One thing in particular is that we want to make the JavaScript code that you include in your app exactly the same on all the different devices that use it. Currently it is sometimes necessary to have multiple JavaScript files, which is an unwanted evil.
Another goal we are working towards is consistent plugin packaging. Instead of forcing developers to take different steps to ready their app to use a plugin on multiple devices, we want to use a plugin configuration file, so the app code will be exactly the same on each device.
Integration between the PhoneGap Build service and custom Plugins is something we are working towards, so developers can just get down to writing their apps.
Expect more plugins in the coming weeks, as we try to fill more 'Gaps' and make everyone's PhoneGap apps easier to make.
I welcome your comments, feedback, and questions.


Alex Foley:
I do not own rights to any of the songs used on this page. These songs belong to their respective authors/producers.
This page is only being used as a source for songs playing in the background of a closed wiki page, not as a source to obtain audio files.
If you are the legal owner of any of the rights to any of the songs used on this site as background music, and would like your song to be removed from it, please send a request to<EMAIL_ADDRESS>and your song will be removed from the list.


define(["model", "configDiff", "async", "lodash"], function (Model, configDiff, async, _) {
The runtime engine for interactive visualizations.
Draws from previous work found at
Created by Curran Kelleher Feb 2015
define(["model", "configDiff", "async", "lodash"], function (Model, configDiff, async, _) {
This module provides a runtime constructor function that returns a runtime
object with the following properties:
return function Runtime(div){
var runtime = Model({
plugins
An object for setting up plugins before loading a configuration.
The runtime first looks here for plugins, then if a plugin is not found here
it is dynamically loaded at runtime using RequireJS where the plugin name publicProperties
An array of property names whose updates will be propagated
to the configuration as part of the component’s serialized state.destroy
(optional) A function that frees all resources allocated by the component. plugins: {},
config
The configuration object encapsulating application state.plugin
- The name of the plugin module that provides a factory
that instantiates the component (and later tears it down).state
- An object containing the serialized state of the public
properties of the component. config: {},
div
The DOM container passed into the runtime constructor.
Visible plugins should append their own DOM elements to this container
(and remove them when destroyed). div: div
});
This tracks the previous configuration state, necessary for computing configuration differences.
var oldConfig = {};
var components = {};
These methods unpack actions and invoke the corresponding functions.
var methods = {
create: function (action, callback) {
create(action.alias, action.plugin, callback);
},
destroy: function (action, callback) {
destroy(action.alias, callback);
},
set: function (action, callback) {
set(action.alias, action.property, action.value, callback);
},
unset: function (action, callback) {
TODO test
unset(action.alias, action.property, callback);
}
};
An asynchronous FIFO queue for applying actions to the runtime.
var actionQueue = async.queue(function(action, callback){
methods[action.method](action, callback);
}, 1);
This object contains the listeners that respond to changes in public properties of components. These must be stored here so they can be removed from components when the components are destroyed.
var listeners = {};
Gets a component by alias, passes it to the callback. If the component exists, the callback is called immediately. If the component does not exist, this function waits until the component is created (by polling), then the callback is called.
function getComponent (alias, callback) {
async.until(
function(){ return alias in components; },
function(cb){ setTimeout(cb, 0); },
function(){ callback(components[alias]); }
);
}
Loads a plugin by name. First tries to find plugin in runtime.plugins, then uses RequireJS to load the plugin as an AMD module.
function loadPlugin(plugin, callback){
if(plugin in runtime.plugins){
callback(runtime.plugins[plugin]);
} else {
require(["plugins/" + plugin], callback);
}
}
Applies a “create” action to the runtime.
function create(alias, plugin, callback){
loadPlugin(plugin, function (constructor) {
Construct the component using the plugin.
var component = constructor(runtime);
Default values for public properties. TODO test
var defaults = {};
components[alias] = component;
Propagate changes from components to configuration.
if("publicProperties" in component){
listeners[alias] = [];
component.publicProperties.forEach(function(property){
Store default values for public properties.
defaults[property] = component[property];
Store the listener so it can be removed later, when the component is destroyed.
listeners[alias].push(component.when(property, function(newValue){
Handle the case that the property is changed after the component has been removed from the configuration but before the component’s listeners have been removed.
if(alias in oldConfig){
var oldValue;
if("state" in oldConfig[alias] && property in oldConfig[alias].state){
oldValue = oldConfig[alias].state[property];
} else {
oldValue = defaults[property];
}
Ignore changes that originated from the config. Use oldConfig rather than runtime.config to handle the case that runtime.config has been changed and its listener that computes the diff and dispatches actions has not yet run. Use JSON.stringify so deep JSON structures are compared correctly.
if(JSON.stringify(oldValue) !== JSON.stringify(newValue)){
Surgically change oldConfig so that the diff computation will yield no actions. Without this, the update would propagate from the component to the config and then back again unnecessarily.
If no state is tracked, create the state object.
if(!("state" in oldConfig[alias])){
oldConfig[alias].state = {};
}
oldConfig[alias].state[property] = newValue;
This assignment will notify any listeners that the config has changed, (e.g. the config editor), but the config diff will yield no actions to execute.
runtime.config = oldConfig;
}
}
}));
});
}
callback();
});
}
Applies a “destroy” action to the runtime.
function destroy(alias, callback){
getComponent(alias, function(component){
Remove public property listeners.
if(alias in listeners){
listeners[alias].forEach(component.removeListener);
delete listeners[alias];
}
Invoke component.destroy()
if("destroy" in component){
component.destroy();
}
Remove the internal reference to the component.
delete components[alias];
callback();
});
}
Applies a “set” action to the runtime.
function set(alias, property, value, callback) {
getComponent(alias, function(component){
component[property] = value;
callback();
});
}
Respond to changes in configuration.
runtime.when("config", function(newConfig){
var actions = configDiff(oldConfig, newConfig);
if(actions.length > 0){
actions.forEach(actionQueue.push);
oldConfig = _.cloneDeep(newConfig);
}
});
Expose getComponent as a public method.
runtime.getComponent = getComponent;
This function checks if a component exists. Necessary for complete code coverage in unit tests.
runtime.componentExists = function(alias){
return alias in components;
};
return runtime;
};
});


Traffic Monitor Administration¶
- These instructions are for the Golang Traffic Monitor, for the legacy Java version, see here.
Installing Traffic Monitor¶
The following are requirements to ensure an accurate set up:
- CentOS 6+
- 8 vCPUs
- 16GB RAM
- Successful install of Traffic Ops
- Administrative access to the Traffic Ops
- Physical address of the site
Enter the Traffic Monitor server into Traffic Ops
Make sure the FQDN of the Traffic Monitor is resolvable in DNS.
Install Traffic Monitor:
sudo yum -y install traffic_monitor
Configure Traffic Monitor. See here
Start the service:
sudo service traffic_monitor start
Starting traffic_monitor:
Verify Traffic Monitor is running by pointing your browser to port 80 on the Traffic Monitor host.
Configuring Traffic Monitor¶
Configuration Overview¶
Traffic Monitor is configured via two JSON configuration files, traffic_ops.cfg
and traffic_monitor.cfg
, by default located in the conf
directory in the install location.
The traffic_ops.cfg
config contains Traffic Ops connection information. Specify the URL, username, and password for the instance of Traffic Ops for which this Traffic Monitor is a member.
The traffic_monitor.cfg
config contains log file locations, as well as detailed application configuration variables, such as processing flush times and initial poll intervals.
Once started with the correct configuration, Traffic Monitor downloads its configuration from Traffic Ops and begins polling caches. Once every cache has been polled, health protocol state is available via RESTful JSON endpoints.
Troubleshooting and log files¶
Traffic Monitor log files are in /opt/traffic_monitor/var/log/
.


| package ti.uia.sysbios |
|
Contains specialized UIA loggers and transports
package ti.uia.sysbios [1, 0, 0, 0] {
// Single core IServiceMgrSupport implementation
// A logger which routes Log events to a users transport function
// This general purpose logger is useful in situations where the application
wants to manage the buffers used to store and transmit events. This
includes managing the sending of the buffers to an instrumentation host
(e.g. System Analyzer in CCS). The logger is named "LoggerStreamer"
because it is designed to enable the application to send a stream of
packets containing UIA event data to the instrumentation host
// General purpose logger enabling applications to stream data
to an instrumentation host
// Module to aid in configuring TI-RTOS logging using UIA and System Analyzer
}
generated on Wed, 28 Aug 2019 19:03:42 GMT


As a former student and in my personal life, reading is the primary mode by which I learn. I take great satisfaction in reading stories and non-fiction. I find this practice to be relaxing and meditative. Below are books I have read on my path to becoming a better programmer. These books have shaped me as a thinker and helped me to engage in a culture with other developers and programmers. Any book listed below can be presumed to have been read cover to cover by me.
| Godel, Escher, Bach: An Eternal Golden Braid | Douglas R. Hofstadter |
| Mathematical Modeling, Cognitive Science, and AI | 1979 |
| The Clean Coder | Robert C. Martin |
| Workplace Professionalism | 2011 |
| Introduction to Networking | Charles R. Severance |
| How the Internet Works | 2015 |
| UML @ Classroom | Martina Seidl, et al. |
| Objection Oriented Modeling | 2012 |
| Data Structures and Algorithms with Python | Dr. Basant Agarwal and Benjamin Baka |
| Data Structures/Algorithms | 2017 |


Welcome to Sihui's Webpage
I like to explore new areas and take on new challenges. During my undergraduate years, I took classes from departments of physics,
math, computer science, information engineering, as well as classes of history, poetry, music, drawing, psychology,
and philosophy. Each area has a different thinking process while they are all in pursuit of understanding and appreciation.
The exploration spirit also brought me to come across the Pacific ocean from China to US. I started my PhD in optics.
Interestingly, my research topic was liquid crystal-based biosensors for the detection of bile acids. This turned out to be mostly material science.
I thought I would love to stay in academia. However, I happened to get an internship opportunity in Microsoft.
During the internship, I found that it was much more fun in the industry, and it was fun to go back to optics.
This led me to the world of Mixed Reality, which could 'teleport' you to anywhere. It is an exciting area as the next
generation of display.


{% extends "base.html" %}
{% block content %}
{% load staticfiles %}
Our product is a lightweight cushion (PE-foam mat) used for sitting outdoor in harsh environments, like wet, cold and rough surface. The cushion comes with a printed logo or name of a company, event, club etc.
This is an ideal product for various outdoor activities, for example: camping, grilling, hiking, skiing, fishing, hunting, birdwatching, berry picking, school excursions, music festivals, sport events etc. Thanks to the elastic stripe, you do not need to carry the mat around; it is always with you when you need to sit down on a wet, cold or harsh surface. It does not get wet when it’s raining and it won’t be blown away with wind. And you do not need to squeeze it into your backpack: just attach it outside of your backpack with the stripe.
The mats are new and unique product at the Finnish market. Such mats with a logo of your company or club make a great promotional tool and a business gift. Please read more about the use cases and ask questions through the contact form.


bsearch
—binary searchSynopsis
#include <stdlib.h> void *bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *));
Description
bsearch
searches an array beginning at base for any element
that matches key, using binary search. nmemb is the element
count of the array; size is the size of each element.
The array must be sorted in ascending order with respect to the
comparison function compar (which you supply as the last argument of
bsearch
).
You must define the comparison function (*compar)
to have two
arguments; its result must be negative if the first argument is
less than the second, zero if the two arguments match, and
positive if the first argument is greater than the second (where
“less than” and “greater than” refer to whatever arbitrary
ordering is appropriate).
Returns
Returns a pointer to an element of array that matches key. If
more than one matching element is available, the result may point to
any of them.
Portability
bsearch
is ANSI.
No supporting OS subroutines are required.


Vault Server
Deployment Token
Auth Type
Token
AppRole
Username/Password
App Role
Get new secret on deploy


Loading...
WELCOME
“Music is a language that doesn’t speak in particular words. It speaks in emotions, and if it’s in the bones, it’s in the bones.”
FL Studio
$100/-
Logic Pro X
$100/-
Abletone
$100/-
Cubase
$100/-
Cubase
$100/-
FL Studio
$100/-
Logic Pro X
$100/-
ReFx
$100/-
Izotope
$100/-
NI Massive
$100/-
Sylenth
$100/-
Sylenth
$100/-
ReFx
$100/-
Izotope
$100/-
Headphone
$100/-
Mic
$100/-
Monitor
$100/-
Speaker
$100/-
Mic
$100/-
Monitor
$100/-
Headphone
$100/-


{% extends "base.html" %} {% load static %} {% load compress %} {% block page_title %} MyUW: View Future Quarters {% endblock %} {% block content %}
{% include "handlebars/banner/profile.html" %} {% include "handlebars/banner/notice.html" %} {% include "handlebars/card/loading.html" %} {% include "handlebars/card/schedule/visual.html" %} {% include "handlebars/card/schedule/visual_day.html" %} {% include "handlebars/card/schedule/final_day.html" %} {% include "handlebars/card/schedule/final_panel.html" %} {% include "handlebars/card/schedule/course_cards.html" %} {% include "handlebars/card/schedule/course_card_content.html" %} {% include "handlebars/card/schedule/course_sche_panel.html" %} {% include "handlebars/card/schedule/eval_panel.html" %} {% include "handlebars/card/schedule/course_resource_panel.html" %} {% include "handlebars/card/schedule/instructor_panel.html" %} {% include "handlebars/card/schedule/final_panel.html" %} {% include "handlebars/card/schedule/sp_final.html" %} {% include "handlebars/card/textbook.html" %} {% include "handlebars/loading.html" %} {% include "handlebars/error.html" %} {% include "handlebars/future.html" %} {% include "handlebars/future_410_error.html" %} {% include "user_state.html" %} {% endblock %} {% block extra_js %} {% compress js inline %} {% endcompress %} {% endblock %}


---
layout: post
title: Wolfram Alpha Search Engine
date: '2011-03-23T09:59:00.001+01:00'
author: Monik
tags:
- Aha!
- Semantic_Web
modified_time: '2016-01-15T23:20:15.630+01:00'
blogger_id: tag:blogger.com,1999:blog-5940427300271272994.post-7777662218893216589
blogger_orig_url: http://learningmonik.blogspot.com/2011/03/wolfram-alpha-search-engine-d.html
commentIssueId: 19
---
Wolfram Alpha Search Engine:
http://www.wolframalpha.com/Wow! it's like seeing information EXACTLY IN THE WAY I AM USED TO STORING IT IN MY BRAIN. I didn't even realise how I remember and organise the information in my brain it up to now. It is as if I was looking at a snapshot, a photo of my memory. Awesome :) and this makes it so usable, so easy to navigate...
The only problem is that it does not understand more complicated questions, e.g. "what is a white hole" gave information about white colour... i guess it is still a long way to go before it can actually be useful..
..but anyway I just really understood the power of Semantic Web :)


We're sorry but jijeact doesn't work properly without JavaScript enabled. Please enable it to continue.


An extensive implementation of state-of-the-art and classical
algorithms to preprocess label noise in classification problems.
| Version: |
0.1.0 |
| Depends: |
R (≥ 3.3.0) |
| Imports: |
RWeka, kknn, nnet, caret, e1071, rpart, randomForest, MASS, rJava, stats, utils |
| Suggests: |
knitr, rmarkdown, testthat |
| Published: |
2016-06-24 |
| Author: |
Pablo Morales [aut],
Julian Luengo [aut, cre],
Luis P.F. Garcia [aut],
Ana C. Lorena [aut],
Andre C.P.L.F. de Carvalho [aut],
Francisco Herrera [aut] |
| Maintainer: |
Julian Luengo <julianlm at decsai.ugr.es> |
| License: |
GPL-3 |
| NeedsCompilation: |
no |
| Materials: |
README NEWS |
| CRAN checks: |
NoiseFiltersR results |


|
Biography:
Webitor Rob
Waring is Legislative Counsel to the California Judges Association.
His reel world is community theater, where he occasionally
performs in musical comedies. He is also a docent at the Point Bonita
Lighthouse in the Marin Headlands
|


{% else %}
{% if data.get_slug in "midwest-high-powered-rocket-competition,collegiate-rocket-competition,high-altitude-balloon-launch,undergraduate-aerospace-design-research-scholarship,clark-graduate-fellowship,graduate-fellowship" %}
{% if data.status %}
{% else %}
{% if data.get_slug in "higher-education-initiatives,early-stage-investigator,research-infrastructure,aerospace-outreach,special-initiatives,clark-graduate-fellowship,graduate-fellowship,undergraduate-research" %}
{% if data.status %}
{% else %}
{% if data.get_slug in "higher-education-initiatives,early-stage-investigator,research-infrastructure,aerospace-outreach,special-initiatives,clark-graduate-fellowship,graduate-fellowship,undergraduate-research,nasa-competition,industry-internship,professional-program-student" %}
{% if data.status %}
{% else %}
{% if data.get_slug in "higher-education-initiatives,early-stage-investigator,research-infrastructure,aerospace-outreach,special-initiatives,nasa-competition,industry-internship" %}
{% if data.status %}
{% else %}
{% if data.get_slug in "higher-education-initiatives,early-stage-investigator,research-infrastructure,aerospace-outreach,special-initiatives,nasa-competition,industry-internship" %}
{% if data.status %}
{% else %}
{% if data.get_slug in "higher-education-initiatives,early-stage-investigator,research-infrastructure,aerospace-outreach,special-initiatives,nasa-competition,industry-internship" %}
{% if data.status %}
{% else %}
{% if data.get_slug in "higher-education-initiatives,early-stage-investigator,research-infrastructure,aerospace-outreach,special-initiatives,nasa-competition,industry-internship" %}
{% if data.status %}
{% else %}
{% if data.get_slug in "higher-education-initiatives,early-stage-investigator,research-infrastructure,aerospace-outreach,special-initiatives,nasa-competition" %}
{% if data.status %}
{% else %}
{% if data.get_slug in "higher-education-initiatives,early-stage-investigator,research-infrastructure,aerospace-outreach,special-initiatives,nasa-competition" %}
{% if data.status %}
{% else %}
{% if data.get_slug in "higher-education-initiatives,early-stage-investigator,research-infrastructure,aerospace-outreach,special-initiatives,nasa-competition" %}
{% if data.status %}
{% else %}
{% if data.get_slug in "higher-education-initiatives,early-stage-investigator,research-infrastructure,aerospace-outreach,special-initiatives,nasa-competition,industry-internship" %}
{% if data.status %}
{% else %}
{% if data.get_slug in "higher-education-initiatives,early-stage-investigator,research-infrastructure,aerospace-outreach,special-initiatives,nasa-competition,industry-internship" %}
{% if data.status %}
{% else %}
{% if data.get_slug in "clark-graduate-fellowship,graduate-fellowship,undergraduate-research,undergraduate-scholarship,stem-bridge-scholarship" %}
{% if data.status %}
{% else %}
{% if data.get_slug in "high-altitude-balloon-launch,undergraduate-aerospace-design-research-scholarship,nasa-competition" %}
{% if data.status %}
{% else %}
{% if data.get_slug in "high-altitude-balloon-launch,undergraduate-aerospace-design-research-scholarship,nasa-competition" %}
{% if data.status %}


--- layout: post authors: ["Greg Wilson"] title: "Data Science Centers at UCB, UW, and NYU" date: 2013-11-13 time: "09:00:00" tags: ["Announcements"] ---
Yesterday, the Gordon and Betty Moore Foundation and the Alfred P. Sloan Foundation (who are Software Carpentry's main backer) announced $37.8M to support new data science centers at UC Berkeley, the University of Washington, and New York University. As UCB's Fernando Perez says in his blog post, it's taken a lot of work to get this off the ground, but the impact will be enormous.
We hope to help. Drew Conway's Venn Diagram shows "Hacking Skills" as one of the three principal components of data science:
Personally, I think the region that includes math and expertise but not hacking skills should be labelled "A World of Pain" rather than "Traditional Research". Our mission is to help scientists get out of it and into the center of the diagram by teaching them how to write code well (which is the key to writing it faster and being able to re-use it), how to automate repetitive tasks, how to use version control to keep track of what they've done and share it with others, and how to use the web to do more than just upload spreadsheets and download PDFs. If you'd like to help, we're now accepting applications for the March 2014 run of our instructor training course; please mail us about that, or about running a bootcamp where you are.
Congratulations to everyone involved in the proposal—we look forward to wonderful things.


Activate district to add/remove polygons
Click to delete district
Activate district to add/remove polygons
Click to delete district
Click to add a new district


The examples in this topic describe how to use connection string properties that allow applications to use Secure Sockets Layer (SSL) encryption in a Java application. For more information about these new connection string properties such as encrypt, trustServerCertificate, trustStore, trustStorePassword, and hostNameInCertificate, see Setting the Connection Properties.
When the encrypt property is set to true and the trustServerCertificate property is set to true, the Microsoft SQL Server JDBC Driver will not validate the SQL Server SSL certificate. This is usually required for allowing connections in test environments, such as where the SQL Server instance has only a self signed certificate.
The following code example demonstrates how to set the trustServerCertificate property in a connection string:
String connectionUrl = "jdbc:sqlserver://localhost:1433;" + "databaseName=AdventureWorks;integratedSecurity=true;" + "encrypt=true;trustServerCertificate=true";
When the encrypt property is set to true and the trustServerCertificate property is set to false, the Microsoft SQL Server JDBC Driver will validate the SQL Server SSL certificate. Validating the server certificate is a part of the SSL handshake and ensures that the server is the correct server to connect to. In order to validate the server certificate, the trust material must be supplied at connection time either by using trustStore and trustStorePassword connection properties explicitly, or by using the underlying Java Virtual Machine (JVM)'s default trust store implicitly.
The trustStore property specifies the path (including filename) to the certificate trustStore file, which contains the list of certificates that the client trusts. The trustStorePassword property specifies the password used to check the integrity of the trustStore data. For more information on using the JVM's default trust store, see the Configuring the Client for SSL Encryption.
The following code example demonstrates how to set the trustStore and trustStorePassword properties in a connection string:
String connectionUrl = "jdbc:sqlserver://localhost:1433;" + "databaseName=AdventureWorks;integratedSecurity=true;" + "encrypt=true; trustServerCertificate=false;" + "trustStore=storeName;trustStorePassword=storePassword";
The JDBC Driver provides an additional property, hostNameInCertificate, which specifies the host name of the server. The value of this property must match the subject property of the certificate.
The following code example demonstrates how to use the hostNameInCertificate property in a connection string:
String connectionUrl = "jdbc:sqlserver://localhost:1433;" + "databaseName=AdventureWorks;integratedSecurity=true;" + "encrypt=true; trustServerCertificate=false;" + "trustStore=storeName;trustStorePassword=storePassword" + "hostNameInCertificate=hostName";


Neymar 'always an option' for Barcelona, says sporting director Eric Abidal
by Pete HallNeymar will "always be an option" for Barcelona given his understanding of the philosophy of the club, according to sporting director Eric Abidal.
Barca spent the bulk of the last transfer window trying to lure Neymar back from Paris Saint-Germain, two years after he left the Catalan club for a world-record transfer fee of £200m.
Neymar remains in Paris, but his future is unclear, with the Brazil international having been left out of the squad on several occasions this season, and Abidal insisted ending Neymar's Paris frustrations is not out of the question.
"A top player, who has a Barca philosophy and who is performing at a high level, will always be an option," Abidal said of Neymar to Mundo Deportivo.
"From there, at the sports level we can make decisions, but the whole financial issue, there are things that you can reach and others that you cannot.
"The future will say. If it continues at this level, because the season is very long, I will not say that it will be option number 1 but it can be a clear option."
Neymar remains out with an injury sustained while playing for Brazil last month, but could return after the international break.
When does the January transfer window open?
As the January transfer window inches ever closer, clubs across the Premier League, Europe and beyond will be identifying potential transfer targets and holding discussions with clubs and agents over future deals.
At this traditionally difficult time to make big moves, the start of the new year looks set to be frantic for a host of top Premier League clubs.
Where can you follow all the latest transfer news?
As well as keeping an eye on Sky Sports News, you can make sure you don't miss a thing with our dedicated Transfer Centre blog.
There will also be the return of the Transfer Talk Podcast and some exciting new features coming your way...


I am Jerry Daniels Lorem Ipsum is simply dummy text of the printi ng and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever It has survived not only five centuries, but also the leap into electronic but also the leap into electronic typesetting , remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing
Happy Customers
Complete Projects
Lines Of Code
Files Downloaded


{% extends "feature.html" %}
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
{% block headtitle %}{% trans "Multimedia" %}{% endblock %}
{% block h2title %}{% trans "Multimedia" %}{% endblock %}
{% block tuttags %}multimedia,audio,video{% endblock %}
{% block caniuse %}audio,video{% endblock %}
{% block updatesblockstyle %}two_columns{% endblock %}
{% block supportblockstyle %}multiple{% endblock %}
{% block header %}
{% blocktrans %}
Audio and Video became first-class citizens on the Web with HTML5 the same way that other media types like images did in the past. Through their new APIs you can access, control and manipulate timeline data and network states of the files. With the coming additions to the APIs you will be able to read and write raw data to audio files (Audio Data API) or manipulate captions in videos (Timed Track API). But the real power of these new HTML elements stands out when they are combined with the other technologies of the web stack, be it Canvas, SVG, CSS or even WebGL.
{% endblocktrans %}
{% blocktrans %}
For instance, you can build a DJ mixer table app where you show several controls to fade and mix audio tracks. Canvas lets you read pixel data from videos so you could add a video visualizer with a scene selection feature and, on top of that, use SVG filters á la Photoshop to distort the movie while the videos are playing.
{% endblocktrans %}
There are also a number of demos of media APIs on simpl.info:


Peeker Quickstart
Peeker
Peeker
Project Home
›
User Guide Home
› Quickstart
Peeker Table of Contents
Quick Start
Peeker
Connect
Header
Body
Parts
File
Detector
Detector Set


HOME is Epic’s long-term resource initiative for a more permanent space in San Francisco.
We believe the next three years is the time to position ourselves in San Francisco in a greater way.
The HOME Initiative will run from November 2019 to December 2022.
The HOME Initiative aims to raise $5 Million towards finding a more permanent home for Epic Church.
HOME allows us to make a greater impact for generations to come.
Hundreds of people paved the way for us to be part of this church and now we get to make it possible for those who aren’t here yet.
The first $500K of giving towards HOME will fund our strategic partners through The Hope Project.
200+ people have taken the next step of baptism at Epic.
Our philosophy is built around the idea that everyone has a next step to take in their journey with God.
HOME will give us a greater capacity to help even more people know Jesus and grow in their faith.
A Place For Everyone.
HOME is not ultimately about a building, but about building people.
As Epic continues to grow, a more permanent home will allow us to continue to deepen and widen the community we share together - within our church, at our workplaces and across the city.
Any significant vision must impact the next generation.
HOME aims to provide the necessary space for our kids and students to be rooted in their faith and thrive in this city.
HOME will enable even more families to thrive long term in San Francisco.
From day one, we’ve been committed to making a difference beyond our own walls. We have given over $1.5 million to churches, ministries, and organizations in San Francisco, throughout North America, and around the world.
The first $500K of giving towards HOME will fund our strategic partners through The Hope Project.
More permanent home in SF makes a statement to our city that we are here to stay.
PartnershipsIt’s going to take all of us playing our part. Our goal is not equal gifts but equal sacrifice.


SugarRecord
If you want to receive updates about the status of SugarRecord, you can subscribe to our mailing list here
What is SugarRecord?
SugarRecord is a persistence wrapper designed to make working with persistence solutions like CoreData/Realm/… in a much easier way. Thanks to SugarRecord you’ll be able to use CoreData with just a few lines of code: Just choose your stack and start playing with your data.
The library is maintained by @pepibumur under GitDo. You can reach me at<EMAIL_ADDRESS>for help or whatever you need to commend about the library.
Features
- Swift 2.1 compatible (XCode 7.1).
- Fully rewritten from the version 1.0.
- Reactive API (using ReactiveCocoa).
- Protocols based design.
- For beginners and advanced users
- Fully customizable. Build your own stack!
- Friendly syntax (fluent)
- Away from Singleton patterns! No shared states :tada:
- Compatible with OSX/iOS/watchOS/tvOS
- Fully tested (thanks Nimble and Quick)
- Actively supported
Setup
Using Cocoapods
- Install CocoaPods. You can do it with
gem install cocoapods
- Edit your
Podfile
file and add the following line `pod ‘SugarRecord’ - Update your pods with the command
pod install
- Open the project from the generated workspace (
.xcworkspace
file).
Note: You can also test the last commits by specifying it directly in the Podfile line
Using Carthage
- Install Carthage on your computer using
brew install carthage
- Edit your
Cartfile
file adding the following linegithub 'gitdoapp/sugarrecord'
- Update and build frameworks with
carthage update
- Add generated frameworks to your app main target following the steps here
- Link your target with CoreData library (from Build Phases)
Version 2.0 Checklist :white_check_mark:
- [ ] Development
- [ ] CoreDataDefaultStorage
- [ ] Request fluent interface
- [ ] Create 2.0 Wiki:
- Setup:
- CoreData
- Carthage
- Getting started
- Storages. Build your own!
- Fetching
- Operations
- Testing
- Good practices
- [ ] Create Contribution document
- Make tasks
- Style guideline
- Unit testing
Features backlog
- [ ] Reactive API
- [ ] Logging support
Support
If you want to communicate any issue, suggestion or even make a contribution, you have to keep in mind the flow bellow:
- If you need help, ask your doubt in Stack Overflow using the tag 'sugarrecord’
- If you want to ask something in general, use Stack Overflow too.
- Open an issue either when you have an error to report or a feature request.
- If you want to contribute, submit a pull request, and remember the rules to follow related with the code style, testing, …
Contribution
- You’ll find more details about contribution with SugarRecord in contribution
Resources
License
The MIT License (MIT)
Copyright © <2014>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the Software
), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Who uses SugarRecord?
Are you using SugarRecord? Let us know, and we’ll list you here. We :heart: to hear about companies, apps that are using us with CoreData.


Kirk Herbstreit Unveils His Top 5 Teams Of Week 12
by Alek ArendBelieve it or not, college football’s Week 12 is in the books – the end of the regular season is near. True contenders have emerged and each team’s final games are pivotal in regards to the post-season.
Week 12 featured several exciting contests which may go a long way in determining the College Football Playoff participants. A few teams came away with statement victories.
ESPN’s Kirk Herbstreit has unveiled his top five teams of the weekend. To no surprise whatsoever, Oklahoma tops the list. The Sooners put together a thrilling comeback to take down undefeated Baylor in a 34-31 victory.
Check out Herbstreit’s other top teams of the week in the list below:
- Oklahoma Sooners
- Georgia Bulldogs
- Michigan Wolverines
- Iowa Hawkeyes
- Rice Owls & New Mexico State
Georgia checks in at No. 2 after taking down a ranked Auburn team. The Bulldogs kept their College Football Playoff hopes alive for the time being and certainly look like one of the top-four teams in the country.
Michigan blasted rival Michigan State en route to a 44-10 victory. The Wolverines brought home the Paul Bunyan trophy for the second straight year. Don’t look now, but Jim Harbaugh’s squad is 8-2.
The Iowa Hawkeyes were yet another team to spoil an opponent’s undefeated season, this time taking down Minnesota. Iowa controlled the line of scrimmage and kept the Golden Gophers at bay in a 23-19 win.
Rice and New Mexico State each come in at No. 5 to wrap up Herbstreit’s ranking this week. Each team won its first game of the season.


About me
Hello it is me, I am 23 years old, I've studied English language and literature at TTU.
I like technology and internet, so I decided to learn programming language.
I was working at computer and phone accessories store as a shop assistant.
My top ten favorite entertainment shows
- The walking dead
- Rami
- Friends
- Peaky blinders
- The joker
- About time
- Two lovers
- The light between the ocean
- Grown up
- twilight
Jop experiences
- Waiter-Al qadi sweets
- volunteer-A charity
- Employee-countdown mall
- Shop assistant-USB for phone and computer accessories


| Path: | scripts/gff2png.rb |
| Last Update: | Fri Dec 14 09:29:08 +0000 2007 |
gff2png.rb
./gff2png.rb [ -h | --help ] -l | --length length_of_sequence [ -i | --infile | < ] your_gff_file.txt -o | --outfile your_output.png
This script parses a GFF file and creates a picture using Bio::Graphics. The flavour of GFF required is GFF3 (see www.sequenceontology.org/gff3.shtml).
-h,--help:: Show help -l,--length=LENGTH:: Length of sequence. Required. -i,--infile=INFILE:: Name of input file. STDIN if not defined. -o,--outfile=OUTFILE:: Name of output file. Required.
GFF3. See www.sequenceontology.org/gff3.shtml
A PNG picture.
Dr Jan Aerts Bioinformatics Group Roslin Institute