# Data science for pathogen genomic surveillance: predicting phenotype from genotype - Eric J. Ma - PhD Candidate - Runstadler Lab, MIT Biological Engineering Follow slides online: [http://bit.ly/gptalk-em][github_repo] (This repo has really bad commit messages. You have been warned.) [github_repo]: http://bit.ly/gptalk-em --- ## A little about the Runstadler Lab
- **Influenza surveillance** in wild animal populations - Specific problems: + Infection dynamics in wild animals + Molecular characterization of viral isolates + Experimental evolution to understand viral dynamics + Virus-environment interactions --- ## A little about me - 5th year PhD Candidate & Resident Hacker in the Runstadler Lab, MIT Biological Engineering. - Self-taught 3 year-old Pythonista. - I solve infectious disease data science problems using the Python programming language. - Specific problems to date: + Computing the quantitative importance of reticulate evolutionary strategies for pathogen host switches. (*in writing*) + Quantitatively predicting viral phenotype from sequence data. (*today's talk*) + Building my own influenza DBG assembler. (*for fun*) + Figuring out how to phase influenza genomes from mixed infections. (*not just for fun*) --- ## Today's Goals 1. Outline R21 proposal to predict phenotype from genotype. 2. Show with live code that, given high quality data, it is easy to get up and going. --- ## The Problem(s) Given only its genomic sequence, how do we tell whether a pathogen is going to be dangerous or not? How can we better **use genomic surveillance for pathogen risk assessment**? Can we do better **preventative surveillance of zoonotic pathogens**? --- ## Influenza The specific pathogen I work with is the Influenza A Virus.
```python class Influenza(Pathogen): def __init__(self): self.substitution_rate = 10**(-3) # in units subst/(nt.yr) self.polymerase_genes = set([1, 2, 3, 5]) self.segments = range(1,9) self.can_reassort = self.has_segments(True) ``` --- ## How influenza genomic surveillance is done now 1. Chase down outbreaks. 2. Look for known mutations that are experimentally tested to enhance some pathogenesis-related phenotype. 3. Experimentally try to evolove those mutations in the lab. 4. Expert panel inferring rules from publications. (reference: [CDC **I**nfluenza **R**isk **A**ssessment **T**ool][irat]) ## How we think genomic surveillance should be done 1. Sample source before sink. 2. Quantitative biochemical measures relevant to pathogenesis. 3. Standardized, safe, and scalable biochemical assays to match genotype and phenotype. 4. Measurements done on both host *and* pathogen. [irat]: http://www.cdc.gov/flu/pandemic-resources/tools/risk-assessment.htm --- ## Difficulties
- **Sufficiency/Necessity**: Presence of mutation may enhance phenotype, but may not necessarily cause a "dangerous phenotype levels" - **Epistasis**: Non-linear mapping from genotype to phenotype - expert rules alone are not enough - **Data**: Lack of high quality genotype-phenotype data - **Experiments**: Not many assays measure biochemical phenotype that is plausibly related to pathogenesis - **Biology**: Novel sequence diversity generated through error-prone polymerase --- ## Our Plan: Characterize the Polymerase
- **Rational sampling** to cover polymorphic diversity. - **High throughput** library construction & verification - **Safe, scalable, standardized** assay of RNA replication rate - **Matched** phenotype from genotype - **Machine learning** models to predict RNA replication rate - **Open data** via web interface and API --- ## Vision
- **Biochemical assays**: quantitative measure *relevant* to pathogenesis - **Characterize**: population diversity - **Machine learning**: learn mapping of phenotype from genotype. - **Model**: risk profile. --- ## Vision in Code ```python # Collect data assay_data = [ReplicationRate(data1), DrugResistance(data2), AntigenicDistance(data3)] # Train ML models models = [] for data in assay_data: model = MachineLearningModel(data) model.train() models.append(model) # Compute risk profile risk_profile = AggregateModelResults(models) # Make predictions new_virus = Sequences(viral_sequence) new_virus_risk = risk_profile.predict(new_virus) ``` --- ## Can we do this?
- **Parallel problems**: HIV drug resistance [Stanford HIV Drug Resistance Database][stanford_db]: 1. comprehensive 2. high quality standardized data 3. sequence matched to fold drug resistance phenotype [stanford_db]: http://hivdb.stanford.edu --- ## Live Demo - [static version][github] [github]: https://github.com/ericmjl/hiv-resistance-prediction/blob/master/Predict%20HIV%20Genotype%20from%20Phenotype%20-%20Custom%20Funcs.ipynb - Tools used - [scikit-learn][sklearn] (aka sklearn): general purpose machine learning library - [nolearn][nolearn]: sklearn API-compatible neural network library [sklearn]: http://scikit-learn.org/stable/ [nolearn]: https://pythonhosted.org/nolearn/ --- ## Genomic Surveillance of the Future 1. **Quantitative Precision**: Precision medicine needs to be complemented with precision prevention. 2. **Predictive Surveillance**: We can tell what will be dangerous before it jumps to humans & farms. --- ## With Thanks
- [Jon Runstadler][runlab] (advisor, MIT) - [Islam Hussein][ihus] (data, MIT) - [Mark Bathe][lcbb] (committee chair & GPU access, MIT) - [JP Onnela][jp] (committee member, HSPH) - [Danny Park][dpark] (invitation, Broad Institute) I'd love to set a time to chat with everybody! [dpark]: http://www.sabetilab.org/daniel-j-park/ [ihus]: http://www.islamhussein.com [runlab]: https://runstadlerlab.mit.edu [lcbb]: http://lcbb.mit.edu [jp]: http://www.hsph.harvard.edu/onnela-lab/


Configuration vs Customisation
I loved a recent post by GIS luminary Peter Batty about forthcoming developments in the GIS industry. However, I was struck by his allusions to a future release of Smallworld which would dispense of the problems caused by the common practice of individual clients writing custom software to tailor the system to their specific needs, by allowing sufficient data-driven customisation out of the box. I wrote a response which I think I'm going to post here as well.
My interest and excitement was tinged with a frisson of trepidation, at the description of the configurable GIS behaviour. I know there's a whole phalanx of very smart engineers at GE, who are no doubt immeasurably more cognisant of the following issues than myself. But, as is my wont, I'm not going to let that get in the way of an opportunity for a jolly good rant, so here goes.
Obviously data driven behaviour is brilliant. However, it's only good up to a point. Once the behaviour in question becomes complex enough (and a GIS definitely qualifies), there's a real risk of the Inner Platform effect: In an effort to achieve the same levels of flexibility as the programming languages that it is designed to replace, the configuration system ends up replicating all their features - badly.
Such an endeavour is caught between two stools. If it is insufficiently ambitious, the configuration will not be flexible enough to meet clients' needs. If it does manages to capture the power of the programming languages it replaces, then it is Turing complete, and all you have done is convert customisation using a standard, proven, well-known programming language into configuration using a ghastly proprietary language that is embedded within your configuration schema.
In addition, creating such a configuration actually ends up being much harder for clients. It requires deep proprietary skills, as opposed to common skills like C#, and it cannot lean on any of the supportive ecosystem of tools and knowledge that an established language has built up over the years. Perhaps worst of all, it will *still* require software engineering skills to perform the configuration, and all the good software engineers will have run a mile.
Like I say, no doubt there are smart people at GE who have been figuring out solutions to all this for years by now, but I'd have to hear what those solutions were before I'd trust such a system.
To my way of thinking, the best solution to the problem is to acknowledge that the best way of specifying behaviour is to use a programming language - that is exactly what they were designed for. Trying to sidestep that is simply swimming against the current, and you need to embrace it. You want a domain specific language (DSL), so that it is concise and intuitive for clients, but you don't want it to be a proprietary language - that way lies madness. So what you need is to provide is a library that extends an existing, established language, making it into your GIS DSL. Creating DSLs from Python or Ruby is all the rage these days, and I believe the above chain of reasoning is why.


The dot command does not support arguments in sh/dash. Set them as variables.
#!/bin/sh
. include/myscript example.com 80
#!/bin/sh
host=example.com port=80 . include/myscript
In Bash and Ksh, you can use . myscript arg1 arg2..
to set $1
and $2
in the sourced script.
This is not the case in Dash, where any additional arguments are ignored, or in POSIX sh where the behavior is unspecified.
Instead, assign arguments to variables and rewrite the sourced script to read from them.
None.


I am a results-oriented full stack developer and graphic designer. While working in the fashion industry I gained invaluable experience designing and executing within tight deadlines. I use my passion of pop culture and current design trends to help curate each project so they have a fresh, modern look that captures the users attention. I believe that finding the solutions within the constraints of each project I work on pushes me to become a better developer and designer. I put an emphasis on user experience to ensure my websites are easy to navigate and visually clear. I am an avid learner and love exploring new technology to constantly enhance my abilities and evolve my style.


#
Create Room
Do your question
What do you want to question?
Perguntas da Comunidade
Delete question
Are you sure want to delete this question? Its forever!
Cancel
yes, delete
Cancel


Emmanuel2J
Home
The title of my blog post
Published Oct 28, 2021
Hullo. This is my second blog post. This stuff is very easy, but I am pretty sure thats because all the main coding has been already done. I am still having fun tho.


PizzaTamu
-- Amazing taste Awesome life --
VISIT US TODAY!
NAIROBI EMBAKASI
Corner House
Ground floor
+24514728941
Opening Hours
Mon-Fri :8.00am-8.00pm
Sat-Sun-- 10.00am-7.00pm
DELIVERY
Ready For Pizza Goodness? Our delivery coverage areas include selected areas in Westlands, Parklands, Nairobi CBD, Waiyaki way, Kinoo and Kikuyu!


{% extends 'base.html' %} {% block content %}
Shows the number of flight routes taken to different destinations by a particular airline over all time, or over a particular year.
Optional: Only show flight routes from a given airport.


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/travis.3A.20fork.20cannot.20allocate.20memory.html ---
What does this Travis error mean?
https://travis-ci.org/leanprover-community/mathlib/jobs/541682321
It means restart the build and it will probably work.
Tried that... failed again :sad:
I guess lean ran out of memory
Can you build it on your own computer?
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


