public interface ServletRequest
ServletRequest
object and passes it as an argument to the servlet's service
method.
A ServletRequest
object provides data including parameter name and values, attributes, and an input
stream. Interfaces that extend ServletRequest
can provide additional protocol-specific data (for
example, HTTP data is provided by HttpServletRequest
.
HttpServletRequest
| Modifier and Type | Method and Description |
|---|---|
AsyncContext |
getAsyncContext()
Gets the AsyncContext that was created or reinitialized by the most recent invocation of
startAsync() or
startAsync(ServletRequest,ServletResponse) on this request. |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the value of the named attribute as an
Object , or null if no attribute of the given
name exists. |
java.util.Enumeration<java.lang.String> |
getAttributeNames()
Returns an
Enumeration containing the names of the attributes available to this request. |
java.lang.String |
getCharacterEncoding()
Returns the name of the character encoding used in the body of this request.
|
int |
getContentLength()
Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not
known or is greater than Integer.MAX_VALUE.
|
long |
getContentLengthLong()
Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not
known.
|
java.lang.String |
getContentType()
Returns the MIME type of the body of the request, or
null if the type is not known. |
DispatcherType |
getDispatcherType()
Gets the dispatcher type of this request.
|
ServletInputStream |
getInputStream()
Retrieves the body of the request as binary data using a
ServletInputStream . |
java.lang.String |
getLocalAddr()
Returns the Internet Protocol (IP) address representing the interface on which the request was received.
|
java.util.Locale |
getLocale()
Returns the preferred
Locale that the client will accept content in, based on the Accept-Language
header. |
java.util.Enumeration<java.util.Locale> |
getLocales()
Returns an
Enumeration of Locale objects indicating, in decreasing order starting with the
preferred locale, the locales that are acceptable to the client based on the Accept-Language header. |
java.lang.String |
getLocalName()
Returns the fully qualified name of the address returned by
getLocalAddr() . |
int |
getLocalPort()
Returns the Internet Protocol (IP) port number representing the interface on which the request was received.
|
java.lang.String |
getParameter(java.lang.String name)
Returns the value of a request parameter as a
String , or null if the parameter does not
exist. |
java.util.Map<java.lang.String,java.lang.String[]> |
getParameterMap()
Returns a java.util.Map of the parameters of this request.
|
java.util.Enumeration<java.lang.String> |
getParameterNames()
Returns an
Enumeration of String objects containing the names of the parameters contained
in this request. |
java.lang.String[] |
getParameterValues(java.lang.String name)
Returns an array of
String objects containing all of the values the given request parameter has, or
null if the parameter does not exist. |
java.lang.String |
getProtocol()
Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion,
for example, HTTP/1.1.
|
java.lang.String |
getProtocolRequestId()
Obtain the request identifier for this request as defined by the protocol in use.
|
java.io.BufferedReader |
getReader()
Retrieves the body of the request as character data using a
BufferedReader . |
java.lang.String |
getRemoteAddr()
Returns the Internet Protocol (IP) of the remote end of the connection on which the request was received.
|
java.lang.String |
getRemoteHost()
Returns the fully qualified name of the address returned by
getRemoteAddr() . |
int |
getRemotePort()
Returns the Internet Protocol (IP) source port the remote end of the connection on which the request was received.
|
RequestDispatcher |
getRequestDispatcher(java.lang.String path)
Returns a
RequestDispatcher object that acts as a wrapper for the resource located at the given path. |
java.lang.String |
getRequestId()
Obtain a unique (within the lifetime of the Servlet container) identifier string for this request.
|
java.lang.String |
getScheme()
Returns the name of the scheme used to make this request, for example,
http , https , or
ftp . |
java.lang.String |
getServerName()
Returns the host name of the server to which the request was sent.
|
int |
getServerPort()
Returns the port number to which the request was sent.
|
ServletConnection |
getServletConnection()
Obtain details of the network connection to the Servlet container that is being used by this request.
|
ServletContext |
getServletContext()
Gets the servlet context to which this ServletRequest was last dispatched.
|
boolean |
isAsyncStarted()
Checks if this request has been put into asynchronous mode.
|
boolean |
isAsyncSupported()
Checks if this request supports asynchronous operation.
|
boolean |
isSecure()
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.
|
void |
removeAttribute(java.lang.String name)
Removes an attribute from this request.
|
void |
setAttribute(java.lang.String name,
java.lang.Object o)
Stores an attribute in this request.
|
void |
setCharacterEncoding(java.lang.String env)
Overrides the name of the character encoding used in the body of this request.
|
AsyncContext |
startAsync()
Puts this request into asynchronous mode, and initializes its
AsyncContext with the original (unwrapped)
ServletRequest and ServletResponse objects. |
AsyncContext |
startAsync(ServletRequest servletRequest,
ServletResponse servletResponse)
Puts this request into asynchronous mode, and initializes its
AsyncContext with the given request and
response objects. |
java.lang.Object getAttribute(java.lang.String name)
Object
, or null
if no attribute of the given
name exists.
Attributes can be set two ways. The servlet container may set attributes to make available custom information about a
request. For example, for requests made using HTTPS, the attribute
jakarta.servlet.request.X509Certificate
can be used to retrieve information on the certificate of the
client. Attributes can also be set programmatically using setAttribute(java.lang.String, java.lang.Object)
. This allows
information to be embedded into a request before a RequestDispatcher
call.
Attribute names should follow the same conventions as package names. This specification reserves names matching
java.*
, javax.*
, and sun.*
.
name
- a String
specifying the name of the attributeObject
containing the value of the attribute, or null
if the attribute does not
existjava.util.Enumeration<java.lang.String> getAttributeNames()
Enumeration
containing the names of the attributes available to this request. This method
returns an empty Enumeration
if the request has no attributes available to it.Enumeration
of strings containing the names of the request's attributesjava.lang.String getCharacterEncoding()
null
if
no request encoding character encoding has been specified. The following methods for specifying the request character
encoding are consulted, in decreasing order of priority: per request, per web app (using
ServletContext.setRequestCharacterEncoding(java.lang.String)
, deployment descriptor), and per container (for all web
applications deployed in that container, using vendor specific configuration).String
containing the name of the character encoding, or null
if the request does
not specify a character encodingvoid setCharacterEncoding(java.lang.String env) throws java.io.UnsupportedEncodingException
env
- String
containing the name of the character encoding.java.io.UnsupportedEncodingException
- if this ServletRequest is still in a state where a character encoding may be
set, but the specified encoding is invalidint getContentLength()
long getContentLengthLong()
java.lang.String getContentType()
null
if the type is not known.String
containing the name of the MIME type of the request, or null if the type is not knownServletInputStream getInputStream() throws java.io.IOException
ServletInputStream
. Either this method or
getReader()
may be called to read the body, not both.ServletInputStream
object containing the body of the requestjava.lang.IllegalStateException
- if the getReader()
method has already been called for this requestjava.io.IOException
- if an input or output exception occurredjava.lang.String getParameter(java.lang.String name)
String
, or null
if the parameter does not
exist. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in
the query string or posted form data.
You should only use this method when you are sure the parameter has only one value. If the parameter might have more
than one value, use getParameterValues(java.lang.String)
.
If you use this method with a multivalued parameter, the value returned is equal to the first value in the array
returned by getParameterValues
.
If the parameter data was sent in the request body, such as occurs with an HTTP POST request, then reading the body
directly via getInputStream()
or getReader()
can interfere with the execution of this method.
name
- a String
specifying the name of the parameterString
representing the single value of the parametergetParameterValues(java.lang.String)
java.util.Enumeration<java.lang.String> getParameterNames()
Enumeration
of String
objects containing the names of the parameters contained
in this request. If the request has no parameters, the method returns an empty Enumeration
.Enumeration
of String
objects, each String
containing the name of a
request parameter; or an empty Enumeration
if the request has no parametersjava.lang.String[] getParameterValues(java.lang.String name)
String
objects containing all of the values the given request parameter has, or
null
if the parameter does not exist.
If the parameter has a single value, the array has a length of 1.
name
- a String
containing the name of the parameter whose value is requestedString
objects containing the parameter's valuesgetParameter(java.lang.String)
java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.
java.lang.String getProtocol()
String
containing the protocol name and version numberjava.lang.String getScheme()
http
, https
, or
ftp
. Different schemes have different rules for constructing URLs, as noted in RFC 1738.String
containing the name of the scheme used to make this requestjava.lang.String getServerName()
Host
header, or the HTTP/2 authority, or
RFC 7239, otherwise the resolved server name or the server IP
address.String
containing the name of the serverint getServerPort()
Host
header, or HTTP authority, or RFC 7239,
otherwise the server port where the client connection was accepted on.java.io.BufferedReader getReader() throws java.io.IOException
BufferedReader
. The reader translates the
character data according to the character encoding used on the body. Either this method or getInputStream()
may be called to read the body, not both.BufferedReader
containing the body of the requestjava.io.UnsupportedEncodingException
- if the character set encoding used is not supported and the text cannot be
decodedjava.lang.IllegalStateException
- if getInputStream()
method has been called on this requestjava.io.IOException
- if an input or output exception occurredgetInputStream()
java.lang.String getRemoteAddr()
String
containing an IP addressjava.lang.String getRemoteHost()
getRemoteAddr()
. If the engine cannot or chooses
not to resolve the hostname (to improve performance), this method returns the IP address.String
containing a fully qualified name or IP address.void setAttribute(java.lang.String name, java.lang.Object o)
RequestDispatcher
.
Attribute names should follow the same conventions as package names.
If the object passed in is null, the effect is the same as calling removeAttribute(java.lang.String)
.
It is warned that when the request is dispatched from the servlet resides in a different web application by
RequestDispatcher
, the object set by this method may not be correctly retrieved in the caller servlet.
name
- a String
specifying the name of the attributeo
- the Object
to be storedvoid removeAttribute(java.lang.String name)
Attribute names should follow the same conventions as package names. Names beginning with java.*
,
javax.*
, and com.sun.*
, are reserved for use by Sun Microsystems.
name
- a String
specifying the name of the attribute to removejava.util.Locale getLocale()
Locale
that the client will accept content in, based on the Accept-Language
header. If the client request doesn't provide an Accept-Language header, this method returns the default locale for
the server.Locale
for the clientjava.util.Enumeration<java.util.Locale> getLocales()
Enumeration
of Locale
objects indicating, in decreasing order starting with the
preferred locale, the locales that are acceptable to the client based on the Accept-Language header. If the client
request doesn't provide an Accept-Language header, this method returns an Enumeration
containing one
Locale
, the default locale for the server.Enumeration
of preferred Locale
objects for the clientboolean isSecure()
RequestDispatcher getRequestDispatcher(java.lang.String path)
RequestDispatcher
object that acts as a wrapper for the resource located at the given path. A
RequestDispatcher
object can be used to forward a request to the resource or to include the resource in
a response. The resource can be dynamic or static.
The pathname specified may be relative, although it cannot extend outside the current servlet context. If the path
begins with a "/" it is interpreted as relative to the current context root. This method returns null
if
the servlet container cannot return a RequestDispatcher
.
Using a RequestDispatcher, requests may be dispatched to any part of the web application bypassing both implicit (no direct access to WEB-INF or META-INF) and explicit (defined by the web application) security constraints. Unsanitized user provided data must not be used to construct the path passed to the RequestDispatcher as it is very likely to create a security vulnerability in the application.
The difference between this method and ServletContext.getRequestDispatcher(java.lang.String)
is that this method can take a
relative path.
path
- a String
specifying the pathname to the resource. If it is relative, it must be relative
against the current servlet.RequestDispatcher
object that acts as a wrapper for the resource at the specified path, or
null
if the servlet container cannot return a RequestDispatcher
RequestDispatcher
,
ServletContext.getRequestDispatcher(java.lang.String)
int getRemotePort()
java.lang.String getLocalName()
getLocalAddr()
. If the engine cannot or chooses
not to resolve the hostname (to improve performance), this method returns the IP address.String
containing the host name of the IP on which the request was received.java.lang.String getLocalAddr()
String
containing an IP address.int getLocalPort()
ServletContext getServletContext()
AsyncContext startAsync() throws java.lang.IllegalStateException
AsyncContext
with the original (unwrapped)
ServletRequest and ServletResponse objects.
Calling this method will cause committal of the associated response to be delayed until AsyncContext.complete()
is called on the returned AsyncContext
, or the asynchronous operation has timed out.
Calling AsyncContext.hasOriginalRequestAndResponse()
on the returned AsyncContext will return
true
. Any filters invoked in the outbound direction after this request was put into asynchronous
mode may use this as an indication that any request and/or response wrappers that they added during their
inbound invocation need not stay around for the duration of the asynchronous operation, and therefore any of
their associated resources may be released.
This method clears the list of AsyncListener
instances (if any) that were registered with the AsyncContext
returned by the previous call to one of the startAsync methods, after calling each AsyncListener at its
onStartAsync
method.
Subsequent invocations of this method, or its overloaded variant, will return the same AsyncContext instance, reinitialized as appropriate.
java.lang.IllegalStateException
- if this request is within the scope of a filter or servlet that does not support
asynchronous operations (that is, isAsyncSupported()
returns false), or if this method is called again without
any asynchronous dispatch (resulting from one of the AsyncContext.dispatch()
methods), is called outside the
scope of any such dispatch, or is called again within the scope of the same dispatch, or if the response has already
been closedAsyncContext.dispatch()
AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws java.lang.IllegalStateException
AsyncContext
with the given request and
response objects.
The ServletRequest and ServletResponse arguments must be the same instances, or instances of
ServletRequestWrapper
and ServletResponseWrapper
that wrap them, that were passed to the
service
method of the Servlet or the doFilter
method of the Filter,
respectively, in whose scope this method is being called.
Calling this method will cause committal of the associated response to be delayed until AsyncContext.complete()
is called on the returned AsyncContext
, or the asynchronous operation has timed out.
Calling AsyncContext.hasOriginalRequestAndResponse()
on the returned AsyncContext will return
false
, unless the passed in ServletRequest and ServletResponse arguments are the original ones or do not
carry any application-provided wrappers. Any filters invoked in the outbound direction after this request was
put into asynchronous mode may use this as an indication that some of the request and/or response wrappers that they
added during their inbound invocation may need to stay in place for the duration of the asynchronous
operation, and their associated resources may not be released. A ServletRequestWrapper applied during the
inbound invocation of a filter may be released by the outbound invocation of the filter only if the
given servletRequest
, which is used to initialize the AsyncContext and will be returned by a call to
AsyncContext.getRequest()
, does not contain said ServletRequestWrapper. The same holds true for
ServletResponseWrapper instances.
This method clears the list of AsyncListener
instances (if any) that were registered with the AsyncContext
returned by the previous call to one of the startAsync methods, after calling each AsyncListener at its
onStartAsync
method.
Subsequent invocations of this method, or its zero-argument variant, will return the same AsyncContext instance, reinitialized as appropriate. If a call to this method is followed by a call to its zero-argument variant, the specified (and possibly wrapped) request and response objects will remain locked in on the returned AsyncContext.
servletRequest
- the ServletRequest used to initialize the AsyncContextservletResponse
- the ServletResponse used to initialize the AsyncContextjava.lang.IllegalStateException
- if this request is within the scope of a filter or servlet that does not support
asynchronous operations (that is, isAsyncSupported()
returns false), or if this method is called again without
any asynchronous dispatch (resulting from one of the AsyncContext.dispatch()
methods), is called outside the
scope of any such dispatch, or is called again within the scope of the same dispatch, or if the response has already
been closedboolean isAsyncStarted()
A ServletRequest is put into asynchronous mode by calling startAsync()
or
startAsync(ServletRequest,ServletResponse)
on it.
This method returns false if this request was put into asynchronous mode, but has since been dispatched
using one of the AsyncContext.dispatch()
methods or released from asynchronous mode via a call to
AsyncContext.complete()
. If AsyncContext.dispatch()
or AsyncContext.complete()
is called before the
container-initiated dispatch that called startAsync()
has returned to the container then this
method must return true
until the container-initiated dispatch that called
startAsync()
has returned to the container.
boolean isAsyncSupported()
Asynchronous operation is disabled for this request if this request is within the scope of a filter or servlet that has not been annotated or flagged in the deployment descriptor as being able to support asynchronous handling.
AsyncContext getAsyncContext()
startAsync()
or
startAsync(ServletRequest,ServletResponse)
on this request.startAsync()
or
startAsync(ServletRequest,ServletResponse)
on this requestjava.lang.IllegalStateException
- if this request has not been put into asynchronous mode, i.e., if neither
startAsync()
nor startAsync(ServletRequest,ServletResponse)
has been calledDispatcherType getDispatcherType()
The dispatcher type of a request is used by the container to select the filters that need to be applied to the request: Only filters with matching dispatcher type and url patterns will be applied.
Allowing a filter that has been configured for multiple dispatcher types to query a request for its dispatcher type allows the filter to process the request differently depending on its dispatcher type.
The initial dispatcher type of a request is defined as DispatcherType.REQUEST
. The dispatcher type of a
request dispatched via RequestDispatcher.forward(ServletRequest, ServletResponse)
or
RequestDispatcher.include(ServletRequest, ServletResponse)
is given as DispatcherType.FORWARD
or
DispatcherType.INCLUDE
, respectively, while the dispatcher type of an asynchronous request dispatched
via one of the AsyncContext.dispatch()
methods is given as DispatcherType.ASYNC
. Finally, the
dispatcher type of a request dispatched to an error page by the container's error handling mechanism is given as
DispatcherType.ERROR
.
DispatcherType
java.lang.String getRequestId()
There is no defined format for this string. The format is implementation dependent.
java.lang.String getProtocolRequestId()
Examples of protocol provided request identifiers include:
ServletConnection getServletConnection()


Contains R functions for simulating and estimating integer-valued trawl processes as described in the article "Modelling, simulation and inference for multivariate time series of counts using trawl processes" by A. E. D. Veraart (Journal of Multivariate Analysis, 2018, to appear, preprint available at: <https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3100076> ) and for simulating random vectors from the bivariate negative binomial and the bi- and trivariate logarithmic series distributions.
| Version: | 0.2.1 |
| Depends: | R (≥ 3.4.0) |
| Imports: | DEoptim, graphics, MASS, rootSolve, Runuran, squash, stats, TSA |
| Suggests: | knitr, rmarkdown, testthat |
| Published: | 2018-08-16 |
| Author: | Almut E. D. Veraart |
| Maintainer: | Almut E. D. Veraart <a.veraart at imperial.ac.uk> |
| License: | GPL-3 |
| NeedsCompilation: | no |
| Citation: | trawl citation info |
| Materials: | NEWS |
| CRAN checks: | trawl results |
| Reference manual: | trawl.pdf |
| Vignettes: |
Simulation from the bivariate negative binomial and bi- and trivariate logarithmic series distribution Simulation and estimation of an integer-valued trawl process |
| Package source: | trawl_0.2.1.tar.gz |
| Windows binaries: | r-devel: trawl_0.2.1.zip, r-release: trawl_0.2.1.zip, r-oldrel: trawl_0.2.1.zip |
| OS X binaries: | r-release: trawl_0.2.1.tgz, r-oldrel: trawl_0.2.1.tgz |
Please use the canonical form https://CRAN.R-project.org/package=trawl to link to this page.


The History of Computer Science and Programming Languages
3 Facts about Computer Programming and Languages
The first Programming language ever designed was called John Mulachey's Short Code and was proposed in 1949
There are ten thousands of different programming languages, it's like the human language, there's no way to know how many there are
The first computer science degree program in the United States was formed at Purdue University in 1962
BASIC
BASIC was designed by John G. Kemeny and Thomas E. Kurtz at Dartmouth College
BASIC became widely used on microcomputers in the mid 70s to 80s
Having an easy to learn language such as BASIC allowed a variety of people to develop their own softeare on computers they could afford
The language was developed for students and people that didn't specialize in science and mathematics to use computers.
Java
Java is a general-purpose computer programming language that is conccurrent, class-based, and object oriented
It is intended to let application developers "write once, run everywhere"
Java apps are designed to work on any computer that contains a Java virtual machine regardless of the type of computer and how it is constructed
Javais one of the most popular programming languages currently in use, especially for client-server web applications
Developed by James Gosling at Sun Microsystems and released in 1995, you can clearly see that the languages syntax is primarily derived from C and C++
Python
Python is a high-level, general-purpose, interpreted, and dynamic programming language
The design is emphasizes code readability and it's syntax allows you to do more, while writing less lines than in C++ or Java
Python code can be packaged into stand-alone executable packages so that Python-based software can be used on enviroments without a Python interpreter
Python was created in the late 80s by Guido van Rossum at Centrum Wiskunde & Informatica, it was not implemented until December 1989
Ruby
Ruby is a dynamic, reflected, object-oriented, and genera-purpose programming language
Ruby was designed and developed in the mid-1990s by Yukihiro "Matz" Matsumoto
Ruby was influenced by Perl, Smalltalk, Eiffel, Ada, and Lisp
The syntax of Ruby shows strong similarities to Perl and Python
C++
C++ is a general-purpose programming language which has imperative, object-oriented and generic programming features
C++ has been found useful in many different contexts, with key strengths being software infrastructure and preformance-critical applications
C++ is a compiled language, with implementations of it available on many platforms provided by various organizations
C++ was developed by Bjarne Stroustrup at Bell Labs in 1979, as an extension of the C language, as he wanted an efficient and flexible language similar to C, which also provided feature for program orginization
C++ influenced many well known programming languages, such as Perl, Java, Lua, Python, and PHP
HTML
HTML (HyperText Markup Language) is the standard markup language used to create web pages
Commonly used with CSS (Cascading Style Sheets) and JavaScript, HTML is a cornerstone technology used to create a majority of all websites
HTML describes the structure of a website semantically while CSS includes cues for the presentation and appearance of the document
HTML provides a means to create structured documents by denoting strucural semantics for text such as heading, paragraphs, lists, links, quotes and other items
In 1980 physicist Tim Berners-Lee proposed and prototyped a system for CERN researchers to use and share documents, in 1989 Berners-Lee wrote a memo proposing an Inernet-based hypertext system later known as HTML
Bash
Bash is a Unix shell and command language written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell
First released in 1989, Bash has been distributed widely as it as a default shell on the major Linux distributions and OS X
Bash is a command processor which runs in a text window, where users type commands that cause actions, Bash can read commands from a file, browse directories and many other things
The keywords, syntax, and other basic features of the language were all copied from sh


SwiftyTesseractRTE
SwiftyTesseractRTE can only currently be used in portrait mode.
About SwiftyTesseractRTE
SwiftyTesseractRTE (SwiftyTesseract Real-Time Engine) is a real-time optical character recognition library built on top of SwiftyTesseract.
| Swift Version | SwiftyTesseractRTE Version |
|---|---|
| 4.0 | 1.x.x |
| 4.1 | 1.x.x |
| 4.2 | 2.x.x |
Using SwiftyTesseractRTE in Your Project
Import the neccessary modules
import SwiftyTesseract
import SwiftyTesseractRTE
Create an instance of RealTimeEngine and assign it’s regionOfInterest property.
var realTimeEngine: RealTimeEngine!
@IBOutlet weak var previewView: UIView!
@IBOutlet weak var regionOfInterest: UIView! // A subview of previewView
override func viewDidLoad() {
let swiftyTesseract = SwiftyTesseract(language: .english)
realTimeEngine = RealTimeEngine(swiftyTesseract: swiftyTesseract, desiredReliability: .verifiable) { recognizedString in
// Do something with the recognized string
}
}
override func viewDidLayoutSubviews() {
// Must occur during viewDidLayoutSubviews() - Autolayout constraints are not set in viewDidLoad()
realTimeEngine.bindPreviewLayer(to: previewView)
realTimeEngine.regionOfInterest = regionOfInterest.frame
// Only neccessary if providing a visual cue where the regionOfInterest is to your end user
previewView.addSublayer(regionOfInterest.layer)
}
Optical Character Recognition and Camera Preview
SwiftyTesseractRTE allows for showing the camera preview without constantly attempting to recognize text. This allows you to let your end user to line up the text to be scanned before starting the scan. The recognitionIsActive
property is set to true
by default, so to prevent a scan from starting immediately, set recognitionIsActive
to false after instantiating RealTimeEngine
and before calling startPreview()
. Calling stopPreview()
also prevents recognition from being attempted because there are no inbound camera frames to be scanned.
Starting and Stopping Recognition
// Starts optical character recognition
realTimeEngine.recognitionIsActive = true
// Stops optical character recognition
realTimeEngine.recognitionIsActive = false
Starting and Stopping Camera Preview
// Starts camera preview
realTimeEngine.startPreview()
// Stops camera preview
realTimeEngine.stopPreview()
Camera Permissions
For camera permissions, you will need to add the Privacy - Camera Usage Description
permission to your Info.plist
file. If you are using the default SwiftyTesseractRTE AVManager
implementation, permission will be requested at the time the camera preview is being generated. If a custom implementation of AVManager
is provided, then it will be up to the developer to implement the permission request. For most use cases, the default AVManager
implementation is preferred and a custom implementation should only be provided if access to CMSampleBuffer
s are needed from the camera at the same time that SwiftyTesseractRTE is being run for OCR.
RealTimeEngine onRecognitionComplete
closure property
Starting in SwiftyTesseractRTE 2.0, the SwiftyTesseractRTEDelegate protocol has been replaced in favor of a closure property called onRecognitionComplete
with a type of ((String) -> ())?
. This can be assigned in a few ways:
Trailing Closure on Instantiation
RealTimeEngine(swiftyTesseract: swiftyTesseract, desiredReliability: .verifiable) { recognizedString in
// Do something with the recognized string
}
Passing a Function Parameter
RealTimeEngine(swiftyTesseract: swiftyTesseract, desiredReliability: .verifiable, onRecognitionComplete: aFunction)
Property Injection
let realTimeEngine = RealTimeEngine(swiftyTesseract: swiftyTesseract, desiredReliability: .verifiable)
// Anonymous closure
realTimeEngine.onRecognitionComplete = { recognizedString in
// Do something with the recognized string
}
// Named closure
realTimeEngine.onRecognitionComplete = aFunction
A Note about Portrait-Only
SwiftyTesseractRTE is currently only able to utilized in portrait mode, but that does not mean your entire app also has to be portrait mode only. See the example project’s AppDelegate (specifically the addition of a shouldRotate
boolean member variable and the implementation of application(_:supportedInterfaceOrientationsFor:)
) and ViewController files (specifically the viewWillAppear()
and viewWillDisappear()
methods) for an example on how to make a single view controller portrait mode only.
Installation
CocoaPods
Tested with pod --version
: 1.3.1
# Podfile
use_frameworks!
target 'YOUR_TARGET_NAME' do
pod 'SwiftyTesseractRTE', '~> 2.0'
end
Replace YOUR_TARGET_NAME
and then, in the Podfile
directory, type:
$ pod install
Setting Up SwiftyTesseract for Use in SwiftyTesseractRTE
See SwiftyTesseract’s Additional Configuration section on properly setting up SwiftyTesseract to be utilized in your project.
Documentation
Official documentation for SwiftyTesseractRTE can be found here
Contributions Welcome
Contributions are always welcome! Please refer to Contributing to SwiftyTesseractRTE for the full guidelines on creating issues and opening pull requests to the project.


featuresExtraction module¶
-
featuresExtraction.
dirExtractBPM
(folder)[source]¶ Generate a list of BPM of each song in the given folder
Parameters: folder (str) – Folder with audio file to extract BPMs Return list: List of BPMs of every song in the folder
-
featuresExtraction.
dirsExtractBPM
(dataset_folder)[source]¶ Folder with sub-folder to extract all the BPMs
Parameters: dataset_folder (str) – Folder with folder of audio files Return list: List ob BPMs of all the songs in the sub-folders
-
featuresExtraction.
extractBPM
(x)[source]¶ Extract the BPM from the list of samples of an audio file. It tries to use essentia, if it is not installed then it used librosa.
Parameters: x (list) – List of samples from an audio file Return float: BPM of the samples of the audio file
-
featuresExtraction.
extractFeatures
(Fs, x, mtWin, mtStep, stWin, stStep)[source]¶ Extract 71 feature of a singe audio file where x are the sample and Fs the frequency rate.
Parameters: Return list: List of 71 features
-
featuresExtraction.
extractFeaturesFolder
(dataset_csv=’CSV/beatsdataset.csv’, dataset_folder=’/Users/Capa/Datasets/beatsdataset/’, mtWin=1, mtStep=1, stWin=0.05, stStep=0.05)[source]¶ MAIN METHOD. Extracts 71 audio features from every audio file in the dataset_folder. Write the result in the dataset_csv file which is a pandas.DataFrame. The dataset_folder must have audio files classified in sub-folders and the name of the class is the name of the sub-folder which contains them.
Parameters: - dataset_csv (str) – File to write the pandas.DataFrame with features and labels
- dataset_folder (str) – Folder with the audio samples to extract features from them
- mtWin (float) – Size of mid term analysis windows
- mtStep (float) – Step of mid term analysis windows
- stWin (float) – Size of short term analysis windows
- stStep (float) – Step of short term analysis windows
Returns: DataFrame with the classes and 71 features for each audio file
-
featuresExtraction.
fileExtractBPM
(fileRoute)[source]¶ It gets the BPM from an audio file
Parameters: fileRoute (str) – Audio file to extract BPM Return float: BPM of the audio file
-
featuresExtraction.
pyAudioFeatures
(dataset_csv=’CSV/beatsdataset.csv’, dataset_folder=’/Users/Capa/Datasets/beatsdataset/’, mtWin=1, mtStep=1, stWin=0.05, stStep=0.05)[source]¶ This method extracts the pyAudioAnalysis features from all the dataset given and it saves them in a .csv file using pandas.
Parameters: - dataset_csv (str) – File to write the dataset extraction of features
- dataset_folder (str) – Folder containing the dataset, with one folder for each class
- mtWin (float) – Size of the mid term analysis window
- mtStep (float) – Size of the step of the analysis mid term window
- stWin (float) – Size of the short term analysis window
- stStep (float) – Size of the step of the analysis short term window
Return pandas.DataFrame: DataFrame object with features and labels of the dataset
-
featuresExtraction.
query_yes_no
(question, default=’yes’)[source]¶ Ask a yes/no question via raw_input() and return their answer.
“question” is a string that is presented to the user. “default” is the presumed answer if the user just hits <Enter>.
It must be “yes” (the default), “no” or None (meaning an answer is required of the user).The “answer” return value is True for “yes” or False for “no”.


WebGL canvas with depth video frame texture:
gl.readPixels and show in 2D canvas
Depth Capture Demo
Capture device with depth stream
Render depth
Background removal
Color stream is displayed over depth that is aligned to color:
background video
background color


I'm a coder, designer, entrepreneur, and rising junior at Olin College. I'm interested in design for accessibility, civic technology, predictive diagnostics, and educational reform. I believe strongly in antidisciplinary work. In my free time I like to paint and explore Boston.


|
|
Package consumer contains interface for any consumer that is able to
process messages. It also contains implementation of Kafka consumer.
|
package consumer
import (
"context"
"github.com/Shopify/sarama"
"github.com/rs/zerolog/log"
"github.com/RedHatInsights/insights-results-aggregator/broker"
"github.com/RedHatInsights/insights-results-aggregator/producer"
"github.com/RedHatInsights/insights-results-aggregator/storage"
"github.com/RedHatInsights/insights-results-aggregator/types"
)
|
Consumer represents any consumer of insights-rules messages
|
type Consumer interface {
Serve ( )
Close ( ) error
ProcessMessage ( msg * sarama . ConsumerMessage ) ( types . RequestID , error )
}
|
KafkaConsumer in an implementation of Consumer interface
Example:
kafkaConsumer, err := consumer.New(brokerCfg, storage)
if err != nil {
panic(err)
}
kafkaConsumer.Serve()
err := kafkaConsumer.Stop()
if err != nil {
panic(err)
}
|
type KafkaConsumer struct {
Configuration broker . Configuration
ConsumerGroup sarama . ConsumerGroup
Storage storage . Storage
numberOfSuccessfullyConsumedMessages uint64
numberOfErrorsConsumingMessages uint64
ready chan bool
cancel context . CancelFunc
payloadTrackerProducer * producer . KafkaProducer
}
|
DefaultSaramaConfig is a config which will be used by default
here you can use specific version of a protocol for example
useful for testing
|
var DefaultSaramaConfig * sarama . Config
|
New constructs new implementation of Consumer interface
|
func New ( brokerCfg broker . Configuration , storage storage . Storage ) ( * KafkaConsumer , error ) {
return NewWithSaramaConfig ( brokerCfg , storage , DefaultSaramaConfig )
}
|
NewWithSaramaConfig constructs new implementation of Consumer interface with custom sarama config
|
func NewWithSaramaConfig (
brokerCfg broker . Configuration ,
storage storage . Storage ,
saramaConfig * sarama . Config ,
) ( * KafkaConsumer , error ) {
if saramaConfig == nil {
saramaConfig = sarama . NewConfig ( )
saramaConfig . Version = sarama . V0_10_2_0
if brokerCfg . Timeout > 0 {
saramaConfig . Net . DialTimeout = brokerCfg . Timeout
saramaConfig . Net . ReadTimeout = brokerCfg . Timeout
saramaConfig . Net . WriteTimeout = brokerCfg . Timeout
}
}
consumerGroup , err := sarama . NewConsumerGroup ( [ ] string { brokerCfg . Address } , brokerCfg . Group , saramaConfig )
if err != nil {
return nil , err
}
payloadTrackerProducer , err := producer . New ( brokerCfg )
if err != nil {
log . Error ( ) . Err ( err ) . Msg ( "unable to construct producer" )
return nil , err
}
consumer := & KafkaConsumer {
Configuration : brokerCfg ,
ConsumerGroup : consumerGroup ,
Storage : storage ,
numberOfSuccessfullyConsumedMessages : 0 ,
numberOfErrorsConsumingMessages : 0 ,
ready : make ( chan bool ) ,
payloadTrackerProducer : payloadTrackerProducer ,
}
return consumer , nil
}
|
Serve starts listening for messages and processing them. It blocks current thread.
|
func ( consumer * KafkaConsumer ) Serve ( ) {
ctx , cancel := context . WithCancel ( context . Background ( ) )
consumer . cancel = cancel
go func ( ) {
for {
|
Consume should be called inside an infinite loop, when a
server-side rebalance happens, the consumer session will need to be
recreated to get the new claims
|
if err := consumer . ConsumerGroup . Consume ( ctx , [ ] string { consumer . Configuration . Topic } , consumer ) ; err != nil {
log . Fatal ( ) . Err ( err ) . Msg ( "unable to recreate kafka session" )
}
|
check if context was cancelled, signaling that the consumer should stop
|
if ctx . Err ( ) != nil {
return
}
log . Info ( ) . Msg ( "created new kafka session" )
consumer . ready = make ( chan bool )
}
} ( )
|
Await till the consumer has been set up
|
log . Info ( ) . Msg ( "waiting for consumer to become ready" )
<- consumer . ready
log . Info ( ) . Msg ( "finished waiting for consumer to become ready" )
|
Actual processing is done in goroutine created by sarama (see ConsumeClaim below)
|
log . Info ( ) . Msg ( "started serving consumer" )
<- ctx . Done ( )
log . Info ( ) . Msg ( "context cancelled, exiting" )
cancel ( )
}
|
Setup is run at the beginning of a new session, before ConsumeClaim
|
func ( consumer * KafkaConsumer ) Setup ( sarama . ConsumerGroupSession ) error {
log . Info ( ) . Msg ( "new session has been setup" )
|
Mark the consumer as ready
|
close ( consumer . ready )
return nil
}
|
Cleanup is run at the end of a session, once all ConsumeClaim goroutines have exited
|
func ( consumer * KafkaConsumer ) Cleanup ( sarama . ConsumerGroupSession ) error {
log . Info ( ) . Msg ( "new session has been finished" )
return nil
}
|
ConsumeClaim starts a consumer loop of ConsumerGroupClaim's Messages().
|
func ( consumer * KafkaConsumer ) ConsumeClaim ( session sarama . ConsumerGroupSession , claim sarama . ConsumerGroupClaim ) error {
log . Info ( ) .
Int64 ( offsetKey , claim . InitialOffset ( ) ) .
Msg ( "starting messages loop" )
latestMessageOffset , err := consumer . Storage . GetLatestKafkaOffset ( )
if err != nil {
log . Error ( ) . Msg ( "unable to get latest offset" )
latestMessageOffset = 0
}
for message := range claim . Messages ( ) {
if types . KafkaOffset ( message . Offset ) <= latestMessageOffset {
log . Warn ( ) .
Int64 ( offsetKey , message . Offset ) .
Msg ( "this offset was already processed by aggregator" )
}
consumer . HandleMessage ( message )
session . MarkMessage ( message , "" )
if types . KafkaOffset ( message . Offset ) > latestMessageOffset {
latestMessageOffset = types . KafkaOffset ( message . Offset )
}
}
return nil
}
|
Close method closes all resources used by consumer
|
func ( consumer * KafkaConsumer ) Close ( ) error {
if consumer . cancel != nil {
consumer . cancel ( )
}
if consumer . ConsumerGroup != nil {
if err := consumer . ConsumerGroup . Close ( ) ; err != nil {
log . Error ( ) . Err ( err ) . Msg ( "unable to close consumer group" )
}
}
if consumer . payloadTrackerProducer != nil {
if err := consumer . payloadTrackerProducer . Close ( ) ; err != nil {
log . Error ( ) . Err ( err ) . Msg ( "unable to close payload tracker Kafka producer" )
}
}
return nil
}
|
GetNumberOfSuccessfullyConsumedMessages returns number of consumed messages
since creating KafkaConsumer obj
|
func ( consumer * KafkaConsumer ) GetNumberOfSuccessfullyConsumedMessages ( ) uint64 {
return consumer . numberOfSuccessfullyConsumedMessages
}
|
GetNumberOfErrorsConsumingMessages returns number of errors during consuming messages
since creating KafkaConsumer obj
|
func ( consumer * KafkaConsumer ) GetNumberOfErrorsConsumingMessages ( ) uint64 {
return consumer . numberOfErrorsConsumingMessages
}
|


|
ID
|
Employee
|
Date
|
Description
|
Actions
|
|---|---|---|---|---|
| {{i+1}} | {{entry.name}} | {{entry.telephonenumber}} | {{entry.billingaddress}} | Edit |
Name, Billing Address and Mobile number is mendatory.


Try it out:
Write
Animate All
Fast
Slow
Write Sequentially
Write Simultaneous
?
🔄
⬤
⬤
⬤
⬤
⬤
⬤
◐
◒
◑
📜


Projects
Agenda Management
React, Django, PostgreSQL, IIS
The Agenda Management software is designed to assist governments of all sizes in the preparation,
approval, creation, publishing, recording, and archiving of official Board meetings. The system
allows for an organization to allow different departments to enter their desired agenda items,
which then flow through a completely customizable workflow for needed approvals.
The system allows for the production of PDFs for each agenda item, the agenda list, the minutes,
any supporting documents, and conversion of any attachments to PDF. Those PDFs and agendas
are also uploaded to a public site to comply with any publication requirements that may exist.
Five Star Ordering
React, Django, PostgreSQL, PythonAnywhere
The Five Star ordering system is a fixed-rate restaurant online ordering platform that supports
both pickup and delivery orders. It allows for address verification and integrates with Stripe
payment processing. The platform allows new restaurants to be added with zero additional coding
and can be completed as quickly as a few hours.
Position Control
Django, React, Microsoft SQL, IIS
The Position Control system is designed to handle the tracking and paperwork for all employee
records. It handles all paperwork including new hires, job changes, termination, and more.
It also handles the creation and budgeting of new positions. It allows approval on both the
department and administration level. It also handles automatic creation
of Active Directory user accounts and uses Active Directory for user authentication.
The Finance department can use the system to calculate labor costs for individual departments or
the whole county, and projects future budgets.
Work Experience
Software Developer,
Hall County Government
2019 - Current
- Developed internal and external systems to manage Hall County’s day to day business needs.
- Management systems include Agenda, Personnel, Fleet, Finance, Policies, and IT Access.
- Started new Enterprise Application Development division from the ground up.
- Made foundational decisions on tools, design paradigms, methodology, and stack.
- Implemented thorough and robust error, tracking, and development lifecycle tools.
- Maintained thorough documentation for users, admins, and future developers through comments.
- Installed, configured, and managed development, staging, and production servers.
Systems Technician,
Hall County Government
2018
- Co-managed enterprise Active Directory environment with 1300 end units plus other hardware.
- Used scripting in order to increase speed of deployments, software installation, and repairs.
- Co-managed Windows Servers under guidance of Systems Administrator, including IIS & SQL.
Remote and In Store Repair Technician and Leader,
Geek Squad
2014 - 2017
- Assisted clients remotely with repairs, including malware and Windows and macOS issues.
- Achieved Rock Star status from first week in remote. (NPS 95.5, Resolves per hour 1.74)
- Championed improvement of process quality to provide better client experiences.
- Educated agents in the tools and strategies to improve efficiency and quality.
- Acted as Sales Floor Leader. Regularly handles delicate issues throughout store.
- Managed, with guidance, scheduling and staffing, including helping with hiring.
Contact Information
Skills
-
React.js, Redux, React Router
-
Python, Django, DRF, Flask
-
Webpack, NPM, Meteor.js
-
PostgreSQL, MS SQL, MongoDB
-
IIS, Ubuntu, wfastcgi
-
Git, GitHub, Jira, Sentry
-
PHP, Java, JSON
Education
-
BS, Computer Science, Univ. of North Georgia
-
TA, Software Engineering, 2020
Open Source Projects
Here are a few open source things I have built.
create-django-react-app
A python package designed to help users set up a Django and React based app,
including the REST framework, JWT based login, and CORS header handling.
PyPi -
GitHub
NertzBoard
NertzBoard is a scoreboard for a multiplayer solitaire game called Nertz. NertzBoard handles the calculations for scoring and
updates the other players in real time to see who is ahead. Players can focus on the action instead of worrying about math.
View -
GitHub
django-bs-icons
A package designed to make it easy for users to display Bootstrap Icons.
PyPi -
GitHub


{% extends "page.html" %} {% block login_widget %} {% endblock %} {% block main %} {% block login %}
The University of Illinois Data Science course uses a JupyterHub Server
to provide an interactive educational experience.
This server application uses github credentials to authenticate valid students.
Contact the instructional staff with any questions.


A WCAG 2.1 Overview
Accessibility criteria aim to make access possible, not pleasant
The new requirements:
The new requirements:
Reflow: low vision
Reflow exceptions
- Tabular data
- Other widgets that rely on 2-dimensional presentation (e.g. a flowchart)
- Toolbars?
Non-text Contrast: low vision
Non-text Contrast exceptions
- Logos
- Text alternative immediately adjacent
- Toolbars?
Text Spacing: cognitive, vision
Text Spacing exceptions
None! :)
Content on Hover or Focus: mobility, vision
Content on Hover or Focus exceptions
- Popups that will never cover other content
- Popups that the user actively opens (e.g. with click, enter, etc.)
Status Messages: low vision
Status Message exceptions
- UI changes that cause a forced context/focus change
- Immediate and successful actions (e.g. opening an accordion does not need a status message)
- Too many or too frequent announcements can be distracting, use with care
Testing and fixing bugs
- Accessibility Insights for Web has 2.1 covered in manual tests
- Come to office hours, or the C&AI Accessibility Teams channel


