Counter-Reformation, God's governance
dale
Spring 2021
Created: 2020-10-26 Mon 20:46
Humanity and Divinity of Christ:
- how fit the Catholic humanists in this?
Reason and revelation: (What is true? Path to salvation?)
- cf. bible and tradition vs. bible alone
Works and Grace:
- maintaining a tension,
- cp. Contarini with similar exp. to Luther
Spirit and Structure: canons and "reforms" aimed at structure,
- cf. also the turmoil over Carmelites
Church and State:
- nb that German Lutherans overthrew state authority, tradition that state followed ruler,
- Rome pretensions to the Roman Empire (left over from high middle ages synthesis)
Geneva
- Europe being divided up
- Radical reformation in pockets
- Calvin inherited what Zwingli had begun
- looked on as "the Protestant Rome"
Emphasis
- where Luther's emphasis on grace and justification
- Calvin on covenant (in the lineage of Abraham)
- the government of society bound up with notion of covenant
- a "civil" use of law as well as "theological" (188)
questions/focus
- "reform" as in "reformed life"
- organizing society, community
- what is community?
- 39 articles
- "Puritans"
epithoughts
- "Calvinist in polity" – huge influence on English world
- Knox and Calvin and the "reformed" tradition
- Calvin retreating from France to Geneva
- reading Calvin elicits not an emotional response but a cumulative one from the systematic presentation p 188
- response to (free) grace is a reformed life (thus the name)
- in contrast to Luther's distinction between law and gospel, Calvin thought we stood in the same convenant as Abraham (189)
- "Reflections on how we come to be saved led to the doctrine of predestination (189 ff.)
- https://en.wikipedia.org/wiki/The_Private_Memoirs_and_Confessions_of_a_Justified_Sinner
- theology of sacraments: cf. Martin Bucer (large influence)
- sought position between Luther and Zwingli
Include for Wed. readings
- Westminster confession
- 39 articles
Cp these two influences from Reformed tradition


How do you get to know someone?
You may ask: “Why is meeting people the most important part of learning about a career? Why can’t I just read about careers and find jobs online?”
The “practical” reason: 80% of jobs go to people that employers know personally or through a 3rd party. This is the “hidden job market.” Employees look to people they know first, and to an online job applicant last. Meet people to discover opportunities.
The deeper reason: The people you will meet already have the experience to tell you what skills and expertise you need to develop, and whether or not this career is a good fit for you. But they need to get to know you by meeting face-to-face. Then you can start building skills for careers that fit you, a process that takes a lot of time. Start meeting people as early as possible in your training.
- Use your LinkedIn network, members in professional organizations, or connections from friends of friends to contact
- "Hi, I'm currently a graduate student at ____. I am studying ____ and am really interested in ____. I am exploring non-academic career options and I'd love to hear more about what you do. If you are not too busy, I hope we can find a time to chat, via phone or in person."
- 20-minute phone call or a 30-minute meeting is a reasonable request
- Mention how you found them: If connected through someone you know- mention it!
- Keep the email short
- Email subject is important: Include who you are & what you do
- Emory PhD student requesting information
- Request for career informational interview
- Meeting request: Referred by [mutual acquaintance] for career advice
- Don't look at it as a reporter calling an expert to research an article. Approach it as you would starting a new research project and get the lay of the land.
- Networking is developing relationships with people who share your professional and personal interests, and alerting them to your goals and abilities
- Networking is NOT schmoozing for a job, and it is not restricted to the slick and superficial
- Who is my network? Anybody you know and feel comfortable talking to can be part of your networks!
- Attend local networking events and prepare an "elevator pitch" (see below) that you can use to summarize what your goals are.
- Should mention your title, company, and what you do
- Use transferable skills related to what you want to be doing
- How does your job help people?
- What value do you bring?
- Example: Experienced clinical research investigator with subject matter expertise in psychiatry and neurological disorders. I am driven in increasing the impact of new scientific discoveries to improve patient outcomes. I am most interested in using my scientific expertise to collaborate with healthcare professionals, scientists and non-scientists to increase access to the latest advances in science and medicine.
- What is your mission as a young professional?
- What are you passionate about?
- What’s the kind of work that doesn’t feel like work because you enjoy doing it so much?
- How do you want to make an impact?
- Example: I am driven to increasing the impact of new scientific discoveries to improve patient outcomes. My scientific training includes a variety of competencies in science communication, scientific consultation and technology transfer. My research background includes expertise in substance abuse, depression and PTSD. Through experiences in technology transfer I have also worked on projects to bring new diagnostic tools to market in diabetes research, cancer and HIV. I have 10 years of preclinical experience and 2 years in clinical research which support my understanding of R&D and clinical trials. Currently as a postdoctoral fellow, I am part of a clinical research study identifying biomarkers that can improve PTSD diagnosis. I enjoy collaborating with key opinion leaders in research and healthcare to successfully implement a multi-site clinical study.
- Contacting their Membership Coordinator and requesting a phone appointment. Let them know you'd like to get involved and let them know your career path. They will suggest ways for you to take on leadership roles, and you'll be jumpstarting your networking and your involvement in the field.
- Posting your resume/ CV in their "banks" and check job postings that may not be publicized elsewhere.
- Checking out the member directory and seeing where the members work. Identify people you may be interested in collaborating with.
- For more info see this article
- Email<EMAIL_ADDRESS>to become a member for free and be added to their email list.
- Check out info on Georgia’s BioScience Industry with list of companies at the bottom of the site
- Interesting data report on Georgia’s growth: The Value of Bioscience Innovation in Growing Jobs and Improving Quality of Life 2016


Continuous call writing at 12,000 strike suggests Nifty upside is capped
As long as Nifty trades below 12,050 level, some consolidation in the range of 11,800-12,000 is expected.
by Moneycontrol ContributorNilesh Ramesh Jain
Nifty remained volatile throughout the week in a wider trading range from 11,800-12,000 levels and faced stiff resistance at 12,000-mark which has been acting as a crucial resistance zone.
On the weekly scale, Nifty formed Doji candles for the continuous two weeks, indicating that bulls and bears both are making attempts to drag the index on either side.
However, the short-term trend for Nifty continues to be rangebound with a slight negative bias. We expect a soft start on Monday with some rangebound trade. As long as it trades below 12,050 levels we expect some consolidation in the range of 11,800-12,000.
On the derivative front, put writers were active in 11,900, 11,800 and 11,700 strikes where maximum open interest concentration is placed at 11,800 strike.
Continuous call writing at 12,000 strike in the weekly as well as monthly expiry is hinting that upside is capped.
Bank Nifty outperformed in the previous week and sustained its positive momentum for the 6th consecutive week even after some profit booking being seen in the Nifty index.
Now, the overall structure still looks positive towards 31,500 and 31,700 where immediate support is placed at 30,300.
The weekly MACD is well in the buy mode and its trading above the zero reference line which is positive for the bulls in the short to medium term.
For the Nifty index to reclaim its positive momentum, Bank Nifty has to continue with its positive momentum.
Kotak Mahindra Bank had provided breakout from its downward sloping trend line on the weekly scale and is moving again after retesting the same levels. Thus the overall structure works in the favour of the bulls.
One can expect the rally to move towards its immediate resistance at Rs 1,684 then Rs 1,720 level, while on the downside Rs 1,580 will act as important support zone.
(The author is Derivative and Technical Analyst at Anand Rathi)
Disclaimer: The views and investment tips expressed by the investment expert on moneycontrol.com are his own and not that of the website or its management. Moneycontrol.com advises users to check with certified experts before taking any investment decisions. Get access to India's fastest growing financial subscriptions service Moneycontrol Pro for as little as Rs 599 for first year. Use the code "GETPRO". Moneycontrol Pro offers you all the information you need for wealth creation including actionable investment ideas, independent research and insights & analysis For more information, check out the Moneycontrol website or mobile app.


gps_latlon2gr.Rd
Coverts latitude and longitude to a grid reference and/or easting and northing.
gps_latlon2gr(latitude, longitude, out_projection = "OSGB", return_type = "both")
| latitude | a vector of numerics giving latitudes |
|---|---|
| longitude | a vector of numerics giving longitudes |
| out_projection | a string giving the desired output projection, either |
| return_type | a string defining what information the funtion should return. If
|
A dataframe of results are returned
gps_latlon2gr(51.60233, -1.111254)#> GRIDREF EASTING NORTHING #> 1 SU6164989650<PHONE_NUMBER>50