WiFi thermostat
Overview
Involvement
Startup instructions
JSON client
Contact
Ethernet thermostat
Repository project - Github:
WiFi thermostat
ESP8266
ESP32
WiFi
DS18B20
OneWire
Dallas
HTML
Webserver
WebSocket
JSON
mDNS
UART
Dallas DS18B20 - case TO-92
Dallas DS18B20 - exterior design
SSR relay OMRON G3MB-202P
Electromagnetic relay SRD-05VDC-SL-C
Pinout of the DS18B20 sensor in the TO-92 housing, or in a water test version
ESP8266 (ESP8266-12E, NodeMCU, Wemos D1 Mini)
Table connection of terminals - ESP8266
ESP8266
Relay
GND
GND
VIN / VUSB (Depending on the power supply)
Vcc
D2 (GPIO 4)
IO
ESP8266
DS18B20
GND
GND
3V3
Vcc (PIO)
D1 (GPIO 5)
DATA
Wiring diagram - WiFi thermostat - ESP8266 (NodeMCU, Wemos D1 Mini):
Connected WiFi thermostat - development kit NodeMCU v3 Lolin v with sensor DS18B20 on OneWire bus via breadboard:
ESP32 (WROOM-32, DevKit V1, DevKitC V4)
Table connection of terminals - ESP32
ESP32
Relay
GND
GND
VIN
Vcc
D22 (GPIO 22)
IO
ESP32
DS18B20
GND
GND
3V3
Vcc (PIO)
D23 (GPIO 23)
DATA
Wiring diagram - WiFi thermostat - ESP32 (DevKit):
Connected WiFi thermostat - development kit ESP32 Devkit V1 with sensor DS18B20, SSR relay OMRON G3MB-202P:
The following types of thermostats can be replaced:
WiFi thermostat can be integrated instead of an existing room thermostat with COM and NO contact without any change in connection.
After connecting the boiler to the COM and NO contacts, it can be used immediately and controlled with the set data in the web interface.
Replaced thermostats during WiFi thermostat test run: -
reported by thermostat users
EMOS Thermo
SALUS 091FL
EBERLE 525
HONEYWELL CM27
TECH CS-296


About
Experience
Education
Skills
Interests
SAFE
FLY
Programmer
<EMAIL_ADDRESS>EXPERIENCE
Website Administrator
Office of Student Affairs, NCU
October 2018 - Present
System Developer (Intern)
Intelligence In Text, Solution Service, Delta Research Center, DELTA
April 2018 - August 2018
System Developer (Part-time)
University Entrance Committee for Overseas Chinese Students
June 2017 - January 2018
Teaching Assistant
Programing, Statistic, Linux in NCNU
September 2015 - June 2018
EDUCATION
National Central University
Master of Information Management
Intelligence Process Technology Lab
September 2018 - Present
National Chi Nan University
Bachelor of Information Management
GPA: 3.93
September 2014 - June 2018
SKILLS
Programming Languages & Tools
Skilled
HTML
CSS
JavaScript
Bootstrap
Git
NodeJS
Python
Beginner
PHP
MySQL
MongoDB
JQuery
React
Workflow
Responsive Web Design
Git workflow
Agile Development & Scrum
INTERESTS
Singing
Dancing
Traveling


--- layout: docs template: t-docs title: Utilities > MARGINS name: margins collection: docs-margins ---
The margins utilities contain helper classes to force the CSS margin-top, margin-right, margin-bottom and margin-left properties.
.u-mv--medium applied
In the playground you can change throught the different medium spaces utilities, ineed you can find the same utilities for all spaces.
The mixin loop all defined spaces and outputs helper classes for each space and utility.
The mixin loops for all the nested colors map and output the different classes:
So you can find utilities such as:


{{if .Pjax}} {{template "header.html" .}} {{else}}
Nickname
Nickname, up to 32 characters.
Profile Comment
Write anything you'd like to be shown on your profile. Just make sure it doesn't violate our rules.
Region
Enter your region here. It'll appear on your profile. If you want to use your location, you can grab it here (it will not be saved automatically).
DiscordTag
YouTube Channel/URL
Add your YouTube channel or a random URL here.
PlayStation Network Username
Nintendo Switch Friend Code
We recommend that you include the "SW-" at the start and seperate the numbers with dashes.
Twitter
Don't add an "@" symbol at the start if you want it to be linked on your profile.
Steam
Nickname Color
This is the color your nickname will appear as.
{{.User.Role.Organization}}
{{.User.Username}}
Theme Color
This is the color that will be shown on the site's menus, as well as on your profile to everyone else.
Who should be able to see your Nintendo Network ID?
Who should be able to send you friend requests?
What's your preferred pronoun?
Who should be able to see your Yeahs given?
Who should be able to see your comments made?
What should the default privacy setting for your posts be?
Forbidden Keywords
Posts or comments that contain any of the keywords you type here will be hidden from your view. Seperate each phrase with a comma (","), and type "\," to look for an actual comma. (and type "\\," to actually find "\,")
Example: "arian,kordi,closedverse"
Email Address
Enter your email address here. This will not be displayed on your profile.
Nintendo Network ID
Enter your Nintendo Network ID here. It'll appear on your profile if you set it to be visible.
Do you want the avatar shown beside your content to use the Mii from your Nintendo Network ID or an avatar?
Import Posts
You can import your posts from other websites using this tool.
Here you can view your past post imports, and undo them if you wish.