The true method of knowledge is experiment. - William Blake
Once the numbers started coming in on the two goals I had set up, one being an event, it was time to see about ways to optimize them. I did some usability testing with some of my known visitors and found that when discussing the pages, many had pointed out that they had not noticed the "download post" link I had set up for easy downloads of my posts. In my initial haste to set up the pages I had set up the link but not updated any of the css to make it stand out. In it's original version it the text color is black, no underline and it doesn't really stand out in any way from the rest of the content in any way. Unless the visitor hovered over the link, it was unlikely they would be able to tell that it was a link at all.
First I looked into Google Analytics Content Experiments. Content Experiments allow the developer to create a variant of a webpage and test different variants on users. These experiments report out under the Behavior Tab in Google Analytics under the Experiments view. When I went to check out the view under the Behavior tab, I got the following message, "Google Optimize is the free, preferred way to run experiments. Analytics Content Experiments remain available but are being deprecated in the future. Learn more about Optimize." Google Optimize works with Google Analytics and provides an enhanced experience of what the Content Experiments had provided. Optimize allows the developer to test variants of their web pages on users and reports out which variants performed best.
To hook up Google Optimize, you need the following:
- Google Analytics installed on your website
- The Chrome web browser
- The Optimize Chrome extension
If you have all those set up you can go to Google Optimize and set up an account. Once that is complete just a single line of code needs to be added to your global site tag that you used to set up Google Analytics tracking on the pages you are testing.
A/B Testing
Once the your Google Optimize account is set up and you've created your container for A/B testing, you can start creating a variant. I decided to create a variant of my Post 6 Download Link. The original (Variant A) was features the original version of my link, black, with no underline. Google Optimize allows you to create an other version for page right from the the Optimize page with a visual editor. Once you've created a Variant B you can test the different looks or features on all visitors or customize who gets what view.
I knew I needed to make the "Download Post" link more visible so for my Variant B I brightened up the text color, added an underline to emphasize the link and added the universal icon for downloads.
Further testing determined the changes were beneficial to a visitors chances of seeing the link and clicking on it, which in turn increased the my goal results.