WITNESS LIST S/C on Ag., Rural Affairs & Coastal Resources Committee September 6, 2006 -10:00A Interim Charge 1 ON: Bridges, Steve Executive Director (Texas Organic Farmers and Gardeners Association), Bastrop, TX Cohen, Amanda (Self), Houston, TX Cowan, John (Texas Association of Dairymen), Grapevine, TX Dierschke, Dan (Texas Farm Bureau), Austin, TX Dopslauf, Bruce (Independent Cattleman's Association of Texas), Lockhart, TX Ellis, Dee (Texas Animal Health Commission), Austin, TX Faries, Floron (Buddy) (Texas A&M University System), College Station, TX Hillman, Bob Dr. (Texas Animal Health Commission), Austin, TX Hooper, David Elliot Executive Director (Texas Thoroughbred Associaiton), Austin, TX Horton, Ken (Texas Pork Producers Association), Austin, TX Kostroun, David (Texas Department of Agriculture), Austin, TX Levin, Marc (Texas Public Policy Foundation), Austin, TX McGeary, Judith (Farm and Ranch Freedom Alliance), Austin, TX Morrison, Dave (Texas Parks and Wildlife), Austin, TX Ross, Joe David Doctor (Self), Sonora, TX Sheppard, Guy Dr. (Texas Veterinary Medical Association), Austin, TX Small, Ed (Texas & Southwestern Cattle Raisers Association), Austin, TX Smith, Ed Mayor (City of Marshall and Paso Fino Horse Association), Marshall, TX Stufflebeam, Brad (Texas Organic Farmers and Gardeners Association), Bastrop, TX Turner, Bob (Texas Poultry Federation), Roundrock, TX Vestel, Tom A. (Andy) (Texas Cooperative Extension Service), College Station, TX Winegarner, Josh (Texas Cattlefeeders Association), Amarillo, TX


class: center, middle Elements of Data Science - F2019 # Week 8 10/28/2019 --- # TODOs
-- count:false - Reading - sklearn documentation: [Feature Selection](https://scikit-learn.org/stable/modules/feature_selection.html) - PDSH Ch 3: [Handling Missing Data](https://jakevdp.github.io/PythonDataScienceHandbook/03.04-missing-values.html) - PDSH Ch 5: [Feature Engineering](https://jakevdp.github.io/PythonDataScienceHandbook/05.04-feature-engineering.html)
-- count: false - **Quiz 8 : Due Sat Nov 2 Midnight via gradescope**, *no late submissions* --- # Today
-- count:false - Feature Selection -- count:false - Data Cleaning -- count:false - Feature Engineering -- count:false - Natural Language Processing --- class:middle # Questions?


k317h
A Blog to Record My Progress...
Main
Projects
Archives
About
404
It does not matter how slowly you go
as long as you do not stop.
Go back


---
layout: docs
category: api
title: Mapbox GL JS API
navtitle: API
permalink: /api
navigation:
- title: mapboxgl.Map
url: /api
id: new-mapboxgl-map-options-
subnav:
- title: Setting map state
url: /api
id: new-mapboxgl-map-options--setting-map-state
- title: Map method options
url: /api
id: new-mapboxgl-map-options--map-method-options
- title: Getting map state
url: /api
id: new-mapboxgl-map-options--getting-map-state
- title: Map lifecycle
url: /api
id: new-mapboxgl-map-options--map-lifecycle
- title: Working with sources
url: /api
id: new-mapboxgl-map-options--working-with-sources
- title: Working with controls
url: /api
id: new-mapboxgl-map-options--working-with-controls
- title: Working with style classes
url: /api
id: new-mapboxgl-map-options--working-with-style-classes
- title: Events
url: /api
id: new-mapboxgl-map-options--events
- title: mapboxgl.Source
url: /api
id: new-mapboxgl-source-options-
subnav:
- title: Methods
url: /api
id: new-mapboxgl-source-options--methods
- title: Events
url: /api
id: new-mapboxgl-source-options--events
- title: mapboxgl.GeoJSONSource
url: /api
id: new-mapboxgl-geojsonsource-options-
subnav:
- title: Methods
url: /api
id: new-mapboxgl-geojsonsource-options--methods
- title: mapboxgl.VideoSource
url: /api
id: new-mapboxgl-videosource-options-
subnav:
- title: mapboxgl.Navigation
url: /api
id: new-mapboxgl-navigation-options-
subnav:
- title: mapboxgl.Evented
url: /api
id: mapboxgl-evented
subnav:
- title: Methods
url: /api
id: mapboxgl-evented-methods
- title: mapboxgl.LatLng
url: /api
id: new-mapboxgl-latlng-latitude-longitude-
subnav:
- title: mapboxgl.LatLngBounds
url: /api
id: new-mapboxgl-latlngbounds-southwest-northeast-
subnav:
- title: Methods
url: /api
id: new-mapboxgl-latlngbounds-southwest-northeast--methods
- title: mapboxgl.util.supported
url: /api
id: mapboxgl-util-supported-
subnav:
- title: mapboxgl.util.getJSON
url: /api
id: mapboxgl-util-getjson-url-callback-
subnav:
---
Note, the following API documentation applies to
mapbox-gl-js
. For
mapbox-gl-cocoa
documentation and implementation instructions, view the
readme.
Mapbox GL JS API Documentation
new mapboxgl.Map(options)
{% highlight js %}var map = new mapboxgl.Map({
container: 'map',
center: [37.772537, -122.420679],
zoom: 13,
style: style_object,
hash: true
});
{% endhighlight %}
Create a map instance given an options object with the following properties:
| Option |
Value |
Description |
container |
string |
HTML element to initialize the map in (or element id as string) |
minZoom |
number |
Minimum zoom of the map, 0 by default |
maxZoom |
number |
Maximum zoom of the map, 20 by default |
style |
object |
Map style and data source definition (either a JSON object or a JSON URL), described in the style reference |
hash |
boolean |
If true , the map will track and update the page URL according to map position (default: false ) |
interactive |
boolean |
If false , no mouse, touch, or keyboard listeners are attached to the map, so it will not respond to input (default: true ) |
classes |
array |
Style class names with which to initialize the map |
Options that define the initial position of the map (if hash
is set to true
, the position will be set according to the URL and options will be used by default):
| Option |
Value |
Description |
center |
array |
Latitude and longitude (passed as [lat, lng] ) |
zoom |
number |
Map zoom level |
bearing |
number |
Map rotation bearing in degrees counter-clockwise from north |
Setting map state
The following methods set the state of the map without performing any animation.
| Method |
Description |
setView(center, zoom, bearing) |
Set map position (center, zoom, bearing) |
setCenter(latlng) |
Center the map view on a location |
setZoom(zoom) |
Set the zoom level of the map |
setBearing(bearing) |
Sets map rotation angle in degrees |
setStyle(style) |
Replaces the map's style object |
The following methods set the state of the map with smooth animation.
| Method |
Description |
panTo(latlng, animOptions?) |
Pan to a certain location with easing |
panBy(offset, animOptions?) |
Pan by a certain number of pixels (offset is [x, y]) |
zoomTo(zoom, animOptions?) |
Zoom to a certain zoom level with easing |
zoomIn(animOptions?) |
Zoom in by 1 level |
zoomOut(animOptions?) |
Zoom out by 1 level |
easeTo(latlng, zoom?, bearing?, animOptions?) |
Easing animation to a specified location/zoom/bearing |
flyTo(latlng, zoom?, bearing?, flyOptions?) |
Flying animation to a specified location/zoom/bearing with automatic curve |
fitBounds(bounds, fitBoundsOptions?) |
Zoom to contain certain geographical bounds ([[minLat, minLng], [maxLat, maxLng]] ) |
rotateTo(bearing, animOptions?) |
Rotate bearing by a certain number of degrees with easing |
resetNorth(animOptions?) |
Sets map bearing to 0 (north) with easing |
stop() |
Stop current animation |
resize() |
Detect the map container's new width and height and resize the map to fit |
Map method options
| Object |
Description |
animOptions |
An object with duration (Number in ms), easing (function), offset (point, origin of movement relative to map center) and animate (when set to false, no animation happens) options |
flyOptions |
An object with speed (1.2 by default, how fast animation occurs), curve (1.42 by default, defines how much zooming out occurs during animation), and easing (function) options |
fitBoundsOptions |
The same as flyOptions with the additional padding (number, defines how much padding there is around the given bounds on each side in pixels) and maxZoom (number) options |
Getting map state
| Method |
Description |
getBounds() |
Get the map's geographical bounds (as LatLngBounds object) |
getCenter() |
Get the current view geographical point (as LatLng object) |
getZoom() |
Get the current zoom |
getBearing() |
Get the current bearing in degrees |
project(latlng) |
Get pixel coordinates (relative to map container) given a geographical location |
unproject(point) |
Get geographical coordinates given pixel coordinates |
featuresAt(point, params, callback) |
Get all features at a point ([x, y]) where params is {radius, layer, type, geometry} (all optional, radius is 0 by default) |
Example:
{% highlight js %}// get all features at a point within a certain radius
map.featuresAt([100, 100], {
radius: 30, // radius in pixels to search in
layer: 'layer' // optional - if set, only features from that layer will be matched
}, callback);
{% endhighlight %}
Map lifecycle
| Method |
Description |
remove() |
Destroys the map's underlying resources, including web workers. |
Working with sources
| Method |
Description |
addSource(id, source) |
Adds a data source to the map, specifying associated string id |
removeSource(id) |
Removes a data source from the map given the id that was used when adding |
Working with controls
| Method |
Description |
addControl(control) |
Adds a control to the map |
Working with style classes
| Method |
Description |
addClass(className) |
Adds a style class to the map |
removeClass(className) |
Removes a style class from the map |
hasClass(className) |
Returns boolean indicating whether a style class is active |
setClasses([className]) |
Sets active style classes to a specified array |
getClasses() |
Returns an array of active style classes |
Events
| Event |
Description |
render |
Fired whenever a frame is rendered to the WebGL context |
load |
Fired on the first complete render, when all dependencies have been loaded |
move |
Fired during any movement of the map (panning, zooming, rotation, etc.) |
movestart |
Fired on start of any movement of the map |
moveend |
Fired after movement of the map, when it becomes idle |
zoom |
Fired when the map zoom changes |
rotate |
Fired when the map bearing changes |
click(point) |
Fired on map click |
mousemove(point) |
Fired when the mouse moves over the map |
resize |
Fired when the map changes size |
source.add(source) |
Fired when a data source is added |
source.remove(source) |
Fired when a data source is removed |
new mapboxgl.Source(options)
{% highlight js %}var sourceObj = new mapboxgl.Source({
type: 'vector',
url: 'mapbox://mapbox.mapbox-streets-v5'
});
map.addSource('some id', sourceObj); // add
map.removeSource('some id'); // remove
{% endhighlight %}
Create a tiled data source instance given an options object with the following properties:
| Option |
Description |
type |
Either 'raster' or 'vector' |
url |
A tile source URL. This should either be mapbox://{mapid} or a full http[s] url that points to a TileJSON endpoint. |
tiles |
An array of tile sources. If url is not specified, tiles can be used instead to specify tile sources, as in the TileJSON spec. Other TileJSON keys such as minzoom and maxzoom can be specified in a source object if tiles is used. |
id |
Optional id to assign to the source |
tileSize |
Optional tile size (width and height in pixels, assuming tiles are square). Defaults to 512; only configurable for raster sources. |
cacheSize |
Optional max number of tiles to cache at any given time |
Methods
| Method |
Description |
update() |
Update tiles according to the viewport and render |
render() |
Render every existing tile |
stats() |
Return an object with tile statistics |
featuresAt(point, params, callback) |
Get all features at a point where params is {radius, layer, type, geometry} (all optional, radius is 0 by default) |
Events
| Event |
Description |
tile.add(tile) |
Fired when a tile is added to the map |
tile.load(tile) |
Fired when a tile is loaded |
tile.remove(tile) |
Fired when a tile is removed from the map |
new mapboxgl.GeoJSONSource(options)
{% highlight js %}var sourceObj = new mapboxgl.GeoJSONSource({
data: {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-76.53063297271729,
39.18174077994108
]
}
}]
}
});
map.addSource('some id', sourceObj); // add
map.removeSource('some id'); // remove
{% endhighlight %}
Create a GeoJSON data source instance given an options object with the following properties:
| Option |
Description |
data |
A GeoJSON data object or an URL to it. The latter is preferable in case of large GeoJSON files. |
maxzoom |
Maximum zoom to preserve detail at. 14 by default. |
Methods
| Method |
Description |
setData(data) |
Update source geojson data and rerender map |
new mapboxgl.VideoSource(options)
{% highlight js %}var sourceObj = new mapboxgl.VideoSource({
url: [
'https://www.mapbox.com/videos/baltimore-smoke.mp4',
'https://www.mapbox.com/videos/baltimore-smoke.webm'
],
coordinates: [
[39.18579907229748, -76.54335737228394],
[39.1838364847587, -76.52803659439087],
[39.17683392507606, -76.5295386314392],
[39.17876344106642, -76.54520273208618]
]
});
map.addSource('some id', sourceObj); // add
map.removeSource('some id'); // remove
{% endhighlight %}
Create a Video data source instance given an options object with the following properties:
| Option |
Description |
url |
A string or array of URL(s) to video files |
coordinates |
lat,lng coordinates in order clockwise starting at the top left: tl, tr, br, bl |
new mapboxgl.Navigation(options)
Creates a navigation control with zoom buttons and a compass.
{% highlight js %}map.addControl(new mapboxgl.Navigation({position: 'topleft'})); // position is optional
{% endhighlight %}
| Option |
Description |
position |
A string indicating the control's position on the map. Options are topright , topleft , bottomright , bottomleft (defaults to topright ) |
mapboxgl.Evented
A class inherited by most other classes (Map
, Source
etc.) to get event capabilities.
Methods
| Method |
Description |
fire(type, data?) |
Fire event of a given string type with the given data object |
on(type, listener) |
Subscribe to a specified event with a listener function the latter gets the data object that was passed to fire and additionally target and type properties. |
off(type?, listener?) |
Remove a listener; remove all listeners of a type if listener is not specified remove all listeners if no arguments specified. |
listens(type) |
Returns true if the object listens to an event of a particular type |
new mapboxgl.LatLng(latitude, longitude)
{% highlight js %}var latlng = new mapboxgl.LatLng(37.76, -122.44);
{% endhighlight %}
A representation of a latitude and longitude point, in degrees.
Create a latitude, longitude object from a given latitude and longitude pair in degrees.
new mapboxgl.LatLngBounds([southwest, northeast])
{% highlight js %}var latlng = new mapboxgl.LatLng([[37.70,-122.51],[37.83,-122.35]]);
{% endhighlight %}
A representation of rectangular box on the earth, defined by its southwest
and northeast points in latitude and longitude
Creates a bounding box from the given pair of points. southwest
and northeast
can be ommitted to create a null bounding box.
Methods
| Method |
Description |
extend(latlng) |
Enlarge the bounds to include a given point |
getCenter() |
Get the point equidistant from this box's corners, as a LatLng object |
getSouthWest() |
Get the southwest corner as a LatLng object |
getSouthEast() |
Get the southeast corner as a LatLng object |
getNorthWest() |
Get the northwest corner as a LatLng object |
getNorthEast() |
Get the northeast corner as a LatLng object |
getNorth() |
Get the north edge's latitude as a number |
getSouth() |
Get the south edge's latitude as a number |
getWest() |
Get the south edge's longitude as a number |
getEast() |
Get the south edge's longitude as a number |
mapboxgl.util.supported()
{% highlight js %}if (!mapboxgl.util.supported()) {
console.log('Your browser does not support Mapbox GL');
}
{% endhighlight %}
Tests whether the basic JavaScript and DOM features required for Mapbox GL are present. Returns true if Mapbox GL should be expected to work, and false if not.
mapboxgl.util.getJSON(url, callback)
{% highlight js %}mapboxgl.util.getJSON('https://www.mapbox.com/mapbox-gl-styles/styles/outdoors-v3.json', function (err, style) {
if (err) throw err;
map.setStyle(style);
});
{% endhighlight %}
Get JSON data from a url.


