class: middle, center background-image: url(public/img/space1.jpg) ![picasso bulls](public/img/abstraction.jpg) --- class: middle, center # bit.ly/tp-2015 --- class: middle, center # hi my name is @ag_dubs --- class: middle, center ![npm](public/img/npm_logo.png) --- class: middle, center ![wombat](public/img/wombatsticker.png) --- class: middle, center # if you don't understand how npm works -- # that's .highlight[my problem] --- class: middle, center # i like to .highlight[think about thinking] -- # ...especially the type of thinking that happens .highlight[when people write code] --- class: middle, center ![board game](public/img/boardgame.png) --- class: middle, center # let's talk about # cows in space --- class: middle, center ![cows in space](public/img/cows1.jpg) --- class: middle, center # let's talk about # art --- class: middle, center ![cows in space](public/img/cows3.png) ![cows in space](public/img/cows4.jpg) ![cows in space](public/img/cows5.jpg) ![cows in space](public/img/cows6.png) --- class: middle, center # let's talk about # javascript --- class: middle, center ![cows in space](public/img/cows2.jpg) --- class: middle, center # let's talk about # ES6/2015 --- class: middle, center ![cows in space](public/img/cows7.jpg) --- class: middle, center # let's talk about # ABSTRACTION --- class: middle, center background-image: url(public/img/space1.jpg) ![picasso bulls](public/img/abstraction.jpg) --- class: left, middle > The effective exploitation of his powers of > .highlight[abstraction] must be regarded as one of the > most vital activities of a competent programmer. ### Edsger W. Dijkstra ##### "The Humble Programmer" (1972) --- class: left, middle #### The Abstraction Principle > Each significant piece of functionality in a > program should be implemented in just one place > in the source code. Where similar functions are > carried out by distinct pieces of code, .highlight[it is] > .highlight[generally beneficial to combine them into one] > .highlight[by abstracting out the varying parts.] ### Benjamin C. Pierce ##### Pierce, Benjamin (2002). Types and Programming Languages. MIT Press. p. 339. ISBN 0-262-16209-1. --- class: left, middle > [Abstraction] tries to factor out details from > a common pattern so that programmers can work > close to the .highlight[level of human thought], leaving out > details which matter in practice, but are > .highlight[immaterial to the problem being solved]. ##### "Abstraction (computer science)", Wikipedia. http://en.wikipedia.org/wiki/Abstraction_(computer_science). Accessed 6 October 2014. --- class: middle, center # [I]mmaterial to the problem being solved. ![danger](public/img/danger.png) --- class: center, middle ![NYC web dev fellowship](public/img/flatironschool.jpg) # I teach beginners, and beginners teach me. --- class: left, middle # Iteration is hard. #### Ruby ```ruby array.each do |item| # do something end ``` #### Javascript ```javascript for(var i =0; i< array.length; i++){ // do something } ``` -- .javascript-cow[![cow in space](public/img/cows8.png)] --- class: top, left > Programs must be written for .highlight[people to read], > and only incidentally for machines to execute. ### Abelson and Sussman ![Abelson](public/img/abelson.jpg) ![Sussman](public/img/sussman.jpg) ##### Abelson and Sussman. "Structure and Interpretation of Computer Programs" MIT Press, Second ed. 1996. --- class: middle, center ![ups](public/img/obvious.jpg) --- class: left, middle # Iteration is hard. #### Ruby ```ruby array.each do |item| # do something end ``` #### Javascript ```javascript for(var i =0; i< array.length; i++){ // do something } ``` -- .ruby-cow[![cow in space](public/img/cows8.png)] --- class: middle, center ![feynman](public/img/feynman.jpg) --- class: middle, left > The real problem in speech is not precise > language. The problem is clear language ... > It is really quite impossible to say anything > with .highlight[absolute precision], unless that thing is > .highlight[so abstracted from the real world as to not] > .highlight[represent any real thing]. ### Richard Feynman ##### "New Textbooks for the "New" Mathematics", Engineering and Science volume 28, number 6 (March 1965) p. 9-15 at p. 14 --- class: middle, center # precision <-> .highlight[clarity] # .highlight[abstraction] <-> reality --- class: center, middle ![picasso](public/img/picasso.jpg) --- class: middle, left > There is no abstract art. .highlight[You must always] > .highlight[start with something.] Afterward you can > remove all traces of reality. ### Pablo Picasso --- class: middle, center # Where should we begin? --- class: center, middle ![draw the owl](public/img/howtodraw.jpg) -- .js-helmet[![helmet](public/img/helmet.png)] -- .ruby-helmet[![helmet](public/img/helmet.png)] --- class: middle, center ![guns](public/img/guns.jpg) --- class: middle, center ![journey](public/img/journey.gif) --- class: middle, center # let's talk about # cows in space --- class: middle, center background-image: url(public/img/space1.jpg) ![picasso bulls](public/img/abstraction.jpg) --- class: middle, center ![taurus constellation](public/img/taurus2.jpg) ??? Humans are awesome pattern identifiers. --- class: middle, center ![taurus constellation](public/img/taurus1.jpg) --- class: middle, center ![taurus constellation](public/img/taurus.jpg) ??? Abstractions are patterns that we give names. --- class: middle, center ![horoscope](public/img/horoscope.png) ??? But we need to be careful about the patterns we pave. --- class: middle, center ![horoscope2](public/img/horoscope2.png) ![horoscope3](public/img/horoscope3.png) --- class: middle, center ![cowpaths](public/img/cowpaths.jpg) --- class: middle, center # let's talk about # javascript --- class: middle, center ![cows in space](public/img/cows2.jpg) --- class: middle, center # Javascript has been a delightful beginner programming language because it has lacked abstractions... --- class: middle, center ![explode](public/img/explode.gif) # That's all about to change. --- class: middle, center, title background-image: url(public/img/space1.jpg) # September 28, 1980 --- class: middle, center ![cosmos](public/img/cosmos.jpg) --- class: middle, left, title background-image: url(public/img/space1.jpg) # If you wish to make an apple pie from scratch, you must first invent the universe ### Carl Sagan --- class: left, middle, title background-image: url(public/img/space1.jpg) # If you wish to learn ES6/2015 from scratch you must first invent the universe ### Carl Sagan --- class: left, middle, title background-image: url(public/img/space1.jpg) # If you wish to learn ES6/2015 from scratch you must first invent the universe ### ag_dubs --- class: middle, center # let's talk about # ES6/2015 --- class: middle, center ![cows in space](public/img/cows7.jpg) --- class: middle, left > ECMAScript syntax is .highlight[relaxed] to enable it > to serve as an easy-to-use scripting language. ##### https://people.mozilla.org/~jorendorff/es6-draft.html. Accessed 12 May 2015. --- class: center, middle ![relax](public/img/relax.png) --- class: middle, center # [I]mmaterial to the problem being solved. ![danger](public/img/danger.png) --- class: middle, center # What is JavaScript trying to solve? --- class: middle, center # What will be JavaScript's legacy? --- class: middle, center ![javscript](public/img/voss_tweet.png) --- class: center, middle #### ECMASCRIPT6/2015 # Classes ![danger](public/img/danger.png) --- class: center, middle # Sugar # makes me # sick --- class: center, middle ![diabetepunk](public/img/diabetes.gif) --- class: center, middle # Syntactic Sugar # makes me # nervous --- class: top, left #### ECMASCRIPT6/2015: Classes > Even though ECMAScript includes syntax for > class definitions, .highlight[ECMAScript objects are not] > .highlight[fundamentally class-based] such as those in C++, > Smalltalk, or Java. ##### https://people.mozilla.org/~jorendorff/es6-draft.html. Accessed 12 May 2015. --- class: center, middle, title background-image: url(public/img/space1.jpg) # You might not need # class syntax --- class: center, middle, title background-image: url(public/img/space1.jpg) # You might not need # JQuery --- class: center, middle, title background-image: url(public/img/space1.jpg) # You might not need # class syntax --- class: middle, center ![gepbox](public/img/gepbox.jpg) --- class: middle, left > Remember that all models are wrong; the practical > question is .highlight[how wrong do they have to be to not be useful]. ### George E. P. Box ##### Box, G. E. P., and Draper, N. R., (1987), Empirical Model Building and Response Surfaces, John Wiley & Sons, New York, NY. p74. --- class: top, left #### ECMASCRIPT6/2015: Classes > In a class-based object-oriented language, in > general, state is carried by instances, methods > are carried by classes, and .highlight[inheritance is only] > .highlight[of structure and behaviour]. In ECMAScript, the > state and methods are carried by objects, while > .highlight[structure, behaviour, and state are all inherited]. ##### https://people.mozilla.org/~jorendorff/es6-draft.html. Accessed 12 May 2015. --- class: middle, center ![raganwald](public/img/raganwald.png) --- class: middle, center ![prototypes aren't classes](public/img/proto_homes.png) --- class: middle center #### Javascript Classes are Model Homes ![arrested dev](public/img/model.png) --- class: center, middle # Javascript classes are... objects -- # not classes. really. --- class: center, middle ![shallow class](public/img/shallowclass.png) --- class: center, middle ![drunk](public/img/drunkface.png) .right[#### go home TC39, you're drunk] -- .tc39[![TC39](public/img/tc39.png)] -- .abstraction[abstraction] -- .no[![no](public/img/no.gif)] --- class: center, middle # This is NOT a hate talk --- class: center, middle # What even is a class? --- class: center, middle ![simula](public/img/simula.png) --- class: center, middle ![this is fine](public/img/thisisfine.png) --- class: center, middle ![too many things](public/img/too_many.jpg) --- class: center, middle ![guidon](public/img/guidon.jpg) --- class: center, middle # .highlight[Teaching] is nature's way of letting you know .highlight[how sloppy your understanding is] --- class: left, top #### Teach Programming Concepts, Not Language Features ![SICP](public/img/sicp.jpg) --- class: middle, center # Javascript .highlight[WILL BE the introduction to programming concepts] for an entire generation of developers --- class: middle, center # [I]mmaterial to the problem being solved. ![danger](public/img/danger.png) --- class: center, middle ![simple vs easy](public/img/simpleeasy.png) ##### Rich Hickey, "Simple, Made Easy" http://www.infoq.com/presentations/Simple-Made-Easy Strangeloop 2011 --- class: middle, center ![Peter Van Roy](public/img/petervanroy.jpg) --- class: top, left #### Teach Programming as a Unified Discipline ![CTM](public/img/ctm.jpg) --- class: middle, center # Programming languages are tools --- class: middle,center # Problem-Solution Pairs => Paradigms --- class: left, top #### The Kernel Teaching Method > A good way to organize a programming course > is to start with a simple language and then > to .highlight[extend this language gradually]. ### Peter Van Roy ##### "Convergence in Language Design: A Case of Lightning Striking Four Times in the Same Place", FLOPS 2006, LNCS 3945, pp. 2-12, 2006. --- class: center, middle # We must invent the .highlight[Universe] --- class: center, middle # EVERY BEGINNER SHOULD WRITE A KERNEL LANGUAGE -- class: center .no[![no](public/img/no.gif)] --- class: middle, center # The Creative Extension Principle --- class: top, left #### You Aren't Going to Need It (YAGNI) > Always implement things when you .highlight[actually] > .highlight[need them], never when you just foresee > that you need them. ### Ron Jeffries, co-founder XP ##### Ron Jeffries. "You’re NOT gonna need it!". Practices. X Programming. Retrieved 2007-11-07. --- class: middle, center # .highlight[Prototypal inheritence] is a big part of the .highlight[JavaScript universe] --- class: middle, center # It's how the .highlight[apple pie] gets made -- ### #veganfriendlymetaphors --- class: middle, left # tl;dr - Abstraction: it's what programming is at it's most essential - Abstraction: beginners struggle with it - Abstraction: it will drive your culture and community - ES6 Classes: an abstraction, a problem - We should be teaching concepts not syntax - Syntax that obfuscates concepts is problematic - When we teach, we have to start at the beginning --- class: middle, center # What do .highlight[we even mean] when we talk about .highlight[programming]? --- class: middle, center ![heidegger](public/img/heidegger.jpg) ![what is called thinking](public/img/whatisthinking.jpg) --- class: middle, left > The most thought-provoking thing in our > thought-provoking time is that .highlight[we are] > .highlight[still not thinking.] ### Martin Heidegger ##### What is Called Thinking? [Was heisst Denken?] (1951–1952), as translated by Fred D. Wieck and J. Glenn Gray (1968) --- class: middle, center # Are we .highlight[programming] yet? --- class: middle, center ![racket](public/img/racket.png) ![pyret](public/img/pyret.png) --- class: middle, center ![scratch](public/img/scratch.jpg) --- class: middle, center ![evelang](public/img/evelang.png) --- class: middle, center ![kuhn](public/img/kuhn.jpg) --- class: middle, left > Scientists work from models acquired through > education and through subsequent exposure to > the literature often .highlight[without quite knowing or] > .highlight[needing to know what characteristics have] > .highlight[given these models the status of community] > .highlight[paradigms.] ### Thomas Kuhn ##### Kuhn, Thomas. "The Structure of Scientific Revolutions", pg 46 (1962) --- class: middle, left # We have an awesome opportunity to think .highlight[more radically] about how we extend JavaScript --- class: middle, left # We have an awesome opportunity to think .highlight[more radically] about how we build abstractions --- class: middle, left > It is far better to grasp the universe as it > really is .highlight[than to persist in delusion], however > satisfying and reassuring. ### Carl Sagan --- class: middle, left # Let's .highlight[reconsider] our .highlight[ontology]. -- # Let's reconsider it .highlight[early] and .highlight[often]. -- # Let's stay .highlight[beginners]. --- class: middle, center ![you're awesome](public/img/awesome.gif) ![you're awesome](public/img/awesome.gif) ![you're awesome](public/img/awesome.gif) ![you're awesome](public/img/awesome.gif) --- class: middle, center # #clapforashley ?