Art is hard. While your first choice should be finding a teammate who is artistic, we don't all have those connections. Luckily, there are free assets out there in the public domain or under the Creative Commons license. As we find good resources, we'll post them here for everyone to see. If you find any good resources, let us know at<EMAIL_ADDRESS>and we'll post them here!
Disclaimer: Free art doesn't mean good art. You should definitely look to find an artistic teammate before you look here.
Huge libarary of spritesheets for almost any type of game. Very impressive. The Common Public license it uses is very similar to public domain, but make sure you read it to fully understand it.
 The animation isn't perfect and nothing is in spritesheet form, but still cool.
Almost entirely classical music, but it's all good and in the public domain
There is a huge variety of surprisingly high-quality music here. Just be careful - nearly every song carries with it a non-commercial clause, which means you probably don't want to use any songs on here if you plan on selling your game after the competition (unless you work out a deal with the author).
A lot of good stuff. The license terms vary by user, so make sure you're following all of the restrictions.


CODE CLASH
Go to Arena
User
's Profile Page
Player Score:
Solo Stats
Solo Wins:
Solo Losses:
Total Solo Attempts:
Percentage Correct:


Integrate line sensors with the robot so that it can follow a line. Then, program the robot to follow a figure eight pattern along a rectangular grid in a robust manner.
Line Tracking Algorithm
We used three line sensors in a row to perform line tracking. We read the output of the three line sensors using analogRead() on pins A0, A1, and A2
These values ranged roughly from 0-1000, with 800-1000 corresponding to the dark floor, and 0-200 corresponding to white line readings.
We wrote a checkSensors() function that reads all of the sensors, and outputs a 1 if the reading is above a threshold, and outputs a 0 if the reading is below. It returns an array of size three. (ex: [1,0,1] if the line is on the middle sensor only)
The threshold we use is 500, which is well in between the ranges for dark and light sensor readings. This can be adjusted for different lighting conditions.
unsigned int * checkSensors() {
static unsigned int sensorValues[NUM_SENSORS]; //declare output array
sensorValues[0] = analogRead(A0);
sensorValues[1] = analogRead(A1);
sensorValues[2] = analogRead(A2);
for (unsigned int i = 0; i < NUM_SENSORS; i++) {
if (sensorValues[i] < THRESHOLD)
sensorValues[i] = 0; //Sees Bright Line
else
sensorValues[i] = 1; //Sees Dark Background
}
return sensorValues;
}
To track the line, we poll the sensors using checkSensors()
If the robot is leaning left, then the first value in the array will be 0
If that is the case, we call our adjustRight(servo_L, servo_R, amount) function to turn the robot slightly right as it moves forward
We can tune the strength of this adjustment by changing the amount value, which can range from 0-90
Similarly, if the robot is leaning right, based on reading the last value of the sensorStatus array, we call adjustLeft(servo_L, servo_R, amount)
Otherwise, if we have the desired [1,0,1] reading, we continue going forward
Line sensor algorithm
Demo:
Figure 8 Traversal
We used our turnRight(servo_L, servo_R), turnLeft(servo_L, servo_R), and moveForward(servo_L, servo_R) functions to write two new motor functions: turnRightIntersection(servo_L, servo_R) and turnLeftIntersection(servo_L, servo_R). When the robot hits an intersection, these two functions will move forward slightly and then perform an in-place 90 degree turn, such that the sensors are realigned with the grid after the turn at intersection.
In order to create the figure-eight pattern, we added a turnCount variable. A figure-eight on the grid consists of 8 turns (4 left followed by 4 right, assuming we start in the middle). Thus, the turnCount variable would increment from 0-7, and if it is less than 4, the robot turns left at the next intersection, and otherwise turns right at the next intersection.
We check the sensors via polling, as there is very little other logic going on in the loop.
If we are not yet at an intersection (in other words checkSensors() does not return [0,0,0]) then we use our line tracking algorithm from the previous section.
The turns are based on delays only, and we rely on our robust line tracking algorithm to get the robot back on track if the turns are a little off. We anticipate that once our robot has more tasks to manage, a turn will be implemented with a hardware interrupt from the middle line sensor.