Backend Store Managment
Track
Analyze
Profit
Improve
Track key data on products, customers, employees and transactions.
Use key data points from tracking data to drive product deployment, reward loyal customers, and reward and promote employees.
Use the data gathered through analytics to increase profit margins, leverage data to enhance negotiation with manufactorers.
Use analytics to improve customer satisfaction, decrease employee turnover, and overall store offerings.
Once you're familiar with this software - please provide feedback for our continual improvment


College Student IT Department College of Computing Sciences Pangasinan State University Lingayen Campus
John 3:16 ❤
Facebook


Alexandra is an undergraduate student at UCSD. She is studying Cognitive and Behavioral Neuroscience and minoring in Education Studies. She has only ever taken one introduction to computer programming course before, and is very nervous about this upcoming quarter. She plans to work hard and always give her best effort!


Please check your appointment details are correct before you finish and book your appointment.
{% include 'book-an-appointment/appointment-summary.html' %}{% extends 'templates/nhs_transaction_layout.html' %} {% import 'includes/form_macros.html' as form_macros %} {% import 'includes/ui_element_macros.html' as ui_element_macros %} {% block afterHeader %} {% endblock %} {% block content %}
Please check your appointment details are correct before you finish and book your appointment.
{% include 'book-an-appointment/appointment-summary.html' %}


xc
yc
zc
x
y
z
xc
yc
zc
xc
yc
zc
ccc
sc
tc
rc
sc
tc
sc
tc
rc
sc
tc
yc
zc
xc
yc
zc
xc
yc
zc
xc
yc
zc
xc
yc
zc
xc
yc
zc