Camden London Borough Council is the local authority for the London Borough of Camden in London, England. The capital of the United Kingdom, London, consists of 32 borough councils one of them is Camden Council. Camden is divided into 18 wards, each electing three councillors.
The council was created by the London Government Act 1963 and replaced three local authorities: Hampstead Metropolitan Borough Council, Holborn Metropolitan Borough Council and St Pancras Metropolitan Borough Council.
The project assigned to our team is called CCTV Analysis with AI (Artificial Intelligence) and our client is the Camden Council. With more than 4 million cameras installed in the whole United Kingdom, Camden has a large number of CCTVs that need monitoring. Due to the lack of personnel in the CCTV monitoring section of Camden Council, they decided to use a software that will help in the analysis of the CCTV footage. The system we were asked to build should have AI and ML (Machine Learning) embedded in it. This will help in making it better over time so that it can be used on its own in the near future. The major requirement of this system is to analyse the footage and notify the users in case of any anti-social behaviour.
Due to the complexity of the project the client made clear from the first meeting that they do not expect a high end working software that will predict accurately any possible case of anti-social behaviour. They explained that the project goal is to build something simple which works, test it for a few years and then develop it further over the years in order to reach the end goal of monitoring the CCTVs solely using this software. The client wants us to develop the CCTV AI which can recognise items, human and postures of the people. Since the government has their own monitoring UI, they do not require us to build a user interface, but build something in order to let them know that the CCTV AI is working.
Gathering the requirements of this project was accomplished by establishing a close cooperation with our client. We held regular meetings almost every Monday in the client's offices near Kings Cross Station. Other than the meetings held any questions raised as we worked on the project during the week were answered by the client using emails. Every two weeks we were asked to write a Progress Report which was also send to the client by the team leader. In this way the client could keep track of our progress and guide us in case of any fault. Since there was only one requirement made by the client our requirement gathering process was really easy. We made a few suggestions to the client for adding extra features in the software. Since these features were considered as extra by the client we stored them in the Could Have area of the MoSCoW requirements list.
The typical users for this application will be the security guards in the CCTV monitoring centre. Jack Ramsey is one of the operators in the CCTV centre, his daily job is to monitor around 100 cameras in Camden. In addition, when there is a suspicious thing going on in the street, he can contact the police to investigate the area. Ms. Park is the leader of the operating team, and her job is to allocate the tasks to her colleagues and make a decision when there is an emergent event going on.
The following process is the goal of our sapient platform.
- There are thousands of cameras around Camden, the users who are the CCTV operators in surveillance room use the Sapient platform to monitor if there is any suspicious situation in Camden.
- Sapient Platform can automatically help the users to show up the cameras which require attention to check whether there is need of making emergency call to specific department.
- Traditionally, CCTV operators have to look through each camera, so that they know which camera needs attention.
After the completion of our requirement gathering technique we separated each requirement based on its priority and stored them in the MoSCow requirement list defining them as functional and non-functional tasks.
| ID | Name / Description | Type |
|---|---|---|
| Must Haves | ||
| 1 | Posture Recognition;
- Recognize all the people within the video frame, whether they are sitting, standing or lying on a bench. - Extend the old implementation from 3 people up to unlimted. |
Functional |
| 2 | Object Recognition;
- Implement the object recognition feature in order to understand also objects other than people. Notify in case of suspicious items, like knives, guns and bombs. |
Functional |
| 3 | Face Recognition;
- Implement face recognition feature in order to make our system more sophisticated, also allow future use of tracking down wanted criminals based on the police database. |
Functional |
| 4 | Cloud based;
- Build the system as a cloud platform in order to allow adjusting scalability and durability easily depending on the demand. |
Functional |
| Should Haves | ||
| 5 | Real-time;
- Work on real-time footage so that it can be used on live video directly from the cameras |
Functional |
| Could Haves | ||
| 6 | User Interface;
- There is no need for a User Interface to be created since the client is happy with their current monitoring software. Instead a single home page will be created simply to show the notifications from the system we built. |
Functional |
| Won't Have | ||
| 7 | Notifications;
- Notify the staff monitoring the CCTVs when a suspicious behaviour is spotted, include camera number and name in order to make it easier for them. |
Functional |
Based on the information we gathered, we started creating use cases in order to show how the system will interact with one another. A list of all the use cases with their description follows along with the overall use case diagram.
The diagram that follows shows the functionalities of our developed software and how they interact with each other.
The overall use case diagram shown above demonstrates how the whole system is working. Due to the type of our project there is no interaction with the user, the whole system is automated. Therefore, we display the tasks that occur automatically within the system. The only interaction that the user has is the notifications that pop-up in the web app.
From the overall use case diagram we had to take each use case and analyze it further. Description, Preconditions and postconditions for each one had to be noted in order for the development to occur flawlessly. A list with all the use cases follows.


| < Day Day Up > |
Knuth [185] and Gonnet [126] are excellent references for the analysis of hashing algorithms. Knuth credits H. P. Luhn (1953) for inventing hash tables, along with the chaining method for resolving collisions. At about the same time, G. M. Amdahl originated the idea of open addressing.
Carter and Wegman introduced the notion of universal classes of hash functions in 1979 [52].
Fredman, Komlós, and Szemerédi [96] developed the perfect hashing scheme for static sets presented in Section 11.5. An extension of their method to dynamic sets, handling insertions and deletions in amortized expected time O(1), has been given by Dietzfelbinger et al. [73].
| < Day Day Up > |