Symphony
Enter your email address to be sent further instructions for logging in.
Email Address
Send Email
Cancel


7
Biography
Apr. 22, 1842 - Born in Louisville, St. Lawrence, New York, USA
Oct. 1, 1850 - age 8, living with parents in Louisville, NY. .....(1)
Jul. 12, 1860 - age 18, living with parents in Louisville, NY. .....(2)
1861 - age 19, Married Harriet Marie Wilson. .....(5)
1863 - age 21, Shown in Civil War draft registrations records. .....(7)
Jul. 14, 1870 - age 28, living with parents and with wife Harriet, daughter Eveline, and sons Lester, Lorenzo and Edmund in Louisville, NY. .....(3)
Jun. 8, 1880 - age 38, living with father, wife Harriet and six children in Louisville, NY. .....(4)
Jun 15, 1900 - age 58, living with wife Harriet and son Lorenzo on farm in Louisville, NY. .....(5)
Jun, 1, 1905 - age 63, living with wife Harriet and sons Lorenzo and Edwin in Louisville, NY. .....(6)
Feb. 1913 - age 70, Died in Louisville, St. Lawrence, New York, USA. .....(8)(9)
Family
Links
(1) Census US 1850 - Louisville New York
(2) Census US 1860 - Louisville New York
(3) Census US 1870 - Louisville New York
(4) Census US 1880 - Louisville New York
(5) Census US 1900 - Louisville New York
(6) Census NY 1905 - Louisville New York
(7) Civil War Draft Registrations Records - Louisville New York