[#include "include/global_meta.html"/]
${site.name}
[#include "include/global_favicon.html"/]
[#include "include/global_css.html"/]
[#include "include/global_js_in_head.html"/]
[#include "include/global_navigation.html"/]
你好，世界！首页模板
[#include "include/global_footer.html"/]
[#include "include/global_js_in_foot.html"/]


GPS-Position¶
This element provides a button to navigate to your current position and display a symbol at that position. The scale will not be changed until you activate zoom to accuracy (zoom to accuracy on first position)
.
The function is built upon the Geolocation-API by the W3C. To validate that your browser supports this functionality please take a look at the Can I Use page. The function uses the High Accurcacy Parameter
that forces the positioning via GPS. If your device is shipped with a GPS-receiver and if it is activated the positioning is more accurate. Otherwise the WIFI access-points are used for positioning.
The midpoint shows the probable position of the device, the outer circle the accuracy of the positioning, that means the region where the position is probably to find.
Compatibility: Internet Explorer and MS Edge devliver without a GPS-reciever at the machine imprecise informationen. This behaviour is also observable with other applications.
Configuration¶
- Show label: Switches the button label on/off.
- Autostart: true/false, default is false.
- Title: Title of the element.
- Tooltip: The text entered as a tool tip will be indicated by hovering over the element with the mouse cursor a longer time.
- Icon: icon to display on button.
- Target: Id of Map element, activated after the click.
- Average: calculates the average of the last at parameter average defined amount of received GPS coordinates, default 1.
- Refreshinterval: refresh interval in ms, default is 5000 ms.
- Follow: default false, true refreshes the map for every received GPS position received, only use with WMS in tiled mode.
- Center on first position: center map only on first received GPS position.
- Zoom to accuracy: zoom map according to received GPS position accuracy.
- Zoom to accuracy on first position: Zoom map according to first received gps position accuracy.
YAML-Definition:¶
The element is placed as a button into the toolbar.
class: Mapbender\CoreBundle\Element\GpsPosition
label: true # true/false to label button, default is true
autoStart: false # true/false, default is false
title: GPS-Position # title of the button
tooltip: GPS-Position # text to use as tool tip
icon: gpsposition # icon to display on button
target: map # Id of Map element to query
average: 1 # calculates the average of the last at parameter average defined amount of received GPS coordinates, default 1
refreshinterval: 5000 # refresh interval in ms, default is 5000 ms
follow: true # default false, true refreshes the map for every received GPS position received, only use with WMS in tiled mode
centerOnFirstPosition: true # center map only on first received gps position
zoomToAccuracy: false # zoom map according to received gps position accuracy
zoomToAccuracyOnFirstPosition: true # zoom map according to first received gps position accuracy
Class, Widget & Style¶
- Class: Mapbender\CoreBundle\Element\GpsPosition
- Widget: mapbender.element.gpsPostion.js
- Style: mapbender.element.gpsPosition.css
HTTP Callbacks¶
None.
JavaScript API¶
None.
JavaScript Signals¶
None.


Ntxt software is licensed under the MIT license. A copy of this distribution's copy is available here.
Or here:Javascript load of LICENSE file should replace this.
A tool to view n.txt formatted notes files.
Ntxt is a reference to my n.txt
file. In that file are notes
in plain text. There are some wiki-like conventions to give it structure and
help guide my reading and assist in searching or grepping for information.
There is no way to edit the n.txt
file through ntxt.html.
It's just here as a display tool.
Header lines look like something you would see out of a wiki.
= Header 1 = == Header 2 == = Another Header 1 =
Header 1 is the largest and highest header. All text after it, aside from another 1-header, will be considered a sub-block. In the example "Header 1" and "Another Header 1" are the two top-level blocks. "Header 2" is a child of "Header 1".
Indentation also forms blocks.
= Header 1 = == Header 2 == Sub block of header 2. Sub block of the preceding line. Another block below header 2. = Another Header 1 =
In the above example Header 2 has 1 sub-block because there is an indentation of 2-spaces with an intermediate indentation of 4-spaces. That 4-space line is bundled into a subblock to the 2-space indented block of text.
The only ways to break out of this 2-indent text is to:
Lines beginning with [tag1] [tag2] (ignoring whitespace) are considered to
have tags tag1
and tag2
. For example:
Block1 [block 1 tag] [example] [this is tag] Block2 [not a tag] [block 2 tag] [example]
Notice, tag names may have spaces. Both blocks are tagged with
example
. And finally, not a tag
is, well,
not a tag. It does not start a line.
Also note that you can't tag header blocks directly because the header line must start with = and tag lines must begin with [.


{{site.user_description}}
University of Toronto
Bachelor of Commerce
Sep 2015 - Jun 2019
University College London
Exchange Program, Economics
Jan 2018 - Jun 2018
University of Oxford
Summer Program, Finance
Aug 2017


Directive - Private scope
* {{phones.nokia.model}}
* {{phones.xiaomi}}
1st phone
2nd phone
Directive - Example
Just the template language
Nothing here {{'yet' + '!'}}
Controller
First Controller
{{message}}


The top half of each code block is editable.
In the bottom half, a code block will display the return value of the last expression in the top half.
All code blocks share the same environment, so updating a function or variable will affect all other blocks.
Duplicate identifiers bound with (define)
will override previous definitions and have effect on its own code block plus subsequent ones.
(define x 12)
(define y 3)
(define countries '(france italy portugal spain))
(+ 1 2)
(+ x y)
(- x y)
(* x y)
(/ x y)
(length '(1 2 3))
(length '())
(length 'nil) ; unlike Common Lisp, there is no "nil" in Scheme
(append '(1 2 3) '(4 5 6))
(reverse '(1 2 3))
(member 2 '(1 2 3))
(member 15 '(1 2 3))
(member 'italy countries)


Diegetic Games
About
Blog
Learn
Story Games
Podcasts
Collaborative Storytelling
404
Page not found :(
The requested page could not be found.


--- layout: post title: The Catalyst of the Industrial Revolution date: '2010-01-12 21:46:46 -0700' mt_id: 1417 blog_id: 1 post_id: 1417 basename: the-catalyst-of-the-industrial-revolution categories: - essays ---
The Industrial Revolution remains one of the most controversial episodes in American history. Many scholars have vilified the entrepreneurs of the time as "robber barons" and scoundrels with few exceptions. Business historians, in the main, have treated the Industrial Revolution with moral blinders on, objectively examining the history of the many corporations that were created during this period while refraining from drawing conclusions about the larger events.1 Its importance is obvious: the significance of the modernization of the American economy and its rocketing to global dominance cannot be understated. But was this robust growth effected by the exploitation of the workers or through shady business dealings alone? Stripped of moral reproach or microscopic specialization, what are the underlying facts of the revolution? In this essay, we will examine the nature and source of the Industrial Revolution in America—showing its different phases and explaining its causes—in an effort to understand how businessmen were able to realize a level of economic growth unprecedented in all of history.
Before we begin, was the Industrial Revolution really a revolution? Sociologist James DeFronzo, in his book Revolutions and Revolutionary Movements, defines revolution as a "social movement in which participants are organized to alter drastically or replace totally existing social, economic, or political institutions."2 This definition is not particularly useful here, though, because it primarily applies to political revolutions, such as those in Russia, China, and France. One could not call the Industrial Revolution a "social movement" since it was not society at all that changed the economic structures. Moreover, the Industrial Revolution did not alter the political institutions of America—the limited government present before the revolution was just as limited after it.3
Better is historian William N. Parker's phrasing: "'Revolution', as the word is used in economic history, commonly means a thoroughgoing change in production processes and in the social organization of labour, occurring at a faster than customary pace."4 The Industrial Revolution was a move away from cottage-based production and into the modern factory system. In addition, labor's role in production was more strictly delimited. No longer was production performed by apprentices at a master's direction—each apprentice doing varied work as required by each product or item. Instead, managers set up the factory such that each worker had but one task to perform and that manual task was repeated day in and day out, day after day. Using this conception of revolution, we can see that the Industrial Revolution is clearly a "real" revolution.
As mentioned earlier, our goal in this essay is to understand the nature of the American Industrial Revolution and the catalytic/causal forces that drove it. Over the years, there have been a number of different theories advanced to account for the Industrial Revolution and its spectacular production of wealth. The two most prevalent are Marxism and determinism. These two have had the most influence in American historical thought, but there have been others. These other theories tend to not have the same influence because they, like the aforementioned case studies of individual corporations, are insufficient for understanding.
The "great-man" theory, for example, posits that history is driven by superlative individuals and would have been totally different without them. In business history, this means that men like Rockefeller and Carnegie were the engines of the Revolution. I do not mean to downplay their importance, but the theory fails to account for the multitude of other firms that lacked such powerful leaders yet still played important roles.
Some have also argued that factors that are unique to America produced the stunning growth. American isolation from warring powers, its extensive natural resources, and its significant immigration have all been proposed as causes of economic growth. While these are all important factors, none of them are fundamental since other nations have lacked such factors and have still experienced significant growth. Thus, I will confine myself to examining only the two most important theories.
Of these, Marxism is, by far, the predominant explanation. In this theory, workers were responsible for production of goods. The entrepreneurs took these goods and marked them up in order to make a profit. In other words, big business prospered on the backs of its workers. As Lawrence Glickman put it, "wage slavery resulted from the difference in value between what workers produced and what they earned in wages, which was often said to have been stolen from them."5 Thus, the source of the Industrial Revolution's wealth generation was the exploitation of its workers. Karl Marx observed that, under capitalism, to "be a productive laborer is … not a piece of luck, but a misfortune."6 To be sure, Marxist theory recognizes that workers themselves did not have adequate capital to purchase the expensive machinery necessary for maximum production. Instead, Marxism holds that this machinery enabled "employers to use fixed capital, to increase the pace of production, lengthen the working day, and extract increased surplus."7
Why, then, did the Industrial Revolution happen when it did? Parker suggests that a "… change in technology or organization (or in both) in one sector conduce[s] to parallel or reciprocal changes in the other."8 In other words, the changing agricultural sector led to growth in the industrial sector. Parker, then, agrees with Marx: "the development of capitalism in agriculture required the displacement of the village system of tenure and work organization, and that displacement in turn 'released productive forces' which allowed commercial farming and modern factory industry to grow within a market economy, i.e. within a capitalist framework."9 The move of labor away from agriculture provided the capitalists human fodder to work their machinery and generate their profits.
Another important framework for explaining the American Industrial Revolution is determinism. Determinism in this context can be found in two variations: market and technological. Market determinism, propounded by historian Robert Higgs, holds that the revolution was the inevitable consequence of market forces. The individuals participating in the market are merely responding to economic laws through economic calculation. Higgs notes that although "[n]o one planned or directed of the organization of economic life in any formal, overall way" the market overall was "orderly and in many ways predictable."10 For Higgs, the central feature of the period was economic growth and he describes this period as one of economic growth through transformation: "changing patterns of demand; differing rates of productivity gain among industries; and changing resource endowments among regions."11 Further, "to the extent that people fail to adjust to the economy's transformed structure, economic growth is retarded."12 Individuals have little control over their destiny: they can either accept market imperatives and participate in the economic growth or they can reject them and risk being left behind. This is what Higgs' argument amounts to, though he goes into greater detail about the activities of the market forces.
Technological determinism similarly leaves individuals out of the equation. It is the theory that innovation begets innovation. The early innovations in textile manufacture led to improvements in power generation which led to innovations in metallurgy. This group of innovations led to the discovery of interchangeable parts and touched off a revolution in manufacturing because of it. That led to railroad development which spurred the iron and steel industries to greater heights of production.13 Historian Robert Fogel observes that the "process of innovation was … continuous, so that practically every decade of the nineteenth century produced important and far-reaching technological advances."14 Perhaps the best example of this view is historian David Landes, who wrote:
The heart of the Industrial Revolution was an interrelated succession of technological changes. The material advance took place in three areas: … substitution of mechanical devices for human skills; … inanimate power—in particular steam—took the place of human and animal strength; … a marked improvement in the getting and working of raw materials.15
These new technologies required large amounts of capital both to procure and maintain. This fact lead to innovations in business organization and finance in order to provide it. Economic growth, then, was attributable to a series of technological innovations, according to this view.
Both Marxism and determinism, popular as they may be, fail to fully explain the causes and nature of American growth during the nineteenth century. Marxism ignores the role of the entrepreneur because factories don't make themselves. Workers can only take jobs in the factories because an entrepreneur or group of entrepreneurs have raised the capital necessary for its construction and concocted a business plan justifying its existence. While workers are vital to production, their labor is not the most fundamental: it is the entrepreneur's that counts most.
Determinism completely eliminates human agency—and that is its failing. Technology does not develop naturally: it requires a human inventor, human entrepreneurs to realize its potential, human engineers to design machines to mass produce it, and human operators to work those machines. Technology is definitely an important factor in explaining how the Industrial Revolution produced the economic growth that it did, for it would be impossible to have the Industrial Revolution without the incredible productivity gains engendered by technology. Similarly, market forces did not drive entrepreneurs to produce except insofar as each entrepreneur discovered and calculated that he could do a better or less expensive job producing a product than others. It is ludicrous to argue that entrepreneurs were simply responding to market demands because examples abound of industrialists who created vast empires where market conditions were unfavorable.16 It is clear that individuals had important roles to perform in the prosecution of the Industrial Revolution. What is not clear is what factor or factors provided the impetus for the economic growth. We have ruled out worker exploitation, technology, great men, geography, and market forces as determinants. What's left?
Before we can fully answer that question, we must look at the nature of the American Industrial Revolution. The revolution took place over the course of the nineteenth century in two distinct phases, with the Civil War serving as the transition point. The first phase begins in the 1840s and ends at the start of the Civil War in 1861. The final phase begins during the Civil War and ends around the turn of the century. There is some overlap because the Civil War, though intensely disruptive and destructive of commerce, did foster some business innovations out of necessity. However one may demarcate the two phases, it is clear that there are differences between them. In the coming pages, we will examine each phase in more detail in order to illuminate these differences and perhaps thereby come to a conclusion about the cause and catalyst of the Industrial Revolution.
High growth characterized the first phase of the revolution. Unfortunately, there are conflicting estimates about this growth because explicit data about this growth are unavailable. The Bureau of the Census did not collect manufacturing statistics until the 1850 Census and it didn't break that data down by specific industries until the Census of 1880. For this reason, Simon Kuznets, Nobel Prize winner in economics, considered Censuses prior to 1880 to be unreliable for analytical purposes.17 Other economists, such as Robert E. Gallman, have made use of these intervening Censuses through statistical extrapolation to divine growth statistics for the period. Gallman examined two general measures of economic growth—total commodity output and value added by manufacture18—and found significant gains. Of total commodity output, he writes: "Between 1839 and 1899 total commodity output increased elevenfold…. Actual rates varied fairly widely, high rates appearing during the decades ending with 1854 and 1884, and a very low rate during the decade ending with 1869."19 Of value added by manufacture: "Gallman's series for value added in constant dollars of the purchasing power of 1879 shows a rise of 157 per cent from 1839 to 1849; 76 per cent from 1849 to 1859 …."20
Other measures of economic growth also support this characterization of the period. Per capita gross national product between 1839 and 1859 rose by 37%.21 This meant a substantial increase in the American people's standard of living. Exports rose from $71.8 million in the 1830s to $144.4 million in the 1850s. Imports rose from $62.7 million to $172.5 million for the same period.22 These indications of international trade indirectly show the vitality of the American economy. Also, an average of 259,821 people per year immigrated to America in the 1850s.23 Immigrants typically flock to prosperous nations. Perhaps the best way to understand the nation's economic growth is to examine the expansion of two vital industries: manufacturing and transportation.
Manufacturing is a very broad term denoting the production of goods from raw materials. Data, as noted earlier, is sketchy overall. Measures of coal output, pig iron production, and textile manufacture are available and reliable, however. Coal's importance to economic growth cannot be overemphasized. During the first half of the nineteenth century, power came from only two sources: water and steam. Water was, by far, the poorer source since a factory or mill had to be located adjacent to a fast moving stream in order to capture its flow. A machine powered by steam could be located anywhere, but steam requires an abundant source of energy to heat the water. That source of energy was wood or charcoal, a wood byproduct, until anthracite coal became available in the quantities necessary for industrial purposes in the 1830s. Coal had the advantage of burning hotter and longer than wood. By the mid-1840s, coal production had reached 2 million tons and the priced had dropped to $3 a ton (from close to $10 a ton in the early 1830s).24 By 1860, coal production hit 14 million tons and America was importing an average of 235,000 tons per year as well.25
The advent of coal spurred on the production of pig iron, which is crude iron cast in blocks. In 1840, anthracite coal was used for the first time to power a pig iron blast furnace. Sixty such furnaces were in operation by 1849 and 121 by 1853. Forty-five percent of all pig iron was produced using anthracite coal by 1854.26 Pig iron, though, is not something that a consumer wants. Iron only becomes useful once it is made into wrought iron.  "Not only did the output of establishments making axes, scythes, hoes, and plows increase, but for the first time the fabricating and assembling of interchangeable parts became widely used in making metal goods besides guns for the United States army," writes historian Alfred D. Chandler Jr. "Locks, safes, clocks, and watches were produced in large departmentalized factories." Chandler further notes that the production of interchangeable parts required specialized machinery which led to "the creation almost overnight of the American machine tool industry."27
But coal wasn't just important for pig iron production. The availability of an inexpensive fuel source increased the use of steam power. Factories that previously had to rely on a nearby stream could relocate to more propitious locations, closer to laborers and large markets. The textile industry, in particular, benefited from steam-powered machines. From 1840 to 1860, the number of spindles in operation had more than doubled to 5.2 million.28 Also, the number of bales of cotton consumed in domestic manufacture rose 143% from 1840 to 1850 and 47% from 1850 to 1860.29 This development made it possible for "the factory to replace the artisans, the small mill owners, and putting-out system as the basic unit of production in many American industries."30
But economic growth didn't just happen in the manufacturing sector. In fact, it was even more pronounced in the transportation arena. Prior to 1830, transportation was slow and erratic. Travel was primarily by horse and boat. Both means of travel had incredible shortcomings: horses could only pull so much and navigable waterways were not always convenient. The latter issue was mitigated by the construction of canals to link towns and waterways, although these canals froze over during the winter months. The coming of the train changed all that. Transportation was no longer constricted by terrain or climate considerations. The train could go anywhere anytime—rapidly. The first transitional steps were hesitant because of the significant entrenched interests in the form of turnpike, canal, and stagecoach operators.31 Even though 3,000 miles of track had been laid by 1840, the railroads were primarily used to connect commercial centers and to supplement waterways. Roads were short, generally not over fifty miles in length.32
Things changed during the 1840s and 1850s. Technological improvements in the production of locomotives, passenger cars, and rails in addition to uniform standards in tracklaying led to the rapid development of the nation's railroads. In 1850, there were 3,700 miles of canals—an increase of 700 miles since 1840—while railroads had almost 9,000 miles of track.33 During the 1850s, they added an additional 21,000 miles of track.34 More importantly, trunk lines connecting the east with the west were built by the giants of the industry: the Erie, the Baltimore and Ohio, the Pennsylvania, and the New York Central. By 1860, the railroad had displaced the waterways as the primary means of transportation for everything except agricultural products and lumber.35 Passenger traffic rose from 90.1 million passenger miles in 1839 to 1.88 billion passenger miles in 1859; freight traffic increased even more: from 32.8 million ton-miles in 1839 to 2.58 billion ton-miles in 1859.36
This era also saw a high number of inventions and technological growth. The annual number of patents stood at 544 in 1830, 993 in 1850, and 4,778 in 1860.37 Some of the more notable agricultural innovations were the steel plow in 1837, the grain elevator in 1842, and the McCormick reaper in 1846.38 Iron-making inventions abounded as well. As noted earlier, the first anthracite coal blast furnace was used to make pig iron in 1840. Heavy iron rails were first successfully rolled in 1845.39 Other inventions that had profound effects were the telegraph, invented in 1832 but unused until 1844, and the sewing machine, invented in 1846 but first mass produced by Isaac Singer in 1853.40 The telegraph made instantaneous communications possible and enabled railroads to coordinate traffic; the sewing machine destroyed the home-based clothing industry—workers could operate sewing machines in factories where managers could control quality and production.
The economy changed during this period on the microeconomic scale as well as the macroeconomic scale that we've been discussing. Individual businesses, with a few exceptions, tended to be specialized in their aims, fairly small, and managed by their owners. Specialization developed over time as production separated from distribution, which separated from marketing. For example, "an iron furnace of the 1850s normally made only pig (cast) iron; it did not convert the cast iron into semi-finished wrought iron or into finished products such as nails or hardware."41 Similarly, "an ironmaster of 1850 would simply turn over the marketing of pig iron to a separate businessman (an iron merchant like Baltimore's Enoch Pratt) who sold the goods and charged the ironmaster for his services."42 In the agricultural sector, the network of commodities dealers came into existence around this time. Commodities dealers dealt with what are today called "futures"—the purchase and sale of the anticipated product of future harvests. On the manufacturing side, we see the distinction drawn between wholesale and retail by merchant houses, who further specialized by handling one particular variety of goods. The merchant houses sold their wares to jobbers, whose role was to market to the thousands of retail establishments around the country.43 These arrangements enabled manufacturers to reach markets that they could not have reached before due to a lack of resources.
They lacked these resources because their operations tended, with a few exceptions, to be small. The largest American industrial firm at the end of the period under consideration was the Pepperell textile mill. It employed around 800 people—puny by today's standards.44 Most manufacturers had little in the way of physical plant or machinery. Alexis de Tocqueville noted in the 1830s that "what most astonishe[d] [him] in the United States [was] not so much the marvelous grandeur of some undertakings, as the innumerable multitudes of small ones."45 Even iron furnaces had in 1849, on average, around eighty workers and an average capitalization of $83,000—much smaller than one would expect given the quantities of iron they produced.46 They were small because they tended to be financed by a single person or by several people in partnership. Historian Robert Higgs argues that "most businessmen conducted their affairs within small and highly localized markets, and therefore proprietorships and partnerships predominated."47 The limits of capital for one person or a handful of people are pretty substantial. This small capitalization, though, encouraged Americans to enter into business. "The fact that it was easy to enter business nurtured the belief that the society was open and fluid, that this was a land of opportunity," notes historian Glenn Porter. "The goods most men bought were made and sold by small businesses, and because the capital requirements for most businesses were small, people could easily dream of owning and operating their own establishments."48
Management of these small businesses was informal and generally performed by the owners and partners. The Pepperell textile mill mentioned earlier could still be "toured and understood by a single manager in a matter of a few hours," even though it was the largest American industrial firm.49 The managerial hierarchy as we know it today simply did not exist. Salaried managers were employed at the large textile firms, but at few other places. Porter characterized the management of these small businesses thusly:
Relationships between owner-managers and their workers were also quite personal. Because the manager saw his few employees frequently and lived with them in the same town, he could at least be expected to know their names, the quality of their work, and perhaps even some things about their personal lives.50
We get a picture of a management not entirely different from the earlier system of masters and apprentices. The owners were the managers and they had a developed affinity with their workers.
The exceptions mentioned earlier to this smallness were the textile mills and the railroads. The average number of spindles per textile mill, for example, increased from less than 500 in 1815 to 2,000 in 1840 and 5,000 in 1860.51 During the 1840s, there were forty-one textile mills capitalized at over $250,000.52 The textile mills bigness, as impressive as it is compared to other enterprises, was dwarfed by the railroads. Railway investment went from $172.3 million in the 1840s to $737.3 million in the 1850s to over $1.1 billion by 1859.53 By 1860, there were numerous railroads capitalized at over $10 million and several at over $20 million.54 We will discuss the special case of the railroads in due course since they transcended the two phases of the American Industrial Revolution.
The second phase of the American Industrial Revolution began soon after the Civil War. If the first phase was characterized by high economic growth, we can call the second a period of extreme economic growth. Per capita gross national product rose at an average annual rate of 2%. Real gross national product grew at an annual average rate of 4%.55 As noted earlier, two useful measures of economic growth—total commodity output and value added by manufacture—reflect this impressive growth. Economist Robert Gallman notes that "between 1839 and 1899 total commodity output increased elevenfold…. Actual rates varied fairly widely, high rates appearing during the decades ending with 1854 and 1884, and a very low rate during the decade ending with 1869."56 Gallman found that the value added in constant dollars of the purchasing power of 1879 had risen 82% from 1869 to 1879 and 112% from 1879 to 1889.57 To illustrate the dramatic increase, Robert Higgs compares America's progress to other advanced industrial nations: "In 1870, after several decades of industrial growth, the United States had a manufacturing output equal to that of France and Germany combined, but only about three fourths as large as that of the United Kingdom; by 1913 the American manufacturing output equaled that of France, Germany, and the United Kingdom combined!"58 This land of opportunity attracted a total of more than 28 million immigrants between 1865 and 1915.59
Manufacturing's portion of total output during this period rose from 33% in 1869 to 53% in 1899 precisely because of this economic growth.60 In order to best illustrate the differences between the two phases of the revolution, we will try to focus on the same areas of manufacturing, transportation, and technology where possible. Unfortunately, this cannot be done exactly since industries were created during the second phase that didn't exist in the first and some industries present in the first had been replaced or displaced by the second.61
One of those that was displaced in the second half of the nineteenth century was the pig iron industry. Although production increased 100% from 1865 to 1870 and 130% from 1870 to 1880, iron's utility was waning in the face of competition from cheap steel.62 When Carnegie entered the steel business in 1872, the Bessemer steelmaking process was introduced into the United States in the late 1860s and early 1870s. Carnegie's Edgar Thomson Works in Pittsburgh was built entirely along the Bessemer process, one of the few steel mills to do so.63 Through the use of this process and the advent of the open-hearth furnace, steel production soared from 70,000 tons in 1870 and over four million tons in 1890 to twelve million tons in 1900.64 By the 1890s, Carnegie's Pittsburgh steel operations were outproducing Great Britain's entire steel industry by 700,000 tons annually!65
This period also saw the implementation of the factory system in sectors that had traditionally been labor-intensive. U.S. Commission of Labor Carroll Wright characterized this rapid increase of the factory system in his 1880 introduction to the special report on manufacturing in that year's Census:
Of the nearly three millions of people employed in the mechanical industries of this country at least four-fifths are working under the factory system. Some of the other remarkable instances of the application of the system [besides those in textiles] are to be found in the manufacture of boots and shoes, of watches, musical instruments, clothing, agricultural implements, metallic goods generally, fire-arms, carriages and wagons, wooden goods, rubber goods, and even the slaughtering of hogs. Most of these industries have been brought under the factory system during the past thirty years.66
One outstanding example of this recent mechanization can be found in the manufacture of cigarettes. Traditionally, cigarettes had been made by hand throughout the manufacturing process. In 1881, cigarette-making machines were introduced. By the mid-1880s, one machine could produce 120,000 cigarettes a day—dizzying when compared to the capacity of the most highly skilled hand workers, who could produce perhaps 3,000 cigarettes a day. The adoption of similar machinery revolutionized the match, soap, and grain-milling industries during the 1880s and 1890s.67
If the gains made by manufacturers were impressive, but those made by the railroads were stunning. This period saw the completion of the first transcontinental railroad in 1869 and subsequent transcontinentals in 1882, two in 1883, and one in 1893.68 Total mileage expanded from 52,922 in 1870 to 166,703 in 1890.69 Passenger and freight traffic reached ever-climbing heights: 7.7 billion passenger miles in 1882 and 12.5 billion passenger miles by 1890; 39.3 billion and 79.2 billion ton-miles in 1882 and 1890, respectively.70 Railroad capitalization also soared from $2.5 billion in 1870 to $10.1 billion in 1890.71 In the 1870s, the Pennsylvania Railroad alone issued $78 million in securities to help finance its expansion.72 That expansion must have produced the desired results since Pennsylvania Railroad freight locomotives hauled an average of 5.1 million ton-miles per year in 1881, up from 2.1 million ton-miles in 1870.73
These numbers are only a shadow of the economic impact wrought by the railroads. In 1880, three-fourths of America's steel output went into the production of rails. The amount of coal required to power the nation's 31,812 locomotives was staggering and inestimable. It is estimated that road construction and maintenance consumed over 71 million railroad ties in 1889-90 alone!74 The railroads also used large quantities of machine tools, copper, glass, India rubber, felt, and animal and mineral oils.75 The secondary or indirect benefits produced by the railroads is incalculable. Since they brought down the costs of transportation, they reduced the cost of manufactured goods. Since they offered reliable transportation and refrigerated cars, they brought produce and livestock to a national market. By enabling rapid postal delivery and granting rights-of-way to the telegraph companies, they enabled nearly instantaneous transcontinental communication. There can be no disagreement about the importance of the railroads to economic growth during the latter half of the nineteenth century.
The second phase of the American Industrial Revolution witnessed an incredible growth in technological innovation and invention as well. In the 1870s, as noted earlier, roller grinding was adopted in grain mills.76 The telephone also was introduced during that period.77 The street car was invented in 1871 and entered into use in 1873.78 The air brake came into widespread use in 1872 and the automatic coupler did in 1874.79 Electric power became available with the advent of the dynamo and the Edison central power system in 1881 and 1882, even though electric arc lighting was invented in 1878 and Edison developed the incandescent light bulb in 1879.80 Finally, the electric welding machine's invention in 1886 enabled the joining of metal without rivets.81
The revolution in manufacturing and technology also extended to a revolution in business organization. This second phase was dominated by business integrations, both vertical and horizontal. Vertical integration occurs when a business expands its operations from production into distribution, marketing, and raw-material production. The best example of vertical integration is Carnegie Steel, the huge steelmaker mentioned earlier. In the 1870s, Carnegie bought firms in order to gain access to the raw materials that they produced. He bought the Unity and the Larimer Coke works, the Scotia Ore mines, and a ferro-manganese mine in an effort to get at the coke and iron ore he so desperately needed.82 In the 1880s and 1890s, he gained control of the Henry C. Frick Coke Company, the prodigious Mesabi iron ore range, and many limestone quarries. In order to transport these raw materials, Carnegie bought a fleet of Great Lakes ore steamships and created a railroad of approximately one thousand miles of track. He founded mills to produce finished steel products like structural steel and rails in addition to the creation of sales outlets to market Carnegie's products.83 James Bridge, in his 1903 book entitled Inside History of the Carnegie Steel Company, noted that "from the moment these crude stuffs were dug out of the earth until they flowed in a stream of liquid steel in the ladles, there was never a price, profit, or royalty paid to an outsider."84
Another vertically integrated enterprise was Gustavus Swift and Company. Swift and Company was a meatpacking operation of nationwide scale that made extensive use of the railroads and telegraph. Before Swift, most cattle were shipped alive to towns near where the meat was to be consumed. This was inefficient because although only 40% of the meat was edible, 100% of the cow had to be shipped to the slaughterhouse.85 Swift bought cattle from the western ranches and then slaughtered them in six packing plants in cities near the frontier. There they were dressed and shipped via refrigerated car to Swift's branch houses around the nation. These branch houses were Swift's master stroke. Each branch house had its own refrigerated storage space and a sales staff to sell the beef.86 The only hurdle Swift had to overcome was consumer resistance to purchasing meat that wasn't slaughtered locally. He overcame this opposition by selling quality meat at prices that substantially undercut those of the local butcher.87 The vertical integration enjoyed by Carnegie Steel and Swift and Company enabled these companies to be "independent of the general market," as Carnegie himself put it.88 Vertical integration rendered them less affected by swings in the price or availability of raw inputs.
The other type of integration—horizontal—sought to control raw materials and distribution by purchase or integration with other firms in the same industry in order to realize economies of scale. By requiring such massive quantities of raw material and producing such massive quantities of finished goods, firms possessing horizontal integration made themselves a force to be reckoned with, thus allowing them considerable bargaining power. The quintessential example of horizontal integration is the largest industrial concern of the time, Standard Oil. Standard Oil started in 1867 when John D. Rockefeller acquired his first oil refinery in Cleveland, Ohio. Oil refining was a very competitive industry: there were many refiners and none of them could affect the market price of oil. These refiners did not particularly like this competition, which they (like many businessmen of the time) deemed ruinous. In 1882, Rockefeller and forty other oil refiners entered into a trust agreement whereby they turned over their common stock to nine trustees in return for dividends from the trust.89 Standard Oil wasn't perfectly horizontal since it owned some supplies of crude oil and the pipelines to transport it. By the 1890s, Standard Oil controlled over 90% of the oil refining capacity in the United States.90 As Chandler expressed the power of horizontal integration:
The transformation of a loose alliance of manufacturing or marketing firms into a single consolidated organization with a central headquarters made possible economies of scale through standardization of processes and standardization in the procurement of materials. Of more significance, consolidation permitted a concentration of production in a few large favorably located factories. By handling a high volume of output, consolidated factories reduced the cost of making each individual unit. They could specialize further and subdivide the process of manufacturing and also were often able to develop and apply new technological improvements more easily than could smaller units.91
These different forms of integration as well as the growing complexity of the organization required changes in the business structure. After the Civil War, corporations became the predominant form of business organization. The development of markets for corporate securities certainly created an incentive for incorporation since the division of ownership into readily transferable shares combined with formal markets for those shares allowed businesses to raise money for expansion through issuance of securities.92 Other changes to the business structure included a more formalized managerial hierarchy. Porter argues that "a hallmark of the modern business enterprise was its separation of ownership and control."93 As businesses grew more complex (and one can easily surmise the complexity of producing the economic growth mentioned elsewhere in this essay), they required the services of professional, full-time managers. Lower levels of managers could specialize in understanding and controlling one or two aspects of the corporation. Middle managers above them could supervise a few lower-level managers and top managers could supervise one or two middle managers. Information and control was thus transferred up the corporate hierarchy until supreme decision-making authority was vested in the president of the corporation, who typically owned very little stock in the company. To be sure, final authority resided with the Board of Directors. However, the Board of Directors typically represented the investment bankers and financiers and they tended to not delve into the operational side of management.94
We have now adequately presented the facts regarding the two phases of the American Industrial Revolution and we can now draw conclusions. Although they share some traits in common, it is clear that they are very different. The most significant differences between them are the higher rate of economic growth and the more sophisticated business structures in the second phase. It is my contention that the former is explained by the latter. The more complex organization enabled opportunities for growth to be realized. The earlier period had many of the same opportunities, but without the expertise and specialization inherent in a professional managerial hierarchy businesses just cannot expand as much. Let's be clear, I am not saying that technology was unimportant. Quite the contrary, I believe that technology was vital to the successful prosecution of the Industrial Revolution. However, technology would have been unavailable were it not for the efforts of entrepreneurs and managers in mass producing it. Likewise, I fully recognize the importance of capital markets and the greater availability of capital in the latter half of the nineteenth century as contributing factors to the economic growth. But capital does not make a factory work or organize complex production processes. These still require human thought, as exemplified by managers.
The "visible hand" of management, as Chandler put it, directed and orchestrated all aspects of production. This role came into existence during the second phase of the revolution. Although there did exist some managers before 1850, the position did not come into its own until after the Civil War. The multiunit business did not exist in the United States in 1840. The railroad, with its need for the safe, efficient movement of passengers and freight, required administrative coordination across business units and was the first truly big business in America.95 In manufacturing, modern management came about when technology allowed the factory system to be implemented. Output rose as machinery, plant design, and administrative procedures were improved by management.96
Once managers had administrative control of the production flows, they sought to grow the business in order to assure its continued success and existence. Their motivations for doing so were both defensive and productive.97 As we have seen with the vertical and horizontal integration of businesses, business expansion could stabilize and rationalize productive processes—as in the case of Carnegie Steel where vertical integration allowed Carnegie's steel mills to operate at full capacity by insuring adequate supply of raw materials or in the case of Standard Oil where horizontal integration allowed the trust to realize economies of scale by enlarging the oil refining capacity. Defensive expansion was most seen in the railroads. The construction of competing lines in already saturated markets arose from the need of the railroad to build great transportation systems. Once the business expanded, further expansion was made easier because the facilities and skills generated by the expansion were easily transferred to new functions.
These growth motivations by managers go far in explaining the incredible economic growth of the late nineteenth century and the rationalization of the production process goes the rest of the way. As philosopher Ayn Rand put it, "managerial work—the organization and integration of human effort into purposeful, large-scale, long-range activities—is, in the realm of action, what man's conceptual faculty is in the realm of cognition."98 This comparison to the mind is no accident, for that is precisely what managers embody in the economy—rational thought organizing process flows and strategically planning future expansion. The managerial revolution can properly be understood as the catalyst driving the American Industrial Revolution.
1 Mansel G. Blackford and K. Austin Kerr, Business Enterprise in American History, (Boston: Houghton Mifflin, 1986), ix. This comports with my experiences studying business history.
2 James DeFronzo, Revolutions and Revolutionary Movements, 2nd ed. (Boulder, CO: Westview Press, 1996), 8.
3 There was some increased regulation of industry towards the end of the Industrial Revolution—viz., the Interstate Commerce Commission—but it was constitutionally sanctioned and limited in scope.
4 William N. Parker, "Agrarian and industrial revolutions," in Revolution in History, ed. Roy Porter and Mikulás Teich (Cambridge: Cambridge University Press, 1986), 167.
5 Lawrence B. Glickman, A Living Wage: American Workers and the Making of Consumer Society, (Ithaca, NY: Cornell University Press, 1997), 25.
6 Karl Marx, Capital: A Critique of Political Economy, 3 vols., (Chicago: n.p., 1906), I, 558; quoted in David Montgomery, The Fall of the House of Labor, (Cambridge: Cambridge University Press, 1987), 62.
7 Parker, 174. Emphasis mine.
8 Parker, 168.
9 Ibid., 172.
10 Robert Higgs, The Transformation of the American Economy, 1865-1914: An Essay in Interpretation, Wiley Series in American Economic History (New York: John Wiley and Sons, 1971), 8.
11 Ibid., 16.
12 Ibid., 17.
13 Peter Temin, Causal Factors in American Economic Growth in the Nineteenth Century, Studies in Economic and Social History (London: Macmillan Press, 1975), 32.
14 Robert W. Fogel, Railroads and American Economic Growth: Essays in Econometric History, (Baltimore: Johns Hopkins Press, 1964), 129.
15 David Landes, The Unbound Prometheus: Technological Change and Industrial Development in Western Europe from 1750 to the Present, (Cambridge: Cambridge University Press, 1970), 1; quoted in Thomas C. Cochran, "The Business Revolution," The American Historical Review 79:5 (December 1974), 1449.
16 I am reminded specifically of James J. Hill, whose Great Northern Railway sat north of the heavily subsidized Northern Pacific Railroad and south of the heavily subsidized Canadian Pacific Railroad. Hill's contemporaries labeled his efforts "Hill's Folly." Henry Ford essentially created a market, the inexpensive automobile, where none existed before.
17 Temin, 13-5. Kuznets, though, worked with the data in the 1950s before the advent of modern computing.
18 The amount by which the value of their output exceeded the value of their raw-material inputs.
19 Robert E. Gallman, Trends in the American Economy in the Nineteenth Century, (Princeton: Princeton University Press, 1960), 15; quoted in Thomas C. Cochran, "Did the Civil War Retard Industrialization?" The Mississippi Valley Historical Review 48:2 (September 1961), 199.
20 Ibid., 199.
21 Blackford and Kerr, 84-5.
22 Harry J. Carman, Harold C. Syrett, and Bernard W. Wishy, A History of the American People: Volume I - to 1877, 2nd ed. (New York: Alfred A. Knopf, 1967), 474.
23 Cochran, "Did the Civil War Retard Industrialization?", 202.
24 Alfred D. Chandler, Jr. The Visible Hand: The Managerial Revolution in American Business, (Cambridge: Harvard University Press, Belknap Press, 1977), 76.
25 Carman, Syrett, and Wishy, 490.
26 Chandler, Visible Hand, 76.
27 Ibid., 76-7.
28 Carman, Syrett, and Wishy, 490.
29 Cochran, "Did the Civil War Retard Industrialization?", 201.
30 Chandler, Visible Hand, 77.
31 Carman, Syrett, and Wishy, 467-8. Interestingly, the Erie Canal operators persuaded the New York state legislature in 1833 to prohibit any railroad in the state from carrying freight. In 1844, an amendment was added allowing railroads to carry freight when the canal was inoperable (frozen over) and, incredibly, the restrictions weren't lifted until 1851.
32 Blackford and Kerr, 92. Chandler, Visible Hand, 82.
33 Temin, 39.
34 Blackford and Kerr, 92.
35 Chandler, Visible Hand, 83. These two items were produced near waterways and were still transported on them.
36 Lance E. Davis and others, eds. American Economic Growth: An Economist's History of the United States, (New York: Harper & Row, 1972), 497.
37 Carman, Syrett, and Wishy, 490.
38 Richard B. Morris, The Encyclopedia of American History, (New York: Harper & Row, 1976), 691, 794.
39 Ibid., 722.
40 Ibid., 794-5.
41 Glenn Porter, The Rise of Big Business, 1860-1910, (Arlington Heights, IL: AHM Publishing, 1973), 15.
42 Ibid., 16.
43 Blackford and Kerr, 108-10.
44 Ibid., 113.
45 Alexis de Tocqueville, quoted in Porter, 8-9.
46 Chandler, Visible Hand, 76.
47 Higgs, 39.
48 Porter, 8.
49 Blackford and Kerr, 113.
50 Porter, 21.
51 Carman, Syrett, and Wishy, 493.
52 Chandler, Visible Hand, 90.
53 Davis and others, 496. Chandler, Visible Hand, 90.
54 Porter, 32. "… [T]he Erie, the Pennsylvania, the Baltimore and Ohio, and the New York Central were capitalized at from $17 to $35 million." Chandler, Visible Hand, 90.
55 This meant a threefold increase in per capita GNP between the Civil War and World War I and an eightfold increase in real GNP. Higgs, 19.
56 Cochran, "Did the Civil War Retard Industrialization?", 199.
57 Ibid., 200.
58 Higgs, 48.
59 Ibid., 24.
60 Ibid., 47.
61 Industries created in the second phase include those that generated or used electric power, such as streetcars and telephones. Industries that had been replaced or displaced include the canals and pig iron, which was displaced by steel.
62 Cochran, "Did the Civil War Retard Industrialization?", 200.
63 Chandler, Visible Hand, 259.
64 Blackford and Kerr, 164.
65 Harold C. Livesay, Andrew Carnegie and the Rise of Big Business, The Library of American Biography, ed. Oscar Handlin (Boston: Little, Brown, 1975), 166.
66 Carroll D. Wright, "The Factory System of the United States," U.S. Bureau of the Census, Report of the United States at the Tenth Census (June 1, 1880), (Washington: 1883), 548; quoted in Chandler, Visible Hand, 246.
67 Blackford and Kerr, 169. In 1881 as well, a machine was produced that packed matches by the billions into boxes. Minneapolis millers average daily output amounted to 274 barrels in 1874 and 1,837 by the end of the 1880s. Chandler, Visible Hand, 253.
68 Morris, 611-2.
69 Alfred D. Chandler Jr., The Railroads: The Nation's First Big Business, The Forces in American Economic Growth Series (New York: Harcourt, Brace & World, 1965), 13.
70 Ibid., 14. By 1890, railroads carried twice as much freight as all other means of transportation combined. (Blackford and Kerr, 162)
71 Ibid., 15.
72 Blackford and Kerr, 154.
73 George Rogers Taylor and Irene D. Neu, The American Railroad Network, 1861-1890, (Cambridge, MA: Harvard University Press, 1956), 2.
74 Fogel, 138-9.
75 Chandler, Railroads, 22, 13, 23.
76 Higgs, 46.
77 Ibid., 45.
78 Morris, 796.
79 Ibid., 795-6.
80 Ibid., 796.
81 Ibid., 797.
82 Livesay, 119-20.
83 Blackford and Kerr, 171-2.
84 Porter, 54.
85 Ibid., 48.
86 Blackford and Kerr, 173.
87 Porter, 48-9.
88 Andrew Carnegie; quoted in Ibid., 54.
89 Blackford and Kerr, 175.
90 Ibid., 176.
91 Alfred D. Chandler Jr., Strategy and Structure: Chapters in the History of the American Industrial Enterprise, (Cambridge, MA: The M.I.T. Press, 1962), 31.
92 Higgs, 40.
93 Porter, 12.
94 Chandler, Visible Hand, 187.
95 Ibid., 485. Note: the specialized management structures and developments of the railroad industry could easily require a book in itself for explanation.
96 Ibid., 486.
97 Ibid., 486-9.
98 Ayn Rand, "The Cashing-in: The Student 'Rebellion'," Capitalism: The Unknown Ideal, (New York: New American Library, 1967), 262.


---
layout: default
title: "About Street Level"
permalink: /colophon/
---
Street Level is written and produced by two guys based in Singapore.
We are two guys based in Singapore with a passion for finance and investing. After almost a decade in high finance, we yearn to find a space to share our own insights beyond our usual circle of friends in the industry and to learn more from a wider audience in return.
After long discussions over lunches & shorter ones at the office watercooler, we feel that there is a lack of Singapore focused writing discussing real estate investments – in-depth articles with a careful balance of technical analysis and simple writing. We hope you will find these articles useful in your own personal pursuit of financial freedom.
That is why we started Street Level.


He has no cutlass, preferring seven assault rifles, a grenade
launcher, and an array of automatic pistols. And who needs an eye
patch when you can snatch a nice pair of imitation Ray Ban
sunglasses from the captain of the ship you've just raided?
Aliasa Bungalos, known and feared as ``Commander Alex'' around
the lawless islands and hidden coves that dot the turquoise waters
of the Southern Philippines, is a latter-day Captain Kidd.
Guarded by a crew masked in balaclavas and bandannas and
brandishing M-16s, Bungalos recently let a journalist visit a
deserted island hideout, 11 miles east of the Philippine Navy's
southern base in Zamboanga City, for an extraordinary look at the
life of a pirate leader. Casually, he described what he does for a
living: sneaking up on ships in a fast launch, clambering up ropes
to board under cover of night, kidnapping and ransoming victims,
selling off the stolen loot.
He is hardly unique.
Piracy is back with a vengeance, and Bungalos is one of tens of
thousands of bandits of the sea who have spurred its resurgence
over the past decade. They prey on merchant mariners, fishermen,
shippers, even pleasure sailors and scuba divers of all
nationalities. Seajacking also poses severe environmental and
safety hazards in busy sea lanes. In 1994, two oil tankers collided
and burned, killing all aboard, after what was thought to be a
pirate attack.
The number of reported pirate attacks has set a record this
year, and Asian waters are the new buccaneers' favored haunt. The
region's financial crisis, which began three years ago, the
political instability and armed insurgencies, and some of the
globe's busiest shipping lanes, have made Asia the site of three of
four pirate attacks worldwide.
But forget ``Yo ho ho, and a bottle of rum.'' Piracy does not
fit the Hollywood image of Treasure Island, swashbuckling fun, and
talking parrots. Buccaneers who terrorized the Caribbean in the
1700s were merciless criminals who forced their victims to walk the
plank while they stole a ship and its cargo.
 But more
often they are hit-and-run bandits in motorized dinghies who prey
on fishermen, ferries, and yachtsmen, robbing them of any valuables
aboard. Bungalos's gang is one of these.
What's common to almost all of these attacks is their
ruthlessness, the use of deadly weapons _ from knives and handguns
to antitank rockets and mortars _ and the cost to the maritime
world in lives, cargo, and ships.
With 90 percent of the world's trade moving by ship, and nearly
half of it passing through Asia's pirate-infested waters, the
threat to global commerce is growing. Estimates of the cost of
piracy and maritime fraud run to more than $16 billion a year.
The pettiest incidents are essentially maritime muggings by
those who subsist by stealing fish, mooring lines, or cans of
paint.
The most serious are meticulously planned attacks in which
organized crime gangs target valuable cargo, resell it in advance,
and prepare fake registration papers for a ship.
In the worst cases, pirates kill the crew, repaint and rename
the vessel, and use the ``phantom ship'' to attack other vessels or
to steal millions of dollars of cargo from unsuspecting shippers
who unwittingly hire the pirates' fly-by-night company to transport
their goods.
Shipowners reported 300 attacks or attempted attacks in 1999 to
the International Maritime Bureau, an industry watchdog, and 309 to
the United Nations' International Maritime Organization. But the
Maritime Bureau says the figures understate, by at least half, the
true picture.
In figures compiled for the Globe, the Philippine Navy and coast
guard cited 28 pirate attacks in the first six months of this year.
The International Maritime Bureau recorded just one in Philippine
waters, based on reports from shipowners.
Why the discrepancy? Cargo ships often do not report minor
attacks because they fear being detained by investigators; every
day in port costs thousands. Captains and shipowners sometimes
cover up attacks to protect their reputations. Coastal ships and
fishermen, meanwhile, report only to local authorities _ or not at
all, if they fear retribution.
But the danger is growing. So far this year, reports of pirate
attacks have jumped 40 percent over the first half of 1999,
according to the Maritime Bureau.
Indonesian waters are by far the world's most dangerous, with
115 incidents reported in 1999, almost double the figure for the
year before.
Last year, 408 seamen were taken hostage, a jump of 67 percent
from 1998.
As far back as 800 BC, sea bandits have plagued waters from
Taiwan to New Guinea, from Madagascar to Australasia, said a
Philippine Navy captain, Omar Tonsay, who has chronicled maritime
raids in the region.
Bandits of the Sulu Sea, in what is now the Southern
Philippines, have long been reputed to be among the most vicious.
But Tonsay says that what 16th-century colonizers branded
``piracy'' was for locals ``a tradition _ economic livelihood for
men and women, a rite of passage.''
Islands provide pirates with countless safe hideouts. The
tangled branches of wild mangroves, and the shallow around Sacol
Island keep Bungalos and his gang out of sight and out of the reach
of the law. Dragging on a counterfeit Marlboro and showing off his
bullet scars, Bungalos recounted his resume while a Navy gunboat
patrolled not a mile away.
Late one night, he and 12 of his gang used motorboats to attack
the Randy-Mar, a commercial fishing boat that had been preparing to
cast out its nets. They used the ship's anchor line to hoist
themselves aboard and stole fish-detecting sonar, ship radios, and
three guns, which they sold for 80,000 Philippine pesos ($1,778).
Another time, three of his men boarded the Magnolia ferry as
passengers and took the captain at gunpoint.
They then threw ropes to seven accomplices in a launch below,
who shinnied on deck to steal cash, watches, jewelry, even clothes
from terrified passengers and crew.
Bungalos's men have used speedy outriggers to zoom into coastal
towns and to snatch victims whose families could pay, including the
13-year-old daughter of a gas station owner. After holding her for
three months on Sacol Island, a pirates' lair where, Bungalos said,
``she was not touched, raped, or harmed,'' he negotiated $8,000 in
ransom and got ``three sacks of rice as thanks when we released the
girl.'' It's a lot more than the $55 a month he can make as a
seaweed farmer.


My socials and portfolio are currently under construction for updates. In the meantime, feel free to check out my links below.
Wedding Portrait Paintings
Character Illustrations & Commissions
Instagram
YouTube
Twitter
(under construction)
Portfolio
Pet Portraits
(coming soon!)


{% extends "base.html" %} {% block title %}How to manage your choice online{% endblock %} {% block content %}
We'll need your:
We'll use these details to find your contact details from your health records so we can send you a security code.
How your data will be processed using this service - Page opens in new window


See RFC 2396 for a
description of URI references and related terms.
For parsing absolute URI references, this service tries to use a
scheme-specific parser. Such a scheme-specific parser will typically enforce
additional restrictions during parsing, and will typically return objects
that support extra, scheme-specific interfaces in addition to
XUriReference. If no such parser
is found, and for relative URI references, a generic parser is used, which
returns objects that only support
XUriReference.
Locating a scheme-specific parser works as follows: A scheme consists of
Latin captial letters
“A
”–“Z
”, Latin small
letters “a
”–“z
”,
digits “0
”–“9
”,
“+
”, “-
”, and
“.
”. A scheme s is transformed into
a string s′ character-by-character, by translating
Lating capital letters to their small counterparts, translating
“+
” to “PLUS
”,
“-
” to “HYPHEN
”,
“.
” to “DOT
”, and copying
Latin small letters and digits unchanged. If the component context used
while creating this UriReferenceFactory
instance offers a
service manager, and there is a service available at that service manager
whose name is the concatenation of
“com.sun.star.uri.UriSchemeParser_
” and
s′, then that service is used. It is an error if that
service does not support
XUriSchemeParser.


{%if _HAL-part1 %}
_links
(object) - links to data sets
self
(object) - link to this data set
href
(string) - referencetemplated
(boolean) - ability to be templatednext
(object) - link to the next data set
href
(string) - reference.templated
(boolean) - ability to be templatedprev
(object) - link to the previous data set
href
(string) - referencetemplated
(boolean) - ability to be templated_embedded
(object) - container
{{ _HAL.wrappin }}
{% if response[1].schema['type'] == 'array' %}({{response[1].schema['type']}})
{array item object}
_embedded
(object) - container
{{ add_property_HAL.as }}
(array) - related
{array item object}
{%assign outer = add_property_HAL.embed %}
{%include partials/autodoc/inner-item.html%}
page
(object) - information about current page in data source
size
(number) - size of page.totalElements
(number) - total number of available elements in servertotalPages
(number) - total number of available pages in servernumber
(number) - current page number counted from 0


Unit Testing Best Practices: Know Your Test’s Lifecycle, Part 3
This will be my last post on unit test lifecycle management. In previous posts, we learned how individual unit tests and test fixtures are run, and how test invocation is affected when test fixtures are derived from an abstract base fixture class. In this installation, we’re going to learn how to manage code that runs before and after groups of test fixtures.
Sometimes, you need some code to run before or after a set of test fixtures. I tend to encounter this scenario frequently with integration and system tests. For example, if you’re using Selenium to run your full system tests through the Selenium Web Driver, you need to make sure that the Selenium server is running before you run any of your tests. You could do this on the build server by extending your build script with a “StartSelenium” task, and then remind all your developers to start the server themselves before they run the tests directly. But wouldn’t it be better to guarantee directly that, every time those ui tests get run, that the selenium server was active? AND, as a bonus, wouldn’t it be great if the selenium server was shut down when the tests finished?
Another case where this need shows up is in database-coupled integration tests. These kinds of tests often suffer from unintended order dependencies - one set of tests end up assuming that some data introduced by an earlier set of tests will be present in the database, and then those tests fail if you run them in isolation.
Another approach I often see people take is to have a “special” test fixture that performs all their database initialization and initial data loading. That test fixture might look like this:
[gist id=1313334 file=SampleDataLoader.cs]
The Explicit attribute means that the test fixture is not run if you execute all the tests in the assembly by default. Typically a test like this would be run by invoking the nunit console runner from an automated build to run only tests in the “DataLoader” category.
That’s not bad, but again - what happens on developer system when you forget to run the dataloader tests first? Or, what do you do when you’ve got different sets of tests that need different default data? You definitely don’t want each individual test or fixture going through an entire, scorched-earth style recreation of the entire database just to get to a clean state, do you?
Fortunately, NUnit provides a not-well-known, but powerful, soltuion for executing code before and after any tests run - the SetUpFixture. It doesn’t have the greatest name in the world, as it’s easily confused with TestFixtureSetup. The difference is that SetUpFixture runs around all the fixtures within the same namespace. SetUpFixture classes defined outside of a namespace will run before any tests in the entire assembly. Here’s a sample:
[gist id=1313334 file=SetUpFixtureSample.cs]
Which produces this output:
[gist id=1313334 file=SetUpFixtureSampleOutput.txt]
As you can see, the SetUpFixture classes exhibit the same nesting that we’ve come to expect from constructors, Dispose methods, SetUp, and TearDown atributes. As with basic test fixtures, I recommend that you use the construct/dispose pattern for SetUpFixture classes, and avoid the SetUp and TearDown-attributed methods. There’s no need for the extra layer of initialization.
Also note that SetUpFixture class construction and disposal is nested by namespace. If you have two of them in the same namespace though, order of execution between the two could be non-deterministic.
One of the great things about these SetUp fixture classes is that they run whenever tests in the same namespace are executed, regardless of how many tests within that namespace you happen to be running. The important thing is that your context of execution is always going to be firmly established, even if you’re only running one test. Andy, by establishing the right part of your entire testing context at the right leve, you can dramatically decrease the test time for expensive tests. For example, you could rebuild the whole test database in a SetUpFixture defined at the assembly level, and then establish and remove different sets of test data for related tests, organized by namespaces. This might look like this:
[gist id=1313334 file=SetUpFixtureDatabaseExample.cs]
Which of course produces the following output:
[gist id=1313334 file=SetUpFixtureDatabaseExampleOutput.txt]
The outermost SetUpFixture ensures that you always start from a known state, by dropping and rebuilding the test database. We open up a transaction within the namespace SetUpFixture’s constructor, and roll it back in the corresponding Dispose method. This technique can help ensure that your integration tests don’t develop unintended order dependencies by relying on data injected by other, previously run tests. Once all the tests in that namespace have run, all the database changes get rolled back. Now the next set of tests can start from a known data state again.
SetUpFixtures, by virtue of being run outside of, and around, all of your unit test fixtures, give you a lot of options in structuring the runtime context in which your unit tests execute. They can be a very powerful tool in your testing toolbelt. Hopefully this introduction to NUnit SetUpFixtures gives you some ideas on how you can re-structure and streamline your own test management - especially for those more challenging scenarios, like UI and integration tests.


Script system\main\socket.ijs has definitions for working with sockets.
The first element of the result of all socket verbs is a result code. It is 0 if there was no error, or it is an error number. Utility sderror
returns the text name of the error number.
Some socket verbs take integer constants as arguments and some of these constants have been given names in socket.ijs. For example SOCK_STREAM
is 1.
A socket can be blocking or non-blocking. A verb such as sdrecv
will hang on a blocking socket until it can complete. On a non-blocking socket, the sdrecv
returns immediately with a result code of EWOULDBLOCK 10035
. In Windows the use of non-blocking sockets is recommend.
A socket created with sdsocket
is a blocking socket. The verb sdioctl
can make it non-blocking.
Verb sdselect
returns information about the state of a socket and indicates if it has data to read, is ready for writing, or has had an error.
Addresses used with sockets consist of 3 parts: family, address, port. The first is an integer which indicates the type of address. Currently this is always AF_INET
(address family internet). The second part is a string that is a series of 1 to 4 numbers separated by dots. The third part is an integer port.
sdsocket family , type , protocol sdsocket '' |
Creates a new socket. A socket is identified by an integer. The family must be AF_INET as defined in sockets.ijs. The type can be any of the SOCK_ values, but is usually SOCK_STREAM . The protocol must be 0 . The result is a socket number that can be used as the socket argument to other verbs. The '' argument is equivalent to AF_INET,SOCK_STREAM,0
sdrecv socket , count , flags |
Receives data from a socket. The count is the maximum amount of data that will be received. The flags are from the MSG_ values and is usually 0 . The result is a boxed list. The first element is the result code and the second is the data. There may be less data received than in count.
If the socket is blocking and there is no data, the verb will hang until there is data.
If the socket is non-blocking and there is no data, it immediately returns result code
If the socket at the other end is closed, then the socket will be in the
If sdrecv sk , 1000 , 0 |
data sdsend socket , flags |
The left argument is the data to send. The flags are from the MSG_ values and is usually 0.
Blocking and non-blocking sockets work with sdsend in a similar manner to
The second element of the result indicates how many characters were actually sent. This may be less than was requested and you need to call 'testing 1 2 3' sdsend sk , 0 |
sdrecvfrom socket , count , flags |
Similar to sdrecv except it is used with a SOCK_DGRAM socket. The result has additional elements that give the address of the data source.
|
data sdsendto socket ; flags ; family ; address ; port |
Similar to sdsend except it is typically used with a SOCK_DGRAM socket and the argument includes the address to send the data to.
'test' sdsend sk ; 0 ; AF_INET ; '<IP_ADDRESS>' ; 800 |
sdclose socket |
|
Close a socket.
|
sdconnect socket , family , address , port |
|
Connect the socket to the socket indicated by the address.
An
An sdconnect sk ; AF_INET ; '<IP_ADDRESS>' ; 800 |
sdbind socket , family , address , port |
Bind a socket to an address. The address can be '' if the socket will be used to listen for connects to any address on the machine. If the port number is 0, the system will assign a port (which can be queried with sdgetsockname ).
A bind is usually done with a socket that will listen for connections. sdbind sk ; AF_INET ; '' ; 800 NB. any connections to 800 |
sdlisten socket , number |
|
Set the socket to listen for connections. A bind must have been done. The number is the limit to queued connections. The host typically forces this limit to be between 1 and 5.
When a connection is made the socket is marked in
|
sdaccept socket |
When a listening socket is marked as ready for reading in sdselect , then an accept can be done to create a new socket for this end of the channel. The new socket is a clone of the listening socket and has all its attributes. In particular, if the listening socket is non-blocking or has been marked with sdasync , then the new socket is as well. The result is the result code and the new socket.
|
sdselect read ; write ; error ; timeout sdselect '' |
|
The argument is a 4 element list. The first is a list of sockets to check for ready-to-read, the second is a list to check for ready-to-write, and the third is a list to check for errors. The last element is a timeout value in milliseconds. If it is 0, the select is non-blocking and returns immediately. If the timeout is not 0, it will return as soon as there is a socket to report on, but will not wait longer than the timeout value.
An empty argument checks all sockets for all conditions with a timeout of 0. The result has a result code and 3 socket lists. The first is the list of ready-to-read sockets. The second is a list of ready-to-write sockets. The last is a list of sockets that had an error.
Ready-to-read sockets are sockets with data available for an
|
sdgetsockopt socket , option_level , option_name |
Returns the value of a socket option.
sdgetsockopt sk , SOL_SOCKET , SO_DEBUG sdgetsockopt sk , SOL_SOCKET , SO_LINGER |
sdsetsockopt socket , option_level, option_name , value... |
Set the value of a socket option.
sdsetsockopt sk , SOL_SOCKET , SO_DEBUG , 1 sdsetsockopt sk , SOL_SOCKET , SO_LINGER , 1 , 66 |
sdioctl socket , option , value |
Read or write socket control information.
sdioctl sk , FIONBIO , 0 NB. set blocking sdioctl sk , FIONBIO , 1 NB. set non-blocking sdioctl sk , FIONREAD, 0 NB. count of data ready to read |
sdgethostname '' |
|
Returns host name.
|
sdgetpeername socket |
|
Returns address of socket this socket is connected to.
|
sdgetsockname socket |
|
Return address of this socket.
|
sdgethostbyname name |
Returns an address from a name.
sdgethostbyname 'localhost' +-+-+---------+ |0|2|<IP_ADDRESS>| +-+-+---------+ sdgethostbyname >1{sdgethostname '' +-+-+-------------+ |0|2|<IP_ADDRESS>| +-+-+-------------+ sdgethostbyname 'www.jsoftware.com' +-+-+--------------+ |0|2|<IP_ADDRESS>| +-+-+--------------+ |
sdgethostbyaddr AF_INET , address_name |
|
Returns a name from an address.
sdgethostbyaddr 2 ; '<IP_ADDRESS>' +-+---------+ |0|localhost| +-+---------+ |
sdgetsockets '' |
|
Return result code and all socket numbers.
|
sdwsaasync socket |
|
Make a socket non-blocking and cause the system to run sentence socket_handler'' whenever the state of the socket has changed.
|
sdcleanup '' |
| Close all sockets and release all socket resources. |


CommenTerra
Menu
The Keyword must be alpha-numeric with at least 3 characters!
Search
Log In
Log In
Please log in with your e-mail and your password
E-Mail
required
Please type in a valid e-mail-adress!
Password
required
Please type in your password!
Log In
×
Site Navigation
New Comment
Advanced Search
Help / FAQ


List of all members.
Public Member Functions |
|
(void) | - retrieveMessageList |
|
(BOOL) | - batchUpdate:option: |
|
(BOOL) | - isBusying |
|
(int) | - messageCount |
|
(UAInboxMessage *) | - messageForID: |
|
(UAInboxMessage *) | - messageAtIndex: |
|
(int) | - indexOfMessage: |
|
(void) | - requestWentWrong: |
Static Public Member Functions |
|
(UAInboxMessageList *) | + defaultInbox |
|
(void) | + land |
Protected Attributes |
|
int | isRetriving |
Properties |
|
NSMutableArray * | messages |
|
int | unreadCount |
|
int | isRetrieving |
|
BOOL | isBatchUpdating |
The documentation for this class was generated from the following file:


|
iconv − character set conversion |
iconv [OPTION...] [−f encoding] [−t encoding] [inputfile ...] iconv −l |
|
The iconv program converts text from one encoding to another encoding. More precisely, it converts from the encoding given for the −f option to the encoding given for the −t option. Either of these encodings defaults to the encoding of the current locale. All the inputfiles are read and converted in turn; if no inputfile is given, the standard input is used. The converted text is printed to standard output. The encodings permitted are system dependent. For the libiconv implementation, they are listed in the iconv_open(3) manual page. Options controlling the input and output format: |
|
−f encoding, −−from−code=encoding |
|
Specifies the encoding of the input. |
|
−t encoding, −−to−code=encoding |
|
Specifies the encoding of the output. |
|
Options controlling conversion problems: |
|
−c |
When this option is given, characters that cannot be converted are silently discarded, instead of leading to a conversion error. |
|
−−unicode−subst=formatstring |
|
When this option is given, Unicode characters that cannot be represented in the target encoding are replaced with a placeholder string that is constructed from the given formatstring, applied to the Unicode code point. The formatstring must be a format string in the same format as for the printf command or the printf() function, taking either no argument or exactly one unsigned integer argument. |
|
−−byte−subst=formatstring |
|
When this option is given, bytes in the input that are not valid in the source encoding are replaced with a placeholder string that is constructed from the given formatstring, applied to the byte’s value. The formatstring must be a format string in the same format as for the printf command or the printf() function, taking either no argument or exactly one unsigned integer argument. |
|
−−widechar−subst=formatstring |
|
When this option is given, wide characters in the input that are not valid in the source encoding are replaced with a placeholder string that is constructed from the given formatstring, applied to the byte’s value. The formatstring must be a format string in the same format as for the printf command or the printf() function, taking either no argument or exactly one unsigned integer argument. |
|
Options controlling error output: |
|
−s, −−silent |
|
When this option is given, error messages about invalid or unconvertible characters are omitted, but the actual converted text is unaffected. |
|
The iconv −l or iconv −−list command lists the names of the supported encodings, in a system dependent format. For the libiconv implementation, the names are printed in upper case, separated by whitespace, and alias names of an encoding are listed on the same line as the encoding itself. |
|
iconv −f ISO−8859−1 −t UTF−8 |
|
converts input from the old West-European encoding ISO−8859−1 to Unicode. |
iconv −f KOI8−R −−byte−subst="<0x%x>" −−unicode−subst="<U+%04X>" |
|
converts input from the old Russian encoding KOI8−R to the locale encoding, substituting an angle bracket notation with hexadecimal numbers for invalid bytes and for valid but unconvertible characters. |
|
iconv −−list |
|
lists the supported encodings. |
|
POSIX:2001 |
|
iconv_open(3), locale(7) |


--- layout: post title: Implementing a Solution to the Accuracy/Robustness Dilemma in Accuracy/ Robustness Dilemma in Impedance Control date: '2014-02-22T15:25:00.001-05:00' author: Mahyar tags: - Impedance Control modified_time: '2014-04-22T14:01:44.300-04:00' blogger_id: tag:blogger.com,1999:blog-727803219276813688.post-1443505157206714563 blogger_orig_url: http://www.etedal.net/2014/02/implementing-solution-to.html ---