The purpose of this notebook and presentation is to provide documentation and validation of the efficiency measurements.
The PhaseIPixelNtuplizer package (used to process the CMSSW output) is available at:
https://github.com/jkarancs/PhaseIPixelNtuplizer
The PhaseIEfficiencyPlotter package (used to create plots) is available at:
For input I used a RECO of run [295463] -> PhaseIPixelNtuplizer -> PhaseIEfficiencyPlotter ntuple with
to validate the efficiency measurements and to fine-tune the efficiency filter cut thresholds.
The loading of the toolkit, and opening of the input file is done here:
import ROOT, sys
ROOT.gStyle.SetPalette(1)
sys.path.append('../python/')
inputDir = "/data/hunyadi/CMSSW/PhaseIEfficiencyPlotter_2017_04_02/CMSSW_9_1_0_pre3/src/DPGAnalysis/PhaseIEfficiencyPlotter/"
inputFile = ROOT.TFile.Open(inputDir + "histograms_efficiency.root", "READ")
The plotter code should have generated a directory system with different directories based on the conditions. Since the ntuple only contains data from the same kind of simulation, it should only have one main directory:
mainDir = ROOT.gDirectory.Get(
ROOT.gDirectory.GetListOfKeys().First().GetTitle())
The file contains categorical plot type subdirectories. This is the list of all the categories:
for index, subDir in enumerate(mainDir.GetListOfKeys()):
sys.stdout.write("%-49s " % subDir.GetTitle())
if index % 2 == 1: print ""
clusterOccupancyROCPlots clusterPhiVsZPlots clusterGlyVsGlxPlots clusterZPlots layersDisksEfficiencyPlots rechitOccupancyROCPlots efficiencyROCPlots rechitOccupancyPhiVsZPlots efficiencyPhiVsZPlots rechitOccupancyGlyVsGlxPlots efficiencyGlyVsGlxPlots vtxNtrkEfficiencyPreCutsPlots vtxNtrkEfficiencyWithCutsPlots ptEfficiencyPreCutsPlots ptEfficiencyWithCutsPlots striphitsEfficiencyPreCutsPlots striphitsEfficiencyWithCutsPlots lxEfficiencyPreCutsPlots lxEfficiencyWithCutsPlots lyEfficiencyPreCutsPlots lyEfficiencyWithCutsPlots lyVsLxEfficiencyPreCutsPlots lyVsLxEfficiencyWithCutsPlots clustDistPreCutsPlots clustDistWithCutsPlots hitDistPreCuts hitDistWithCutsPlots d0PreCutsPlots d0WithCutsPlots dzPreCutsPlots dzWithCutsPlots rocEfficiencyDistributionPlots forwardLocalPositionsByOrientationEfficiencyPlots forwardLocalPositionsWithFidicualCutsEfficiencyPlots
To draw the contents of these categories, a drawing tool is introduced here:
def mergeCanvasRow(canvas, padIndex):
if padIndex % 2 == 0: print "Function mergeCanvasRow() was called on invalid taget."
original = canvas.cd(padIndex)
original.SetPad("centeredPad","centeredPad",
(1.0 - original.GetAbsWNDC()) / 2.0, original.GetAbsYlowNDC(),
(1.0 - original.GetAbsWNDC()) / 2.0 + original.GetAbsWNDC(), original.GetAbsYlowNDC() + original.GetAbsHNDC(), 0)
canvas.cd(padIndex + 1).Delete()
def renderToCanvases(name, title, width, height, plotDirectory, plotNames):
canvases = []
for index, plotName in enumerate(plotNames):
if index % 2 == 0:
canvases = canvases + [ROOT.TCanvas(name + "_%d" % (index / 2), title, width, height)]
canvases[-1].Divide(2, 1)
canvases[-1].cd((index % 2) + 1)
plot = ROOT.gDirectory.Get(plotDirectory + "/" + plotName)
if plot: plot.Draw("COLZ")
else: print "Missing plot: ", plotName
if(len(plotNames) % 2 == 1): mergeCanvasRow(canvases[-1], 1)
return canvases
The visualization of the is customized here:
# ROOT.enableJSVis() # Uncommenting this adds interactive html/javascript elements to the notebook
ROOT.gStyle.SetPalette(1)
canvases = renderToCanvases("ClusterOccupancyCanvas", "Cluster Occupancy on the ROCs", 900, 400,
mainDir.GetTitle() + "/" + "clusterOccupancyROCPlots",
["clusterOccupancyROCPlots_Layer1",
"clusterOccupancyROCPlots_Layer2",
"clusterOccupancyROCPlots_Layer3",
"clusterOccupancyROCPlots_Layer4",
"clusterOccupancyROCPlots_AllDisks"])
canvases[0].Draw()
canvases[1].Draw()
canvases[2].Draw()
canvases = renderToCanvases("ClusterPhiVsZCanvas", "Cluster occupancy, phi vs Z", 900, 400,
mainDir.GetTitle() + "/" + "clusterPhiVsZPlots",
["clusterPhiVsZPlots_Layer1",
"clusterPhiVsZPlots_Layer2",
"clusterPhiVsZPlots_Layer2",
"clusterPhiVsZPlots_Layer4"])
canvases[0].Draw()
canvases[1].Draw()
canvases = renderToCanvases("ClusterGlyVsGlxCanvas", "Cluster occupancy, Y vs X", 900, 400,
mainDir.GetTitle() + "/" + "clusterGlyVsGlxPlots",
["clusterGlyVsGlxPlots_Disk1",
"clusterGlyVsGlxPlots_Disk2",
"clusterGlyVsGlxPlots_Disk3",
"clusterGlyVsGlxPlots_Disk4",
"clusterGlyVsGlxPlots_Disk5",
"clusterGlyVsGlxPlots_Disk6"])
canvases[0].Draw()
canvases[1].Draw()
canvases[2].Draw()
canvases = renderToCanvases("RechitOccupancyCanvas", "Rechit Occupancy on the ROCs", 900, 400,
mainDir.GetTitle() + "/" + "rechitOccupancyROCPlots",
["rechitOccupancyROCPlots_Layer1_Hits",
"rechitOccupancyROCPlots_Layer2_Hits",
"rechitOccupancyROCPlots_Layer3_Hits",
"rechitOccupancyROCPlots_Layer4_Hits",
"rechitOccupancyROCPlots_AllDisks_Hits"])
Warning in <TCanvas::Constructor>: Deleting canvas with same name: RechitOccupancyCanvas_0 Warning in <TCanvas::Constructor>: Deleting canvas with same name: RechitOccupancyCanvas_1 Warning in <TCanvas::Constructor>: Deleting canvas with same name: RechitOccupancyCanvas_2
canvases[0].Draw()
canvases[1].Draw()
canvases[2].Draw()
canvases = renderToCanvases("rechitOccupancyPhiVsZCanvas", "Rechit occupancy, phi vs Z", 900, 400,
mainDir.GetTitle() + "/" + "rechitOccupancyPhiVsZPlots",
["rechitOccupancyPhiVsZPlots_Layer1_Hits",
"rechitOccupancyPhiVsZPlots_Layer2_Hits",
"rechitOccupancyPhiVsZPlots_Layer2_Hits",
"rechitOccupancyPhiVsZPlots_Layer4_Hits"])
canvases[0].Draw()
canvases[1].Draw()
canvases = renderToCanvases("RechitOccupancyGlyVsGlxCanvas", "Rechit occupancy, Y vs X", 900, 450,
mainDir.GetTitle() + "/" + "rechitOccupancyGlyVsGlxPlots",
["rechitOccupancyGlyVsGlxPlots_Disk1_Hits",
"rechitOccupancyGlyVsGlxPlots_Disk4_Hits",
"rechitOccupancyGlyVsGlxPlots_Disk2_Hits",
"rechitOccupancyGlyVsGlxPlots_Disk5_Hits",
"rechitOccupancyGlyVsGlxPlots_Disk3_Hits",
"rechitOccupancyGlyVsGlxPlots_Disk6_Hits"])
canvases[0].Draw()
canvases[1].Draw()
canvases[2].Draw()
The list of the cuts and their functions are listed here:
| # | Cut name | Function |
|---|---|---|
| 1 | nvtxCut | Discards tracks that come from a vertex with low number of tracks. |
| 2 | zerobiasCut | Discards trajectory measurements that come from non MinBias trigger selection (for data). |
| 3 | federrCut | Discards data when FED errors were present. |
| 4 | hpCut | Allows high-purity tracks only. |
| 5 | ptCut | Minimum track transverse momenta. |
| 6 | nstripCut | Number of strip hits required to validate the track presence. |
| 7 | d0Cut | Maximum track-vertex XY distance. |
| 8 | dzCut | Maximum track-vertex Z distance. |
| 9 | pixhitCut | Discards measurements with positions that have been propagated without a validhit in the adjacent detector layers/disks. |
| 10 | lxFidCut | Discards hits on the edges of the modules. For the forward section this is combined with the lyFidCut. |
| 11 | lyFidCut | Discards hits on the edges of the modules. For the forward section this is combined with the lxFidCut. |
| 12 | valmisCut | Discarding hits with invalid states. |
| 13 | hitsepCut | Discarding hits that have ambiguous track assignments (= there are more than one track traversing the detector near the hit). |
| 14 | badROCCut | Excluding non functioning modules and ROCs. |
Many of these cuts have different boundaries than the ones used in the Phase-0 scenario.
The fine-tuning of the cut values was an iterative process. In order to fine tune a single threshold, the other cuts should be present. The plots with all except one cut values pre-set are referred to as n - 1 plots. I used the Phase-0 cut values as the starting points of the iterations, where it was reasonable to do so.
Since the geometry of the detector is completely different, it is reasonable to start the fine tuning on the most geometry dependent cuts: the fidicual cuts. The scenario of the barrel modules is relatively straightforward:
canvases = renderToCanvases("lyVsLxEfficiencyOnTheBarrelCanvas", "Ly vs lx efficiency on the barrel layers", 900, 400,
mainDir.GetTitle() + "/" + "lyVsLxEfficiencyWithCutsPlots",
["lyVsLxEfficiencyWithCutsPlots_Layer1_Eff.",
"lyVsLxEfficiencyWithCutsPlots_Layer2_Eff.",
"lyVsLxEfficiencyWithCutsPlots_Layer3_Eff.",
"lyVsLxEfficiencyWithCutsPlots_Layer4_Eff."])
canvases[0].Draw()
canvases[1].Draw()
As for the modules on the Pixel Endcaps, it is a completely different matter. Unfortunately, there are lots of different configurations for these modules for which the overlapping areas are completely different. As of the current state of the efficiency measurements, only the center of the forward modules were used, since this is the only place, where there are no overlaps between the adjacent modules. Unfortunately, this is a quite small proportion of the modules, so these cuts throw away most of the endcap trajectory measurements.
If you have any ideas how this approach can be upgraded/replaced, please make sure to comment on the matter! :)
For the orientation of the forward modules, 24 differerent scenarios were separated, and an area with correct efficiency measurement values were selected for each of them. Here I present only some of these cuts. The plots on the left side show the total n - 1 efficiencies. The plots on the right side present the efficiency values on the selected area only.
preCutsNamePrefix = "forwardLocalPositionsByOrientationEfficiencyPlots"
postCutsNamePrefix = "forwardLocalPositionsByOrientationWithFidicualCutsEfficiencyPlots"
canvases = renderToCanvases("lyVsLxEfficiencyOnTheEndcapCanvas", "Ly vs lx efficiency on the endcap disks", 900, 400,
mainDir.GetTitle(),
["forwardLocalPositionsByOrientationEfficiencyPlots/" + preCutsNamePrefix + "_Disk1Efficiency_2",
"forwardLocalPositionsWithFidicualCutsEfficiencyPlots/" + postCutsNamePrefix + "_Disk1Efficiency_2",
"forwardLocalPositionsByOrientationEfficiencyPlots/" + preCutsNamePrefix + "_Disk1Efficiency_3",
"forwardLocalPositionsWithFidicualCutsEfficiencyPlots/" + postCutsNamePrefix + "_Disk1Efficiency_3",
"forwardLocalPositionsByOrientationEfficiencyPlots/" + preCutsNamePrefix + "_Disk2Efficiency_4",
"forwardLocalPositionsWithFidicualCutsEfficiencyPlots/" + postCutsNamePrefix + "_Disk2Efficiency_4"])
canvases[0].Draw()
canvases[1].Draw()
canvases[2].Draw()
As for this cut, it was already introduced in the implementation of the PhaseIPixelNtuplizer. The cut value of 10 tracks seems to be perfectly reasonable.
canvases = renderToCanvases("vtxNtrkEfficiencyWithCutsPlotsCanvas", "Number of tracks in the vertices", 900, 400,
mainDir.GetTitle() + "/" + "vtxNtrkEfficiencyWithCutsPlots",
["vtxNtrkEfficiencyWithCutsPlots_Hits",
"vtxNtrkEfficiencyWithCutsPlots_Eff."])
The Phase-0 value for this cut was set to 1.0. This value seems to be alll right and was kept.
canvases = renderToCanvases("ptEfficiencyWithCutsPlotsCanvas", "Pt. of the traj. meas. tracks", 900, 400,
mainDir.GetTitle() + "/" + "ptEfficiencyWithCutsPlots",
["ptEfficiencyWithCutsPlots_Hits",
"ptEfficiencyWithCutsPlots_Eff."])
canvases[0].Draw()
canvases = renderToCanvases("striphitsEfficiencyWithCutsPlotsCanvas", "Strip hits for the traj. meas. tracks", 900, 400,
mainDir.GetTitle() + "/" + "striphitsEfficiencyWithCutsPlots",
["striphitsEfficiencyWithCutsPlots_Hits",
"striphitsEfficiencyWithCutsPlots_Eff.",])
canvases[0].Draw()
The distribution of the number of strip hits is quite interesting. Most of the tracks with non-zero strip hits are located in a gaussian with a mean of ~14. Currently the cut value for the minimum number of strip hits is currently set to 10, this means, that most of the tracks in this region are kept.
The threshold used for the barrel modules and the forward modules were selected separately, since the error of the trajectory measurements on the layer is more dependent on the Z track-vertex distance, and as for the traj. measurements on the disks the precision is more dependent on the XY distance.
The current cut values for d0 of the layers are set to 0.01 on the first layer, and 0.02 on the other layers. There is also a cut value for dz, set to 0.1 just to throw away all the tracks with very bad vertex association.
canvases = renderToCanvases("d0WithCutsPlotsAllLayersCanvas", "D0 of the traj. meas. tracks on the layers", 900, 400,
mainDir.GetTitle(),
["d0WithCutsPlots/d0WithCutsPlots_AllLayers_Hits",
"d0WithCutsPlots/d0WithCutsPlots_AllLayers_Eff.",
"dzWithCutsPlots/dzWithCutsPlots_AllLayers_Hits",
"dzWithCutsPlots/dzWithCutsPlots_AllLayers_Eff."])
canvases[0].Draw()
canvases[1].Draw()
The tracking accuracy of the forward region should be more dependent on d0 than on dz, still neither of these correlations seem to be too strong. The current d0 cut value is set to 0.05 and the dz is 0.5, but it is entirely possible that the dz cut is entirely unnecessary.
canvases = renderToCanvases("d0WithCutsPlotsAllDisksCanvas", "D0 of the traj. meas. tracks on the disks", 900, 400,
mainDir.GetTitle(),
["d0WithCutsPlots/d0WithCutsPlots_AllDisks_Hits",
"d0WithCutsPlots/d0WithCutsPlots_AllDisks_Eff.",
"dzWithCutsPlots/dzWithCutsPlots_AllDisks_Hits",
"dzWithCutsPlots/dzWithCutsPlots_AllDisks_Eff."])
canvases[0].Draw()
canvases[1].Draw()
The distance of the hits is also an important factor in accuracy of the track association. The best trajectory measurements for efficiency measurements are the ones that are far from the trajectory of every other track. The hit separation cut value is currently set to 0.1.
canvases = renderToCanvases("hitDistWithCutsPlotsCanvas", "Distance of closest non-parent track", 900, 400,
mainDir.GetTitle() + "/" + "hitDistWithCutsPlots",
["hitDistWithCutsPlots_Hits",
"hitDistWithCutsPlots_Eff.",])
canvases[0].Draw()
The ratio of clusters falsely assigned to a track is highly dependent on the pileup. The association threshold is 0.01 which should keep the false-association minimal.
canvases = renderToCanvases("clustDistWithCutsPlotsCanvas", "Traj. meas distance to the closest cluster", 900, 400,
mainDir.GetTitle() + "/" + "clustDistWithCutsPlots",
["clustDistWithCutsPlots_Hits",
"clustDistWithCutsPlots_Eff.",])
canvases[0].Draw()
canvases = renderToCanvases("efficiencyMeasurementsCanvas", "Efficiency measurements", 900, 400,
mainDir.GetTitle() + "/" + "layersDisksEfficiencyPlots",
["layersDisksEfficiencyPlots_Hits",
"layersDisksEfficiencyPlots_Eff.",])
canvases[0].Draw()