This survey measures customer satisfaction with service. All information provided is anonymous, and will not be shared with 3rd parties. All fields are required.
Select all the services you have availed of.
1. How satisfied were you with your overall experience?
2. How likely are you to recommend this service to a friend?
3. How satisfied are you with the timeliness of the experience?
4. How friendly were the employees?


 A SONG.
1 On the holy mount stands the city he founded;
2 the LORD loves the gates of Zion
more than all the dwelling places of Jacob.
3 Glorious things of you are spoken,
O city of God.
Selah
4 Among those who know me I mention Rahab and Babylon;
behold, Philistia and Tyre, with Cush—
“This one was born there,” they say.
5 And of Zion it shall be said,
“This one and that one were born in her”;
for the Most High himself will establish her.
6 The LORD records as he registers the peoples,
“This one was born there.”
Selah
7 Singers and dancers alike say,
“All my springs are in you.”


Object#andand
Get Version
1.2.0→ ‘andand’
What
Object#andand lets us write:
@phone = Location.find(:first, ...elided... ).andand.phoneAnd get a guarded method invocation or safe navigation method. This snippet performs a
.find
on the Location class, then sends .phone
to the result if the result is not nil. If the result is nil, then the expression returns nil without throwing a NoMethodError.
We also get an enhanced Object#tap method.
Installing
sudo gem install andand
The basics
Object#andand
Ruby programmers are familiar with the two guarded assignment operators &&=
and ||=
. The typical use for them is when you have a variable that might be nil. For example:
first_name &&= @first_name.trim @phone ||= '612-777-9311'You are trimming the first name provided it isn’t nil, and you are assigning ‘612-777-9311’ to the phone if it is nil (or false, but that isn’t important right now). The other day we were discussing the guards and we agreed that we wished there was a guarded method invocation operator. Here’s an example of when you would use it:
@phone = Location.find(:first, ...elided... )&&.phoneMeaning, search the location table for the first record matching some criteria, and if you find a location, get its phone. If you don’t, get nil. (Groovy provides this exact functionality, although Groovy uses
?.
instead of &&.
) However, &&.
won’t work because &&.
is not a real Ruby operator.
Object#andand let’s us write:
@phone = Location.find(:first, ...elided... ).andand.phoneAnd get the same effect as:
@phone = ->(loc){ loc && loc.phone }.call(Location.find(:first, ...elided... ))Note that because you accept any method using Ruby’s method invocation syntax, you can accept methods with parameters and/or blocks:
list_of_lists.detect { ...elided... }.andand.inject(42) { ...elided ... }Object#andand emphasizes syntactic regularity: the goal was to make an
&&.
operation that worked like &&=
. &&=
looks just like normal assignment, you can use any expression on the RHS, only the semantics are different. The andand method also works just like a normal method invocation, only the semantics are modified.
Enhanced Object#tap
Ruby 1.9 introduces Object#tap. This library implements Object#tap for Ruby 1.8 and enhances it. As in Ruby 1.9, you can call .tap
with a block:
blah.sort.grep( /foo/ ).tap { |xs| p xs }.map { |x| x.blah }But like its sibling
.andand
, you can now call .tap
with a method as well:
[1, 2, 3, 4, 5].tap.pop.map { |n| n * 2 } => [2, 4, 6, 8]
Doctor, it hurts when I do that
Don’t do that!
The popular use case for Object#tap is poor man’s debugging:
blah.sort.grep( /foo/ ).tap { |xs| p xs }.map { |x| x.blah }Perhaps you want to remove the tap, you can delete it:
blah.sort.grep( /foo/ ).tap { |xs| p xs }.map { |x| x.blah }Or, you can change it to
.dont
:
blah.sort.grep( /foo/ ).dont { |xs| p xs }.map { |x| x.blah }Like
.andand
and .tap
, .dont
works with arbitrary methods, not just blocks:
(1..10).to_a.reverse! => [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] (1..10).dont.to_a.reverse! => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
A little more background
Object#andand & Object#me in Ruby explains the original motivations, as well as providing links to similar implementations you may want to consider. A few people have pointed out that Object#andand is similar to Haskell’s Maybe
monad. The Maybe Monad in Ruby is a good introduction for Ruby programmers.
How to submit patches
Read the 8 steps for fixing other people’s code.
The trunk repository is svn://rubyforge.org/var/svn/andand/trunk
for anonymous access.
License
This code is free to use under the terms of the MIT license.
Shout Out
Mobile Commons. Huge.
Contact
Comments are welcome. Send an email to Reginald Braithwaite.
Reginald Braithwaite, 15th February 2008
Theme extended from Paul Battley