PERLFAQ8
Section: Perl Programmers Reference Guide (1)Updated: 2009-08-15
Index Return to Main Contents
NAME
perlfaq8 - System InteractionDESCRIPTION
This section of the Perl FAQ covers questions involving operating system interaction. Topics include interprocess communication (IPC), control over the user-interface (keyboard, screen and pointing devices), and most anything else not related to data manipulation.Read the FAQs and documentation specific to the port of perl to your operating system (eg, perlvms, perlplan9, ...). These should contain more detailed information on the vagaries of your perl.
How do I find out which operating system I'm running under?
The $^O variable ($OSNAME if you use English) contains an indication of the name of the operating system (not its release number) that your perl binary was built for.How come exec() doesn't return?
(contributed by brian d foy)The "exec" function's job is to turn your process into another command and never to return. If that's not what you want to do, don't use "exec". :)
If you want to run an external command and still keep your Perl process going, look at a piped "open", "fork", or "system".
How do I do fancy stuff with the keyboard/screen/mouse?
How you access/control keyboards, screens, and pointing devices (``mice'') is system-dependent. Try the following modules:- Keyboard
-
Term::Cap Standard perl distribution Term::ReadKey CPAN Term::ReadLine::Gnu CPAN Term::ReadLine::Perl CPAN Term::Screen CPAN
- Screen
-
Term::Cap Standard perl distribution Curses CPAN Term::ANSIColor CPAN
- Mouse
-
Tk CPAN
Some of these specific cases are shown as examples in other answers in this section of the perlfaq.
How do I print something out in color?
In general, you don't, because you don't know whether the recipient has a color-aware display device. If you know that they have an ANSI terminal that understands color, you can use the Term::ANSIColor module from CPAN:
use Term::ANSIColor; print color("red"), "Stop!\n", color("reset"); print color("green"), "Go!\n", color("reset");
Or like this:
use Term::ANSIColor qw(:constants); print RED, "Stop!\n", RESET; print GREEN, "Go!\n", RESET;
How do I read just one key without waiting for a return key?
Controlling input buffering is a remarkably system-dependent matter. On many systems, you can just use the stty command as shown in ``getc'' in perlfunc, but as you see, that's already getting you into portability snags.
open(TTY, "+</dev/tty") or die "no tty: $!"; system "stty cbreak </dev/tty >/dev/tty 2>&1"; $key = getc(TTY); # perhaps this works # OR ELSE sysread(TTY, $key, 1); # probably this does system "stty -cbreak </dev/tty >/dev/tty 2>&1";
The Term::ReadKey module from CPAN offers an easy-to-use interface that should be more efficient than shelling out to stty for each key. It even includes limited support for Windows.
use Term::ReadKey; ReadMode('cbreak'); $key = ReadKey(0); ReadMode('normal');
However, using the code requires that you have a working C compiler and can use it to build and install a CPAN module. Here's a solution using the standard POSIX module, which is already on your systems (assuming your system supports POSIX).
use HotKey; $key = readkey();
And here's the HotKey module, which hides the somewhat mystifying calls to manipulate the POSIX termios structures.
# HotKey.pm package HotKey; @ISA = qw(Exporter); @EXPORT = qw(cbreak cooked readkey); use strict; use POSIX qw(:termios_h); my ($term, $oterm, $echo, $noecho, $fd_stdin); $fd_stdin = fileno(STDIN); $term = POSIX::Termios->new(); $term->getattr($fd_stdin); $oterm = $term->getlflag(); $echo = ECHO | ECHOK | ICANON; $noecho = $oterm & ~$echo; sub cbreak { $term->setlflag($noecho); # ok, so i don't want echo either $term->setcc(VTIME, 1); $term->setattr($fd_stdin, TCSANOW); } sub cooked { $term->setlflag($oterm); $term->setcc(VTIME, 0); $term->setattr($fd_stdin, TCSANOW); } sub readkey { my $key = ''; cbreak(); sysread(STDIN, $key, 1); cooked(); return $key; } END { cooked() } 1;
How do I check whether input is ready on the keyboard?
The easiest way to do this is to read a key in nonblocking mode with the Term::ReadKey module from CPAN, passing it an argument of -1 to indicate not to block:
use Term::ReadKey; ReadMode('cbreak'); if (defined ($char = ReadKey(-1)) ) { # input was waiting and it was $char } else { # no input was waiting } ReadMode('normal'); # restore normal tty settings
How do I clear the screen?
(contributed by brian d foy)To clear the screen, you just have to print the special sequence that tells the terminal to clear the screen. Once you have that sequence, output it when you want to clear the screen.
You can use the "Term::ANSIScreen" module to get the special sequence. Import the "cls" function (or the ":screen" tag):
use Term::ANSIScreen qw(cls); my $clear_screen = cls(); print $clear_screen;
The "Term::Cap" module can also get the special sequence if you want to deal with the low-level details of terminal control. The "Tputs" method returns the string for the given capability:
use Term::Cap; $terminal = Term::Cap->Tgetent( { OSPEED => 9600 } ); $clear_string = $terminal->Tputs('cl'); print $clear_screen;
On Windows, you can use the "Win32::Console" module. After creating an object for the output filehandle you want to affect, call the "Cls" method:
Win32::Console; $OUT = Win32::Console->new(STD_OUTPUT_HANDLE); my $clear_string = $OUT->Cls; print $clear_screen;
If you have a command-line program that does the job, you can call it in backticks to capture whatever it outputs so you can use it later:
$clear_string = `clear`; print $clear_string;
How do I get the screen size?
If you have Term::ReadKey module installed from CPAN, you can use it to fetch the width and height in characters and in pixels:
use Term::ReadKey; ($wchar, $hchar, $wpixels, $hpixels) = GetTerminalSize();
This is more portable than the raw "ioctl", but not as illustrative:
require 'sys/ioctl.ph'; die "no TIOCGWINSZ " unless defined &TIOCGWINSZ; open(TTY, "+</dev/tty") or die "No tty: $!"; unless (ioctl(TTY, &TIOCGWINSZ, $winsize='')) { die sprintf "$0: ioctl TIOCGWINSZ (%08x: $!)\n", &TIOCGWINSZ; } ($row, $col, $xpixel, $ypixel) = unpack('S4', $winsize); print "(row,col) = ($row,$col)"; print " (xpixel,ypixel) = ($xpixel,$ypixel)" if $xpixel || $ypixel; print "\n";
How do I ask the user for a password?
(This question has nothing to do with the web. See a different FAQ for that.)There's an example of this in ``crypt'' in perlfunc). First, you put the terminal into ``no echo'' mode, then just read the password normally. You may do this with an old-style ioctl() function, POSIX terminal control (see POSIX or its documentation the Camel Book), or a call to the stty program, with varying degrees of portability.
You can also do this for most systems using the Term::ReadKey module from CPAN, which is easier to use and in theory more portable.
use Term::ReadKey; ReadMode('noecho'); $password = ReadLine(0);
How do I read and write the serial port?
This depends on which operating system your program is running on. In the case of Unix, the serial ports will be accessible through files in /dev; on other systems, device names will doubtless differ. Several problem areas common to all device interaction are the following:- lockfiles
- Your system may use lockfiles to control multiple access. Make sure you follow the correct protocol. Unpredictable behavior can result from multiple processes reading from one device.
- open mode
- If you expect to use both read and write operations on the device, you'll have to open it for update (see ``open'' in perlfunc for details). You may wish to open it without running the risk of blocking by using sysopen() and "O_RDWR|O_NDELAY|O_NOCTTY" from the Fcntl module (part of the standard perl distribution). See ``sysopen'' in perlfunc for more on this approach.
- end of line
-
Some devices will be expecting a ``\r'' at the end of each line rather
than a ``\n''. In some ports of perl, ``\r'' and ``\n'' are different from
their usual (Unix) ASCII values of ``\012'' and ``\015''. You may have to
give the numeric values you want directly, using octal (``\015''), hex
(``0x0D''), or as a control-character specification (``\cM'').
print DEV "atv1\012"; # wrong, for some devices print DEV "atv1\015"; # right, for some devices
Even though with normal text files a ``\n'' will do the trick, there is still no unified scheme for terminating a line that is portable between Unix, DOS/Win, and Macintosh, except to terminate ALL line ends with ``\015\012'', and strip what you don't need from the output. This applies especially to socket I/O and autoflushing, discussed next.
- flushing output
-
If you expect characters to get to your device when you print() them,
you'll want to autoflush that filehandle. You can use select()
and the $| variable to control autoflushing (see ``$|'' in perlvar
and ``select'' in perlfunc, or perlfaq5, ``How do I flush/unbuffer an
output filehandle? Why must I do this?''):
$oldh = select(DEV); $| = 1; select($oldh);
You'll also see code that does this without a temporary variable, as in
select((select(DEV), $| = 1)[0]);
Or if you don't mind pulling in a few thousand lines of code just because you're afraid of a little $| variable:
use IO::Handle; DEV->autoflush(1);
As mentioned in the previous item, this still doesn't work when using socket I/O between Unix and Macintosh. You'll need to hard code your line terminators, in that case.
- non-blocking input
- If you are doing a blocking read() or sysread(), you'll have to arrange for an alarm handler to provide a timeout (see ``alarm'' in perlfunc). If you have a non-blocking open, you'll likely have a non-blocking read, which means you may have to use a 4-arg select() to determine whether I/O is ready on that device (see ``select'' in perlfunc.
While trying to read from his caller-id box, the notorious Jamie Zawinski<EMAIL_ADDRESS>after much gnashing of teeth and fighting with sysread, sysopen, POSIX's tcgetattr business, and various other functions that go bump in the night, finally came up with this:
sub open_modem { use IPC::Open2; my $stty = `/bin/stty -g`; open2( \*MODEM_IN, \*MODEM_OUT, "cu -l$modem_device -s2400 2>&1"); # starting cu hoses /dev/tty's stty settings, even when it has # been opened on a pipe... system("/bin/stty $stty"); $_ = <MODEM_IN>; chomp; if ( !m/^Connected/ ) { print STDERR "$0: cu printed `$_' instead of `Connected'\n"; } }
How do I decode encrypted password files?
You spend lots and lots of money on dedicated hardware, but this is bound to get you talked about.Seriously, you can't if they are Unix password files---the Unix password system employs one-way encryption. It's more like hashing than encryption. The best you can do is check whether something else hashes to the same string. You can't turn a hash back into the original string. Programs like Crack can forcibly (and intelligently) try to guess passwords, but don't (can't) guarantee quick success.
If you're worried about users selecting bad passwords, you should proactively check when they try to change their password (by modifying passwd(1), for example).
How do I start a process in the background?
(contributed by brian d foy)There's not a single way to run code in the background so you don't have to wait for it to finish before your program moves on to other tasks. Process management depends on your particular operating system, and many of the techniques are in perlipc.
Several CPAN modules may be able to help, including IPC::Open2 or IPC::Open3, IPC::Run, Parallel::Jobs, Parallel::ForkManager, POE, Proc::Background, and Win32::Process. There are many other modules you might use, so check those namespaces for other options too.
If you are on a unix-like system, you might be able to get away with a system call where you put an "&" on the end of the command:
system("cmd &")
You can also try using "fork", as described in perlfunc (although this is the same thing that many of the modules will do for you).
- STDIN, STDOUT, and STDERR are shared
- Both the main process and the backgrounded one (the ``child'' process) share the same STDIN, STDOUT and STDERR filehandles. If both try to access them at once, strange things can happen. You may want to close or reopen these for the child. You can get around this with "open"ing a pipe (see ``open'' in perlfunc) but on some systems this means that the child process cannot outlive the parent.
- Signals
- You'll have to catch the SIGCHLD signal, and possibly SIGPIPE too. SIGCHLD is sent when the backgrounded process finishes. SIGPIPE is sent when you write to a filehandle whose child process has closed (an untrapped SIGPIPE can cause your program to silently die). This is not an issue with "system("cmd&")".
- Zombies
-
You have to be prepared to ``reap'' the child process when it finishes.
$SIG{CHLD} = sub { wait }; $SIG{CHLD} = 'IGNORE';
You can also use a double fork. You immediately wait() for your first child, and the init daemon will wait() for your grandchild once it exits.
unless ($pid = fork) { unless (fork) { exec "what you really wanna do"; die "exec failed!"; } exit 0; } waitpid($pid, 0);
See ``Signals'' in perlipc for other examples of code to do this. Zombies are not an issue with "system("prog &")".
How do I trap control characters/signals?
You don't actually ``trap'' a control character. Instead, that character generates a signal which is sent to your terminal's currently foregrounded process group, which you then trap in your process. Signals are documented in ``Signals'' in perlipc and the section on ``Signals'' in the Camel.You can set the values of the %SIG hash to be the functions you want to handle the signal. After perl catches the signal, it looks in %SIG for a key with the same name as the signal, then calls the subroutine value for that key.
# as an anonymous subroutine $SIG{INT} = sub { syswrite(STDERR, "ouch\n", 5 ) }; # or a reference to a function $SIG{INT} = \&ouch; # or the name of the function as a string $SIG{INT} = "ouch";
Perl versions before 5.8 had in its C source code signal handlers which would catch the signal and possibly run a Perl function that you had set in %SIG. This violated the rules of signal handling at that level causing perl to dump core. Since version 5.8.0, perl looks at %SIG *after* the signal has been caught, rather than while it is being caught. Previous versions of this answer were incorrect.
How do I modify the shadow password file on a Unix system?
If perl was installed correctly and your shadow library was written properly, the getpw*() functions described in perlfunc should in theory provide (read-only) access to entries in the shadow password file. To change the file, make a new shadow password file (the format varies from system to system---see passwd for specifics) and use pwd_mkdb(8) to install it (see pwd_mkdb for more details).How do I set the time and date?
Assuming you're running under sufficient permissions, you should be able to set the system-wide date and time by running the date(1) program. (There is no way to set the time and date on a per-process basis.) This mechanism will work for Unix, MS-DOS, Windows, and NT; the VMS equivalent is "set time".However, if all you want to do is change your time zone, you can probably get away with setting an environment variable:
$ENV{TZ} = "MST7MDT"; # unixish $ENV{'SYS$TIMEZONE_DIFFERENTIAL'}="-5" # vms system "trn comp.lang.perl.misc";
How can I sleep() or alarm() for under a second?
If you want finer granularity than the 1 second that the "sleep()" function provides, the easiest way is to use the "select()" function as documented in ``select'' in perlfunc. Try the "Time::HiRes" and the "BSD::Itimer" modules (available from CPAN, and starting from Perl 5.8 "Time::HiRes" is part of the standard distribution).How can I measure time under a second?
(contributed by brian d foy)The "Time::HiRes" module (part of the standard distribution as of Perl 5.8) measures time with the "gettimeofday()" system call, which returns the time in microseconds since the epoch. If you can't install "Time::HiRes" for older Perls and you are on a Unixish system, you may be able to call gettimeofday(2) directly. See ``syscall'' in perlfunc.
How can I do an atexit() or setjmp()/longjmp()? (Exception handling)
Release 5 of Perl added the END block, which can be used to simulate atexit(). Each package's END block is called when the program or thread ends (see perlmod manpage for more details).For example, you can use this to make sure your filter program managed to finish its output without filling up the disk:
END { close(STDOUT) || die "stdout close failed: $!";  You can use eval() as setjmp and die() as longjmp. For details of this, see the section on signals, especially the time-out handler for a blocking flock() in ``Signals'' in perlipc or the section on ``Signals'' in the Camel Book.
If exception handling is all you're interested in, try the exceptions.pl library (part of the standard perl distribution).
If you want the atexit() syntax (and an rmexit() as well), try the AtExit module available from CPAN.
Why doesn't my sockets program work under System V (Solaris)? What does the error message Protocol not supported mean?
Some Sys-V based systems, notably Solaris 2.X, redefined some of the standard socket constants. Since these were constant across all architectures, they were often hardwired into perl code. The proper way to deal with this is to ``use Socket'' to get the correct values.Note that even though SunOS and Solaris are binary compatible, these values are different. Go figure.
How can I call my system's unique C functions from Perl?
In most cases, you write an external module to do it---see the answer to ``Where can I learn about linking C with Perl? [h2xs, xsubpp]''. However, if the function is a system call, and your system supports syscall(), you can use the syscall function (documented in perlfunc).Remember to check the modules that came with your distribution, and CPAN as well---someone may already have written a module to do it. On Windows, try Win32::API. On Macs, try Mac::Carbon. If no module has an interface to the C function, you can inline a bit of C in your Perl source with Inline::C.
Where do I get the include files to do ioctl() or syscall()?
Historically, these would be generated by the h2ph tool, part of the standard perl distribution. This program converts cpp(1) directives in C header files to files containing subroutine definitions, like &SYS_getitimer, which you can use as arguments to your functions. It doesn't work perfectly, but it usually gets most of the job done. Simple files like errno.h, syscall.h, and socket.h were fine, but the hard ones like ioctl.h nearly always need to hand-edited. Here's how to install the *.ph files:
1. become super-user 2. cd /usr/include 3. h2ph *.h */*.h
If your system supports dynamic loading, for reasons of portability and sanity you probably ought to use h2xs (also part of the standard perl distribution). This tool converts C header files to Perl extensions. See perlxstut for how to get started with h2xs.
If your system doesn't support dynamic loading, you still probably ought to use h2xs. See perlxstut and ExtUtils::MakeMaker for more information (in brief, just use make perl instead of a plain make to rebuild perl with a new static extension).
Why do setuid perl scripts complain about kernel problems?
Some operating systems have bugs in the kernel that make setuid scripts inherently insecure. Perl gives you a number of options (described in perlsec) to work around such systems.How can I open a pipe both to and from a command?
The IPC::Open2 module (part of the standard perl distribution) is an easy-to-use approach that internally uses pipe(), fork(), and exec() to do the job. Make sure you read the deadlock warnings in its documentation, though (see IPC::Open2). See ``Bidirectional Communication with Another Process'' in perlipc and ``Bidirectional Communication with Yourself'' in perlipcYou may also use the IPC::Open3 module (part of the standard perl distribution), but be warned that it has a different order of arguments from IPC::Open2 (see IPC::Open3).
Why can't I get the output of a command with system()?
You're confusing the purpose of system() and backticks (``). system() runs a command and returns exit status information (as a 16 bit value: the low 7 bits are the signal the process died from, if any, and the high 8 bits are the actual exit value). Backticks (``) run a command and return what it sent to STDOUT.
$exit_status = system("mail-users"); $output_string = `ls`;
How can I capture STDERR from an external command?
There are three basic ways of running external commands:
system $cmd; # using system() $output = `$cmd`; # using backticks (``) open (PIPE, "cmd |"); # using open()
With system(), both STDOUT and STDERR will go the same place as the script's STDOUT and STDERR, unless the system() command redirects them. Backticks and open() read only the STDOUT of your command.
You can also use the open3() function from IPC::Open3. Benjamin Goldberg provides some sample code:
To capture a program's STDOUT, but discard its STDERR:
use IPC::Open3; use File::Spec; use Symbol qw(gensym); open(NULL, ">", File::Spec->devnull); my $pid = open3(gensym, \*PH, ">&NULL", "cmd"); while( <PH> ) { } waitpid($pid, 0);
To capture a program's STDERR, but discard its STDOUT:
use IPC::Open3; use File::Spec; use Symbol qw(gensym); open(NULL, ">", File::Spec->devnull); my $pid = open3(gensym, ">&NULL", \*PH, "cmd"); while( <PH> ) { } waitpid($pid, 0);
To capture a program's STDERR, and let its STDOUT go to our own STDERR:
use IPC::Open3; use Symbol qw(gensym); my $pid = open3(gensym, ">&STDERR", \*PH, "cmd"); while( <PH> ) { } waitpid($pid, 0);
To read both a command's STDOUT and its STDERR separately, you can redirect them to temp files, let the command run, then read the temp files:
use IPC::Open3; use Symbol qw(gensym); use IO::File; local *CATCHOUT = IO::File->new_tmpfile; local *CATCHERR = IO::File->new_tmpfile; my $pid = open3(gensym, ">&CATCHOUT", ">&CATCHERR", "cmd"); waitpid($pid, 0); seek $_, 0, 0 for \*CATCHOUT, \*CATCHERR; while( <CATCHOUT> ) {} while( <CATCHERR> ) {}
But there's no real need for *both* to be tempfiles... the following should work just as well, without deadlocking:
use IPC::Open3; use Symbol qw(gensym); use IO::File; local *CATCHERR = IO::File->new_tmpfile; my $pid = open3(gensym, \*CATCHOUT, ">&CATCHERR", "cmd"); while( <CATCHOUT> ) {} waitpid($pid, 0); seek CATCHERR, 0, 0; while( <CATCHERR> ) {}
And it'll be faster, too, since we can begin processing the program's stdout immediately, rather than waiting for the program to finish.
With any of these, you can change file descriptors before the call:
open(STDOUT, ">logfile"); system("ls");
or you can use Bourne shell file-descriptor redirection:
$output = `$cmd 2>some_file`; open (PIPE, "cmd 2>some_file |");
You can also use file-descriptor redirection to make STDERR a duplicate of STDOUT:
$output = `$cmd 2>&1`; open (PIPE, "cmd 2>&1 |");
Note that you cannot simply open STDERR to be a dup of STDOUT in your Perl program and avoid calling the shell to do the redirection. This doesn't work:
open(STDERR, ">&STDOUT"); $alloutput = `cmd args`; # stderr still escapes
This fails because the open() makes STDERR go to where STDOUT was going at the time of the open(). The backticks then make STDOUT go to a string, but don't change STDERR (which still goes to the old STDOUT).
Note that you must use Bourne shell (sh(1)) redirection syntax in backticks, not csh(1)! Details on why Perl's system() and backtick and pipe opens all use the Bourne shell are in the versus/csh.whynot article in the ``Far More Than You Ever Wanted To Know'' collection in http://www.cpan.org/misc/olddoc/FMTEYEWTK.tgz . To capture a command's STDERR and STDOUT together:
$output = `cmd 2>&1`; # either with backticks $pid = open(PH, "cmd 2>&1 |"); # or with an open pipe while (<PH>) { } # plus a read
To capture a command's STDOUT but discard its STDERR:
$output = `cmd 2>/dev/null`; # either with backticks $pid = open(PH, "cmd 2>/dev/null |"); # or with an open pipe while (<PH>) { } # plus a read
To capture a command's STDERR but discard its STDOUT:
$output = `cmd 2>&1 1>/dev/null`; # either with backticks $pid = open(PH, "cmd 2>&1 1>/dev/null |"); # or with an open pipe while (<PH>) { } # plus a read
To exchange a command's STDOUT and STDERR in order to capture the STDERR but leave its STDOUT to come out our old STDERR:
$output = `cmd 3>&1 1>&2 2>&3 3>&-`; # either with backticks $pid = open(PH, "cmd 3>&1 1>&2 2>&3 3>&-|");# or with an open pipe while (<PH>) { } # plus a read
To read both a command's STDOUT and its STDERR separately, it's easiest to redirect them separately to files, and then read from those files when the program is done:
system("program args 1>program.stdout 2>program.stderr");
Ordering is important in all these examples. That's because the shell processes file descriptor redirections in strictly left to right order.
system("prog args 1>tmpfile 2>&1"); system("prog args 2>&1 1>tmpfile");
The first command sends both standard out and standard error to the temporary file. The second command sends only the old standard output there, and the old standard error shows up on the old standard out.
Why doesn't open() return an error when a pipe open fails?
If the second argument to a piped open() contains shell metacharacters, perl fork()s, then exec()s a shell to decode the metacharacters and eventually run the desired program. If the program couldn't be run, it's the shell that gets the message, not Perl. All your Perl program can find out is whether the shell itself could be successfully started. You can still capture the shell's STDERR and check it for error messages. See ``How can I capture STDERR from an external command?'' elsewhere in this document, or use the IPC::Open3 module.If there are no shell metacharacters in the argument of open(), Perl runs the command directly, without using the shell, and can correctly report whether the command started.
What's wrong with using backticks in a void context?
Strictly speaking, nothing. Stylistically speaking, it's not a good way to write maintainable code. Perl has several operators for running external commands. Backticks are one; they collect the output from the command for use in your program. The "system" function is another; it doesn't do this.Writing backticks in your program sends a clear message to the readers of your code that you wanted to collect the output of the command. Why send a clear message that isn't true?
Consider this line:
`cat /etc/termcap`;
You forgot to check $? to see whether the program even ran correctly. Even if you wrote
print `cat /etc/termcap`;
this code could and probably should be written as
system("cat /etc/termcap") == 0 or die "cat program failed!";
which will echo the cat command's output as it is generated, instead of waiting until the program has completed to print it out. It also checks the return value.
"system" also provides direct control over whether shell wildcard processing may take place, whereas backticks do not.
How can I call backticks without shell processing?
This is a bit tricky. You can't simply write the command like this:
@ok = `grep @opts '$search_string' @filenames`;
As of Perl 5.8.0, you can use "open()" with multiple arguments. Just like the list forms of "system()" and "exec()", no shell escapes happen.
open( GREP, "-|", 'grep', @opts, $search_string, @filenames ); chomp(@ok = <GREP>); close GREP;
You can also:
my @ok = (); if (open(GREP, "-|")) { while (<GREP>) { chomp; push(@ok, $_); } close GREP; } else { exec 'grep', @opts, $search_string, @filenames; }
Just as with "system()", no shell escapes happen when you "exec()" a list. Further examples of this can be found in ``Safe Pipe Opens'' in perlipc.
Note that if you're using Windows, no solution to this vexing issue is even possible. Even if Perl were to emulate "fork()", you'd still be stuck, because Windows does not have an argc/argv-style API.
Why can't my script read from STDIN after I gave it EOF (^D on Unix, ^Z on MS-DOS)?
Some stdio's set error and eof flags that need clearing. The POSIX module defines clearerr() that you can use. That is the technically correct way to do it. Here are some less reliable workarounds:- 1.
-
Try keeping around the seekpointer and go there, like this:
$where = tell(LOG); seek(LOG, $where, 0);
- 2.
- If that doesn't work, try seeking to a different part of the file and then back.
- 3.
- If that doesn't work, try seeking to a different part of the file, reading something, and then seeking back.
- 4.
- If that doesn't work, give up on your stdio package and use sysread.
How can I convert my shell script to perl?
Learn Perl and rewrite it. Seriously, there's no simple converter. Things that are awkward to do in the shell are easy to do in Perl, and this very awkwardness is what would make a shell->perl converter nigh-on impossible to write. By rewriting it, you'll think about what you're really trying to do, and hopefully will escape the shell's pipeline datastream paradigm, which while convenient for some matters, causes many inefficiencies.Can I use perl to run a telnet or ftp session?
Try the Net::FTP, TCP::Client, and Net::Telnet modules (available from CPAN). http://www.cpan.org/scripts/netstuff/telnet.emul.shar will also help for emulating the telnet protocol, but Net::Telnet is quite probably easier to use..If all you want to do is pretend to be telnet but don't need the initial telnet handshaking, then the standard dual-process approach will suffice:
use IO::Socket; # new in 5.004 $handle = IO::Socket::INET->new('www.perl.com:80') or die "can't connect to port 80 on www.perl.com: $!"; $handle->autoflush(1); if (fork()) { # XXX: undef means failure select($handle); print while <STDIN>; # everything from stdin to socket } else { print while <$handle>; # everything from socket to stdout } close $handle; exit;
How can I write expect in Perl?
Once upon a time, there was a library called chat2.pl (part of the standard perl distribution), which never really got finished. If you find it somewhere, don't use it. These days, your best bet is to look at the Expect module available from CPAN, which also requires two other modules from CPAN, IO::Pty and IO::Stty.Is there a way to hide perl's command line from programs such as ps?
First of all note that if you're doing this for security reasons (to avoid people seeing passwords, for example) then you should rewrite your program so that critical information is never given as an argument. Hiding the arguments won't make your program completely secure.To actually alter the visible command line, you can assign to the variable $0 as documented in perlvar. This won't work on all operating systems, though. Daemon programs like sendmail place their state there, as in:
$0 = "orcus [accepting connections]";
I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible?
- Unix
- In the strictest sense, it can't be done---the script executes as a different process from the shell it was started from. Changes to a process are not reflected in its parent---only in any children created after the change. There is shell magic that may allow you to fake it by eval()ing the script's output in your shell; check out the comp.unix.questions FAQ for details.
How do I close a process's filehandle without waiting for it to complete?
Assuming your system supports such things, just send an appropriate signal to the process (see ``kill'' in perlfunc).
If by daemon process you mean one that's detached (disassociated from its tty), then the following process is reported to work on most Unixish systems. Non-Unix users should check their Your_OS::Process module for other solutions.- *
- Open /dev/tty and use the TIOCNOTTY ioctl on it. See tty for details. Or better yet, you can just use the POSIX::setsid() function, so you don't have to worry about process groups.
- *
- Change directory to /
- *
- Reopen STDIN, STDOUT, and STDERR so they're not connected to the old tty.
- *
-
Background yourself like this:
fork && exit;
The Proc::Daemon module, available from CPAN, provides a function to perform these actions for you.
How do I find out if I'm running interactively or not?
Good question. Sometimes "-t STDIN" and "-t STDOUT" can give clues, sometimes not.
if (-t STDIN && -t STDOUT) { print "Now what? "; }
On POSIX systems, you can test whether your own process group matches the current process group of your controlling terminal as follows:
use POSIX qw/getpgrp tcgetpgrp/; # Some POSIX systems, such as Linux, can be # without a /dev/tty at boot time. if (!open(TTY, "/dev/tty")) { print "no tty\n"; } else { $tpgrp = tcgetpgrp(fileno(*TTY)); $pgrp = getpgrp(); if ($tpgrp == $pgrp) { print "foreground\n"; } else { print "background\n"; } }
How do I timeout a slow event?
Use the alarm() function, probably in conjunction with a signal handler, as documented in ``Signals'' in perlipc and the section on ``Signals'' in the Camel. You may instead use the more flexible Sys::AlarmCall module available from CPAN.The alarm() function is not implemented on all versions of Windows. Check the documentation for your specific version of Perl.
How do I set CPU limits?
(contributed by Xho)Use the "BSD::Resource" module from CPAN. As an example:
use BSD::Resource; setrlimit(RLIMIT_CPU,10,20) or die $!;
This sets the soft and hard limits to 10 and 20 seconds, respectively. After 10 seconds of time spent running on the CPU (not ``wall'' time), the process will be sent a signal (XCPU on some systems) which, if not trapped, will cause the process to terminate. If that signal is trapped, then after 10 more seconds (20 seconds in total) the process will be killed with a non-trappable signal.
See the "BSD::Resource" and your systems documentation for the gory details.
How do I avoid zombies on a Unix system?
Use the reaper code from ``Signals'' in perlipc to call wait() when a SIGCHLD is received, or else use the double-fork technique described in ``How do I start a process in the background?'' in perlfaq8.How do I use an SQL database?
The DBI module provides an abstract interface to most database servers and types, including Oracle, DB2, Sybase, mysql, Postgresql, ODBC, and flat files. The DBI module accesses each database type through a database driver, or DBD. You can see a complete list of available drivers on CPAN: http://www.cpan.org/modules/by-module/DBD/ . You can read more about DBI on http://dbi.perl.org .Other modules provide more specific access: Win32::ODBC, Alzabo, iodbc, and others found on CPAN Search: http://search.cpan.org .
How do I make a system() exit on control-C?
You can't. You need to imitate the system() call (see perlipc for sample code) and then have a signal handler for the INT signal that passes the signal on to the subprocess. Or you can check for it:
$rc = system($cmd); if ($rc & 127) { die "signal death" }
How do I open a file without blocking?
If you're lucky enough to be using a system that supports non-blocking reads (most Unixish systems do), you need only to use the O_NDELAY or O_NONBLOCK flag from the Fcntl module in conjunction with sysopen():
use Fcntl; sysopen(FH, "/foo/somefile", O_WRONLY|O_NDELAY|O_CREAT, 0644) or die "can't open /foo/somefile: $!":
How do I tell the difference between errors from the shell and perl?
(answer contributed by brian d foy)When you run a Perl script, something else is running the script for you, and that something else may output error messages. The script might emit its own warnings and error messages. Most of the time you cannot tell who said what.
You probably cannot fix the thing that runs perl, but you can change how perl outputs its warnings by defining a custom warning and die functions.
Consider this script, which has an error you may not notice immediately.
#!/usr/locl/bin/perl print "Hello World\n";
I get an error when I run this from my shell (which happens to be bash). That may look like perl forgot it has a print() function, but my shebang line is not the path to perl, so the shell runs the script, and I get the error.
$ ./test ./test: line 3: print: command not found
A quick and dirty fix involves a little bit of code, but this may be all you need to figure out the problem.
#!/usr/bin/perl -w BEGIN { $SIG{__WARN__} = sub{ print STDERR "Perl: ", @_; }; $SIG{__DIE__} = sub{ print STDERR "Perl: ", @_; exit 1}; } $a = 1 + undef; $x / 0; __END__
The perl message comes out with ``Perl'' in front. The BEGIN block works at compile time so all of the compilation errors and warnings get the ``Perl:'' prefix too.
Perl: Useless use of division (/) in void context at ./test line 9. Perl: Name "main::a" used only once: possible typo at ./test line 8. Perl: Name "main::x" used only once: possible typo at ./test line 9. Perl: Use of uninitialized value in addition (+) at ./test line 8. Perl: Use of uninitialized value in division (/) at ./test line 9. Perl: Illegal division by zero at ./test line 9. Perl: Illegal division by zero at -e line 3.
If I don't see that ``Perl:'', it's not from perl.
You could also just know all the perl errors, and although there are some people who may know all of them, you probably don't. However, they all should be in the perldiag manpage. If you don't find the error in there, it probably isn't a perl error.
Looking up every message is not the easiest way, so let perl to do it for you. Use the diagnostics pragma with turns perl's normal messages into longer discussions on the topic.
use diagnostics;
If you don't get a paragraph or two of expanded discussion, it might not be perl's message.
How do I install a module from CPAN?
The easiest way is to have a module also named CPAN do it for you. This module comes with perl version 5.004 and later.
$ perl -MCPAN -e shell cpan shell -- CPAN exploration and modules installation (v1.59_54) ReadLine support enabled cpan> install Some::Module
To manually install the CPAN module, or any well-behaved CPAN module for that matter, follow these steps:
- 1.
- Unpack the source into a temporary area.
- 2.
-
perl Makefile.PL
- 3.
-
make
- 4.
-
make test
- 5.
-
make install
If your version of perl is compiled without dynamic loading, then you just need to replace step 3 (make) with make perl and you will get a new perl binary with your extension linked in.
See ExtUtils::MakeMaker for more details on building extensions. See also the next question, ``What's the difference between require and use?''.
What's the difference between require and use?
(contributed by brian d foy)Perl runs "require" statement at run-time. Once Perl loads, compiles, and runs the file, it doesn't do anything else. The "use" statement is the same as a "require" run at compile-time, but Perl also calls the "import" method for the loaded package. These two are the same:
use MODULE qw(import list); BEGIN { require MODULE; MODULE->import(import list); }
However, you can suppress the "import" by using an explicit, empty import list. Both of these still happen at compile-time:
use MODULE (); BEGIN { require MODULE; }
Since "use" will also call the "import" method, the actual value for "MODULE" must be a bareword. That is, "use" cannot load files by name, although "require" can:
require "$ENV{HOME}/lib/Foo.pm"; # no @INC searching!
See the entry for "use" in perlfunc for more details.
How do I keep my own module/library directory?
When you build modules, tell Perl where to install the modules.For "Makefile.PL"-based distributions, use the INSTALL_BASE option when generating Makefiles:
perl Makefile.PL INSTALL_BASE=/mydir/perl
You can set this in your CPAN.pm configuration so modules automatically install in your private library directory when you use the CPAN.pm shell:
% cpan cpan> o conf makepl_arg INSTALL_BASE=/mydir/perl cpan> o conf commit
For "Build.PL"-based distributions, use the --install_base option:
perl Build.PL --install_base /mydir/perl
You can configure CPAN.pm to automatically use this option too:
% cpan cpan> o conf mbuild_arg --install_base /mydir/perl cpan> o conf commit
INSTALL_BASE tells these tools to put your modules into /mydir/perl/lib/perl5. See ``How do I add a directory to my include path (@INC) at runtime?'' for details on how to run your newly installed moudles.
There is one caveat with INSTALL_BASE, though, since it acts differently than the PREFIX and LIB settings that older versions of ExtUtils::MakeMaker advocated. INSTALL_BASE does not support installing modules for multiple versions of Perl or different architectures under the same directory. You should consider if you really want that , and if you do, use the older PREFIX and LIB settings. See the ExtUtils::Makemaker documentation for more details.
How do I add the directory my program lives in to the module/library search path?
(contributed by brian d foy)If you know the directory already, you can add it to @INC as you would for any other directory. You might <use lib> if you know the directory at compile time:
use lib $directory;
The trick in this task is to find the directory. Before your script does anything else (such as a "chdir"), you can get the current working directory with the "Cwd" module, which comes with Perl:
BEGIN { use Cwd; our $directory = cwd; } use lib $directory;
You can do a similar thing with the value of $0, which holds the script name. That might hold a relative path, but "rel2abs" can turn it into an absolute path. Once you have the
BEGIN { use File::Spec::Functions qw(rel2abs); use File::Basename qw(dirname); my $path = rel2abs( $0 ); our $directory = dirname( $path ); } use lib $directory;
The "FindBin" module, which comes with Perl, might work. It finds the directory of the currently running script and puts it in $Bin, which you can then use to construct the right library path:
use FindBin qw($Bin);
How do I add a directory to my include path (@INC) at runtime?
Here are the suggested ways of modifying your include path, including environment variables, run-time switches, and in-code statements:- the PERLLIB environment variable
-
$ export PERLLIB=/path/to/my/dir $ perl program.pl
- the PERL5LIB environment variable
-
$ export PERL5LIB=/path/to/my/dir $ perl program.pl
- the perl -Idir command line flag
-
$ perl -I/path/to/my/dir program.pl
- the use lib pragma:
-
use lib "$ENV{HOME}/myown_perllib";
The last is particularly useful because it knows about machine dependent architectures. The lib.pm pragmatic module was first included with the 5.002 release of Perl.
What is socket.ph and where do I get it?
It's a Perl 4 style file defining values for system networking constants. Sometimes it is built using h2ph when Perl is installed, but other times it is not. Modern programs "use Socket;" instead.REVISION
Revision: $Revision$Date: $Date$
See perlfaq for source control details and availability.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-2009 Tom Christiansen, Nathan Torkington, and other authors as noted. All rights reserved.This documentation is free; you can redistribute it and/or modify it under the same terms as Perl itself.
Irrespective of its distribution, all code examples in this file are hereby placed into the public domain. You are permitted and encouraged to use this code in your own programs for fun or for profit as you see fit. A simple comment in the code giving credit would be courteous but is not required.
Index
- NAME
- DESCRIPTION
-
- How do I find out which operating system I'm running under?
- How come exec() doesn't return?
- How do I do fancy stuff with the keyboard/screen/mouse?
- How do I print something out in color?
- How do I read just one key without waiting for a return key?
- How do I check whether input is ready on the keyboard?
- How do I clear the screen?
- How do I get the screen size?
- How do I ask the user for a password?
- How do I read and write the serial port?
- How do I decode encrypted password files?
- How do I start a process in the background?
- How do I trap control characters/signals?
- How do I modify the shadow password file on a Unix system?
- How do I set the time and date?
- How can I sleep() or alarm() for under a second?
- How can I measure time under a second?
- How can I do an atexit() or setjmp()/longjmp()? (Exception handling)
- Why doesn't my sockets program work under System V (Solaris)? What does the error message Protocol not supported mean?
- How can I call my system's unique C functions from Perl?
- Where do I get the include files to do ioctl() or syscall()?
- Why do setuid perl scripts complain about kernel problems?
- How can I open a pipe both to and from a command?
- Why can't I get the output of a command with system()?
- How can I capture STDERR from an external command?
- Why doesn't open() return an error when a pipe open fails?
- What's wrong with using backticks in a void context?
- How can I call backticks without shell processing?
- Why can't my script read from STDIN after I gave it EOF (^D on Unix, ^Z on MS-DOS)?
- How can I convert my shell script to perl?
- Can I use perl to run a telnet or ftp session?
- How can I write expect in Perl?
- Is there a way to hide perl's command line from programs such as ps?
- I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible?
- How do I close a process's filehandle without waiting for it to complete?
- How do I fork a daemon process?
- How do I find out if I'm running interactively or not?
- How do I timeout a slow event?
- How do I set CPU limits?
- How do I avoid zombies on a Unix system?
- How do I use an SQL database?
- How do I make a system() exit on control-C?
- How do I open a file without blocking?
- How do I tell the difference between errors from the shell and perl?
- How do I install a module from CPAN?
- What's the difference between require and use?
- How do I keep my own module/library directory?
- How do I add the directory my program lives in to the module/library search path?
- How do I add a directory to my include path (@INC) at runtime?
- What is socket.ph and where do I get it?
- REVISION
- AUTHOR AND COPYRIGHT
This document was created by man2html, using the manual pages.
Time: 05:29:08 GMT, December 24, 2015


The Shining (1980) 140m
How could any movie live up to a publicity campaign that culminated with full-page newspaper ads in the Southern Hemisphere blaring 'The tide of terror that swept the world is here'? Stanley Kubrick's only horror film, an adaptation of Stephen King's bestseller, was a disappointment for first-time audiences who were expecting to be scared out of their wits, but grew to be a more rewarding film for repeat viewers. The film begins with caretaker Jack Torrance (Jack Nicholson), wife Wendy (Shelley Duvall) and son Danny (Danny Lloyd) moving into a Colorado Hotel which is closed and inaccessible during the Winter - Jack figures he can use the months of isolation to work on a novel. The film ends with Jack running amok with an ax, howling for his family's blood. What happens in between? That's THE SHINING's main controversy. The other area of controversy, at least for those Kubrick fans who had been weaned on the philosophical/ideological complexities of 2001: A SPACE ODYSSEY and A CLOCKWORK ORANGE, was that THE SHINING was too simple - it just seemed to be a ghost story about a man who went nuts in a Hotel, so what was the big deal?
After initial mixed feelings about the film, King joined its critics, finally agreeing to say nothing further in exchange for the rights to produce his own television version. In King, the cause of Jack's switch from father to murderer is clear-cut: he and his son are telepathically sensitive to a host of evil spirits that haunt the Hotel. In Kubrick, it's much murkier. He sets up a number of horror-movie motifs and then brushes over them - clairvoyance, ax murders, ghosts, a pact with the devil, insanity, animated corpses, ghosts, and reincarnation (to cap it off, he has the family move into the Hotel on Halloween). Every supernatural event can be explained rationally - here the telepathy becomes a conduit not for entities but hallucinations. Kubrick offers many other alternatives for Jack's madness - the isolation, his frustration as a writer, the cabin fever that has him trapped in the Hotel, his alcoholic past. Is Jack conjuring up his own demons? Has the Hotel become a sort of magnifying lens that expands hallucinatory images and passes them on in a form of autosuggestion to everyone else staying there? We can't trust any image that we see as real, although as viewers we are too caught up in events to give this much thought. It's only afterwards when you might work out the only piece of the puzzle that doesn't make sense - that if this was all happening in the characters' minds, then who let Jack out of the room he was locked in?
THE SHINING is a horror film to admire for its atmosphere, not its frights, although many fans enjoy it for Nicholson's pumped-up performance. It's hard to tell what may have attracted Kubrick to a mainstream horror novel, but I suspect it was the setting that clinched it. In THE SHINING the idea of the haunted house is turned completely inside out. Gone are the dark corridors, the narrow staircases, musty attics, dank cellars and scary woods outside. Instead the Hotel is immaculate, huge, and illuminated, surrounded by empty white wildnerness. There is barely a shadow to be seen. At the one point in the film when a character (Danny) enters darkness it is treated not as a place to be feared but as an area of refuge, only to have it become lit up with floodlights. John Alcott's cinematography and Kubrick's precise camerawork make THE SHINING a visual treat - which is quite something when you consider that it is shot mostly indoors. There is some great floor-level Steadicam tracking that follows Danny as he cycles through the hallways and a memorable cutaway shot of Jack staring at the Hotel maze, which is worth the price of admission alone.
In discussion THE SHINING is often companioned with 2001 (and not just because they share the same running times and a four-act structure). It's an intriguing comparison - inner space versus outer space. If the Star Child at the conclusion of 2001 was meant to signal an evolved consciousness of humanity then it's easy to see THE SHINING's clairvoyant child, Danny, as being its flesh and blood incarnation. The Hotel is his new, mysterious universe; an arena in which he may flex his fledging powers. Meanwhile Jack, who regresses to a grunting, animalistic state by the film's conclusion, returns full circle to 2001's apes. In both films we see points of evolution represented not only by characters but also by the weapons they use (in THE SHINING it progresses from club to knife to ax). There is also an obvious metaphysical link between both films - Kubrick likes to show us that time and space are connected. The psychological pathways of Jack's mind literally become a labyrinth by the film's end, in which he becomes hopelessly lost.
The Hotel itself is also a maze, cosmic or otherwise - the Steadicam's lengthy, fluid negotiations of its corridors serve not to map the layout of the Hotel but to disorient us. Even Wendy, when first entering the Hotel, remarks that she will have to leave a trail of breadcrumbs to find her way around, a la Hansel and Gretel (another story which features a father instructed to kill his children with an ax). In short, the Hotel is unfixed in space and time (the intertitles that announce the days, date and time don't do anything to make the experience more concrete for us). The past and the present are an overlapping confusion, muddied further by Danny's precognitive flashes into the future. The Hotel itself cannot be discounted as a major character of THE SHINING. Even though it may be unfixed it can still occupy what Jung called an objective psyche, a place where biology and psychology might mingle with and influence each other. The Hotel is a living entity (blood gushes from its elevators like burst arteries), thinking, imagining, creating images of humans to act out endless games for its amusement (the 1927 photograph at the end of the film would suggest as much). The forces of creation and destruction are in constant conflict. Small wonder that Jack, as a character in this staged entertainment, is unable to write a novel himself.
I'm impressed with THE SHINING and always look forward to repeat viewings every five years or so(only in cinemas, mind you) that give me the chance to re-evaluate my prior discoveries about the film and make new ones. The beauty of Kubrick's film is that despite its many layers it can still be enjoyed at the most basic level of a simple horror yarn. But don't be surprised if something sneaks into your subconscious and stays with you for some time afterwards. It may have even happened to Stephen King.
<EMAIL_ADDRESS>The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


KQuery Language Reference Manual
Table Of Contents
- Introduction
- Notation
- Structure
- Literals
- Declarations
- Versions
- Expressions
Introduction
The KQuery language is the textual representation of constraint expressions and queries which is used as input to the Kleaver constraint solver.
Currently the language is capable of representing quantifier free formulas over bitvectors and arrays, with direct support for all standard operations on bitvectors. The language has been designed to be compact and easy to read and write.
The KQuery language is closely related to the C++ API for Exprs, see also the doxygen Expr documentation.
Notation
In this document, syntax is given in Extended Backus-Naur Form and appears as:
Unless noted, the rules are described in terms of tokens not characters, and tokens can be separate by white space and comments.
In some case, a production like child-expression is used as an alias for the expression production, when subsequent text needs to differentiate the expression.
Examples are shown using:
Structure
A KQuery source file consists of a sequence of declarations.
Syntax:
Currently, the language supports two kinds of declarations:
- Array Declarations: Use to declare an array of bitvectors for use in subsequent expressions.
- Query Commands: Used to define queries which should be executed by the constraint solver. A query consists of a set of constraints (assumptions), a query expression, and optionally expressions and arrays to compute values for if the query expression is invalid.
Comments begin with "#" and continue until the end of line. For example:
Expression and Version Labels
Expressions are frequently shared among constraints and query expressions. In order to keep the output succinct and readable, expression labels can be used to introduce a lexical binding which can be used in subsequent expressions. Expression labels are globally scoped through the entire source file, and a definition must preceed any use in the source file.
Syntax:
Likewise, versions are frequently shared among reads and can be labelled in the same fashion.
Examples:
array const_array[] : w32 -> w8 = [5,6]
(Read w8 0 U0:[0=255] @ const_array) # U0 now refers to an array [255,6]
(Read w8 1 U0) # Read from byte offset 1 of [255,6]
Literals
Identifiers
Identifiers are used for specifying array names and for expression labels.
Syntax:
Examples:
arr10_20
Note that in order to keep open the possibility to introduce explicit integral and floating-point types, the following identifiers are treated as reserved keywords:
integer-type = "i[0-9]+"
Numbers
Numeric constants can be specified as follows.
Syntax:
signed-constant = [ "+" | "-" ] ( dec-constant | bin-constant | oct-constant | hex-constant )
dec-constant = "[0-9_]+"
bin-constant = "0b[01_]+"
oct-constant = "0o[0-7_]+"
hex-constant = "0x[0-9a-fA-F_]+"
Examples:
-10
0b1000_0001 # 129
Non-decimal constants can be signed. The '_' character is ignored when evaluating constants, but is available for use as a separator.
Types
Types are explicit operands to most expressions, and indicate the bit-width of the type.
Syntax:
Example:
The numeric portion of the token is taken to be a decimal integer specifying the bit-width of the type.
Declarations
Arrays
Arrays are the basic type for defining symbolic variables (the language does not currently support simple variables).
Syntax:
array-initializer = "symbolic" | "[" number-list "]"
number-list = number | number "," number-list
Arrays can be initialized to be either symbolic, or to have a given list of constant values. For constant arrays, the initializer list must exactly match the size of the array (if the size was unspecified, it will be the number of constant values).
Examples:
array foo[] : w8 -> w1 = [ true, false, false, true ] # A constant array of four booleans
Query Commands
Query declarations describe the queries that the constraint solver should run, along with optional additional arguments to specify expressions and arrays for which counterexamples should be provided.
Syntax:
query-expression = expression
constraint-list = "[" { expression } "]"
eval-expr-list = "[" { expression } "]"
eval-array-list = "[" { identifier } "]"
Examples:
(query [(Eq w8 (Read w8 0 mem) 10)] false [] [ mem ])
A query command consists a query, consisting of a constraint list and a query expression, and two optional lists for use when a counterexample is desired.
The constraint-list is a list of expressions (with boolean type) which are assumed to hold. Although not required in the language, many solvers require that this set of constraints be consistent. The query-expression is the expression to determine the validity of.
If a counterexample is desired for invalid queries, eval-expr-list is a list of expressions for which a possible value should be constructed, and eval-array-list is a list of arrays for which values for the entire array should be provided. All counterexamples results must be simultaneously feasible.
Versions
Versions are used to refer to an array with an ordered sequence of writes to it.
Syntax:
update-list = lhs-expression "=" rhs-expression [ "," update-list ]
Examples:
(Read w8 0 thing) # No Updates to small_array
(Read w8 1 [1=0xff] @ small_array) # Read from small_array at byte offset 1 with update where byte 1 set to decimal 255
A version can be specified either by an identifier, which can refer to an array or a labelled version, or by an explicit list of writes which are to be concatenated to another version (the most recent writes are first).
Expressions
Expressions are strongly typed, and have the following general form:
where EXPR_NAME is the expression name, EXPR_TYPE is the expression type (which may be optional), followed by any additional arguments.
Primitive Expressions
Expression References
An expression reference can be used to refer to a previously labelled expression.
Syntax:
Expression and version labels are in separate namespaces, it is the users responsibility to use separate labels to preserve readability.
Constants
Constants are specified by a numeric token or a type and numeric token.
Syntax:
When a constant is specified without a type, the resulting expression is only well-formed if its type can be inferred from the enclosing context. The true and false constants always have type w1.
Examples:
(w32 0)
(Add w32 10 20) # The type for 10 and 20 is inferred to be w32.
Arithmetic Operations
Add, Sub, Mul, UDiv, SDiv, URem, SRem
Syntax:
expression = "(" arithmetic-expr-kind type expression expression ")"
Arithmetic operations are always binary and the types of the left- and right-hand side expressions must match the expression type.
UDiv
Truncated unsigned division. Undefined if divisor is 0.
URem
Unsigned remainder. Undefined if divisor is 0.
SDiv
Signed division. Undefined if divisor is 0.
SRem
Signed remainder. Undefined if divisor is 0. Sign of the remainder is the same as that of the dividend.
Bitwise Operations
Not
Syntax:
Bitwise negation. The result is the bitwise negation (one's complement) of the input expression. If the type is specified, it must match the expression type.
And, Or, Xor, Shl, LShr, AShr
Syntax:
expression = "(" bitwise-expr-kind type expression expression ")"
These bitwise operations are always binary and the types of the left- and right-hand side expressions must match the expression type.
Shl
Logical shift left. Moves each bit of X to the left by Y positions. The Y right-most bits of X are replaced with zero, and the left-most bits discarded.
LShr
Logical shift right. Moves each bit of X to the right by Y positions. The Y left-most bits of X are replaced with zero, and the right-most bits discarded.
AShr
Arithmetic shift right. Behaves as LShr except that the left-most bits of X copy the initial left-most bit (the sign bit) of X.
Comparisons
Eq, Ne, Ult, Ule, Ugt, Uge, Slt, Sle, Sgt, Sge
Syntax:
expression = "(" comparison-expr-kind [ type ] expression expression ")"
Comparison operations are always binary and the types of the left- and right-hand side expression must match. If the type is specified, it must be w1.
Bitvector Manipulation
Concat
Syntax:
Concat evaluates to a type bits formed by concatenating lsb-expression to msb-expression.
Extract
Syntax:
Extract evaluates to type bits from child-expression taken from offset-number, where offset-number is the index of the least-significant bit in child-expression which should be extracted.
ZExt
Syntax:
ZExt evaluates to the lowest type bits of child-expression, with undefined bits set to zero.
SExt
Syntax:
SExt evaluates to the lowest type bits of child-expression, with undefined bits set to the most-significant bit of input-expression.
Special Expressions
Read
Syntax:
The Read expression evaluates to the first write in version for which index-expression is equivalent to the index in the write. The type of the expression must match the range of the root array in version, and the type of index-expression must match the domain.
Select
Syntax:
The Select expression evalues to true-expression if the condition evaluates to true, and to false-expression if the condition evaluates to false. The cond-expression must have type w1.
Both the true and false expressions must be well-formed, regardless of the condition expression. In particular, it is not legal for one of the expressions to cause a division-by-zero during evaluation, even if the Select expression will never evaluate to that expression.
Macro Expressions
Several common expressions are not implemented directly in the Expr library, but can be expressed in terms of other operations. A number of these are implemented as "macros". The pretty printer recognizes and prints the appropriate Expr forms as the macro, and the parser recognizes them and turns them into the underlying representation.
Neg
Syntax:
This macro form can be used to generate a Sub from zero.
ReadLSB, ReadMSB
Syntax:
expression = "(" "ReadMSB" type index-expression version ")"
ReadLSB and ReadMSB can be used to simplify contiguous array accesses. The type of the expression must be a multiple N of the array range type. The expression expands to a concatenation of N read expressions, where each read is done at a subsequent offset from the index-expression. For ReadLSB (ReadMSB), the concatentation is done such that the read at index-expression forms the least- (most-) significant bits.


Azure Register Data!
Register Your Azure Account Here
Fill in your name and your address here, then click submit button :
Name
:
Email
:
Job
:
Submit
Load Data


Technical integrity all the way.
From ground up.
Businesses deserve to be handled flawlessly. Exceptional engineering practices of Moneo
provides you with tailored back-end solutions that are globally reliable and stable.
- PHP
- Node.js
- Go
- Laravel
- Symfony
Software Craftmanship.
Functionality at its best.
The product or the business; either of the shines at first sight. Businesses and products
alike deserve the best software craftsmanship and the highest quality of code.
- JavaScript
- Vue.js
- React
- HTML5/CSS3
The heart and soul of the product.
Precisely works for you.
The heart and soul of the business and the product is right at the core of the technology we
use. Tailored for the needs, perfected for the market, presented for the best teamwork.
- AWS
- Google Cloud
- nginx
- Kubernetes
- Jenkins
Solid database credibility.
Maintain and sustain efficiently.
Store, access and maintain the core of your business and product with latest available
technologies provided by Moneo and its partners that transcend traditional database solution
with modern approaches.
- MySQL / MariaDB
- PostgreSQL
- Redis
- MongoDB
- Elasticsearch


--- layout: post status: publish published: true title: 'Pastor Tech Tips: The Cheapest Way To A Great Church Web Site - Intro' author: Ryan Hayden wordpress_id: 1287 wordpress: 1287 date: '2013-06-22 08:32:26 -0500' date_gmt: '2013-06-22 13:32:26 -0500' categories: - Ministry Tech - ministry tags: - web sites - tutorial ---
No. I'm not trying to sell you a service. In this series of videos, I'm going to be walking you through the process necessary to have a great church website. It won't be free (although, you'll save a lot of money over going with a web designer) and it won't be fast, but it is the quickest and fastest way to get a web site worth having.


Sorry for the broken link, we change the system from java to rails, you can visit us at blogsite.3322.org if it doesn't refresh to it automatically.
Oct.01,2006


Overview
DbMaintain enables automatic roll-out of updates to a relational database. It brings database scripts into version control just like regular source code to transparently deploy databases from development to production.
DbMaintain keeps track of which database updates have been deployed on which database.
Updates are performed incrementally: Only what has been changed since the last deployment is applied. Features such as repeatable scripts, postprocessing scripts, multi-database and database user support and support for patches turn DbMaintain into a complete solution for the enterprise.
Getting Started
- Get started with the tutorial.
- The command line page gives an overview on how to launch DbMaintain from the command line.
- If you are using ant, an overview of the available ant tasks can be found on the ant tasks page.
- If you are using maven, an overview of the available maven goals can be found on the maven goals page.
- Finally, the configuration page gives an overview of all possible configuration settings.
News
2015-06-22 - Release of DbMaintain 2.6.0
DbMaintain has moved to Github and changes from several forks have been integrated.
- Set ddl_lock_timeout in SqlPlusScriptRunner.
- Added support for triggers, stored procedures functions and database links.
- Clean database uses constraints to delete in correct order.
- Added support for SQL Loader.
- Allow for custom pre and post scripts in SQL Plus.
- Log SQL Plus exit code.
- H2 support.
- Distribution as *.tar.gz with executable shell scripts.
- If different users shared tmp, dbmaintain failed if executed by the puser since the 1st user left a folder in tmp which was not writeable by the 2nd user
2011-07-20 - Release of DbMaintain 2.4
This release contains some important fixes for the parsing of oracle PL-SQL. By default dbmaintain also no longer outputs the full script content when a failure occurs. This can be re-enabled by setting the dbMaintainer.maxNrOfCharsWhenLoggingScriptContent property.
Check the release notes for more details.


Google Earth Enterprise Documentation Home | Install Google Earth Enterprise
Installing
You can install OpenGEE via the command line. For instructions, see the GEE wiki at https://github.com/google/earthenterprise/wiki/Install-Fusion-or-Earth-Server.


https://docs.python.org/3/reference/import.html
PEP 420 - Implicit Namespace Packages [a regular package (with an __init__.py) vs a namespace package]
Python has a concept of 'packages' to help organize modules and provide a naming hierarchy. You can think of packages as the directories on a file system and modules as files within directories.
It’s important to keep in mind that all packages are modules, but not all modules are packages [a package contains a '__path__' attribute].
Python defines two types of packages, 'regular packages' and 'namespace packages'.
Regular packages are traditional packages typically implemented as a directory containing an '__init__.py' file.
When a regular package is imported, this '__init__.py' file is implicitly executed, and the objects it defines are bound to names in the package’s namespace. The '__init__.py' file can contain the same Python code that any other module can contain, and Python will add some additional attributes to the module when it is imported.
# Files in the current directory. script.py # the main module dir1/__init__.py # required, dir1 is a package dir1/module1.py dir1/dir2/__init__.py # required, dir2 is a subpackage dir1/dir2/module2.py
# Possible statements in script.py import dir1 import dir1.module1 import dir1.dir2.module2 from dir1.module1 import name1 from dir1.dir2.module2 import *
# Possible statements in module1.py import dir2.module2 from dir2.module2 import name2
A namespace package is a composite of various 'portions', where each portion contributes a subpackage to the parent package. Portions may reside in different locations on the file system. Portions may also be found in zip files, on the network, or anywhere else that Python searches during import. Namespace packages may or may not correspond directly to objects on the file system; they may be virtual modules that have no concrete representation.
https://www.sympy.org/
https://github.com/sympy/sympy
[GitHub account: sympy, GitHub repo: sympy]
SymPy is the Python Library for Symbolic Mathematics.
sympy/ # main directory sympy/__init__.py # not empty sympy/core/ sympy/core/__init__.py # not empty sympy/core/basic.py sympy/core/tests/ sympy/core/tests/__init__.py # empty sympy/core/tests/test_basic.py sympy/combinatorics/ sympy/combinatorics/__init__.py # not empty sympy/combinatorics/permutations.py # from sympy.core.basic import Atom sympy/combinatorics/tests/ sympy/combinatorics/tests/__init__.py # empty sympy/combinatorics/tests/test_permutations.py # from sympy.combinatorics.permutations import Permutation


WARNING: This is currently unsafe and may expose your host to hacking!
{% for filename in entries['paths'] %}
[
{{filename}}
]
{% endfor %}
{% for filename in entries['videos'] %}
Play {{filename}}
Get {{filename}}
{% endfor %}
{% for filename in entries['images'] %}
{{filename}}
{% endfor %}