Created by Spencer Walton
'Veronica Mars' is a collection of four dashboards, built using the dashing framework.
The first dashboard monitors the statuses of the test sites - the response codes, last data refresh, version, and schema name. Double-clicking visits a site, and shift-clicking allows you to copy the database schema name. Sites will be green when up, and red when down.
This dashboard uses the Shareworks REST API to check the status of data imports for companies using AST. Any company that has no import in the last 24 hours turns red.
This dashboard displays an approximation of where the work (in jira form) is being created, by office. It uses a customized version of a community widget.
'LiveBot' is a chat bot built using the Hubot framework, and the Hipchat adapter. It uses Hipchat's Jabber/XMPP integration in order to communicate with an internally hosted instance of Hipchat.
The default frameworks were missing some features, so they were added manually:
LiveBot was made able to leave rooms - this required changing source code. A number of scripts were also added. The more significant ones are listed below.
When a jira key is mentioned in a room, LiveBot will hear it, and return the title and issue type, as well as a link to the jira.
The LIVE team uses a monitoring and alerting system built on opsgenie and sensu.
A feature was added to LiveBot so members of the live team could take the pager from the person on call for a period of time, using the opsgenie forwarding API.
A 'panic button' was also added, allowing people to alert the person on call about a critical jira.
Functions were added to allow LiveBot to return statistics involving jira types and timelines, using googlecharts and the jira SOAP gem.
LiveBot can also generate the approximate cost of downtime, by querying the database for the daily trade dollars, and the pingdom API for downtime.
Livebot was given functionality to download the Marketing Site and create a mirror, either on a local server or on s3. This used a shell script that would check if the website was up, downloading a new version if it was, then pushing the existing or new copy to the user specified location.
The Jira Report Card gives statistics on the jiras that a person or group of people raise. This is to show areas where improvement is needed (longer descriptions, more detail or planning) and where a person is strong (bug reports that lead to code fixes, multiple attachments). Statistics on the internal creators of tickets is important, as the higher the ticket quality, the faster it can be resolved.
Uses the opsgenie API to get how long each person was on call for during a time range, how many total pages they received, and how many were during off-hours, then generates a spreadsheet of this data.
A ruby gem used to simplify API calls to Shareworks, which was then used for the test harness. The test harness was written in ruby, using rspec. Tests the commands against expected values, proper formatting, and successful responses.
In order to have a consistent install pattern for setting up the Veronica Mars and LiveBot projects, Chef was used to create Vagrant machines customized with dependencies and files.
Using the Zendesk API and the Shareworks API wrapper gem, I checked for consistencies between companies, to ensure all companies were able to receive support through Zendesk.
Solium uses a monitoring and alerting system with 'traps' to catch errors and events that occur, such as a site outage or stalled transaction. I wrote a trap (using Ruby) that logs into Shareworks, follows redirects and navigates to the desired page, then checks for errors.
This is a simple page, using PHP with the jira API to retrieve a list of versions, then removing past releases, and sorting by date.
Using ruby and postgresql, I built a sample database to allow people to learn basic SQL without touching a critical database. It uses various constraints such as primary keys, foreign keys, and unique values. The database contains several tables, each containing 1000 unique records.


| DOSE: |
4.0 mg |
oral |
2C-T-7 |
(liquid) |
Carefully weighing out 120+-mg of pharmaceutical 2C-T-7, I added the crystals to 30 ml of dH2O resulting in a solution of approximately 4mg/ml.
4:00PM Off work, I take an 10cc oral dose syringe out (same one used to measure the water) and draw exactly 1cc (4 mg) of this solution and squirt unceremoniously into my mouth.
4:30 waiting
5:00 waiting
5:30 a slight alert, only barely noticeable
5:45 some mood elevation, slight nausea
6:00 now I am feeling the substance. It has a warm very rosy feel to it, even though it was preceded by uneasy stomach.
8:00 Ok, I know some will say it ain't so, but my curtains are revolving tubes of vertical colors. It isn't a huge visual, and it takes some staring, but it is there. This substance gives a secure and warm feeling. In a dose of 2mg it might be an excellent antidepressant. The edge of psychedelia is there even at 4mg, although I have heard it isn't active below 10mg.
10:00 Down completely, weird background echos, but otherwise normal.
excellent material. I recommend experimentation in both higher and lower dosages, perhaps as low as 1mg. Certainly I went over threshold at 4mg.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


VisuaLynk IoT Sensor Monitoring System
Demonstration for the integration of VisuaLynk with open OMI-ODF for IoT data transfer.
12.0
0.7
1
Demonstration for the integration of VisuaLynk with open OMI-ODF for IoT data transfer.


These heuristics are intended to estimate the average effect on your hand
state when you play the card, not to define what the card actually does.
NOTE: This is not used anywhere yet. I thought it would be useful as a base
case for code that analyzes a game tree.
The values are all constants, even when the card’s effect isn’t, so that in
the base case a hand can be quickly evaluated. The more sophisticated way to
evaluate a hand, of course, is to consider the actual effect of playing the
card, and evaluate the resulting hand, recursively. As such, it doesn’t even
matter when these values are wrong for complex actions, as long as they’re
not incredibly wrong.
The +’s have no effect on the values, they just make some of them sound more
natural.
Victory cards are modeled as cards that replace their action and do nothing
(this isn’t accurate, but the things that would care about the difference —
like Libraries — aren’t accurate either.)
If they appeared as the default -1 action, it would imply that there was some
benefit to having +actions with victory cards.
“Churn” is how many more cards you get to see than you get to keep. (Think of
what Cellar and Warehouse do, even though they’re different.)


A. No ink effect and no sliding bar
ITEM ONE
ITEM TWO
ITEM THREE
B. The bottom bar appears to indicate the selected tab, but without sliding effect.
ITEM ONE
ITEM TWO
ITEM THREE
C.


XMAG(1) XMAG(1) NAME xmag - magnify parts of the screen SYNOPSIS xmag [ -mag magfactor ] [ -source geom ] [ -toolkitoption ... ] DESCRIPTION The xmag program allows you to magnify portions of an X screen. If no explicit region is specified, a square with the pointer in the upper left corner is displayed indicating the area to be enlarged. The area can be dragged out to the desired size by pressing Button 2. Once a region has been selected, a window is popped up showing a blown up version of the region in which each pixel in the source image is represented by a small square of the same color. Pressing Button1 in the enlargement window shows the position and RGB value of the pixel under the pointer until the button is released. Typing ``Q'' or ``^C'' in the enlargement window exits the program. The application has 5 buttons across its top. Close deletes this particular magnification instance. Replace brings up the rubber band selector again to select another region for this magnifica‐ tion instance. New brings up the rubber band selector to create a new magnification instance. Select puts the magnification image into the primary selection. Paste copies the primary selection buffer into xmag. Note that you can cut and paste between xmag and the bitmap program. Resizing xmag resizes the magnification area. xmag preserves the col‐ ormap, visual, and window depth of the source. WIDGETS xmag uses the X Toolkit and the Athena Widget Set. The magnified image is displayed in the Scale widget. For more information, see the Athena Widget Set documentation. Below is the widget structure of the xmag application. Indentation indicates hierarchical structure. The widget class name is given first, followed by the widget instance name. Xmag xmag RootWindow root TopLevelShell xmag Paned pane1 Paned pane2 Command close Command replace Command new Command select Command paste Label xmag label Paned pane2 Scale scale OverrideShell pixShell Label pixLabel OPTIONS -source geom This option specifies the size and/or location of the source region on the screen. By default, a 64x64 square is provided for the user to select an area of the screen. -mag integer This option indicates the magnification to be used. 5 is the default. AUTHORS Dave Sternlicht and Davor Matic, MIT X Consortium. X Version 11 xmag 1.0.4 XMAG(1)


Match play. Red trails 3-4 to 7. Should Red double? If doubled, should White take?
pips Red=127 White=157
(CorrectAnswer= 0/0, ErrorScore= 0)
For money this is a massive no double. At 4-away vs 3-away not doubling is worse than a triple blunder!
A very easy, if slightly scary take.
A very easy, if slightly scary take.
Cube analysis 2-ply cubeless equity +0.247 (Money: +0.287) 0.569 0.268 0.005 - 0.431 0.120 0.004 Cubeful equities: 1. Double, take +0.795 2. Double, pass +1.000 (+0.205) 3. No double +0.545 (-0.250) Proper cube action: Double, take