From 10 cents to $1.3 million, first Marvel comic sets auction record
by AFPThe first comic book produced by Marvel, the famed US publisher behind Spider-Man, X-Men and The Avengers, went under the hammer Thursday, fetching a record $1.26 million, Heritage Auctions said.
"This is a historic copy of a historic comic book," Ed Jaster, auction house senior vice president, said of the book, which was published in 1939 by Timely Comics, which later became Marvel.
"Without question, this is the granddaddy of all Marvel Comics, without which we would not have the characters and stories we enjoy in today's comics and feature films," Jaster added.
Under the direction of screenwriter Stan Lee, Marvel in the 1960s created superheroes which have become iconic today and whose cinema adaptations have conquered box offices worldwide.
The first copy of "Marvel Comics" was sold in very good condition and well above the price of 10 cents it fetched back in 1939.
"Amazing Fantasy #15," in which Spider-Man first appears, slipped to second-highest Marvel comic ever auctioned, having sold for $1.1 million in 2011.
The most expensive comic book in history remains the first issue of "Action Comics" published in 1938 in which Superman makes his debut. It sold for $3.2 million in 2014.


Hard Cap
$5M
Hard Cap
$5M
Hard Cap
$5M
Contribution Denomination
ETH/USD
Contribution Denomination
ETH
Contribution Denomination
ETH
Participants
Strategic Partners
Participants
Accredited Investors
Participants
Non-US/CA/CN/TW/HK Participants
Period
December 6 - December 15
Period
January 2 - January 19
Period
January 31 - February 28
Min Contribution Amount
50 ETH
Min Contribution Amount
0.1 ETH
Max Contribution Amount
50 ETH
Max Contribution Amount
Determined by # of Registrants


Namespace Vasont.Inspire.Models.Common
Classes
BatchActionResultModelBase
This abstract class defines common model properties to return during a batch action within the application.
ComponentStandards
This class contains constants containing component standards.
CoordinatesModel
This class contains coordinate information and settings to be used by models requiring a graphical interface.
CreatedUpdaterModelBase
This class contains basic created and updater properties for model records.
DeleteResultModelBase
This abstract class defines common model properties to return during a delete action within the application.
DisplayValuePair<N, V>
This class represents a base for displaying a name value pair combination.
ErrorModel
This class represents an error message within the ErrorResponseModel class.
ErrorResponseModel
This class is used as the Error Response Model.
FeatureModel
This class represents a feature for the application.
FileExtensionModel
This class is a model representation of a file extension definition within the application.
LanguageModel
This class represents a supported language definition for the application.
MicroCreatedUpdaterModelBase
This class contains basic created and updater properties for model records.
MinimalLanguageModel
This class represents a minimal representation of a language within the application.
PaginatedQueryRequestModel
This class contains parameters passed to the query for filtering.
TenantDetailModel
This class represents the basic tenant information needed for the web application.


Basic vega-element demo
Load with a URL to the vega or vega-lite specification.
Load with vega or vega-lite specification.
Download a SVG and PNG of the chart while in headless mode
Download SVG
Download PNG