|
CAMO.NRW
|
Main-File for the CAMO.NRW Firmware. More...
#include <Arduino.h>
#include "PCA9685.h"
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <ros.h>
#include <std_msgs/Float32.h>
#include <GxEPD2_BW.h>
#include <GxEPD2_3C.h>
#include <GxEPD2_7C.h>
#include <Fonts/FreeMonoBold9pt7b.h>
#include <BitmapDisplay.h>
#include <TextDisplay.h>
#include <GxEPD2_display_selection_new_style.h>
Classes | |
| struct | messwerte |
| struct | display_data |
Macros | |
| #define | DEBUG false |
| #define | DHTTYPE DHT22 |
| #define | DHTPIN 19 |
| #define | DS18B20_PIN 26 |
| #define | LTC2943_ALCC_PIN 36 |
| #define | taster_1_PIN 34 |
| #define | taster_2_PIN 35 |
| #define | taster_3_PIN 32 |
| #define | taster_4_PIN 33 |
| #define | taster_5_PIN 25 |
| #define | pc_remote_led_PIN 27 |
| #define | on_board_led_PIN 2 |
| #define | pwm_port_rgb_led_blau 0 |
| #define | pwm_port_rgb_led_rot 1 |
| #define | pwm_port_rgb_led_gruen 2 |
| #define | pwm_port_relais_fan 3 |
| #define | pwm_port_relais_r3 4 |
| #define | pwm_port_relais_r1_r2 5 |
| #define | pwm_port_fan_pwm 6 |
| #define | pwm_port_mosfet_pc_remote 7 |
| #define | battery_capacity 27 |
| #define | uS_TO_S_FACTOR 1000000 /*! Conversion factor for micro seconds to seconds */ |
| #define | TIME_TO_DEEPSLEEP 60 /*! Time ESP32 will go to sleep (in seconds) */ |
| #define | ENABLE_GxEPD2_GFX 1 |
Functions | |
| void | i2c_flush () |
| Routine for flushing the i2c-interface. More... | |
| void | pwm_setup () |
| Initialize the pwm-controller. More... | |
| void | relais_switch_to_charge (bool on) |
| Switch the relais 1 & 2 between using battery for the system or charging the battery. More... | |
| void | relais_switch_system_on_bat (bool on) |
| Switch the relais 3 between using battery or external power-suplly for the system. More... | |
| void | luefter_steuerung (float temperatur) |
| Set the fan-speed according to the temperature temperature < 40 degree Celsius: Fans off temperature > 70 degree Celsius: Fans at highets speed temperture between: Fan-Speed linear to temperature. More... | |
| void | fan_relais_extern () |
| Switch fan power-supply to external-connector "Load battery". | |
| void | fan_relais_batterie () |
| Switch fan power-supply to internal battery. | |
| void | pc_remote_mosfet (bool on) |
| Switch the mosfet to controll the pc´s powerswitch on or off. More... | |
| void | set_rgb_led (int rot, int gruen, int blau) |
| Set the color of the build-in-rgb-led. More... | |
| DHT_Unified | dht (DHTPIN, DHTTYPE) |
| void | dht_setup () |
| Init the DHT-Sensor. | |
| void | get_dht_values (float *dht_temperature, float *dht_humidity) |
| Get values from the DHT-Sensor. More... | |
| OneWire | ds18b20_oneWire (DS18B20_PIN) |
| void | ds18b20_setup () |
| Init the DS18B20-Sensor. | |
| void | ds18b20_start_meassurment () |
| Tell the DS18B20-Sensor to start a measurment. The measurments takes about 500 ms, so comeback later to read out. | |
| void | get_ds18b20_value (float *temperature) |
| Get values from the external DS18B20-Sensor. More... | |
| void | mcp3428_setup () |
| Init the MCP3428 ADC-IC. More... | |
| void | get_adc_values (float *adc_extern_1, float *adc_charger, float *adc_externe_stromversorgung, float *adc_extern_2) |
| Get values from ADC-IC. More... | |
| void | ltc2943_setup () |
| Init the LTC2943 battery gauge IC. | |
| void | ltc_2943_standby (bool state) |
| Switch the analog front-end of the LTC2943 into standby or vice versa. More... | |
| void | set_ltc_2943_coulomb_full () |
| tell the LTC-2943 the battery is fully charged | |
| void | get_ltc2943_values (float *spannung, float *strom, uint16_t *coulomb, float *temperatur, float *battery_percent) |
| Get values from LTC2943 battery gauge IC. More... | |
| BitmapDisplay | bitmaps (display) |
| void | display_setup () |
| init the display | |
| void | display_refresh_background_task (void *pvParameters) |
| background helper task for display-refreshing. More... | |
| void | show_data_on_display (struct display_data data_to_show) |
| Refresh the display if there are newer values than already displayed. More... | |
| void | gpio_setup () |
| init all GPIO ports that are directly connected to the ESP32 More... | |
| void | set_onboard_led (bool on) |
| set the onboard LED on or off. More... | |
| void | read_all_sensors (struct messwerte *messwerte) |
| Read all sensors and return their current values. More... | |
| ros::Publisher | pub_dht_temperature ("dht_temperature", &ros_msg_dht_temperature) |
| ros::Publisher | pub_dht_humidity ("dht_humidity", &ros_msg_dht_humidity) |
| ros::Publisher | pub_ds18b20_temperature ("ds18b20_temperature", &ros_msg_ds18b20_temperature) |
| ros::Publisher | pub_ltc2943_spannung ("ltc2943_spannung", &ros_msg_ltc2943_spannung) |
| ros::Publisher | pub_ltc2943_strom ("ltc2943_strom", &ros_msg_ltc2943_strom) |
| ros::Publisher | pub_ltc2943_temperature ("ltc2943_temperature", &ros_msg_ltc2943_temperature) |
| ros::Publisher | pub_ltc2943_coulomb ("ltc2943_coulomb", &ros_msg_ltc2943_coulomb) |
| ros::Publisher | pub_ltc2943_battery_percentage ("ltc2943_battery_percentage", &ros_msg_ltc2943_battery_percentage) |
| ros::Publisher | pub_adc_extern_1 ("adc_extern_1", &ros_msg_adc_extern_1) |
| ros::Publisher | pub_adc_charger ("adc_charger", &ros_msg_adc_charger) |
| ros::Publisher | pub_adc_externe_stromversorgung ("adc_externe_stromversorgung", &ros_msg_adc_externe_stromversorgung) |
| ros::Publisher | pub_adc_extern_2 ("adc_extern_2", &ros_msg_adc_extern_2) |
| void | ros_serial_init () |
| init a ROS-Serial-Node and advertise all publishers to it | |
| void | ros_serial_send_msg (struct messwerte messwerte) |
| write the actual values to all publishers and send it out by uart More... | |
| void | setup () |
| setup routine, started after each coldstart or deepsleep-wakeup | |
| void | loop () |
| Main Loop. | |
Variables | |
| RTC_DATA_ATTR bool | system_an |
| RTC_DATA_ATTR bool | first_start = true |
| RTC_DATA_ATTR uint8_t | relais_mode = 0 |
| long | switch_sys_off_at_time = 0 |
| RTC_DATA_ATTR PCA9685 | pwmController |
| Routines for accesing the PCA9685 pwm-controller. | |
| DallasTemperature ds18b20_sensor & | ds18b20_oneWire |
| DeviceAddress | sensor_address |
| uint8_t | ltc2943_config = 0b11111000 |
| uint8_t | ltc2943_config_standby = 0b11111001 |
| uint8_t | ltc2943_adr = 0x64 |
| TaskHandle_t | Task1 |
| RTC_DATA_ATTR struct display_data | data_on_display |
| RTC_DATA_ATTR bool | refresh_display_busy_flag = false |
| std_msgs::Float32 | ros_msg_dht_temperature |
| std_msgs::Float32 | ros_msg_dht_humidity |
| std_msgs::Float32 | ros_msg_ds18b20_temperature |
| std_msgs::Float32 | ros_msg_ltc2943_spannung |
| std_msgs::Float32 | ros_msg_ltc2943_strom |
| std_msgs::Float32 | ros_msg_ltc2943_temperature |
| std_msgs::Float32 | ros_msg_ltc2943_coulomb |
| std_msgs::Float32 | ros_msg_ltc2943_battery_percentage |
| std_msgs::Float32 | ros_msg_adc_extern_1 |
| std_msgs::Float32 | ros_msg_adc_charger |
| std_msgs::Float32 | ros_msg_adc_externe_stromversorgung |
| std_msgs::Float32 | ros_msg_adc_extern_2 |
| ros::NodeHandle | nh |
| RTC_DATA_ATTR bool | esp_was_in_deepsleep = 0 |
| int | ros_publish_time |
Main-File for the CAMO.NRW Firmware.
This file is the main.cpp file of the CAMO.NRWs Mainboard Firmware All files and the documentation can be found on https://github.com/topoppe/camo.nrw.dachbox
| #define DEBUG false |
Define Debug-State, Pins and bat-capacity
| void display_refresh_background_task | ( | void * | pvParameters | ) |
background helper task for display-refreshing.
Runs on second CPU-Core to avoid blocking while display refreshes
| void get_adc_values | ( | float * | adc_extern_1, |
| float * | adc_charger, | ||
| float * | adc_externe_stromversorgung, | ||
| float * | adc_extern_2 | ||
| ) |
Get values from ADC-IC.
Calculates values in Volt from the raw-adc-values and stores them into memory
| adc_extern_1 | pointer to a float variable to store the value from adc_extern_1 in Volt into |
| adc_charger | pointer to a float variable to store the value from the external charger-connector in Volt into |
| adc_externe_stromversorgung | pointer to a float variable to store the value from the external power-supply-connector in Volt into |
| adc_extern_2 | pointer to a float variable to store the value from adc_extern_2 in Volt into |
| void get_dht_values | ( | float * | dht_temperature, |
| float * | dht_humidity | ||
| ) |
Get values from the DHT-Sensor.
Returns the measurment value into memory. Returns NAN if sensor can´t be read
| dht_temperature | pointer to a float variable to store the temperature value into |
| dht_humidity | pointer to a float variable to store the humidity value into |
| void get_ds18b20_value | ( | float * | temperature | ) |
Get values from the external DS18B20-Sensor.
Returns the measurment value into memory. Returns NAN if sensor can´t be read
| dht_temperature | pointer to a float variable to store the temperature value into |
| void get_ltc2943_values | ( | float * | spannung, |
| float * | strom, | ||
| uint16_t * | coulomb, | ||
| float * | temperatur, | ||
| float * | battery_percent | ||
| ) |
Get values from LTC2943 battery gauge IC.
Calculates values from the raw-values and stores them into memory
| spannung | pointer to a float variable to store the voltage value at shunt into |
| strom | pointer to a float variable to store the current value over shunt into |
| coulomb | pointer to a float variable to store the integrated coulomb into |
| temperatur | pointer to a float variable to store the ic´s temperature into |
| battery_percent | pointer to a float variable to store the percentage SOC of the battery into |
| void gpio_setup | ( | ) |
init all GPIO ports that are directly connected to the ESP32
This is NOT for the GPIOs on the PWM-IC!
| void i2c_flush | ( | ) |
Routine for flushing the i2c-interface.
switch of timer
| void ltc_2943_standby | ( | bool | state | ) |
Switch the analog front-end of the LTC2943 into standby or vice versa.
To avoid write processes while readout the LTC2943 needs to be shutdown before readout and switch again afterwards
| state | true for switch to standby, false to switch on |
| void luefter_steuerung | ( | float | temperatur | ) |
Set the fan-speed according to the temperature temperature < 40 degree Celsius: Fans off temperature > 70 degree Celsius: Fans at highets speed temperture between: Fan-Speed linear to temperature.
Max Fan-Speed is limited to about 80%, due to higher system-voltage on loaeding than fans are rated!
| temperatur | temperature as setup for the fans |
| void mcp3428_setup | ( | ) |
Init the MCP3428 ADC-IC.
In fact just a general-call reset. Resets also the PWM-IC!
| void pc_remote_mosfet | ( | bool | on | ) |
Switch the mosfet to controll the pc´s powerswitch on or off.
| on | bool input for switch the mosfet on (true, switch pressed) or off (false, switch not pressed) |
| void pwm_setup | ( | ) |
Initialize the pwm-controller.
Library using default B000000 (A5-A0) i2c address, and default Wire @400kHz
Resets all PCA9685 devices on i2c line
Initializes module using default totem-pole driver mode, and default disabled phase balancer
Set PWM freq to 1000Hz (default is 200Hz, supports 24Hz to 1526Hz)
| void read_all_sensors | ( | struct messwerte * | messwerte | ) |
Read all sensors and return their current values.
| messwerte | pointer to a struct to save values into |
| void relais_switch_system_on_bat | ( | bool | on | ) |
Switch the relais 3 between using battery or external power-suplly for the system.
| on | bool input for setting the relais to system-battery-powered (true) or external power-supply (false) |
| void relais_switch_to_charge | ( | bool | on | ) |
Switch the relais 1 & 2 between using battery for the system or charging the battery.
| on | bool input for setting the relais to system-battery-powered (true) or charge the battery (false) |
| void ros_serial_send_msg | ( | struct messwerte | messwerte | ) |
write the actual values to all publishers and send it out by uart
| messwerte | data to send |
| void set_onboard_led | ( | bool | on | ) |
set the onboard LED on or off.
| on | true = on, false = off |
| void set_rgb_led | ( | int | rot, |
| int | gruen, | ||
| int | blau | ||
| ) |
Set the color of the build-in-rgb-led.
| rot | value of the red-channel 0-255 |
| gruen | value of the green-channel 0-255 |
| blau | value of the blue-channel 0-255 |
| void show_data_on_display | ( | struct display_data | data_to_show | ) |
Refresh the display if there are newer values than already displayed.
| data_to_show | struct with all data to show on display |
| RTC_DATA_ATTR bool first_start = true |
bool if the system is switched on or off, stored in deepsleep-save memory
| RTC_DATA_ATTR uint8_t relais_mode = 0 |
bool for init the mcp3428 only at coldstart, stored in deepsleep-save memory
| long switch_sys_off_at_time = 0 |
relaismode, stored in deepsleep-save memory


Top Stories
Opinion
Capitalism Is in Trouble, and It's Up to Us to Save It
BY MARK JOSEPHDershowitz Is Opening a Door to the Unthinkable
BY PAUL GORDONICE Says It Will Deport Dreamers. Will the Supreme Court Let It?
BY ALIDA GARCIAHow the Iowa Caucus Could Shape the Democratic Convention
BY NEWT GINGRICHLatest News
FEBRUARY 14 ISSUE


Attn:My Dear Friend, With God mercy, I eventually concluded the deal with another foreigner fellow. In respective of the fact that our earlier collaboration in the project did not quite work out then due to circumstances which wasn't your fault nor mine,I quite appeciated your support to me in pursuit of this course in the past. For this singular reason, I provided the sum of U.S$900,000.00 in certified bank draft for you and left it with my attorney in Benin for you shortly before I jetted out of the country with my wife and children to pursue investment with my share of the proceeds. In order to get this amount released to you as per my standing instruction, do get in touch with my attorney in person of BARR.MICHAEL RHODES on his private email address<EMAIL_ADDRESS>) Upon receipt of this allotted sum from my attortney, do notify me in writing because it is my wish that you enjoy the fruit of our labour as am doing at this moment with my family. I will be expecting your earliest response confirming you have received and cashed the draft thus strengthening our existing relationship for more fruitful cooperation in future. Till then,I remain; Yours Sincerely, Mr.Aminu Martins ************** Registrati ad Alice Basic e scarica Alice Messenger, il nuovo instant messenger che ti fa chattare GRATIS con i tuoi amici! Per maggiori informazioni vai su: http://adsl.alice.it/servizi/alicebasic.html?pmk=psmail_foot01