About your service
Provide details about your service and which phase you would like to be assessed for, Alpha, Beta or Live. There are criteria to meet the Digital Service Standard for each phase.
Provide details about your service and which phase you would like to be assessed for, Alpha, Beta or Live. There are criteria to meet the Digital Service Standard for each phase.


- search(HttpServletRequest) - Method in class boundary.Servlet
-
This method receives criteria through the HttpServletRequest
object and uses it to narrow down the list of cars that will
be processed and displayed using FreeMarker in the search.ftl
file.
- sendToLastPage(HttpServletResponse, HttpSession) - Method in class boundary.Servlet
-
This method redirects the user to the last page
they visited (stored in HttpSession object).
- serialVersionUID - Static variable in class boundary.Servlet
-
- Servlet - Class in boundary
-
Servlet class.
- Servlet() - Constructor for class boundary.Servlet
-
- setCarId(int) - Method in class objectlayer.Image
-
This method is the setter for carId.
- setCarID(int) - Method in class objectlayer.Rental
-
This method is the setter for carID.
- setCarType(String) - Method in class objectlayer.Car
-
This method is the setter for carType.
- setColor(String) - Method in class objectlayer.Car
-
This method is the setter for color.
- setDescription(String) - Method in class objectlayer.Car
-
This method is the setter for description.
- setEmail(String) - Method in class objectlayer.User
-
This method is the setter for email.
- setEndDate(String) - Method in class objectlayer.Rental
-
This method is the setter for endDate.
- setFirstName(String) - Method in class objectlayer.User
-
This method is the setter for firstName.
- setId(int) - Method in class objectlayer.Car
-
This method is the setter for id.
- setId(int) - Method in class objectlayer.Image
-
This method is setter for id.
- setId(int) - Method in class objectlayer.Rental
-
This method is the setter for id.
- setId(int) - Method in class objectlayer.User
-
This method is the setter for id.
- setImage(String) - Method in class objectlayer.Image
-
This method is the setter for image.
- setImages(List<Image>) - Method in class objectlayer.Car
-
This method is the setter for images.
- setLastName(String) - Method in class objectlayer.User
-
This method is the setter for lastName.
- setMake(String) - Method in class objectlayer.Car
-
This methd is the setter for make.
- setModel(String) - Method in class objectlayer.Car
-
This method is the setter for model.
- setOwnerId(int) - Method in class objectlayer.Car
-
This method is the setter for ownerId.
- setPassword(String) - Method in class objectlayer.User
-
This method is the setter for password.
- setPhone(String) - Method in class objectlayer.User
-
This method is the setter for phone.
- setPrice(int) - Method in class objectlayer.Car
-
This method is the setter for price.
- setRenterID(int) - Method in class objectlayer.Rental
-
This method is the setter for renteID.
- setStartDate(String) - Method in class objectlayer.Rental
-
This method is the setter for startDate.
- setUsername(String) - Method in class objectlayer.User
-
This method is the setter for username.
- setYear(int) - Method in class objectlayer.Car
-
This method is the setter for year.
- startDate - Variable in class objectlayer.Rental
-


/** * The JavaScript code that creates the firebase map goes between the empty script tags below. */