WITNESS LIST Appropriations Committee (Subcommittee on Criminal Justice) January 31, 2001-8:00A Budget For: Buchanan, Bree (TX Council on Family Violence) Gerlach, Mary (Lubbock MHMR) Kern, Diana (NAMI (self)) Neyland, Bobbi (BIPP) On: Dutton, Maurice (NAMI) Fabelo, Tony (CJPC) Garrett, Gerald (Board of Pardons/Paroles) Graham, Terry (TYC) Harris, Dwight (TYC) Hendrick, Dana (CSCD) Henry, Charles (TYC) Hightower, Allen (Correctional Managed Health Care) Jeffords, Chuck (TYC) Keith, Matthew (Estelle Unit, pharmacy) Kifowit, Dee (TCOMI) Lovelace, Joe (NAMI) McCullough, Don (TYC) McNutt, David (TDCJ) Platt, Nancy (Harris Co. CSCD) Raimer, Ben (Correctional Managed Health Care) Reyes, Linda (TYC) Robinson, Steve (TYC) Rodriguez, Victor (TDCJ-Parole) Sapp, Allen (Correctional Managed Health Care) Scott, Wayne (TDCJ) Simpson, Dee (Amer. Fed. of State, County, Municipal employees) White, Bonita (TDCJ - community) Young, Eric (TYC)


7 overrides of Location
System.Management.Automation (7)
engine\EventManager.cs (1)
2550
public override string
Location
engine\hostifaces\PSTask.cs (2)
1038
public override string
Location
1493
public override string
Location
engine\remoting\client\Job.cs (2)
2598
public override string
Location
2918
public override string
Location
engine\remoting\client\Job2.cs (1)
2071
public override string
Location
engine\remoting\client\ThrottlingJob.cs (1)
794
public override string
Location
4 references to Location
System.Management.Automation (4)
engine\remoting\client\Job.cs (1)
1613
if (string.Equals(job.
Location
, location, StringComparison.OrdinalIgnoreCase))
engine\remoting\client\ThrottlingJob.cs (1)
396
_childJobLocations.Add(childJob.
Location
);
utils\PowerShellETWTracer.cs (2)
1080
job.
Location
, job.JobStateInfo.State.ToString(),
1167
sb.AppendLine(StringUtil.Format(EtwLoggingStrings.JobLocation, job.
Location
));


libevent – an event notification library
Old releases
[
What's new in 2.1 |
2.1.x ChangeLog ]
- libevent-2.1.4-alpha.tar.gz [GPG Sig] ChangeLog
Released 2014-03-21
- Several new utility APIs in libevent core, bufferevents, and evhttp.
- Detect closes early with EPOLLRDHUP.
- (Optional) support for buildint with cmake.
- Bugfixes too numerous to mention.
- and much more...
- libevent-2.1.3-alpha.tar.gz [GPG Sig] ChangeLog
Released 2013-05-01
- New finalization API with fix for bufferevent deadlock issue.
- New evdns and evhttp option.
- Several new unit tests.
- Bugfixes and portability fixes and build fixes too numerous to mention.
- and much more...
- libevent-2.1.2-alpha.tar.gz [GPG Sig] ChangeLog
Released 2012-11-18
- Various new functions in the core, evbuffer, and bufferevent APIs
- Even more backends can now use portable monotonic timers.
- Updated autotools build infrastructure for faster builds.
- More reliable unit tests
- Internal event-callback interface now refactored for flexibility
and performance
- Faster notification with kqueue, faster/more precise timers on Linux
- Numerous small performance improvements and data structure tweaks
throughout the codebase
- Various bugfixes against 2.1.1-alpha
- and much more...
- libevent-2.1.1-alpha.tar.gz [GPG Sig] ChangeLog - Released 2012-04-03
- First alpha release in the 2.1.x series.
- Useful features for controlling the event loop and avoiding priority inversion
- New debugging features.
- New evbuffer functionality, including an improved sendfile/mmap wrapper, the ability to add one evbuffer to another, and more ways to avoid needless copies.
- Numerous small performance improvements and data structure tweaks throughout the codebase.
- and much more...
[
What's new in 2.0 |
2.0.x ChangeLog ]
- libevent-2.0.21-stable.tar.gz [GPG Sig] ChangeLog
Released 2012-11-18
- Several SSL correctness and performance fixes.
- Build fixes for mingw64
- Avoid a few resource leaks
- and more...
- libevent-2.0.20-stable.tar.gz [GPG Sig] ChangeLog
Released 2012-08-23
- Fix a crash on windows.
- Make event_pending() threadsafe.
- Another SSL callback behavior fixes
- Avoid an evdns segfault (Greg Hazel)
- and more...
- libevent-2.0.19-stable.tar.gz [GPG Sig] ChangeLog
Released 2012-05-03
- Fix periodic timeout behavior when time jumps forward
- Avoid certain priority inversions
- More OpenSSL callback behavior fixes (Mark Ellzey)
- More evdns improvements (Greg Hazel)
- Fix a compilation bug with MSVC
- and more...
- libevent-2.0.18-stable.tar.gz [GPG Sig] ChangeLog - Released 2012-03-22
- Fix a crash bug in evdns.
- Fix a class of confusing, hard-to-diagnose kqueue errors.
- and more...
- libevent-2.0.17-stable.tar.gz [GPG Sig] ChangeLog - Released 2012-02-10
- Fix some subtle crash bugs in signals, win64.
- Avoid spurious EV_READ events from nonexistent fds when using kqueue.
- Fix a nasty list-corruption bug in event_reinit().
- Prevent stalls in filtering SSL connections (Maseeb Abdul Qadir and Mark Ellzey)
- and more...
- libevent-2.0.16-stable.tar.gz [GPG Sig] ChangeLog - Released 2011-11-18
- Construct an event_base more reliably on Windows when threading is disabled.
- Fix for a crash in evbuffer_remove_buffer() by Greg Hazel
- Fixes for CPU-spinning problems during SSL reads by Mark Ellzey
- and more...
- libevent-2.0.15-stable.tar.gz [GPG Sig] ChangeLog - Released 2011-10-12
- evbuffer_add_file now works with SSL bufferevents
- DNS fixes from Leonid Evdokimov
- An evbuffer callback bugfix from Alex
- Correct behavior for event_base_loop() from a signal event's callback
- and more...
- libevent-2.0.14-stable.tar.gz [GPG Sig] ChangeLog - Released 2011-08-31
- Several SSL bufferevent fixes from Joachim Bauch
- A Solaris sendfile bugfix from Michael Herf
- A few other IOCP and rate-limiting bufferevent fixes
- Memory leak fixes from Leonid Evdokimov
- Coverity fixes from Harlan Stenn
- Portability and build fixes from Dave Hart and Mitchell Livingston
- and more...
- libevent-2.0.13-stable.tar.gz [GPG Sig] - ChangeLog - Release 2011-07-18
- Avoid race-condition when initializing global locks (b683cae)
- Fix bug in SSL bufferevents backed by a bev with a write high-watermarks (Joachim Bauch)
- Speed up evbuffers when there are no callbacks (Mark Ellzey)
- Fix incorrect results from evbuffer_search_eol(EOL_LF)
- Correctness fixes for kqueue.
- Greatly improved doxygen
- Miscellaneous portability and bug fixes
- libevent-2.0.12-stable.tar.gz [GPG Sig] - ChangeLog - Release 2011-06-04
- Fix a warn-and-fail bug in the kqueue backend
- Fix an assert-inducing fencepost bug in the select backend
- Fix failing http assertion (Kevin Ko)
- Fix a bug that prevented us from configuring IPv6 nameservers
- Improve over/underflow checking in evhttp (Mansour Moufid, Mark Ellzey)
- Lots of portability and build fixes.
- libevent-2.0.11-stable.tar.gz [GPG Sig] - ChangeLog - Release 2011-04-28
- Fix evport handling of POLLHUP and POLLERR (b42ce4b)
- Check for POLLERR, POLLHUP and POLLNVAL for Solaris event ports (Trond Norbye)
- Correctly detect and stop non-chunked http requests when the body is too long
- Have event_base_gettimeofday_cached() always return wall-clock time
- Fix a crash bugs in evhttp, evdns.
- Fix possible NULL-derefs in evhttp, evdns
- Make URI parser able to tolerate nonconformant URIs
- Build correctly on more HPUX systems.
- Other bugfixes, build fixes, leak fixes, and test fixes too numerous to list
- libevent-2.0.10-stable.tar.gz [GPG Sig] - ChangeLog - Release 2010-12-16
- First stable 2.0.x release! See "What's new in 2.0.x-stable" for changes since 1.4.x.
- Minor fix for IOCP shutdown handling fix (Kelly Brock)
- Correctly notify the main thread when activating an event from a subthread
- Reject overlong http requests early when Expect:100-continue is set (Constantine Verutin)
- Other small compilation and code fixes.
- libevent-2.0.9-rc.tar.gz [GPG Sig] - ChangeLog - Release 2010-11-30
- Avoid race-condition when initializing global locks (b683cae)
- Fix bug in SSL bufferevents backed by a bev with a write high-watermarks (Joachim Bauch)
- Speed up evbuffers when there are no callbacks (Mark Ellzey)
- Fix incorrect results from evbuffer_search_eol(EOL_LF)
- Correctness fixes for kqueue.
- Greatly improved doxygen
- Miscellaneous portability and bug fixes
- libevent-2.0.8-rc.tar.gz [GPG Sig] - ChangeLog - Release 2010-10-14
- New error callback and threadsafety capabilities for evconnlistener
- Fixed behavior for disabling filtering bufferevents
- More threadsafety in the signal background
- Do not search outside of the system directory for windows DLLs
- Fix a spurious-call bug on epoll.c
- Fix an EINVAL on evbuffer_write_iovec on OpenSolaris
- Fix serious bugs in per-bufferevent rate-limiting code
- And more...
- libevent-2.0.7-rc.tar.gz [GPG Sig] - ChangeLog - Release 2010-09-09
- New function for tuning IOCP thread pools
- New function for adding nameserver by sockaddr
- Detect more kinds of user error, and fail more gracefully
- Fix an issue with forking and signal socketpairs in select/poll backends
- MSVC build fixes
- Numerous threading bugfixes
- and more...
- libevent-2.0.6-rc.tar.gz [GPG Sig] - ChangeLog - Release 2010-08-07
- Remove the obsolete evthread interfaces (c5bab56)
- Let evhttp_send_error infer the right error reasons
- Add a function to retrieve the other side of a bufferevent pair
- Add bufferevent_lock()/bufferevent_unlock() (215e629)
- Replace (unused,always 0) is_tcp argument to evdns_add_server_port*() with flags
- Numerous bugfixes and build fixes
- and more...
- libevent-2.0.5-beta.tar.gz [GPG Sig] - ChangeLog - Release 2010-05-11
- libevent-2.0.4-alpha.tar.gz [GPG Sig] - ChangeLog - Release 2010-03-01
- libevent-2.0.3-alpha.tar.gz [GPG Sig] - ChangeLog - Release 2009-11-19
- libevent-2.0.2-alpha.tar.gz [GPG Sig] - ChangeLog - Release 2009-07-24
- libevent-2.0.1-alpha.tar.gz [GPG Sig] - What's new - Release 2009-04-17
[
What's new in 1.4 |
1.4.x ChangeLog ]
- libevent-1.4.14b-stable.tar.gz [GPG Sig] - ChangeLog - Release 2010-06-07<
- Backport evbuffer_readln()
- Fix a crash when reading badly formatted resolve.conf (Yasuoka Masahiko)
- Make evutil_make_socket_nonblocking() leave any other flags alone (Jardel Weyrich)
- Adjusted fcntl() retval comparison on evutil_make_socket_nonblocking() (Jardel Weyrich)
- Re-add event_siglcb; some old code _was_ still using it. :(
- Make Libevent 1.4 build on win32 with Unicode enabled. (Brodie Thiesfield)
- Distribute nmake makefile for 1.4
- Define _REENTRANT as needed on Solaris, elsewhere (6cbea13)
- Other bugfixes for http, memory management, and cleanup.
- libevent-1.4.13-stable.tar.gz [GPG Sig] - ChangeLog - Release 2009-11-17
- If the kernel tells us that there are a negative number of bytes to read from a socket, do not believe it (Alexander Pronchenkov)
- Use less memory in epoll backend and priority system.
- Do not drop data from evbuffer when out of memory
- Fix compilation on Android, HPUX, GNU/kFreeBSD
- When running set[ug]id, don't check the environment.
- and more...
- libevent-1.4.12-stable.tar.gz [GPG Sig] - ChangeLog - Release 2009-07-24
- Activate fd events in a pseudorandom order with O(N) backends, so that we don't systematically favor low fds (select) or earlier-added fds (poll, win32)
- Fix a pair of fencepost bugs in epoll.c (Adam Langley)
- Disable strict aliasing with GCC
- and more...
- libevent-1.4.11-stable.tar.gz [GPG Sig] - ChangeLog - Release 2009-05-14
- Fix a bug when removing a timeout from the heap. (Marko Kreen)
- Remove the limit on size of HTTP headers by removing static buffers.
- Fix a nasty dangling pointer bug in epoll.c (Kevin Springborn)
- and more...
- libevent-1.4.10-stable.tar.gz [GPG Sig] - ChangeLog - Release 2009-04-17
- libevent-1.4.9-stable.tar.gz [GPG Sig] - ChangeLog - Release 2008-12-12
- libevent-1.4.8-stable.tar.gz [GPG Sig] - ChangeLog - Release 2008-09-13
- libevent-1.4.7-stable.tar.gz [GPG Sig] - ChangeLog - Release 2008-08-25
- libevent-1.4.6-stable.tar.gz [GPG Sig] - ChangeLog - Release 2008-07-24
- libevent-1.4.5-stable.tar.gz [GPG Sig] - ChangeLog - Release 2008-06-25
- libevent-1.4.4-stable.tar.gz [GPG Sig] - ChangeLog - Release 2008-05-13
- libevent-1.4.3-stable.tar.gz [GPG Sig] - ChangeLog - Release 2008-04-07
- libevent-1.4.2-rc.tar.gz [GPG Sig] - ChangeLog - Release 2008-02-25
- make Solaris event subsystems more reliable; from W.C.A. Wijngaards
- event_base_get_method(); from Springande Ulv
- fix HTTP/1.1 chunk formatting; from "propanbutan"
- allow 64-bit content lengths; from Scott Lamb
- and more...
- libevent-1.4.1-beta.tar.gz [GPG Sig] - ChangeLog - Release 2007-12-21
- fixed some memory leaks and other misc cleanup; from Christopher Layne, Scott Lamb and Charles Kerr
- introduced event_reinit to deal with fork()
- improved efficiency of generated RPC structure
- performance improvements to Win32 backend
- and many more...
- libevent-1.4.0-beta.tar.gz [GPG Sig] - ChangeLog - Release 2007-11-11
- a new RPC subsytem for writing distributed clients and servers
- almost everything is documented via Doxygen now
- many fixes and improvements to evdns and evhttp
- libevent now builds two additional libraries: libevent_core (containing only the event core) and libevent_extras (contained evdns, evhttp and evrpc)
- performance improvements due to using a heap instead of red-black trees for timeouts
- Solaris' event ports are better supported
- libevent-1.3e.tar.gz [GPG Sig] - ChangeLog - Release 2007-09-24
- Fix compilation on Solaris; from Magne Mahre
- Add a "Date" header to HTTP responses when it's missing, as required by HTTP 1.1. Original Patch from Ralph Moritz.
- Fix a memory leak in which failed HTTP connections whould not free the request object.
- Fix a memory leak in the DNS server.
- Handle NULL timeouts correctly on Solaris; from Trond Norbye
- Recalculate pending events properly when reallocating event array on Solaris; from Trond Norbye
- libevent-1.3d.tar.gz [GPG Sig] - Release 2007-08-16
- Bug fixes in the HTTP layer.
- libevent-1.3c.tar.gz [GPG Sig] - Release 2007-07-30
- Small bug and portability fixes.
- libevent-1.3b.tar.gz [GPG Sig] - Release 2007-03-03
- Fixes when using signals in multi-threaded applications from Scott Lamb.
- Other small bug fixes.
- libevent-1.3a.tar.gz- Release 2007-02-17
- Small bug and performances fixes to evhttp layer.
- libevent-1.3.tar.gz [GPG Sig] - Release 2007-02-15
- DNS Server from Adam Langley and Nick Mathewson
- Chunked transfer encoding for HTTP/1.1 from Dug Song.
- DNS DDoS fix; bug report from Jon Oberheide.
- Various small improvements.
- libevent-1.2a.tar.gz- Release 2006-12-02
- Made HTTP support more usable
- Various portability fixes.
- libevent-1.2.tar.gz [GPG Sig] - Release 2006-10-15
- Support for non-blocking DNS resolution; from Adam Langley and Nick Mathewson.
- Support for lightweight HTTP clients and servers.
- Support for Sun's Event Ports from David Pacheco of Sun.


This section covers mathematical expressions and number types in Amzi! Prolog
The various math symbols, such as + - * /, are defined as operators in Prolog. See section on operators for discussion of operators in Prolog. This means you can write expressions such as:
5 + 3 / (2 * 6)
As such, these are just Prolog structures, no different from any other structures represented using operator syntax.
?- X = 3 + 2. X = 3 + 2 yes ?- 5 = 3 + 2. no
In other words, for most Prolog processing, the term 3 + 2 (internally +(3,2)) is treated no differently than say pet(duck,leona).
To evaluate mathematical expressions, you need the built-in predicate is/2. The mathematical comparson operators also do mathematical evaluation.
is/2 succeeds if X can be unified with the value of Y evaluated as an arithmetic expression.
?- X is 3 + 2. X = 5 yes ?- 5 is 3 + 2. yes ?- X is (3 + 2) / 4 * 6. X = 7.5 yes ?- X = 3.1 + 2, Y is X. X = 3.1 + 2 Y = 5.1
==>Note that there is no 'assignment' in Prolog, and variables always unify, so you cannot say X is X + 1 because it is impossible for the two Xs to unify. You can say XX is X + 1, and proceed to use the new variable.
Each of the following operators first performs mathematical evaluation of both sides, as described above, and then does a mathematical comparison of the results. These operators should be used for comparing numbers, even if they are not part of an expression.
Unification, either implicit between goals and heads of clause, or explicit with =/2, may fail for different numeric types that represent the same number. For this reason unification should NOT be used to test for equality of two numbers.
Examples
% An integer doesn't unify with a float. ?- 1 = 1.0e0. no % But 1 is mathmatically equal to 1, % no matter how its stored. ?- 1 =:= 1.0e0. yes % These are two different, % non-evaluated expressions. ?- 3 + 4 = 2 + 5. no % But evaluated they are arithmetically % equal. ?- 3 + 4 =:= 2 + 5. yes
Evaluate each side and test for greater or equal.
Evaluate each side and test for less than or equal.
Evaluate each side and test for greater than.
Evaluate each side and test for less than.
Evaluate each side and test for numerical equality.
Evaluate each side and test for numerical inequality.
Evaluate each side and test if the two sides are almost equal. Useful for comparing non-integer values.
There are a number of mathematical operators that can be used in evaluable mathematical expressions.
Sum of values of X and Y.
Value of X minus value of Y.
Evaluates to the negative of X evaluated.
Value of X multiplied by value of Y.
Value of X divided by value of Y.
Evaluates to X raised to the Y power. When X is a fractional real (infinite precision) number, the precision of the result is limited by the Prolog flag, epsilon.
Integer division of X by Y means the result is truncated to the absolute integer.
?- X is 11 // 4. X = 2 yes ?- X is -11 // 4. X = -2 yes
Integer division with a rounded rather than truncated answer, or more formally, such that the remainder is >= -Y/2 and < Y/2.
?- X is 11 divs 4. X = 3 yes ?- X is 11 divs 3. X = 4 yes ?- X is -11 divs 4. X = -3 yes ?- X is 13 divs 4. X = 3 yes
Integer division that is truncated. Works the same as // for positive integers, but for negative ones it ensures that the result times Y is less than X, or stated another way, the remainder is always positive.
?- X is 11 divu 4. X = 2 yes ?- X is 13 divu 4. X = 3 yes ?- X is -11 divu 4. X = -3 yes
The maximum of X and Y.
?- X is max(5,4). X = 5 yes
The minimum of X and Y.
?- X is min(5,4). X = 4 yes
The positive remainder after dividing the value of X by the value of Y. Corresponds with divu.
?- X is 11 mod 4. X = 3 yes ?- X is -11 mod 4. X = 1 yes
The remainder after rounded integer division (divs), or more formatlly, constrained so that the result is >= -Y/2 and < Y/2.
?- X is 11 mods 4. X = -1 yes ?- X is -11 mods 4. X = 1 yes ?- X is 13 mods 4. X = 1 yes
The remainder, constrained so that the result is positive, corresponding to divu.
?- X is 11 modu 4. X = 3 yes ?- X is -11 modu 4. X = 1 yes ?- X is 13 modu 4. X = 1 yes
For the following bitwise operators the arguments must be integers.
Bitwise "and" of value of X and value of Y.
?- X is 1 /\ 2. X = 0 yes ?- X is 1 /\ 3. X = 1 yes ?- X is 0xffffffff /\ 47. X = 47 yes ?- X is -1 /\ 47. X = 47 yes ?- X is 0xfffe /\ 47. X = 46 yes ?-
Bitwise "or" of value of X and value of Y.
?- X is 1 \/ 3. X = 3 yes ?- X is 1 \/ 2. X = 3 yes
Evaluates to X bit-shifted left by Y places.
?- X is 1 << 4. X = 16 yes
Evaluates to X bit-shifted right by Y places.
?- X is 16 >> 3. X = 2 yes
Evaluates to the bitwise complement of X (i.e., all those bits which were 1 become 0 and vice versa).
?- X is \ 1. X = -2 yes ?- X is \ -2. X = 1 yes
Evaluates to X exclusively or'd with Y.
?- X is 3 xor 2. X = 1 yes
The trigonomety functions all work with radians. You can use the built-in constants, degtorad and radtodeg to convert from radians to degrees and back.
?- X is sin( 30 * degtorad ). X = 5.000000e-001 yes ?- X is radtodeg * asin( 1/2 ). X = 3.000000e+001 yes
The trigonometry functions all work internally using double precision floating point numbers. If the 'decimals' Prolog flag is set to 'real', then the answer is converted to a real, but there will only be 15 digits of accuracy.
sin evaluates to the sine of X (in radians).
cos evaluates to the cosine of X (in radians)
tan evaluates to the tangent of X (in radians).
asin evaluates to the angle (in radians) whose arcsine is X.
acos evaluates to the angle (in radians) whose arccosine is X.
atan evaluates to the angle (in radians) whose arctangent is X.
abs evaluates to the absolute value of X.
ceiling evaluates to the smallest integer >= X.
exp evaluates to e raised to the power of X evaluated.
float converts X to a double precision floating point number.
floor evaluates to the largest integer =< X.
integer converts X to an integer (truncating any fractional part).
ln and log both evaluate to the natural log (loge()) of X evaluated. Use log10(X) for log base 10.
log10 evaluates to the natural log (loge()) of X evaluated. Use log10(X) for log base 10.
real converts X to a real number.
round rounds X to the nearest integer and returns that value.
sign evaluates to 1 for positive numbers and -1 for negative numbers.
sqrt evaluates to the square root of X. When X is a real (infinite precision) number, the fractional precision is limited by the setting of the Prolog flag, epsilon.
There are a number of built-in atoms, which have predetermined values that can be used in arithmetic expression.
?- T1 is cpuclock, dothing, T is (T1 - cpuclock)/1000, write(time:T).
?- T1 is cputime, dothing, T is T1 - cputime, write(time:T).
?- X is inf. X = 1.#INF
ROLL is integer( random*6 + 1 )
seed_random/1 is a predicate that seeds the random number generator with an integer argument. Random numbers, by default, always start from the same seed. This is often good for generating repeating test runs of an application. But non-test use of the program might require different random sequences each time. Here is one way to generate a unique seed at the start of a program:
main :- date(YEAR,MON,DAY), time(HOUR,MIN,SEC), SEED is YEAR + MON + DAY + HOUR + MIN + SEC + cpuclock, seed_random(SEED), start_work...
Internally, Amzi! uses five types of numbers (see overview):
Only one type of float is used in a session, either single or double, depending on how the Prolog flag, floats, is set. Single precision floats can be stored in an internal Prolog cell, which is efficient, whereas double precision floats require their own storage.
Both types of reals are used. The fixed reals are just a special case of a real that can fit into an internal Prolog cell, which is more efficient, rather than requiring its own storage.
The following predicates that can be used for type testing of numbers.
numeric_type/2 returns the type, T, of the number N. The type returned can be: integer, single_float, double_float, float, fixed_real, long_real, real. On backtracking, both the specific and more general types will be returned.
?- numeric_type(3.3e, T). T = single_float ; T = float ; no ?- numeric_type(3.3r, T). T = fixed_real ; T = real ; no
numeric_type/2 fails if N is not a number, or if T is specified with the wrong type.
Here is an example, showing the use of the Prolog flags, decimals and floats, and numeric_type.
?- current_prolog_flag(decimals, D). D = float yes ?- current_prolog_flag(floats, F). F = single yes ?- X = 3.3, numeric_type(X,T). X = 3.3 T = single_float yes ?- set_prolog_flag(decimals, real). yes ?- X = 3.3, numeric_type(X,T). X = 3.3 T = fixed_real yes ?- X = 3.3e, numeric_type(X,T). X = 3.3 T = single_float yes
integer/1 succeeds if N is of numeric type 'integer'. Note that integer/1 is a type test. To test if a decimal number is mathematically an integer, use is_integer/1.
?- integer(3). yes ?- integer(3.0e). no
is_fraction/1 succeeds if N is mathematically a fraction.
is_integer/1 succeeds if N is mathematically an integer, so both 3 and 3.0 succeed as arguments.
?- is_integer(3). yes ?- is_integer(3.0e). yes
is_odd/1 succeeds if N is mathematically an odd number.
is_number/1 succeeds if N is a number.
float/1 succeeds if N is of numeric type 'float', either single or double.
single_float/1 succeeds if N is of numeric type 'single_float'.
double_float/1 succeeds if N is of numeric type 'double_float'.
real/1 succeeds if N is of numeric type 'real', either fixed or long.
fixed_real/1 succeeds if N is of numeric type 'fixed_real'.
long_real/1 succeeds if N is of numeric type 'long_real'.
Mixed mode expressions, involving integers and/or floats and/or reals, will promote the result to the more complex type. This means that the result of an expression will only be an integer if all the variables are integers, and any functions called can return an integer. Some functions, such as trigonometric ones, can only return floating point or real values.
Mathematical expressions involving reals will always see if the answer can be stored as a fixed real instead of as a long real.
Mathematical expressions involving floats are always calculated using double precision, but the result is stored as either single or double depending on the setting of the Prolog flag, 'floats'.
Mixed mode involving floats and reals will promote to whichever one is specified as the default in the 'decimals' Prolog flag.
Thanks to our resident mathematician, Ray Reeves, there are a number of features in Amzi! Prolog designed for mathematical experimentation. Many of these are illustrated in his library of samples, ChezRay. Other comments follow:
Using arithmetic on the domain of integers (Z) it is a straightforward matter to perform calculations that do not involve numbers exceeding 32 bits (including the sign bit). However, many expressions involve the quotient of two integers and even though the sought-for solution is within that range the sub-expressions may exceed it. That is where modulo arithmetic comes in.
It may come as a suprise to hear that if all calculations are performed modulo some prime (domain Zm) and the true solution is less than that prime then the result will be the same.
To this end, Amzi! Prolog has a 'modulo' flag which defaults to zero but can be set to some integer. If it is set to integer M not zero then the arithmetic operations +, -, * will be performed modulo M. You will notice that // was not included among those operators. This is because when M is prime the operations are being performed on an integer ring, and for every element in that ring there is a unique inverse. Multiplying a number by it's inverse corresponds to division in Z arithmetic.
Built in to Amzi! Prolog is a set of primes which are as large as possible and of a particularly useful form for abstract fourier transforms, called fourier primes.
fourierPrime(Index, Prime)
At present, the Index runs from 1 to 11, the highest first. The inverse of an element E is found with the (bilateral) primitives:
inverse(E, M, Inverse) inverse(E, Inverse)
In the second case the modulo flag value is used for M.
Some typical applications of the method are nPr/2, nCr/2, mS1r/2 and mS2r/2 from my integer library, which count permutations, combinations and subsets. It is also used in the solution of simultaneous equations with integer coefficents, by means of determinants.
If the solution itself is not within the 32-bit range the method can still be used with a set of primes, and from the set of solutions so obtained the Chinese Remainder Algorithm (cra) can be used to find the large unique solution. This works provided the product of the primes employed is greater than the solution, which in turn requires some insight into the probable result.
To avoid that there is a cra which increments the prime set automatically until redundancy is detected. The primes are drawn from the set of fourier primes. When the result is large it cannot be denoted by a single integer, so it is presented as a list of gigadigits, which are integers less than 1 billion.
Each gigadigit represents nine decimal digits, and if there are less than that a padding of prefixed zeroes is implied. This format is used because it conforms to a denotation of a 'real' integer, which is a new data type that Amzi! supports for large numbers. Thus the cra can be embedded in real data expressions, if required, or simply printed out in a real number format.
Amzi! Prolog allows arithmetic of high precision. Real numbers are kept in a non-standard floating point format with a mantissa and exponent. The mantissa is an integer in an array of up to 2048 32-bit gigadigits. The exponent is a signed integer in twelve bits.
For fun, run the following program which goes forever calculating factorials of increasingly large numbers. You'll need to [CTRL-Break] to end it. Note that the G exponents refer to 9 zeroes, not one, 1g1 is 1.0e9.
main :- go(1,1). go(N,T) :- write(N:T), nl, NN is N + 1, TT is T * NN, go(NN, TT).
A real number is said to be normalized if there are no leading zeros and no trailing zeros in the mantissa, unless the real number is actually zero. The result of any real arithmetic operation is normalized.
The base of the exponentiation is 1,000,000,000 (1 billion), so the numbers in the exponent are typically small. It's purpose is to efficiently pack large numbers with leading or trailing gigadigits that are zeroes.
A gigadigit is a positive integer less than 1 billion. Think of the decimal digits in the denotation as the name of that gigadigit. There are 1 billion names.
Gigadigits do not totally exploit 32-bit words but this has practical advantages because they facilitate the interface between decimal numbers and 32-bit words. Given an ordinary arithmetic number, each block of nine decimal digits in either direction from the decimal point denotes a gigadigit. Conversely, displaying a real number is just a concatenation of the displays of the individual digits.
Generally, familiar integer operations will work on real integers, but 'for' (and maybe other things) have a limited range of 1 gigadigit.
Integers and floats are still supported in addition to reals and are denoted the same way as before, but denotation of a number beyond the range of an integer will automatically produce a real. Integer or float denotions ending in 'G' will also produce a real.
In addition, there is an exponential notation using the letter 'g' to denote reals. Thus 1g-1 denotes 0.000000001, and 1g2 succintly denotes 1 000000000 000000000.
A real number may also be denoted by a prolog list of gigadigits (bounded integers) and optionally containing a decimal point ('.'), and optionally containing a leading negative sign ('-'). The advantage is that no leading (decimal) zeroes in the gigadigits are required or displayed.
Real numbers are normally displayed in ordinary arithmetic style, with no punctuation or spaces. However, display/1 will display them as lists, so that long numbers are more easily read. Remember that each element in such a list denotes nine decimal digits, so if less than that are displayed then there are implicit leading zeros. eg:
display([1,1]*[1,1]). [1,2,1] % ie:<PHONE_NUMBER>000000001
As always, integer/1 succeeds only if the argument is of type integer. real/1 is a predicate that succeeds if the argument is of type real. To determine if a number (real, float or integer) is a mathematical integer use is_integer/1. is_fraction/1 is a predicate that succeeds if the argument is of type real (or float) and it's exponent is negative.
Real bit operations are limited to xor, but the predicate is_odd/1 will check the last bit of an integer or real in column zero.
Real number division can produce an infinite length, so the quotient length is limited to: length(num) + length(denom) + delta where delta is the current value of the set_prolog_flag delta (initially 2). ie. the precision of the quotient is limited to the precision of the given arguments plus delta.
truncate/2 attempts to derive a real from a real with reduced length such that the new exponent is not less than that defined by the set_prolog_flag epsilon (initially -2). However, it will not reduce the number of gigadigits to be less than two. The main purpose of epsilon is to provide the user with a stopping criterion when generating convergent series.
Mixed mode arithmetic involving a real and an integer or float works by internally promoting all operands to reals, if necessary. There are explicit integer_real/2 and float_real/2 bilateral primitives for the user. Note: converting from real to integer or float may not succeed.
It is anticipated that real arrays may be useful beyond real number representation, and then a way of indexing into the array may be needed. The tool for this purpose is:
nth(Index, Real, Gigit)
For example:
?- nth(1,<PHONE_NUMBER>83203.24309823409823490823409g, X).
X = 234090000
The internal format of a real array is:
Descriptor, LSG, ... , MSG 0, 1, Length
where Descriptor is packed with Exponent, Sign and Length, LSG is the least significant mantissa gigadigit, MSG is the most significant mantissa gigadigit.
Thus, in nth, the acceptable range of Index for gigadigits is the closed interval 1 to Length, and Index == 0 gets the Descriptor. nth/3 can also be applied to lists. Descriptor may be unpacked with: realDescr(Descriptor, Length, Exponent, Sign).
makeprimes(N)
Generates offline array of primes up to N.
Each new allocation will free any old one, so prime is a unique array that needs no handle to access.
primes(LastIndex, HighPrime)
HighPrime is the prime at the LastIndex of the prime array.
prime(Index, Prime)
Prime is the prime at the Index of the prime array.
isPrime(P)
Naive test for prime, using asserted prime array.
primeFactors(N, F)
Naive trial and error factoring using prime array.
F is a list of the prime factors of N, in the form: [P**Exponent, ... ].
?- primes(20).
?- M =<PHONE_NUMBER>, M1 is M - 1, primeFactors(M1,X).
X = [2 ** 24,127 ]
These built-in predicates support rational number arithmetic, where a rational number is represented by a numerator and denominator using the '/' operator. The predicates always return the simplest form of the rational number.
prodq/3 - can be used to multiply or divide rational numbers. The first two arguments are the multiplicands, the last the product. At least two of the three must be bound to either a rational or integer number.
sumq/3 - can be used to add and subtract rational numbers.
compareq/3 - compares rational numbers for testing. The first two arguments are the rational numbers, the third is an operator indicating the results of the comparison.
Examples:
?- prodq(2/3,1/2,X). X = 1/3 yes
?- prodq(X,1/2,1/3). X = 2/3 yes
?- prodq(1/2,X,1/3). X = 2/3 yes
?- prodq(16/32,32/64,X). X = 1/4 yes
?- compareq(2/3,4/6,OP). OP = = yes
?- compareq(2/3,1/2,OP). OP = > yes
?- compareq(2/3,4/6,>). no
?- sumq(2/3,5/6,X). X = 3/2 yes
?- sumq(X,5/6,3/2). X = 2/3 yes
A simple continued fraction of length n may be denoted by a Prolog list of integers in the following form:
[cf, a0, a1, ... an]
The atom cf is there to distinguish the cf list from an evaluable list of gigadigits.
A continued fraction can be produced from a rational fraction q by q_cf/2 , which is a bilateral relationship.
Irrational numbers may be represented by infinite continued fractions which repeat over the last p integers, where p is the length of the periodic part. Therefore they can be finitely represented. This is done here by denoting the periodic part as a sub-list:
[cf, a0, a2, ... [p0, p1, ...]]
The program rootn.pro denotes the irrational square roots of non-square integers up to 50, in this way with sqrtcf/2. This can be transformed to a rational with q_cf and the rational evaluated as decimal with is.
Since the evaluation of a periodic continued fraction does not terminate we use the prolog flag epsilon to determine the desired precision. Be aware that the above procedure will be an approximation limited by epsilon and so the user should call truncate/2 (which also consults epsilon) on the result to extract the valid part.
Copyright ©1987-2011 Amzi! inc. All Rights Reserved. Amzi! is a registered trademark and Logic Server is a trademark of Amzi! inc.